]> andersk Git - splint.git/blobdiff - src/cgrammar.y
Tried to fix some problems with the configuration system.
[splint.git] / src / cgrammar.y
index 3cfd7b192d8c1fe4a9470f368894f5c30e1a29f2..701ccce4261bed8d4cb8e057d4df5ac6514846d1 100644 (file)
 
 extern int yylex ();
 extern void swallowMacro (void);
+extern void yyerror (char *);
 
 # include "lclintMacros.nf"
 # include "basic.h"
+# include "cscanner.h"
 # include "cgrammar.h"
 # include "exprChecks.h"
 
@@ -53,7 +55,6 @@ extern void swallowMacro (void);
 /*@-matchfields@*/
 
 # define SHOWCSYM FALSE
-void yyerror (char *s);
 
 /*
 ** This is necessary, or else when the bison-generated code #include's malloc.h,
@@ -69,31 +70,57 @@ void yyerror (char *s);
 # undef realloc
 # endif
 
-void checkandsetBufState(idDecl id, exprNode is);
 %}
 
 %union
 {
- lltok tok;
- int count;
- specialClauseKind sck;
- qual typequal;
- qualList tquallist;
- ctype ctyp;
- sRef sr;
- /*@only@*/ qtype qtyp;
- /*@only@*/ cstring cname;
- /*@only@*/ idDecl ntyp;
- /*@only@*/ idDeclList ntyplist;
- /*@only@*/ uentryList flist;
- /*@owned@*/ uentryList entrylist;
- /*@observer@*/ /*@dependent@*/ uentry entry;
- /*@only@*/ uentry oentry;
- /*@only@*/ exprNode expr;
- /*@only@*/ enumNameList enumnamelist;
- /*@only@*/ exprNodeList alist;
- /*@only@*/ sRefSet srset; 
- /*@only@*/ cstringList cstringlist;
+  lltok tok;
+  int count;
+  qual typequal;
+  qualList tquallist;
+  ctype ctyp;
+  /*@dependent@*/ sRef sr;
+  /*@only@*/ sRef osr;
+
+  /*@only@*/ functionClauseList funcclauselist;
+  /*@only@*/ functionClause funcclause;  
+  /*@only@*/ flagSpec flagspec;
+  /*@only@*/ globalsClause globsclause;
+  /*@only@*/ modifiesClause modsclause;
+  /*@only@*/ warnClause warnclause;
+  /*@only@*/ stateClause stateclause;
+
+  /*@only@*/ functionConstraint fcnconstraint; 
+
+  /*@only@*/ metaStateConstraint msconstraint;
+  /*@only@*/ metaStateSpecifier msspec;
+  /*@only@*/ metaStateExpression msexpr;
+  /*@observer@*/ metaStateInfo msinfo;
+
+  /*@only@*/ sRefList srlist;
+  /*@only@*/ globSet globset;
+  /*@only@*/ qtype qtyp;
+  /*@only@*/ cstring cname;
+  /*@observer@*/ annotationInfo annotation;
+  /*@only@*/ idDecl ntyp;
+  /*@only@*/ idDeclList ntyplist;
+  /*@only@*/ uentryList flist;
+  /*@owned@*/ uentryList entrylist;
+  /*@observer@*/ /*@dependent@*/ uentry entry;
+  /*@only@*/ uentry oentry;
+  /*@only@*/ exprNode expr;
+  /*@only@*/ enumNameList enumnamelist;
+  /*@only@*/ exprNodeList exprlist;
+  /*@only@*/ sRefSet srset; 
+  /*@only@*/ cstringList cstringlist;
+
+  /*drl
+    added 1/19/2001
+  */
+  constraint con;
+  constraintList conL;
+  constraintExpr conE;
+  /* drl */  
 }
 
 /* standard C tokens */
@@ -111,6 +138,7 @@ void checkandsetBufState(idDecl id, exprNode is);
 %token <tok> LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
 %token <tok> CSTRUCT CUNION CENUM
 %token <tok> VA_ARG VA_DCL
+%token <tok> QWARN
 %token <tok> QGLOBALS
 %token <tok> QMODIFIES 
 %token <tok> QNOMODS
@@ -162,29 +190,54 @@ void checkandsetBufState(idDecl id, exprNode is);
 %token <ctyp> CGCHAR CBOOL CINT CGFLOAT CDOUBLE CVOID 
 %token <tok> QANYTYPE QINTEGRALTYPE QUNSIGNEDINTEGRALTYPE QSIGNEDINTEGRALTYPE
 
+%type <typequal> nullterminatedQualifier
 %token <tok> QNULLTERMINATED
 %token <tok> QSETBUFFERSIZE
-%token <tok> QBUFFERCONSTRAINT
 %token <tok> QSETSTRINGLENGTH
 %token <tok> QMAXSET
 %token <tok> QMAXREAD
 %token <tok> QTESTINRANGE
 
+%token <tok> TCAND
 
 
 /* identifiers, literals */
 %token <entry> IDENTIFIER
 %token <cname> NEW_IDENTIFIER TYPE_NAME_OR_ID 
-%token <expr>  CCONSTANT
+%token <annotation> CANNOTATION
+%token <expr> CCONSTANT
+%type <cname> flagId
+%type <flagspec> flagSpec
+%type <expr> cconstantExpr
 %token <entry> ITER_NAME ITER_ENDNAME 
 %type <entry> endIter 
-%type <sr> globId
+
+%type <funcclauselist> functionClauses functionClausesPlain
+%type <funcclause> functionClause functionClause functionClausePlain
+
+%type <globsclause> globalsClause globalsClausePlain
+%type <modsclause> modifiesClause modifiesClausePlain nomodsClause
+%type <warnclause> warnClause warnClausePlain optWarnClause
+%type <funcclause> conditionClause conditionClausePlain
+%type <stateclause> stateClause stateClausePlain
+%type <msconstraint> metaStateConstraint 
+%type <fcnconstraint> functionConstraint
+%type <msspec> metaStateSpecifier
+%type <msexpr> metaStateExpression
+
+%type <sr> globId globIdListExpr
+%type <globset> globIdList
+
 %token <ctyp>  TYPE_NAME 
+%token <msinfo> METASTATE_NAME 
+%type <msinfo> metaStateName
 %type <cname> enumerator newId  /*@-varuse@*/ /* yacc declares yytranslate here */
 %type <count> pointers /*@=varuse@*/
 
