/*;-*-C-*-;
** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2001 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
** Massachusetts Institute of Technology
**
** This program is free software; you can redistribute it and/or modify it
** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
** MA 02111-1307, USA.
**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.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
*/
/*
%{
# include <stdio.h>
-# include "lclintMacros.nf"
-# include "llbasic.h"
+# include "splintMacros.nf"
+# include "basic.h"
# include "lslparse.h"
# include "signature.h"
-void lslerror (char *);
+static void lslerror (char *);
+extern int lsllex ();
+
/*@dependent@*/ /*@null@*/ lslOp importedlslOp;
/*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
%token <ltok> LST_COMMA /* , */
%token <ltok> LST_EOL LST_COMMENTSYM LST_WHITESPACE
-%token LST_WHITESPACE
+ /* %token LST_WHITESPACE */ /* Duplicate tokey removed */
%token LST_QUANTIFIERSYM
%token LST_EQUATIONSYM
%token LST_EQSEPSYM
%%
top: operatorList { lslOpList_free ($1); }
+ ;
operatorList: operator
{ lslOpList x = lslOpList_new ();
| operatorList operator
{ lslOpList_add ($1, $2);
$$ = $1; }
+;
operator: name LST_COLON signature
{ $$ = makelslOpNode ($1, $3); }
/* The next production is never used in the output of lsl -syms
| name
{ $$ = makelslOpNode ($1, (sigNode)0); } */
+;
name: opId /* check for the case of if_then_else */
{ $$ = makeNameNodeId ($1); }
| opForm
{ $$ = makeNameNodeForm ($1); }
+;
opForm
: LST_ifTOKEN LST_MARKERSYM LST_thenTOKEN LST_MARKERSYM LST_elseTOKEN LST_MARKERSYM
| LST_MARKERSYM LST_FIELDMAPSYM LST_SIMPLEID
{ $$ = makeOpFormNode ($1, OPF_MMAP,
opFormUnion_createAnyOp ($3), ltoken_undefined); }
-
+;
anyOp: LST_SIMPLEOP
{ $$ = $1; }
{ $$ = $1; }
| LST_EQOP
{ $$ = $1; }
+;
middle: /* empty */
{ $$ = 0; }
| placeList
{ $$ = $1; }
+;
placeList: LST_MARKERSYM
{ $$ = 1; }
| placeList separator LST_MARKERSYM
{ $$ = $1 + 1; }
+;
separator: LST_COMMA
{ $$ = $1; }
| LST_SEPSYM
{ $$ = $1; }
+;
signature: domain LST_MAPSYM sortId
{ $$ = makesigNode ($2, $1, $3); }
+;
domain: /* empty */
{ $$ = ltokenList_new (); }
| sortList
{ $$ = $1; }
+;
sortList: sortId
{ $$ = ltokenList_singleton ($1); }
| sortList LST_COMMA sortId
{ $$ = ltokenList_push ($1, $3); }
+;
sortId: LST_SIMPLEID
{
$$ = $1;
ltoken_setText ($$, processTraitSortId (ltoken_getText ($1)));
}
+;
opId: LST_SIMPLEID
{ $$ = $1; }
+;
+
%%
# include "bison.reset"
llfatalbug
(cstring_makeLiteral
("There has been a problem in the parser with LSL signatures. This is believed to result "
- "from a problem with bison v. 1.25. Please try rebuidling LCLint "
+ "from a problem with bison v. 1.25. Please try rebuidling Splint "
"using the pre-compiled grammar files by commenting out the "
"BISON= line in the top-level Makefile."));
}