]> andersk Git - splint.git/blobdiff - src/cgrammar.y
Changed to used /\ and requires instead of bufferConstraint
[splint.git] / src / cgrammar.y
index 6c057b13e48046f7d74ad13b005289fe1dd11b11..ea03f8a7006bdcf7c0fb7eba053d15c5cf04d0e0 100644 (file)
@@ -69,7 +69,6 @@ void yyerror (char *s);
 # undef realloc
 # endif
 
-void checkandsetBufState(idDecl id, exprNode is);
 %}
 
 %union
@@ -178,6 +177,7 @@ void checkandsetBufState(idDecl id, exprNode is);
 %token <tok> QMAXREAD
 %token <tok> QTESTINRANGE
 
+%token <tok> TCAND
 
 
 /* identifiers, literals */
@@ -330,16 +330,13 @@ namedDeclBase
      context_popLoc (); 
    }
  | namedDeclBase PushType TLPAREN genericParamList TRPAREN 
-   { setCurrentParams ($4);
-    
+   { setCurrentParams ($4); 
         } 
  optGlobMods  optGlobBufConstraints
    { setImplictfcnConstraints ();
      clearCurrentParams ();
      $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
-     context_popLoc ();
-
-     //     printf("Done nameDeclBase\n");
+     context_popLoc (); 
    }
 
 plainNamedDeclBase
@@ -421,7 +418,7 @@ optGlobEnsuresConstraintsAux
 context_setProtectVars (); enterParamsTemp (); 
      sRef_setGlobalScopeSafe (); 
 
-}  QENSURESCONSTRAINT BufConstraintList  QENDMACRO
+}  QENSURESCONSTRAINT BufConstraintList optSemi QENDMACRO
 {
   setEnsuresConstraints ($3);
   exitParamsTemp ();
@@ -437,7 +434,7 @@ optGlobBufConstraintsAux
 context_setProtectVars (); enterParamsTemp (); 
      sRef_setGlobalScopeSafe (); 
 
-}  QBUFFERCONSTRAINT BufConstraintList  QENDMACRO
+}  QBUFFERCONSTRAINT BufConstraintList optSemi QENDMACRO
 {
   setFunctionConstraints ($3);
   exitParamsTemp ();
@@ -447,11 +444,11 @@ context_setProtectVars (); enterParamsTemp ();
  | /*empty*/
 
 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 c; c = constraintList_makeNew(); c = constraintList_add (c, $1); $$ = c}
 
 BufConstraint
-:  BufConstraintExpr relationalOp BufConstraintExpr TSEMI  {
+:  BufConstraintExpr relationalOp BufConstraintExpr {
  $$ = makeConstraintParse3 ($1, $2, $3);
  DPRINTF(("Done BufConstraint1\n")); }
 
@@ -713,7 +710,7 @@ fcnDef
  : fcnDefHdr fcnBody 
    { 
      context_setFunctionDefined (exprNode_loc ($2)); 
-     /* exprNode_checkFunction (context_getHeader (), $2); */
+     exprNode_checkFunction (context_getHeader (), $2); 
      /* DRL 8 8 2000 */
      
      context_exitFunction ();
This page took 0.035061 seconds and 4 git commands to generate.