-%type <tok> doHeader specialTag endSpecialTag stateSpecialClause endStateTag 
-%type <sck> specialClauseType
+%type <tok> doHeader stateTag conditionTag startConditionClause
+%type <typequal> exitsQualifier checkQualifier stateQualifier 
+                 paramQualifier returnQualifier visibilityQualifier
+                 typedefQualifier refcountQualifier definedQualifier
 
 /* type construction */
 %type <ctyp> abstractDecl abstractDeclBase optAbstractDeclBase
@@ -201,23 +254,24 @@ void checkandsetBufState(idDecl id, exprNode is);
 %type <ntyplist> structNamedDeclList
 
 %type <entrylist> genericParamList paramTypeList paramList idList paramIdList
-%type <alist> argumentExprList iterArgList
-%type <alist> initList
+%type <exprlist> argumentExprList iterArgList
+%type <exprlist> initList namedInitializerList namedInitializerListAux
 %type <flist> structDeclList structDecl
-%type <srset> locModifies locPlainModifies modList specClauseList
+%type <srset> locModifies modList specClauseList optSpecClauseList
 %type <sr>    mExpr modListExpr specClauseListExpr
 
 /*drl*/
-%type <sr>    BufConstraint
+%type <con> BufConstraint
 %type <tok> relationalOp
 %type <tok> BufBinaryOp
 %type <tok> bufferModifier
 
-%type <sr> BufConstraintExpr
+%type <conE> BufConstraintExpr
 
-%type <sr> BufConstraintTerm
+%type <conE> BufConstraintTerm
+%type <sr> BufConstraintSrefExpr
 
-%type <sr>    BufConstraintList
+%type <conL> BufConstraintList
 
 %type <tok>  BufUnaryOp
 
@@ -244,13 +298,12 @@ void checkandsetBufState(idDecl id, exprNode is);
 %type <expr> expressionStmt selectionStmt iterationStmt jumpStmt iterDefIterationStmt 
 %type <expr> stmtErr stmtListErr compoundStmtErr expressionStmtErr 
 %type <expr> iterationStmtErr initializerList initializer ifPred whilePred forPred iterWhilePred
-%type <expr> tst1
 
 %type <typequal> storageSpecifier typeQualifier typeModifier globQual
 %type <tquallist> optGlobQuals
 %type <qtyp> completeType completeTypeSpecifier optCompleteType
 %type <qtyp> completeTypeSpecifierAux altType typeExpression 
-%type <expr> lclintassertion
+/*%type <expr> lclintassertion*/
 
 %start file
 
@@ -261,8 +314,8 @@ file
  | externalDefs
 
 externalDefs
- : externalDef
- | externalDefs externalDef 
+ : externalDef { context_checkGlobalScope (); }
+ | externalDefs externalDef { context_checkGlobalScope (); }
 
 externalDef
  : fcnDef optSemi { uentry_clearDecl (); } 
@@ -280,9 +333,11 @@ constantDecl
    { checkValueConstant ($2, $4, $8) ; }
 
 fcnDecl
- : QFUNCTION { context_enterFunctionDecl (); } plainFcn optSemi QENDMACRO 
-   { declareStaticFunction ($3); context_quietExitFunction (); 
-     context_exitFunctionDecl (); }
+ : QFUNCTION { context_enterFunctionHeader (); } plainFcn optSemi QENDMACRO 
+   { 
+     declareStaticFunction ($3); context_quietExitFunction (); 
+     context_exitFunctionHeader (); 
+   }
 
 plainFcn
  : plainNamedDecl
@@ -306,29 +361,38 @@ namedDeclBase
  | namedDeclBase TLSQBR TRSQBR 
    { $$ = idDecl_replaceCtype ($1, ctype_makeArray (idDecl_getCtype ($1))); }
  | namedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
