/*;-*-C-*-;
-** Copyright (c) Massachusetts Institute of Technology 1994-1998.
-** All Rights Reserved.
-** Unpublished rights reserved under the copyright laws of
-** the United States.
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2002 University of Virginia,
+** Massachusetts Institute of Technology
**
-** THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-** OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-**
-** This code is distributed freely and may be used freely under the
-** following conditions:
-**
-** 1. This notice may not be removed or altered.
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2 of the License, or (at your
+** option) any later version.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
+**
+** The GNU General Public License is available from http://www.gnu.org/ or
+** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+** MA 02111-1307, USA.
**
-** 2. Works derived from this code are not distributed for
-** commercial gain without explicit permission from MIT
-** (for permission contact lclint-request@sds.lcs.mit.edu).
+** For information on splint: splint@cs.virginia.edu
+** To report a bug: splint-bug@cs.virginia.edu
+** For more information: http://www.splint.org
*/
/*
-** Copyright (c) Massachusetts Institute of Technology, 1993
-** All Rights Reserved. Unpublished rights reserved
-** under the copyright laws of the United States.
-**++
-** FACILITY: LSLC
-**
-** MODULE DESCRIPTION:
-**
-** FILENAME: llgramar.y
-**
-** PURPOSE: bison grammar for LCL language.
-**
-** AUTHORS:
-** Yang Meng Tan, Massachusetts Institute of Technology
+** Original author: Yang Meng Tan, Massachusetts Institute of Technology
*/
-
%{
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
# include "llbasic.h"
# include "lclscan.h"
# include "checking.h"
/*@=noparams@*/
/*@-redecl@*/
-void ylerror (char *) /*@modifies *g_msgstream@*/ ;
+void ylerror (char *) /*@modifies *g_warningstream@*/ ;
/*@=redecl@*/
bool g_inTypeDef = FALSE;
/*@only@*/ abstBodyNode abstbody;
/*@only@*/ abstractNode abstract;
/*@only@*/ exposedNode exposed;
+ /*@only@*/ pointers pointers;
/* taggedUnionNode taggedunion; */
/*@only@*/ globalList globals;
/*@only@*/ constDeclarationNode constdeclaration;
%type <opform> opForm
%type <signature> signature
%type <typname> typeName
-%type <count> middle placeList pointers
+%type <count> middle placeList
+%type <pointers> pointers
%type <abstDecl> optAbstDeclarator
%type <lcltypespec> lclTypeSpec lclType sortSpec
%type <ltokenList> enumeratorList postfixOps
$1->pointers = $2; $$ = $1; }
pointers
- : LLT_MULOP { $$ = 1; }
- | pointers LLT_MULOP { $$ = $1 + 1; }
+ : LLT_MULOP { $$ = pointers_createLt ($1); }
+ | pointers LLT_MULOP { $$ = pointers_extend ($1, pointers_createLt ($2)); }
structOrUnionSpec
: LLT_STRUCT optTagId