# undef realloc
# endif
-void checkandsetBufState(idDecl id, exprNode is);
+
%}
%union
/*@only@*/ exprNodeList alist;
/*@only@*/ sRefSet srset;
/*@only@*/ cstringList cstringlist;
+ /*drl
+ added 1/19/2001
+ */
+ constraint con;
+ constraintList conL;
+ constraintExpr conE;
+ /* drl */
}
/* standard C tokens */
%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
%type <tquallist> optGlobQuals
%type <qtyp> completeType completeTypeSpecifier optCompleteType
%type <qtyp> completeTypeSpecifierAux altType typeExpression
-%type <expr> lclintassertion
+/*%type <expr> lclintassertion*/
%start file
context_popLoc ();
}
| namedDeclBase PushType TLPAREN genericParamList TRPAREN
- { setCurrentParams ($4);
+ { setCurrentParams ($4);
+
}
optGlobMods optGlobBufConstraints
- { clearCurrentParams ();
+ { setImplictfcnConstraints ();
+ clearCurrentParams ();
$$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
context_popLoc ();
BufConstraintList
: BufConstraint BufConstraintList{ $$ = constraintList_add ($2, $1); }
-| BufConstraint {constraintList c; c = constraintList_new(); c = constraintList_add (c, $1); $$ = c}
+| BufConstraint {constraintList c; c = constraintList_makeNew(); c = constraintList_add (c, $1); $$ = c}
BufConstraint
: BufConstraintExpr relationalOp BufConstraintExpr TSEMI {
$$ = constraintExpr_parseMakeBinaryOp ($2, $3, $4); }
BufConstraintTerm
-: id { /* $$ = constraintExpr_makeTermsRef (checkSpecClausesId ($1)); */
- $$ = constraintExpr_makeTermsRef (checkbufferConstraintClausesId ($1));}
- | NEW_IDENTIFIER { $$ = constraintExpr_makeTermsRef(fixSpecClausesId ($1) ); }
+: BufConstraintSrefExpr { $$ = constraintExpr_makeTermsRef($1);}
| CCONSTANT { char *t; int c;
t = cstring_toCharsSafe (exprNode_unparse($1));
c = atoi( t );
$$ = constraintExpr_makeIntLiteral (c);
}
+
+BufConstraintSrefExpr
+: id {
+ $$ =
+ checkbufferConstraintClausesId ($1);}
+ | NEW_IDENTIFIER { $$ = fixSpecClausesId ($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, c); }
+ | 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
*/
| 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);
}