-   { 
-     $$ = idDecl_replaceCtype ($1, ctype_makeFixedArray (idDecl_getCtype ($1), exprNode_getLongValue ($4)));
+   {
+     exprNode_findValue($4);
+     if (exprNode_hasValue ($4)) 
+       {
+        $$ = idDecl_replaceCtype ($1, ctype_makeFixedArray (idDecl_getCtype ($1), exprNode_getLongValue ($4)));
+       } 
+     else
+       {
+        $$ = idDecl_replaceCtype ($1, ctype_makeArray (idDecl_getCtype ($1))); 
+       }
    }
  | namedDeclBase PushType TLPAREN TRPAREN 
-   { setCurrentParams (uentryList_missingParams); 
-        }
- optGlobMods  optGlobBufConstraints
+   { setCurrentParams (uentryList_missingParams); }
+   functionClauses
    { /* need to support globals and modifies here! */
      ctype ct = ctype_makeFunction (idDecl_getCtype ($1), 
                                    uentryList_makeMissingParams ());
-
+     
      $$ = idDecl_replaceCtype ($1, ct);
-     context_popLoc (); 
+     idDecl_addClauses ($$, $6);
+     context_popLoc ();
+     /*drl 7/25/01 added*/
+     setImplictfcnConstraints();
    }
  | namedDeclBase PushType TLPAREN genericParamList TRPAREN 
-   { setCurrentParams ($4); 
-        } 
- optGlobMods  optGlobBufConstraints
-   { clearCurrentParams ();
+   { setCurrentParams ($4); 
+   functionClauses
+   { setImplictfcnConstraints ();
+     clearCurrentParams ();
      $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
-     context_popLoc ();
-
-     //     printf("Done nameDeclBase\n");
+     idDecl_addClauses ($$, $7);
+     context_popLoc (); 
    }
 
 plainNamedDeclBase
@@ -354,28 +418,29 @@ plainNamedDeclBase
      $$ = idDecl_replaceCtype ($1, ctype_makeFixedArray (idDecl_getCtype ($1), value));
    }
  | plainNamedDeclBase PushType TLPAREN TRPAREN 
-   { setCurrentParams (uentryList_missingParams); 
-        }
-   optPlainGlobMods 
-   { /* need to support globals and modifies here! */
+   { setCurrentParams (uentryList_missingParams); }
+   functionClausesPlain
+   {
      ctype ct = ctype_makeFunction (idDecl_getCtype ($1), 
                                    uentryList_makeMissingParams ());
-
+     
      $$ = idDecl_replaceCtype ($1, ct);
+     idDecl_addClauses ($$, $6);
      context_popLoc (); 
    }
  | plainNamedDeclBase PushType TLPAREN genericParamList TRPAREN 
-   { setCurrentParams ($4); 
-        } 
-   optPlainGlobMods
-   { clearCurrentParams ();
+   { setCurrentParams ($4); 
+   functionClausesPlain
+   { 
+     clearCurrentParams ();
      $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
+     idDecl_addClauses ($$, $7);
      context_popLoc (); 
    }
 
 iterDecl
  : QITER newId TLPAREN genericParamList TRPAREN 
-   { setCurrentParams ($4); } optPlainGlobMods 
+   { setCurrentParams ($4); } functionClausesPlain
    { clearCurrentParams (); } optSemi QENDMACRO
    { declareCIter ($2, $4); }
 
@@ -386,50 +451,41 @@ macroDef
  | LLMACRO TENDMACRO /* no stmt */ { exprChecks_checkEmptyMacroBody (); } 
 
 fcnDefHdr
 : fcnDefHdrAux { declareFunction ($1); }
: fcnDefHdrAux { clabstract_declareFunction ($1); }
 
-optGlobMods
- : { setProcessingGlobMods (); } optGlobModsRest
-   { clearProcessingGlobMods (); }
+metaStateConstraint
+ : metaStateSpecifier TASSIGN metaStateExpression 
+   { $$ = metaStateConstraint_create ($1, $3); }
 
+metaStateSpecifier
+  : BufConstraintSrefExpr { cscanner_expectingMetaStateName (); } TCOLON metaStateName
+    { cscanner_clearExpectingMetaStateName ();
+      $$ = metaStateSpecifier_create ($1, $4); }
+  | CTOK_ELIPSIS { cscanner_expectingMetaStateName (); } TCOLON metaStateName
+    { cscanner_clearExpectingMetaStateName ();
+      $$ = metaStateSpecifier_createElipsis ($4); }
 
-/*drl*/
+metaStateExpression
+: metaStateSpecifier { $$ = metaStateExpression_create ($1); }
+| metaStateSpecifier TBAR metaStateExpression { $$ = metaStateExpression_createMerge ($1, $3); }
 
-optGlobBufConstraints
- : { setProcessingGlobMods (); } optGlobBufConstraintsRest
-   { clearProcessingGlobMods (); }
+metaStateName
+: METASTATE_NAME
 
-
-optGlobBufConstraintsRest
- : optGlobBufConstraintsAux
-
-optGlobBufConstraintsAux
-: {
-  DPRINTF ( ("doing optGlobBufConstraintsAux\n") );
-context_setProtectVars (); enterParamsTemp (); 
-     sRef_setGlobalScopeSafe (); 
-
-}  QBUFFERCONSTRAINT BufConstraintList  QENDMACRO
-{
-  setFunctionConstraints ($3);
-  exitParamsTemp ();
-     sRef_clearGlobalScopeSafe (); 
-     context_releaseVars ();
-  printf ("done optGlobBufConstraintsAux\n");}
- | /*empty*/
+/*drl*/
 
 BufConstraintList
-: BufConstraint BufConstraintList{ $$ = constraintList_add ($2, $1); }
-| BufConstraint {constraintList c; c = constraintList_new(); c = constraintList_add (c, $1); $$ = c}
+: BufConstraint TCAND BufConstraintList { $$ = constraintList_add ($3, $1); }
+| BufConstraint { $$ = constraintList_single ($1); } 
 
 BufConstraint
-:  BufConstraintExpr relationalOp BufConstraintExpr TSEMI  {
+:  BufConstraintExpr relationalOp BufConstraintExpr {
  $$ = makeConstraintParse3 ($1, $2, $3);
printf("Done BufConstraint1\n"); }
DPRINTF(("Done BufConstraint1\n")); }
 
 bufferModifier
  : QMAXSET
- |QMAXREAD
+ | QMAXREAD
 
 relationalOp
  : GE_OP
@@ -444,15 +500,41 @@ BufConstraintExpr
    $$ = constraintExpr_parseMakeBinaryOp ($2, $3, $4); }
 
 BufConstraintTerm
- : id                              { $$ = constraintExpr_makeTermsRef (
-                                            uentry_getSref ($1));
-                                   checkModifiesId ($1); }
- | NEW_IDENTIFIER                  { $$ = constraintExpr_makeTermsRef(fixModifiesId ($1) ); }
- | CCONSTANT {  char *t; int c;
-  t =  cstring_toCharsSafe (exprNode_unparse($1));
-  c = atoi( t );
-  $$ = constraintExpr_makeIntLiteral (c);
-}
+ : BufConstraintSrefExpr { $$ =  constraintExpr_makeTermsRef ($1);} 
+ | CCONSTANT { $$ = constraintExpr_makeIntLiteral (exprNode_getLongValue ($1)); }
+
+BufConstraintSrefExpr
+: id            
+  { /*@-onlytrans@*/ $$ = checkbufferConstraintClausesId ($1); /*@=onlytrans@*/ /*@i523@*/ }
+| NEW_IDENTIFIER                   
+  { $$ = fixStateClausesId ($1); }
+| BufConstraintSrefExpr TLSQBR TRSQBR       
+  { $$ = sRef_makeAnyArrayFetch ($1); }
+| BufConstraintSrefExpr  TLSQBR CCONSTANT TRSQBR 
+  {
+    /*
+    char *t; int c; 
+    t =  cstring_toCharsSafe (exprNode_unparse($3)); 
+    c = atoi( t );
+    */
+    $$ = sRef_makeArrayFetchKnown ($1, exprNode_getLongValue ($3));
+  }
+| TMULT  BufConstraintSrefExpr               
+  { $$ = sRef_constructPointer ($2); }
+| TLPAREN BufConstraintSrefExpr TRPAREN     
+  { $$ = $2; }  
+| BufConstraintSrefExpr TDOT newId          
+  { cstring_markOwned ($3); $$ = sRef_buildField ($1, $3); }
+| BufConstraintSrefExpr ARROW_OP newId      
+  { cstring_markOwned ($3); $$ = sRef_makeArrow ($1, $3); }
+
+/*
+| BufConstraintTerm TLSQBR TRSQBR       { $$ = sRef_makeAnyArrayFetch ($1); }
+ | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
+ | TLPAREN specClauseListExpr TRPAREN     { $$ = $2; }  
+ | specClauseListExpr TDOT newId          { cstring_markOwned ($3);
+                                           $$ = sRef_buildField ($1, $3); }
+*/
 
 /*BufConstraintExpr
 : BufConstraintTerm 
@@ -466,45 +548,113 @@ BufBinaryOp
  : TPLUS
 | TMINUS
 ;
+/*
+** Function clauses can appear in any order.
+*/
 
+functionClauses
+ : { $$ = functionClauseList_new (); }
+ | functionClause functionClauses
+   { $$ = functionClauseList_prepend ($2, $1); }
 
-koptPlainGlobMods
- : { setProcessingGlobMods (); } optPlainGlobModsRest
-   { clearProcessingGlobMods (); }
+/*
+** Inside macro definitions, there are no end macros.
+*/
 
+functionClausesPlain
+ : 
+   { $$ = functionClauseList_new (); }
+ | functionClausePlain functionClausesPlain
+   { $$ = functionClauseList_prepend ($2, $1); }
+
+functionClause
+ : globalsClause   { $$ = functionClause_createGlobals ($1); }
+ | modifiesClause  { $$ = functionClause_createModifies ($1); }
+ | nomodsClause    { $$ = functionClause_createModifies ($1); }
+ | stateClause     { $$ = functionClause_createState ($1); }  
+ | conditionClause { $$ = $1; }
+ | warnClause      { $$ = functionClause_createWarn ($1); }
+
+functionClausePlain
+ : globalsClausePlain   { $$ = functionClause_createGlobals ($1); }
+ | modifiesClausePlain  { $$ = functionClause_createModifies ($1); }
+ | nomodsClause         { $$ = functionClause_createModifies ($1); }
+ | stateClausePlain     { $$ = functionClause_createState ($1); }  
+ | conditionClausePlain { $$ = $1; }
+ | warnClausePlain      { $$ = functionClause_createWarn ($1); }
+
+globalsClause
+ : globalsClausePlain QENDMACRO { $$ = $1; }
+
+globalsClausePlain
+ : QGLOBALS { setProcessingGlobalsList (); } 
+   globIdList optSemi  
+   { 
+     unsetProcessingGlobals (); 
+     $$ = globalsClause_create ($1, $3); 
+   }
+
+nomodsClause
+ : QNOMODS { $$ = modifiesClause_createNoMods ($1); }
+
+modifiesClause
+ : modifiesClausePlain QENDMACRO { $$ = $1; }
 
-/*: id  {  $$ = unentry_getSref($1);  checkModifiesId ($1); }
-| NEW_INDENTIFIER { $$ = fixModifiesId ($1)} */
+modifiesClausePlain
+ : QMODIFIES 
+   {
+     context_setProtectVars (); enterParamsTemp (); 
+     sRef_setGlobalScopeSafe (); 
+   }
+   locModifies
+   { 
+     exitParamsTemp ();
+     sRef_clearGlobalScopeSafe (); 
+     context_releaseVars ();
+     $$ = modifiesClause_create ($1, $3);
+   }
 
-/*end*/
+flagSpec
+ : flagId 
+   { $$ = flagSpec_createPlain ($1); }
+ | flagId TBAR flagSpec
+   { $$ = flagSpec_createOr ($1, $3); }
 
+flagId
+ : NEW_IDENTIFIER
 
-optPlainGlobMods
- : { setProcessingGlobMods (); } optPlainGlobModsRest
  { clearProcessingGlobMods (); }
+optWarnClause
+ : warnClause
| /* empty */ { $$ = warnClause_undefined; }
 
-optGlobModsRest
- : optGlobModsAux 
- | specialClauses optGlobModsAux
+warnClause
+ : warnClausePlain QENDMACRO { $$ = $1; }
 
-optPlainGlobModsRest
- : optPlainGlobModsAux 
- | specialClauses optPlainGlobModsAux
+warnClausePlain
+ : QWARN flagSpec cconstantExpr
+   {      
+     llassert (exprNode_knownStringValue ($3));
+     $$ = warnClause_create ($1, $2, cstring_copy (multiVal_forceString (exprNode_getValue ($3)))); 
+     exprNode_free ($3);
+   }
+ | QWARN flagSpec
+   { $$ = warnClause_create ($1, $2, cstring_undefined); }
 
-specialClauses
- : specialClause
- | specialClause specialClauses
 globIdList
- : globIdListExpr                     { ; }
- | globIdList TCOMMA globIdListExpr   { ; }
+ : globIdListExpr                     { $$ = globSet_single ($1); }
+ | globIdList TCOMMA globIdListExpr   { $$ = globSet_insert ($1, $3); }
  
 globIdListExpr 
- : optGlobQuals globId { globListAdd ($2, $1); }
+ : optGlobQuals globId { $$ = clabstract_createGlobal ($2, $1); }
+
+optGlobQuals
+ : /* empty */           { $$ = qualList_undefined; }
+ | globQual optGlobQuals { $$ = qualList_add ($2, $1); }
 
 globId
  : id             { $$ = uentry_getSref ($1); }
- | NEW_IDENTIFIER { $$ = globListUnrecognized ($1); }
+ | NEW_IDENTIFIER { $$ = clabstract_unrecognizedGlobal ($1); }
+ | initializer    { $$ = clabstract_checkGlobal ($1); }
 
 globQual
  : QUNDEF   { $$ = qual_createUndef (); }
@@ -513,123 +663,17 @@ globQual
  | QIN      { $$ = qual_createIn (); }
  | QPARTIAL { $$ = qual_createPartial (); }
 
-optGlobQuals
- : /* empty */         { $$ = qualList_undefined; }
- | globQual optGlobQuals { $$ = qualList_add ($2, $1); }
-
-optGlobModsAux  
- : QGLOBALS { setProcessingGlobalsList (); } initializerList optSemi 
-   QENDMACRO optMods
-   { unsetProcessingGlobals (); }
- | QGLOBALS { setProcessingGlobalsList (); } globIdList optSemi 
-   QENDMACRO optMods
-   { unsetProcessingGlobals (); }
- | QNOMODS 
-   { setFunctionNoGlobals ();
-     setFunctionModifies (sRefSet_single (sRef_makeNothing ())); 
-   }
- | fcnMods
- | /* empty */
-
-optPlainGlobModsAux
- : QGLOBALS { setProcessingGlobalsList (); } initializerList optSemi 
-   optMods
-   { unsetProcessingGlobals (); }
- | QGLOBALS { setProcessingGlobalsList (); } globIdList optSemi 
-   optMods
-   { unsetProcessingGlobals (); }
- | QNOMODS 
-   { setFunctionNoGlobals ();
-     setFunctionModifies (sRefSet_single (sRef_makeNothing ())); 
-   }
- | fcnPlainMods
- | /* empty */
-
-optMods
- : fcnMods
- | /* empty */
-
-fcnMods
- : QMODIFIES 
-   {
-     context_setProtectVars (); enterParamsTemp (); 
-     sRef_setGlobalScopeSafe (); 
-   }
-   locModifies
-   { 
-     setFunctionModifies ($3); exitParamsTemp ();
-     sRef_clearGlobalScopeSafe (); 
-     context_releaseVars ();
-   }
-
-fcnPlainMods
- : QMODIFIES 
-   {
-     context_setProtectVars (); enterParamsTemp (); 
-     sRef_setGlobalScopeSafe (); 
-   }
-   locPlainModifies
-   { 
-     setFunctionModifies ($3); exitParamsTemp ();
-     sRef_clearGlobalScopeSafe (); 
-     context_releaseVars ();
-   }
-
-specialTag
+stateTag
  : QDEFINES
  | QUSES
  | QALLOCATES
  | QSETS
  | QRELEASES
 
-endStateTag
- : QENDMACRO
-
-endSpecialTag
- : QENDMACRO
-
-stateSpecialClause
+conditionTag
  : QPRECLAUSE
  | QPOSTCLAUSE
 
-specialClauseType
- : QONLY       { $$ = SP_ISONLY; }
- | QOBSERVER   { $$ = SP_ISOBSERVER; }
- | QEXPOSED    { $$ = SP_ISEXPOSED; }
- | QDEPENDENT  { $$ = SP_ISDEPENDENT; }
- | QOWNED      { $$ = SP_ISOWNED; }
- | QSHARED     { $$ = SP_ISSHARED; }
- | QISNULL     { $$ = SP_ISNULL; }
- | QNOTNULL    { $$ = SP_ISNOTNULL; }
-specialClause
- : specialTag NotType
-   {
-     context_setProtectVars (); 
-     enterParamsTemp (); 
-     sRef_setGlobalScopeSafe (); 
-   }
-   specClauseList optSemi endSpecialTag IsType
-   { 
-     setFunctionSpecialClause ($1, $4, $6); 
-     exitParamsTemp ();
-     sRef_clearGlobalScopeSafe (); 
-     context_releaseVars ();
-   }
-  | stateSpecialClause NotType specialClauseType 
-    {
-      context_setProtectVars (); 
-      enterParamsTemp (); 
-      sRef_setGlobalScopeSafe (); 
-    }
-    specClauseList optSemi endStateTag IsType
-    { 
-      setFunctionStateSpecialClause ($1, $3, $5, $7); 
-      exitParamsTemp ();
-      sRef_clearGlobalScopeSafe (); 
-      context_releaseVars ();
-    }
-
 fcnDefHdrAux
  : namedDecl                               
    { 
@@ -647,30 +691,26 @@ fcnBody
      exprNode_checkFunctionBody ($3); $$ = $3; 
      context_exitInner ($3); 
    }
- | initializerList 
-   { doneParams (); context_enterInnerContext (); }
+ | { context_enterOldStyleScope (); } initializerList 
+   { oldStyleDoneParams (); context_enterInnerContext (); } 
    compoundStmt 
    {
-     context_exitInner ($3);
-     exprNode_checkFunctionBody ($3); 
-     $$ = $3; /* old style */ 
+     exprNode_checkFunctionBody ($4); 
+     $$ = $4; /* oldstyle */ 
+     context_exitInner ($4);
    } 
  
 fcnDef
  : fcnDefHdr fcnBody 
    { 
      context_setFunctionDefined (exprNode_loc ($2)); 
-     exprNode_checkFunction (context_getHeader (), $2);
+     exprNode_checkFunction (context_getHeader (),  $2); 
      /* DRL 8 8 2000 */
      
      context_exitFunction ();
    }
 
 locModifies
- : modList optSemi QENDMACRO { $$ = $1; }
- | optSemi QENDMACRO         { $$ = sRefSet_new (); }
-
-locPlainModifies
  : modList optSemi           { $$ = $1; }
  | optSemi                   { $$ = sRefSet_new (); }
  
@@ -686,8 +726,8 @@ modListExpr
 
 
 mExpr
-  : modListExpr { $$ = $1; }
-  | CCONSTANT   { $$ = sRef_makeUnknown (); /* sRef_makeConstant ($1); ? */ }
+  : modListExpr     { $$ = $1; }
+  | cconstantExpr   { $$ = sRef_makeUnknown (); /* sRef_makeConstant ($1); ? */ }
     /* arithmetic? */
 
 modList
@@ -696,9 +736,9 @@ modList
 
 specClauseListExpr
  : id                                     
-   { $$ = checkSpecClausesId ($1); }
+   { $$ = checkStateClausesId ($1); }
  | NEW_IDENTIFIER                         
-   { $$ = fixSpecClausesId ($1); }
+   { $$ = fixStateClausesId ($1); }
  | specClauseListExpr TLSQBR TRSQBR       { $$ = sRef_makeAnyArrayFetch ($1); }
  | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
  | TMULT specClauseListExpr               { $$ = sRef_constructPointer ($2); }
@@ -708,6 +748,10 @@ specClauseListExpr
  | specClauseListExpr ARROW_OP newId      { cstring_markOwned ($3);
                                             $$ = sRef_makeArrow ($1, $3); }
 
+optSpecClauseList
+ : /* empty */ { $$ = sRefSet_undefined }
+ | specClauseList
+
 specClauseList
   : specClauseListExpr                       
     { if (sRef_isValid ($1)) { $$ = sRefSet_single ($1); } 
@@ -727,7 +771,7 @@ specClauseList
 primaryExpr
  : id { $$ = exprNode_fromIdentifier ($1); }
  | NEW_IDENTIFIER { $$ = exprNode_fromUIO ($1); } 
- | CCONSTANT      { $$ = $1; }
+ | cconstantExpr
  | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
  | TYPE_NAME_OR_ID { $$ = exprNode_fromIdentifier (coerceId ($1)); } 
  | QEXTENSION { $$ = exprNode_makeError (); }
@@ -738,8 +782,8 @@ postfixExpr
  | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
  | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
  | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN { $$ = exprNode_vaArg ($1, $3, $5); }
- | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $4); }
- | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $4); }
+ | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $3, $4); }
+ | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
  | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
  | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
  
@@ -888,7 +932,8 @@ initializer
  | typeDecl     { $$ = exprNode_makeError (); }
 
 instanceDecl
- : completeTypeSpecifier IsType TSEMI { $$ = exprNode_makeError (); }
+ : completeTypeSpecifier IsType TSEMI 
+   { $$ = exprNode_makeError (); }
     /*
      ** This causes r/r conflicts with function definitions.
      ** Instead we need to snarf one first. (gack)
@@ -903,25 +948,35 @@ instanceDecl
      */
  | completeTypeSpecifier NotType namedDecl NotType 
    {
-               setProcessingVars ($1); 
-     processNamedDecl ($3); }
-   IsType optDeclarators TSEMI IsType { unsetProcessingVars (); $$ = $7; }
+     setProcessingVars ($1); 
+     processNamedDecl ($3); 
+   }
+   IsType optDeclarators TSEMI IsType 
+   { 
+     unsetProcessingVars (); 
+     $$ = exprNode_makeEmptyInitialization ($3); 
+     DPRINTF (("Empty initialization: %s", exprNode_unparse ($$)));
+   }
  | completeTypeSpecifier NotType namedDecl NotType TASSIGN 
-   { setProcessingVars ($1); processNamedDecl ($3); 
-        }
+   { setProcessingVars ($1); processNamedDecl ($3); }
    IsType init optDeclarators TSEMI IsType 
    { $$ = exprNode_concat ($9, exprNode_makeInitialization ($3, $8)); 
      unsetProcessingVars ();
    }
+
 namedInitializer
- : namedDecl NotType { processNamedDecl ($1); $$ = exprNode_makeError (); }
+ : namedDecl NotType 
+   { 
+     processNamedDecl ($1); 
+     $$ = exprNode_makeEmptyInitialization ($1);
+   }
  | namedDecl NotType TASSIGN { processNamedDecl ($1); } IsType init
    { $$ = exprNode_makeInitialization ($1, $6); }
 
-
 typeDecl
  : CTYPEDEF completeTypeSpecifier { setProcessingTypedef ($2); } 
-   NotType namedInitializerList IsType TSEMI { unsetProcessingTypedef (); } 
+   NotType namedInitializerList IsType optWarnClause TSEMI 
+   { clabstract_declareType ($5, $7); }
  | CTYPEDEF completeTypeSpecifier IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
  | CTYPEDEF namedInitializerList IsType TSEMI { /* in the ANSI grammar, semantics unclear */ } 
 
@@ -932,18 +987,18 @@ PushType
  : { g_expectingTypeName = TRUE; context_pushLoc (); }
 
 namedInitializerList
- :  namedInitializerListAux IsType { ; }
+ :  namedInitializerListAux IsType { $$ = $1; }
 
 namedInitializerListAux
- : namedInitializer { ; }
- | namedInitializerList TCOMMA NotType namedInitializer { ; }
+ : namedInitializer { $$ = exprNodeList_singleton ($1); }
+ | namedInitializerList TCOMMA NotType namedInitializer { $$ = exprNodeList_push ($1, $4); }
 
 optDeclarators
  : /* empty */      { $$ = exprNode_makeError (); }
  | optDeclarators TCOMMA NotType namedInitializer { $$ = exprNode_concat ($1, $4); }
 
 init
- : assignExpr                      { $$ = $1; }
+ : assignExpr                      
  | TLBRACE initList TRBRACE        { $$ = exprNode_makeInitBlock ($1, $2); }
  | TLBRACE initList TCOMMA TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); }
 
@@ -966,56 +1021,140 @@ storageSpecifier
  | QAUTO     { $$ = qual_createAuto (); }
  | QREGISTER { $$ = qual_createRegister (); }
 
-typeQualifier
- : QCONST IsType       { $$ = qual_createConst (); }
- | QVOLATILE IsType    { $$ = qual_createVolatile (); }
- | QOUT IsType         { $$ = qual_createOut (); }
- | QIN IsType          { $$ = qual_createIn (); }
- | QPARTIAL IsType     { $$ = qual_createPartial (); }
- | QSPECIAL IsType     { $$ = qual_createSpecial (); }
- | QOWNED IsType       { $$ = qual_createOwned (); }
- | QDEPENDENT IsType   { $$ = qual_createDependent (); }
- | QYIELD IsType       { $$ = qual_createYield (); }
- | QTEMP IsType        { $$ = qual_createTemp (); }
- | QONLY IsType        { $$ = qual_createOnly (); }
- | QKEEP IsType        { $$ = qual_createKeep (); }
- | QKEPT IsType        { $$ = qual_createKept (); }
- | QSHARED IsType      { $$ = qual_createShared (); }
- | QUNIQUE IsType      { $$ = qual_createUnique (); }
- | QEXITS IsType       { $$ = qual_createExits (); }
- | QMAYEXIT IsType     { $$ = qual_createMayExit (); }
- | QTRUEEXIT IsType    { $$ = qual_createTrueExit (); }
- | QFALSEEXIT IsType   { $$ = qual_createFalseExit (); }
- | QNEVEREXIT IsType   { $$ = qual_createNeverExit (); }
- | QNULL IsType        { $$ = qual_createNull (); }
- | QRELNULL IsType     { $$ = qual_createRelNull (); }
- | QRETURNED IsType    { $$ = qual_createReturned (); }
- | QEXPOSED IsType     { $$ = qual_createExposed (); }
- | QOBSERVER IsType    { $$ = qual_createObserver (); }
- | QCHECKED IsType     { $$ = qual_createChecked (); }
- | QCHECKMOD IsType    { $$ = qual_createCheckMod (); }
- | QUNCHECKED IsType   { $$ = qual_createUnchecked (); }
- | QCHECKEDSTRICT IsType  { $$ = qual_createCheckedStrict (); }
- | QTRUENULL IsType    { $$ = qual_createTrueNull (); }
- | QFALSENULL IsType   { $$ = qual_createFalseNull (); }
- | QUNUSED IsType      { $$ = qual_createUnused (); }
- | QEXTERNAL IsType    { $$ = qual_createExternal (); }
- | QSEF IsType         { $$ = qual_createSef (); }
- | QABSTRACT IsType    { $$ = qual_createAbstract (); }
- | QCONCRETE IsType    { $$ = qual_createConcrete (); }
- | QMUTABLE IsType     { $$ = qual_createMutable (); }
- | QIMMUTABLE IsType   { $$ = qual_createImmutable (); }
- | QNOTNULL IsType     { $$ = qual_createNotNull (); }
- | QREFCOUNTED IsType  { $$ = qual_createRefCounted (); }
- | QREFS IsType        { $$ = qual_createRefs (); }
- | QKILLREF IsType     { $$ = qual_createKillRef (); }
- | QRELDEF IsType      { $$ = qual_createRelDef (); }
- | QNEWREF IsType      { $$ = qual_createNewRef (); }
- | QTEMPREF IsType     { $$ = qual_createTempRef (); }
- | QNULLTERMINATED IsType { $$ = qual_createNullTerminated (); }
-
-/* | QSETBUFFERSIZE IsType { $$ = qual_createSetBufferSize (); } */
+nullterminatedQualifier:
+ QNULLTERMINATED IsType { $$ = qual_createNullTerminated (); }
+
+stateClause
+ : stateClausePlain QENDMACRO { $$ = $1; }
+
+stateClausePlain
+ : stateTag NotType
+   {
+     context_setProtectVars (); 
+     enterParamsTemp (); 
+     sRef_setGlobalScopeSafe (); 
+   }
+   specClauseList optSemi IsType
+   { 
+     exitParamsTemp ();
+     sRef_clearGlobalScopeSafe (); 
+     context_releaseVars ();
+     $$ = stateClause_createPlain ($1, $4);
+   }
+
+conditionClause
+ : conditionClausePlain QENDMACRO { $$ = $1; }
+
+startConditionClause
+: conditionTag NotType { $$ = $1; context_enterFunctionHeader (); } 
+
+conditionClausePlain
+ : startConditionClause stateQualifier
+   {
+     context_exitFunctionHeader ();
+     context_setProtectVars (); 
+     enterParamsTemp (); 
+     sRef_setGlobalScopeSafe (); 
+   }
+   optSpecClauseList optSemi IsType
+   { 
+     exitParamsTemp ();
+     sRef_clearGlobalScopeSafe (); 
+     context_releaseVars ();
+     $$ = functionClause_createState (stateClause_create ($1, $2, $4));
+   }
+ | startConditionClause
+   {
+     context_setProtectVars (); 
+     enterParamsTemp (); 
+     sRef_setGlobalScopeSafe (); 
+   } 
+   functionConstraint optSemi IsType
+   {
+     context_exitFunctionHeader ();
+     exitParamsTemp ();
+     sRef_clearGlobalScopeSafe (); 
+     context_releaseVars ();
+     DPRINTF (("done optGlobBufConstraintsAux\n"));
+
+     if (lltok_isEnsures ($1)) 
+       {
+        $$ = functionClause_createEnsures ($3);
+       }
+     else if (lltok_isRequires ($1))
+       {
+        $$ = functionClause_createRequires ($3);
+       }
+     else
+       {
+        BADBRANCH;
+       }
+
+     DPRINTF (("FunctionclauseS: %s", functionClause_unparse ($$)));
+   }
 
+functionConstraint
+ : BufConstraintList   { $$ = functionConstraint_createBufferConstraint ($1); }
+ | metaStateConstraint { $$ = functionConstraint_createMetaStateConstraint ($1); DPRINTF (("Made constraint: %s", functionConstraint_unparse ($$))); } 
+exitsQualifier
+ : QEXITS        { $$ = qual_createExits (); }
+ | QMAYEXIT      { $$ = qual_createMayExit (); }
+ | QTRUEEXIT     { $$ = qual_createTrueExit (); }
+ | QFALSEEXIT    { $$ = qual_createFalseExit (); }
+ | QNEVEREXIT    { $$ = qual_createNeverExit (); }
+
+checkQualifier
+ : QCHECKED        { $$ = qual_createChecked (); }
+ | QCHECKMOD       { $$ = qual_createCheckMod (); }
+ | QUNCHECKED      { $$ = qual_createUnchecked (); }
+ | QCHECKEDSTRICT  { $$ = qual_createCheckedStrict (); }
+
+stateQualifier
+ : QOWNED        { $$ = qual_createOwned (); }
+ | QDEPENDENT    { $$ = qual_createDependent (); }
+ | QYIELD        { $$ = qual_createYield (); }
+ | QTEMP         { $$ = qual_createTemp (); }
+ | QONLY         { $$ = qual_createOnly (); }
+ | QKEEP         { $$ = qual_createKeep (); }
+ | QKEPT         { $$ = qual_createKept (); }
+ | QSHARED       { $$ = qual_createShared (); }
+ | QUNIQUE       { $$ = qual_createUnique (); }
+ | QNULL         { $$ = qual_createNull (); }
+ | QISNULL       { $$ = qual_createIsNull (); }
+ | QRELNULL      { $$ = qual_createRelNull (); }
+ | QNOTNULL      { $$ = qual_createNotNull (); }
+ | QEXPOSED      { $$ = qual_createExposed (); }
+ | QOBSERVER     { $$ = qual_createObserver (); }
+ | QNULLTERMINATED { $$ = qual_createNullTerminated (); } 
+ | CANNOTATION   { $$ = qual_createMetaState ($1); }
+
+
+paramQualifier
+ : QRETURNED     { $$ = qual_createReturned (); }
+ | QSEF          { $$ = qual_createSef (); }
+
+visibilityQualifier
+ : QUNUSED       { $$ = qual_createUnused (); }
+ | QEXTERNAL     { $$ = qual_createExternal (); }
+
+returnQualifier
+ : QTRUENULL     { $$ = qual_createTrueNull (); }
+ | QFALSENULL    { $$ = qual_createFalseNull (); }
+
+typedefQualifier
+ : QABSTRACT     { $$ = qual_createAbstract (); }
+ | QCONCRETE     { $$ = qual_createConcrete (); }
+ | QMUTABLE      { $$ = qual_createMutable (); }
+ | QIMMUTABLE    { $$ = qual_createImmutable (); }
+
+refcountQualifier
+ : QREFCOUNTED   { $$ = qual_createRefCounted (); }
+ | QREFS         { $$ = qual_createRefs (); }
+ | QKILLREF      { $$ = qual_createKillRef (); }
+ | QRELDEF       { $$ = qual_createRelDef (); }
+ | QNEWREF       { $$ = qual_createNewRef (); }
+ | QTEMPREF      { $$ = qual_createTempRef (); }
 
 typeModifier
  : QSHORT            { $$ = qual_createShort (); }
@@ -1023,6 +1162,29 @@ typeModifier
  | QSIGNED           { $$ = qual_createSigned (); }
  | QUNSIGNED         { $$ = qual_createUnsigned (); }
 
+definedQualifier
+ : QOUT              { $$ = qual_createOut (); }
+ | QIN               { $$ = qual_createIn (); }
+ | QPARTIAL          { $$ = qual_createPartial (); }
+ | QSPECIAL          { $$ = qual_createSpecial (); }
+
+typeQualifier
+ : QCONST IsType       { $$ = qual_createConst (); }
+ | QVOLATILE IsType    { $$ = qual_createVolatile (); }
+ | definedQualifier IsType { $$ = $1; } 
+ | stateQualifier IsType { $$ = $1; } 
+ | exitsQualifier IsType { $$ = $1; }
+ | paramQualifier IsType { $$ = $1; }
+ | checkQualifier IsType { $$ = $1; }
+ | returnQualifier IsType { $$ = $1; }
+ | visibilityQualifier IsType { $$ = $1; }
+ | typedefQualifier IsType { $$ = $1; }
+ | refcountQualifier IsType { $$ = $1; }
+
+/*
+** This is copied into the mtgrammar!
+*/
+
 typeSpecifier
  : CGCHAR NotType 
  | CINT NotType 
@@ -1082,9 +1244,9 @@ suSpc
    structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
    TRBRACE 
    { $$ = declareUnnamedStruct ($7); }
- | NotType CUNION  IsType TLBRACE { sRef_setGlobalScopeSafe (); } 
-   CreateStructInnerScope 
-   structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
+ | NotType CUNION IsType TLBRACE { sRef_setGlobalScopeSafe (); } 
+   CreateStructInnerScope structDeclList DeleteStructInnerScope 
+   { sRef_clearGlobalScopeSafe (); }
    TRBRACE 
    { $$ = declareUnnamedUnion ($7); } 
  | NotType CSTRUCT IsType TLBRACE TRBRACE
@@ -1271,10 +1433,9 @@ stmt
  | iterationStmt 
  | iterStmt
  | jumpStmt 
-/*  | tst1 */
- | lclintassertion {$$ = $1; printf ("Doing stmt lclintassertion\n"); }
-
+/* | lclintassertion {$$ = $1; printf ("Doing stmt lclintassertion\n"); }*/
 
+/*
 lclintassertion
  : QSETBUFFERSIZE id CCONSTANT QENDMACRO { printf(" QSETBUFFERSIZE id CCONSTANT HEllo World\n");  uentry_setBufferSize($2, $3); $$ = exprNode_createTok ($4);
   }
@@ -1285,11 +1446,6 @@ lclintassertion
 
 /* | QSETBUFFERSIZE id id  {$$ = $2; printf(" QSETBUFFERSIZE id id HEllo World\n");} */
 
-tst1
-: TCOLON newId { $$ = exprNode_labelMarker ($2); }
-
-
-
 iterBody
  : iterDefStmtList { $$ = $1; }
 
@@ -1329,7 +1485,7 @@ iterDefStmt
  : labeledStmt 
  | caseStmt 
  | defaultStmt
- | openScope initializerList { $$ = $2; }
+ | openScope initializerList { $$ = $1; DPRINTF (("def stmt: %s", exprNode_unparse ($$))); }
  | openScope
  | closeScope
  | expressionStmt
@@ -1427,7 +1583,6 @@ compoundStmtRest
                                                        lltok_getLoc ($3))); 
    }
 
-
 compoundStmtAux
  : TLBRACE compoundStmtRest 
    { $$ = exprNode_makeBlock ($2); }
@@ -1528,8 +1683,12 @@ iterArgExpr
 ** everything is the same, EXCEPT it cannot be a NEW_IDENTIFIER 
 */
 
+cconstantExpr
+ : CCONSTANT
+ | cconstantExpr CCONSTANT { $$ = exprNode_combineLiterals ($1, $2); }  
+
 primaryIterExpr
- : CCONSTANT 
+ : cconstantExpr 
  | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
  
 postfixIterExpr
@@ -1539,8 +1698,8 @@ postfixIterExpr
  | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
  | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN
        { $$ = exprNode_vaArg ($1, $3, $5); }
- | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $4); }
- | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $4); }
+ | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $3, $4); }
+ | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
  | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
  | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
  
@@ -1685,9 +1844,9 @@ typeName
 
 %%
 
-/*@-redecl@*/
+/*@-redecl@*/ /*@-namechecks@*/
 extern char *yytext;
-/*@=redecl@*/
+/*@=redecl@*/ /*@=namechecks@*/
 
 # include "bison.reset"
 
@@ -1710,7 +1869,7 @@ void yyerror (/*@unused@*/ char *s)
       llerror (FLG_SYNTAX, message ("Macro syntax not parseable: %s", 
                                    context_inFunctionName ()));
       
-      if (context_inMacroUnknown ())
+      if (context_inUnknownMacro ())
        {
          if (!givehint)
            {
@@ -1722,6 +1881,7 @@ void yyerror (/*@unused@*/ char *s)
        }
 
       swallowMacro ();
+      context_exitAllClausesQuiet ();
     }
   else
     {
@@ -1729,30 +1889,12 @@ void yyerror (/*@unused@*/ char *s)
     }
 }
 
-void printState (idDecl t) {
- cstring id = idDecl_getName (t);
- uentry ue = usymtab_lookupSafe (id);
 
- sRef s = uentry_getSref (ue);
- printf("State = %d\n", s->bufinfo.bufstate);
-}
 
 
-/*take this out soon */
-/* void testassert1 (cstring id, icstring cons ) { */
- /*   uentry ue =usymtab_lookupSafe (id); */
-/*   sRef s = uentry_getSref (ue); */
-/*   printf ("Doing testassert1 with setbuffersize\n"); */
-/*   printf("State = %d\n", s->bufinfo.bufstate); */
-/* } */
-/* void testassert2 (cstring id) { */
-/*    uentry ue =usymtab_lookupSafe (id); */
-/*   sRef s = uentry_getSref (ue); */
-/*   printf ("Doing testassert2 with setbuffersize\n"); */
-/*   printf("State = %d\n", s->bufinfo.bufstate); */
-/* } */
-  
+
+
+
 
 
 
This page took 0.773705 seconds and 4 git commands to generate.