2 ** Splint - annotation-assisted static program checker
3 ** Copyright (C) 1994-2002 University of Virginia,
4 ** Massachusetts Institute of Technology
6 ** This program is free software; you can redistribute it and/or modify it
7 ** under the terms of the GNU General Public License as published by the
8 ** Free Software Foundation; either version 2 of the License, or (at your
9 ** option) any later version.
11 ** This program is distributed in the hope that it will be useful, but
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ** General Public License for more details.
16 ** The GNU General Public License is available from http://www.gnu.org/ or
17 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 ** MA 02111-1307, USA.
20 ** For information on splint: info@splint.org
21 ** To report a bug: splint-bug@splint.org
22 ** For more information: http://www.splint.org
29 ** Yacc/Bison grammar for extended ANSI C used by Splint.
31 ** original grammar by Nate Osgood ---
32 ** hacrat@catfish.lcs.mit.edu Mon Jun 14 13:06:32 1993
34 ** changes for Splint --- handle typedef names correctly
35 ** fix struct/union parsing bug (empty struct is accepted)
36 ** add productions to handle macros --- require
37 ** error correction --- main source of conflicts in grammar.
38 ** need to process initializations sequentially, L->R
40 ** production names are cryptic, so more productions fit on one line
42 ** conflicts: 87 shift/reduce, 18 reduce/reduce
43 ** most of these are due to handling macros
44 ** a few are due to handling type expressions
50 extern void yyerror (char *);
52 # include "splintMacros.nf"
54 # include "cscanner.h"
55 # include "cgrammar.h"
56 # include "exprChecks.h"
61 # define SHOWCSYM FALSE
64 ** This is necessary, or else when the bison-generated code #include's malloc.h,
65 ** there will be a parse error.
67 ** Unfortunately, it means the error checking on malloc, etc. is lost for allocations
68 ** in bison-generated files under Win32.
86 /*@dependent@*/ sRef sr;
89 /*@only@*/ functionClauseList funcclauselist;
90 /*@only@*/ functionClause funcclause;
91 /*@only@*/ flagSpec flagspec;
92 /*@only@*/ globalsClause globsclause;
93 /*@only@*/ modifiesClause modsclause;
94 /*@only@*/ warnClause warnclause;
95 /*@only@*/ stateClause stateclause;
96 /*@only@*/ pointers pointers;
97 /*@only@*/ functionConstraint fcnconstraint;
99 /*@only@*/ metaStateConstraint msconstraint;
100 /*@only@*/ metaStateSpecifier msspec;
101 /*@only@*/ metaStateExpression msexpr;
102 /*@observer@*/ metaStateInfo msinfo;
104 /*@only@*/ sRefList srlist;
105 /*@only@*/ globSet globset;
106 /*@only@*/ qtype qtyp;
107 /*@only@*/ cstring cname;
108 /*@observer@*/ annotationInfo annotation;
109 /*@only@*/ idDecl ntyp;
110 /*@only@*/ idDeclList ntyplist;
111 /*@only@*/ uentryList flist;
112 /*@owned@*/ uentryList entrylist;
113 /*@observer@*/ /*@dependent@*/ uentry entry;
114 /*@only@*/ uentry oentry;
115 /*@only@*/ exprNode expr;
116 /*@only@*/ enumNameList enumnamelist;
117 /*@only@*/ exprNodeList exprlist;
118 /*@only@*/ sRefSet srset;
119 /*@only@*/ cstringList cstringlist;
130 /* standard C tokens */
132 %token <tok> BADTOK SKIPTOK
133 %token <tok> CTOK_ELIPSIS CASE DEFAULT CIF CELSE SWITCH WHILE DO CFOR
134 %token <tok> GOTO CONTINUE BREAK RETURN
135 %token <tok> TSEMI TLBRACE TRBRACE TCOMMA TCOLON TASSIGN TLPAREN
136 %token <tok> TRPAREN TLSQBR TRSQBR TDOT TAMPERSAND TEXCL TTILDE
137 %token <tok> TMINUS TPLUS TMULT TDIV TPERCENT TLT TGT TCIRC TBAR TQUEST
138 %token <tok> CSIZEOF CALIGNOF CTYPEOF ARROW_OP CTYPEDEF COFFSETOF
139 %token <tok> INC_OP DEC_OP LEFT_OP RIGHT_OP
140 %token <tok> LE_OP GE_OP EQ_OP NE_OP AND_OP OR_OP
141 %token <tok> MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN SUB_ASSIGN
142 %token <tok> LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
143 %token <tok> CSTRUCT CUNION CENUM
144 %token <tok> VA_ARG VA_DCL
146 %token <tok> QGLOBALS
147 %token <tok> QMODIFIES
149 %token <tok> QCONSTANT
150 %token <tok> QFUNCTION
152 %token <tok> QDEFINES
154 %token <tok> QALLOCATES
156 %token <tok> QRELEASES
157 %token <tok> QPRECLAUSE
158 %token <tok> QPOSTCLAUSE
159 %token <tok> QINVARIANT
161 %token <tok> QUNDEF QKILLED
162 %token <tok> QENDMACRO
164 /* additional tokens introduced by splint pre-processor. */
165 %token <tok> LLMACRO LLMACROITER LLMACROEND TENDMACRO
167 /* break comments: */
168 %token <tok> QSWITCHBREAK QLOOPBREAK QINNERBREAK QSAFEBREAK
169 %token <tok> QINNERCONTINUE
171 /* case fall-through marker: */
172 %token <tok> QFALLTHROUGH
174 /* used in scanner only */
175 %token <tok> QLINTNOTREACHED
176 %token <tok> QLINTFALLTHROUGH
177 %token <tok> QLINTFALLTHRU
178 %token <tok> QARGSUSED
179 %token <tok> QPRINTFLIKE QLINTPRINTFLIKE QSCANFLIKE QMESSAGELIKE
181 /* not-reached marker: (used like a label) */
182 %token <tok> QNOTREACHED
184 /* type qualifiers: */
185 %token <tok> QCONST QRESTRICT QVOLATILE QINLINE QEXTENSION QEXTERN QSTATIC QAUTO QREGISTER
186 %token <tok> QOUT QIN QYIELD QONLY QTEMP QSHARED QREF QUNIQUE
187 %token <tok> QCHECKED QUNCHECKED QCHECKEDSTRICT QCHECKMOD
188 %token <tok> QKEEP QKEPT QPARTIAL QSPECIAL QOWNED QDEPENDENT
189 %token <tok> QRETURNED QEXPOSED QNULL QOBSERVER QISNULL
190 %token <tok> QEXITS QMAYEXIT QNEVEREXIT QTRUEEXIT QFALSEEXIT
191 %token <tok> QLONG QSIGNED QUNSIGNED QSHORT QUNUSED QSEF QNOTNULL QRELNULL
192 %token <tok> QABSTRACT QCONCRETE QMUTABLE QIMMUTABLE
193 %token <tok> QTRUENULL QFALSENULL QEXTERNAL
194 %token <tok> QREFCOUNTED QREFS QNEWREF QTEMPREF QKILLREF QRELDEF
195 %token <ctyp> CGCHAR CBOOL CINT CGFLOAT CDOUBLE CVOID
196 %token <tok> QANYTYPE QINTEGRALTYPE QUNSIGNEDINTEGRALTYPE QSIGNEDINTEGRALTYPE
198 %token <tok> QNULLTERMINATED
199 %token <tok> QSETBUFFERSIZE
200 %token <tok> QSETSTRINGLENGTH
202 %token <tok> QMAXREAD
203 %token <tok> QTESTINRANGE
208 /* identifiers, literals */
209 %token <entry> IDENTIFIER
210 %token <cname> NEW_IDENTIFIER TYPE_NAME_OR_ID
211 %token <annotation> CANNOTATION
212 %token <expr> CCONSTANT
214 %type <flagspec> flagSpec
215 %type <expr> cconstantExpr
216 %token <entry> ITER_NAME ITER_ENDNAME
217 %type <entry> endIter
219 %type <funcclauselist> functionClauses functionClausesPlain
220 %type <funcclause> functionClause functionClause functionClausePlain
222 %type <globsclause> globalsClause globalsClausePlain
223 %type <modsclause> modifiesClause modifiesClausePlain nomodsClause
224 %type <warnclause> warnClause warnClausePlain optWarnClause
225 %type <funcclause> conditionClause conditionClausePlain
226 %type <stateclause> stateClause stateClausePlain
227 %type <msconstraint> metaStateConstraint
228 %type <fcnconstraint> functionConstraint
229 %type <msspec> metaStateSpecifier
230 %type <msexpr> metaStateExpression
232 %type <sr> globId globIdListExpr
233 %type <globset> globIdList
235 %token <ctyp> TYPE_NAME
236 %token <msinfo> METASTATE_NAME
237 %type <msinfo> metaStateName
238 %type <cname> enumerator newId /*@-varuse@*/ /* yacc declares yytranslate here */
239 %type <pointers> pointers /*@=varuse@*/
241 %type <tok> doHeader stateTag conditionTag startConditionClause
242 %type <typequal> exitsQualifier checkQualifier stateQualifier
243 paramQualifier returnQualifier visibilityQualifier
244 typedefQualifier refcountQualifier definedQualifier
246 /* type construction */
247 %type <ctyp> abstractDecl abstractDeclBase optAbstractDeclBase
248 %type <ctyp> suSpc enumSpc typeName typeSpecifier
250 %type <ntyp> namedDecl namedDeclBase optNamedDecl
251 %type <ntyp> plainNamedDecl plainNamedDeclBase
252 %type <ntyp> structNamedDecl
253 %type <ntyp> fcnDefHdrAux plainFcn
255 %type <oentry> paramDecl
258 %type <ntyplist> structNamedDeclList
260 %type <entrylist> genericParamList paramTypeList paramList idList paramIdList
261 %type <exprlist> argumentExprList iterArgList
262 %type <exprlist> initList namedInitializerList namedInitializerListAux
263 %type <flist> structDeclList structDecl
264 %type <srset> locModifies modList specClauseList optSpecClauseList
265 %type <sr> mExpr modListExpr specClauseListExpr
268 %type <con> BufConstraint
269 %type <tok> relationalOp
270 %type <tok> BufBinaryOp
271 %type <tok> bufferModifier
273 %type <conE> BufConstraintExpr
275 %type <conE> BufConstraintTerm
276 %type <sr> BufConstraintSrefExpr
278 %type <conL> BufConstraintList
280 %type <conL> optStructInvariant
282 %type <tok> BufUnaryOp
284 /*drl 1/6/2002 either /\ or && */
285 %type <tok> constraintSeperator
287 %type <enumnamelist> enumeratorList
288 %type <cstringlist> fieldDesignator
290 %type <expr> sizeofExpr sizeofExprAux offsetofExpr
291 %type <expr> openScope closeScope
292 %type <expr> instanceDecl namedInitializer optDeclarators
293 %type <expr> primaryExpr postfixExpr primaryIterExpr postfixIterExpr
294 %type <expr> unaryExpr castExpr timesExpr plusExpr
295 %type <expr> unaryIterExpr castIterExpr timesIterExpr plusIterExpr
296 %type <expr> shiftExpr relationalExpr equalityExpr bitandExpr
297 %type <expr> xorExpr bitorExpr andExpr
298 %type <expr> orExpr conditionalExpr assignExpr
299 %type <expr> shiftIterExpr relationalIterExpr equalityIterExpr bitandIterExpr
300 %type <expr> xorIterExpr bitorIterExpr andIterExpr
301 %type <expr> orIterExpr conditionalIterExpr assignIterExpr iterArgExpr
302 %type <expr> expr optExpr constantExpr
303 %type <expr> init macroBody iterBody endBody partialIterStmt iterSelectionStmt
304 %type <expr> stmt stmtList fcnBody iterStmt iterDefStmt iterDefStmtList
305 %type <expr> labeledStmt caseStmt defaultStmt
306 %type <expr> compoundStmt compoundStmtAux compoundStmtRest compoundStmtAuxErr
307 %type <expr> expressionStmt selectionStmt iterationStmt jumpStmt iterDefIterationStmt
308 %type <expr> stmtErr stmtListErr compoundStmtErr expressionStmtErr
309 %type <expr> iterationStmtErr initializerList typeInitializerList initializer
310 %type <expr> ifPred whilePred forPred iterWhilePred typeInitializer
312 %type <expr> designator designatorList designation
314 %type <typequal> storageSpecifier typeQualifier typeModifier globQual innerMods
315 %type <tquallist> optGlobQuals innerModsList
316 %type <qtyp> completeType completeTypeSpecifier optCompleteType
317 %type <qtyp> completeTypeSpecifierAux altType typeExpression
329 : externalDef { context_checkGlobalScope (); }
330 | externalDefs externalDef { context_checkGlobalScope (); }
334 : fcnDef optSemi { uentry_clearDecl (); }
335 | constantDecl { uentry_clearDecl (); }
336 | fcnDecl { uentry_clearDecl (); }
337 | iterDecl { uentry_clearDecl (); }
338 | macroDef { uentry_clearDecl (); }
339 | initializer { uentry_checkDecl (); exprNode_free ($1); }
340 | TSEMI { uentry_clearDecl (); lltok_free ($1); /* evans 2002-02-08: okay to have a null statement */ }
341 | error { uentry_clearDecl (); }
345 : QCONSTANT completeTypeSpecifier NotType namedDecl NotType optSemi IsType QENDMACRO
346 { checkConstant ($2, $4); lltok_free2 ($1, $8); }
347 | QCONSTANT completeTypeSpecifier NotType namedDecl NotType TASSIGN IsType init optDeclarators optSemi QENDMACRO
348 { checkValueConstant ($2, $4, $8); lltok_free3 ($1, $6, $11); }
352 : QFUNCTION { context_enterFunctionHeader (); } plainFcn optSemi QENDMACRO
354 declareStaticFunction ($3); context_quietExitFunction ();
355 context_exitFunctionHeader ();
356 lltok_free2 ($1, $5); /*!*/
363 qtype qint = qtype_create (ctype_int);
364 $$ = idDecl_fixBase ($1, qint);
367 | completeTypeSpecifier NotType plainNamedDecl
368 { $$ = idDecl_fixBase ($3, $1); }
373 | pointers plainNamedDeclBase
374 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
378 : newId { $$ = idDecl_create ($1, qtype_unknown ()); }
379 | IsType TLPAREN NotType namedDecl IsType TRPAREN
380 { $$ = idDecl_expectFunction ($4); lltok_free2 ($2, $6); }
381 | namedDeclBase TLSQBR TRSQBR
382 { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); lltok_free2 ($2, $3); }
383 | namedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
385 exprNode_findValue ($4);
386 idDecl_notExpectingFunction ($1);
388 if (exprNode_hasValue ($4))
390 $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1),
391 exprNode_getLongValue ($4)));
395 $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1)));
398 lltok_free2 ($2, $5);
400 | namedDeclBase PushType TLPAREN TRPAREN
401 { setCurrentParams (uentryList_missingParams); }
403 { /* need to support globals and modifies here! */
404 ctype ct = ctype_makeFunction (idDecl_getCtype ($1),
405 uentryList_makeMissingParams ());
407 $$ = idDecl_replaceCtype ($1, ct);
409 /*drl 7/25/01 added*/
410 setImplictfcnConstraints();
412 /* functionClauseList_ImplictConstraints($6); */
414 idDecl_addClauses ($$, $6);
416 lltok_free2 ($3, $4);
418 | namedDeclBase PushType TLPAREN genericParamList TRPAREN
419 { setCurrentParams ($4); }
422 setImplictfcnConstraints ();
423 /* functionClauseList_ImplictConstraints($7);*/
424 clearCurrentParams ();
425 $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
426 idDecl_addClauses ($$, $7);
428 lltok_free2 ($3, $5);
433 : newId { $$ = idDecl_create ($1, qtype_unknown ()); }
434 | IsType TLPAREN NotType plainNamedDecl IsType TRPAREN
435 { $$ = idDecl_expectFunction ($4); lltok_free2 ($2, $6); }
436 | plainNamedDeclBase TLSQBR TRSQBR
437 { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1)));
438 lltok_free2 ($2, $3);
440 | plainNamedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
444 if (exprNode_hasValue ($4)
445 && multiVal_isInt (exprNode_getValue ($4)))
447 value = (int) multiVal_forceInt (exprNode_getValue ($4));
454 $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1), value));
455 lltok_free2 ($2, $5);
457 | plainNamedDeclBase PushType TLPAREN TRPAREN
458 { setCurrentParams (uentryList_missingParams); }
461 ctype ct = ctype_makeFunction (idDecl_getCtype ($1),
462 uentryList_makeMissingParams ());
464 $$ = idDecl_replaceCtype ($1, ct);
465 idDecl_addClauses ($$, $6);
467 lltok_free2 ($3, $4);
469 | plainNamedDeclBase PushType TLPAREN genericParamList TRPAREN
470 { setCurrentParams ($4); }
473 clearCurrentParams ();
474 $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
475 idDecl_addClauses ($$, $7);
478 /*!! lltok_free2 ($3, $5); */
483 : QITER newId TLPAREN genericParamList TRPAREN
484 { setCurrentParams ($4); } functionClausesPlain
485 { clearCurrentParams (); } optSemi QENDMACRO
486 { declareCIter ($2, $4);
487 lltok_free3 ($1, $3, $5);
492 : LLMACRO macroBody TENDMACRO { exprNode_checkMacroBody ($2); lltok_free2 ($1, $3); }
493 | LLMACROITER iterBody TENDMACRO { exprNode_checkIterBody ($2); lltok_free2 ($1, $3); }
494 | LLMACROEND endBody TENDMACRO { exprNode_checkIterEnd ($2); lltok_free2 ($1, $3);}
495 | LLMACRO TENDMACRO /* no stmt */ { exprChecks_checkEmptyMacroBody (); lltok_free2 ($1, $2); }
499 : fcnDefHdrAux { clabstract_declareFunction ($1); }
503 : metaStateSpecifier TASSIGN metaStateExpression
504 { $$ = metaStateConstraint_create ($1, $3); lltok_free ($2); }
508 : BufConstraintSrefExpr { cscanner_expectingMetaStateName (); } TCOLON metaStateName
509 { cscanner_clearExpectingMetaStateName ();
510 $$ = metaStateSpecifier_create ($1, $4);
513 | CTOK_ELIPSIS { cscanner_expectingMetaStateName (); } TCOLON metaStateName
514 { cscanner_clearExpectingMetaStateName ();
515 $$ = metaStateSpecifier_createElipsis ($4);
516 lltok_free2 ($1, $3);
521 : metaStateSpecifier { $$ = metaStateExpression_create ($1); }
522 | metaStateSpecifier TBAR metaStateExpression { $$ = metaStateExpression_createMerge ($1, $3); lltok_free ($2); }
537 : BufConstraint constraintSeperator BufConstraintList { $$ = constraintList_add ($3, $1); }
538 | BufConstraint { $$ = constraintList_single ($1); }
542 : BufConstraintExpr relationalOp BufConstraintExpr {
543 $$ = makeConstraintParse3 ($1, $2, $3);
544 DPRINTF(("Done BufConstraint1\n")); }
560 | BufUnaryOp TLPAREN BufConstraintExpr TRPAREN {$$ = constraintExpr_parseMakeUnaryOp ($1, $3); DPRINTF( ("Got BufConstraintExpr UNary Op ") ); }
561 | TLPAREN BufConstraintExpr BufBinaryOp BufConstraintExpr TRPAREN {
562 DPRINTF( ("Got BufConstraintExpr BINary Op ") );
563 $$ = constraintExpr_parseMakeBinaryOp ($2, $3, $4); }
567 : BufConstraintSrefExpr { $$ = constraintExpr_makeTermsRef ($1);}
568 | CCONSTANT { $$ = constraintExpr_makeIntLiteral (exprNode_getLongValue ($1)); }
571 BufConstraintSrefExpr
573 { /*@-onlytrans@*/ $$ = checkbufferConstraintClausesId ($1); /*@=onlytrans@*/ /*@i523@*/ }
575 { $$ = fixStateClausesId ($1); }
576 | BufConstraintSrefExpr TLSQBR TRSQBR
577 { $$ = sRef_makeAnyArrayFetch ($1); }
578 | BufConstraintSrefExpr TLSQBR CCONSTANT TRSQBR
582 t = cstring_toCharsSafe (exprNode_unparse($3));
585 $$ = sRef_makeArrayFetchKnown ($1, exprNode_getLongValue ($3));
587 | TMULT BufConstraintSrefExpr
588 { $$ = sRef_constructPointer ($2); }
589 | TLPAREN BufConstraintSrefExpr TRPAREN
591 | BufConstraintSrefExpr TDOT newId
592 { cstring_markOwned ($3); $$ = sRef_buildField ($1, $3); }
593 | BufConstraintSrefExpr ARROW_OP newId
594 { cstring_markOwned ($3); $$ = sRef_makeArrow ($1, $3); }
597 | BufConstraintTerm TLSQBR TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
598 | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
599 | TLPAREN specClauseListExpr TRPAREN { $$ = $2; }
600 | specClauseListExpr TDOT newId { cstring_markOwned ($3);
601 $$ = sRef_buildField ($1, $3); }
618 ** Function clauses can appear in any order.
622 : { $$ = functionClauseList_new (); }
623 | functionClause functionClauses
624 { $$ = functionClauseList_prepend ($2, $1); }
628 ** Inside macro definitions, there are no end macros.
633 { $$ = functionClauseList_new (); }
634 | functionClausePlain functionClausesPlain
635 { $$ = functionClauseList_prepend ($2, $1); }
639 : globalsClause { $$ = functionClause_createGlobals ($1); }
640 | modifiesClause { $$ = functionClause_createModifies ($1); }
641 | nomodsClause { $$ = functionClause_createModifies ($1); }
642 | stateClause { $$ = functionClause_createState ($1); }
643 | conditionClause { $$ = $1; }
644 | warnClause { $$ = functionClause_createWarn ($1); }
648 : globalsClausePlain { $$ = functionClause_createGlobals ($1); }
649 | modifiesClausePlain { $$ = functionClause_createModifies ($1); }
650 | nomodsClause { $$ = functionClause_createModifies ($1); }
651 | stateClausePlain { $$ = functionClause_createState ($1); }
652 | conditionClausePlain { $$ = $1; }
653 | warnClausePlain { $$ = functionClause_createWarn ($1); }
657 : globalsClausePlain QENDMACRO { $$ = $1; }
661 : QGLOBALS { setProcessingGlobalsList (); }
664 unsetProcessingGlobals ();
665 $$ = globalsClause_create ($1, $3);
670 : QNOMODS { $$ = modifiesClause_createNoMods ($1); }
674 : modifiesClausePlain QENDMACRO { $$ = $1; }
680 context_setProtectVars (); enterParamsTemp ();
681 sRef_setGlobalScopeSafe ();
686 sRef_clearGlobalScopeSafe ();
687 context_releaseVars ();
688 $$ = modifiesClause_create ($1, $3);
694 { $$ = flagSpec_createPlain ($1); }
695 | flagId TBAR flagSpec
696 { $$ = flagSpec_createOr ($1, $3); }
705 | /* empty */ { $$ = warnClause_undefined; }
709 : warnClausePlain QENDMACRO { $$ = $1; }
713 : QWARN flagSpec cconstantExpr
715 llassert (exprNode_knownStringValue ($3));
716 $$ = warnClause_create ($1, $2, cstring_copy (multiVal_forceString (exprNode_getValue ($3))));
720 { $$ = warnClause_create ($1, $2, cstring_undefined); }
724 : globIdListExpr { $$ = globSet_single ($1); }
725 | globIdList TCOMMA globIdListExpr { $$ = globSet_insert ($1, $3); }
729 : optGlobQuals globId { $$ = clabstract_createGlobal ($2, $1); }
733 : /* empty */ { $$ = qualList_undefined; }
734 | globQual optGlobQuals { $$ = qualList_add ($2, $1); }
738 : id { $$ = uentry_getSref ($1); }
739 | NEW_IDENTIFIER { $$ = clabstract_unrecognizedGlobal ($1); }
740 | initializer { $$ = clabstract_checkGlobal ($1); }
744 : QUNDEF { $$ = qual_createUndef (); }
745 | QKILLED { $$ = qual_createKilled (); }
746 | QOUT { $$ = qual_createOut (); }
747 | QIN { $$ = qual_createIn (); }
748 | QPARTIAL { $$ = qual_createPartial (); }
767 /**!!! deal with fred; fred (int); declarations! **/
768 qtype qint = qtype_create (ctype_int);
769 $$ = idDecl_fixBase ($1, qint);
772 | completeTypeSpecifier NotType namedDecl
773 { $$ = idDecl_fixBase ($3, $1); }
777 : TLBRACE { checkDoneParams (); context_enterInnerContext (); }
780 exprNode_checkFunctionBody ($3); $$ = $3;
781 context_exitInner ($3);
783 | { context_enterOldStyleScope (); } initializerList
784 { oldStyleDoneParams (); context_enterInnerContext (); }
787 exprNode_checkFunctionBody ($4);
788 $$ = $4; /* oldstyle */
789 context_exitInner ($4);
796 context_setFunctionDefined (exprNode_loc ($2));
797 exprNode_checkFunction (context_getHeader (), $2);
800 context_exitFunction ();
805 : modList optSemi { $$ = $1; }
806 | optSemi { $$ = sRefSet_new (); }
810 : id { $$ = uentry_getSref ($1); checkModifiesId ($1); }
811 | NEW_IDENTIFIER { $$ = fixModifiesId ($1); }
812 | TYPE_NAME_OR_ID { $$ = fixModifiesId ($1); }
813 | modListExpr TLSQBR TRSQBR { $$ = modListArrayFetch ($1, sRef_undefined); }
814 | modListExpr TLSQBR mExpr TRSQBR { $$ = modListArrayFetch ($1, $3); }
815 | TMULT modListExpr { $$ = modListPointer ($2); }
816 | TLPAREN modListExpr TRPAREN { $$ = $2; }
817 | modListExpr TDOT newId { $$ = modListFieldAccess ($1, $3); }
818 | modListExpr ARROW_OP newId { $$ = modListArrowAccess ($1, $3); }
822 : modListExpr { $$ = $1; }
823 | cconstantExpr { $$ = sRef_makeUnknown (); /* sRef_makeConstant ($1); ? */ }
828 : modListExpr { $$ = sRefSet_single ($1); }
829 | modList TCOMMA modListExpr { $$ = sRefSet_insert ($1, $3); }
834 { $$ = checkStateClausesId ($1); }
836 { $$ = fixStateClausesId ($1); }
837 | specClauseListExpr TLSQBR TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
838 | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
839 | TMULT specClauseListExpr { $$ = sRef_constructPointer ($2); }
840 | TLPAREN specClauseListExpr TRPAREN { $$ = $2; }
841 | specClauseListExpr TDOT newId { cstring_markOwned ($3);
842 $$ = sRef_buildField ($1, $3); }
843 | specClauseListExpr ARROW_OP newId { cstring_markOwned ($3);
844 $$ = sRef_makeArrow ($1, $3); }
848 : /* empty */ { $$ = sRefSet_undefined }
854 { if (sRef_isValid ($1)) { $$ = sRefSet_single ($1); }
855 else { $$ = sRefSet_undefined; }
857 | specClauseList TCOMMA specClauseListExpr
858 { if (sRef_isValid ($3))
860 $$ = sRefSet_insert ($1, $3);
870 : id { $$ = exprNode_fromIdentifier ($1); }
871 | NEW_IDENTIFIER { $$ = exprNode_fromUIO ($1); }
873 | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
874 | TYPE_NAME_OR_ID { $$ = exprNode_fromIdentifier (coerceId ($1)); }
875 | QEXTENSION { $$ = exprNode_makeError (); }
876 | TLPAREN { exprChecks_inCompoundStatementExpression (); }
878 { exprChecks_leaveCompoundStatementExpression (); $$ = exprNode_compoundStatementExpression ($1, $3); }
883 | postfixExpr TLSQBR expr TRSQBR { $$ = exprNode_arrayFetch ($1, $3); }
884 | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
885 | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
886 | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN { $$ = exprNode_vaArg ($1, $3, $5); }
887 | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $3, $4); }
888 | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
889 | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
890 | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
891 | TLPAREN typeExpression TRPAREN TLBRACE typeInitializerList optComma TRBRACE
892 { /* added for C99 */ $$ = exprNode_undefined; /*@i87 no checking */ }
896 : assignExpr { $$ = exprNodeList_singleton ($1); }
897 | argumentExprList TCOMMA assignExpr { $$ = exprNodeList_push ($1, $3); }
902 | INC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
903 | DEC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
904 | TAMPERSAND castExpr { $$ = exprNode_preOp ($2, $1); }
905 | TMULT castExpr { $$ = exprNode_preOp ($2, $1); }
906 | TPLUS castExpr { $$ = exprNode_preOp ($2, $1); }
907 | TMINUS castExpr { $$ = exprNode_preOp ($2, $1); }
908 | TTILDE castExpr { $$ = exprNode_preOp ($2, $1); }
909 | TEXCL castExpr { $$ = exprNode_preOp ($2, $1); }
910 | sizeofExpr { $$ = $1; }
911 | offsetofExpr { $$ = $1; }
915 : fieldDesignator TDOT newId { $$ = cstringList_add ($1, $3); lltok_free ($2); }
916 | fieldDesignator TLSQBR expr TRSQBR { $$ = $1; lltok_free2 ($2, $4); }
917 /* evans 2002-07-02: offsetof designators can use array indexes */
918 | newId { $$ = cstringList_single ($1); }
922 : COFFSETOF IsType TLPAREN typeExpression NotType TCOMMA fieldDesignator TRPAREN IsType
923 { $$ = exprNode_offsetof ($4, $7);
924 lltok_free3 ($1, $3, $6); lltok_free ($8); }
928 : IsType { context_setProtectVars (); }
929 sizeofExprAux { context_sizeofReleaseVars (); $$ = $3; }
933 : CSIZEOF TLPAREN typeExpression TRPAREN { $$ = exprNode_sizeofType ($3); lltok_free3 ($1, $2, $4); }
934 | CSIZEOF unaryExpr { $$ = exprNode_sizeofExpr ($2); lltok_free ($1); }
935 | CALIGNOF TLPAREN typeExpression TRPAREN { $$ = exprNode_alignofType ($3); lltok_free3 ($1, $2, $4); }
936 | CALIGNOF unaryExpr { $$ = exprNode_alignofExpr ($2); lltok_free ($1); }
941 | TLPAREN typeExpression TRPAREN castExpr
942 { $$ = exprNode_cast ($1, $4, $2); lltok_free ($3); }
947 | timesExpr TMULT castExpr { $$ = exprNode_op ($1, $3, $2); }
948 | timesExpr TDIV castExpr { $$ = exprNode_op ($1, $3, $2); }
949 | timesExpr TPERCENT castExpr { $$ = exprNode_op ($1, $3, $2); }
954 | plusExpr TPLUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
955 | plusExpr TMINUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
960 | shiftExpr LEFT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
961 | shiftExpr RIGHT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
966 | relationalExpr TLT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
967 | relationalExpr TGT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
968 | relationalExpr LE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
969 | relationalExpr GE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
974 | equalityExpr EQ_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
975 | equalityExpr NE_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
980 | bitandExpr TAMPERSAND equalityExpr { $$ = exprNode_op ($1, $3, $2); }
985 | xorExpr TCIRC bitandExpr { $$ = exprNode_op ($1, $3, $2); }
990 | bitorExpr TBAR xorExpr { $$ = exprNode_op ($1, $3, $2); }
996 { exprNode_produceGuards ($1);
997 context_enterAndClause ($1);
1001 $$ = exprNode_op ($1, $4, $2);
1002 context_exitAndClause ($$, $4);
1010 exprNode_produceGuards ($1);
1011 context_enterOrClause ($1);
1015 $$ = exprNode_op ($1, $4, $2);
1016 context_exitOrClause ($$, $4);
1022 | orExpr TQUEST { exprNode_produceGuards ($1); context_enterTrueClause ($1); } expr TCOLON
1023 { context_enterFalseClause ($1); } conditionalExpr
1024 { $$ = exprNode_cond ($1, $4, $7); context_exitClause ($1, $4, $7); }
1029 | unaryExpr TASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1030 | unaryExpr MUL_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1031 | unaryExpr DIV_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1032 | unaryExpr MOD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1033 | unaryExpr ADD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1034 | unaryExpr SUB_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1035 | unaryExpr LEFT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1036 | unaryExpr RIGHT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1037 | unaryExpr AND_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1038 | unaryExpr XOR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1039 | unaryExpr OR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1044 | expr TCOMMA assignExpr { $$ = exprNode_comma ($1, $3); }
1048 : /* empty */ { $$ = exprNode_undefined; }
1056 /* instance_orTypeDecl_and_possible_initialization */
1059 : instanceDecl { $$ = $1; }
1060 | VA_DCL { doVaDcl (); $$ = exprNode_makeError (); }
1061 | typeDecl { $$ = exprNode_makeError (); }
1065 : completeTypeSpecifier IsType TSEMI
1066 { $$ = exprNode_makeError (); }
1068 ** This causes r/r conflicts with function definitions.
1069 ** Instead we need to snarf one first. (gack)
1071 ** | completeTypeSpecifier { setProcessingVars ($1); }
1073 ** namedInitializerList IsType TSEMI
1074 ** { unsetProcessingVars (); }
1077 ** the solution is pretty ugly:
1079 | completeTypeSpecifier NotType namedDecl NotType
1081 setProcessingVars ($1);
1082 processNamedDecl ($3);
1084 IsType optDeclarators TSEMI IsType
1086 unsetProcessingVars ();
1087 $$ = exprNode_makeEmptyInitialization ($3);
1088 DPRINTF (("Empty initialization: %s", exprNode_unparse ($$)));
1090 | completeTypeSpecifier NotType namedDecl NotType TASSIGN
1091 { setProcessingVars ($1); processNamedDecl ($3); }
1092 IsType init optDeclarators TSEMI IsType
1093 { $$ = exprNode_concat ($9, exprNode_makeInitialization ($3, $8));
1094 unsetProcessingVars ();
1101 processNamedDecl ($1);
1102 $$ = exprNode_makeEmptyInitialization ($1);
1104 | namedDecl NotType TASSIGN { processNamedDecl ($1); } IsType init
1105 { $$ = exprNode_makeInitialization ($1, $6); }
1109 : CTYPEDEF completeTypeSpecifier { setProcessingTypedef ($2); }
1110 NotType namedInitializerList IsType optWarnClause TSEMI
1111 { clabstract_declareType ($5, $7); }
1112 | CTYPEDEF completeTypeSpecifier IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
1113 | CTYPEDEF namedInitializerList IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
1117 : { g_expectingTypeName = TRUE; }
1121 : { g_expectingTypeName = TRUE; context_pushLoc (); }
1124 namedInitializerList
1125 : namedInitializerListAux IsType { $$ = $1; }
1128 namedInitializerListAux
1129 : namedInitializer { $$ = exprNodeList_singleton ($1); }
1130 | namedInitializerList TCOMMA NotType namedInitializer { $$ = exprNodeList_push ($1, $4); }
1134 : /* empty */ { $$ = exprNode_makeError (); }
1135 | optDeclarators TCOMMA NotType namedInitializer { $$ = exprNode_concat ($1, $4); }
1140 | TLBRACE initList TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); lltok_free ($3); }
1141 | TLBRACE initList TCOMMA TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); lltok_free2 ($3, $4); }
1142 | designation init { $$ = exprNode_undefined; }
1146 ** Splint parses these (added in ISO C99), but no checking yet...
1150 : designatorList TASSIGN { $$ = $1; }
1151 | newId TCOLON { $$ = exprNode_undefined;
1152 /* gcc extension, obsolete since 2.5 */ }
1156 : designator { $$ = exprNode_undefined; }
1157 | designatorList designator { $$ = exprNode_undefined; }
1161 : TLSQBR constantExpr TRSQBR { $$ = exprNode_undefined; }
1162 | TDOT newId { $$ = exprNode_undefined; }
1167 { $$ = exprNodeList_singleton ($1); }
1168 | initList TCOMMA init
1169 { $$ = exprNodeList_push ($1, $3); }
1173 ** need to do the storage class global hack so tags are
1174 ** declared with the right storage class.
1178 : QEXTERN { setStorageClass (SCEXTERN); $$ = qual_createExtern (); }
1179 | QINLINE { $$ = qual_createInline (); }
1180 | QSTATIC { setStorageClass (SCSTATIC); $$ = qual_createStatic (); }
1181 | QAUTO { $$ = qual_createAuto (); }
1182 | QREGISTER { $$ = qual_createRegister (); }
1186 : stateClausePlain QENDMACRO { $$ = $1; }
1192 context_setProtectVars ();
1194 sRef_setGlobalScopeSafe ();
1196 specClauseList optSemi IsType
1199 sRef_clearGlobalScopeSafe ();
1200 context_releaseVars ();
1201 $$ = stateClause_createPlain ($1, $4);
1206 : conditionClausePlain QENDMACRO { $$ = $1; }
1209 startConditionClause
1210 : conditionTag NotType { $$ = $1; context_enterFunctionHeader (); }
1213 conditionClausePlain
1214 : startConditionClause stateQualifier
1216 context_exitFunctionHeader ();
1217 context_setProtectVars ();
1219 sRef_setGlobalScopeSafe ();
1221 optSpecClauseList optSemi IsType
1224 sRef_clearGlobalScopeSafe ();
1225 context_releaseVars ();
1226 $$ = functionClause_createState (stateClause_create ($1, $2, $4));
1228 | startConditionClause
1230 context_setProtectVars ();
1232 sRef_setGlobalScopeSafe ();
1234 functionConstraint optSemi IsType
1236 context_exitFunctionHeader ();
1238 sRef_clearGlobalScopeSafe ();
1239 context_releaseVars ();
1240 DPRINTF (("done optGlobBufConstraintsAux\n"));
1242 if (lltok_isEnsures ($1))
1244 $$ = functionClause_createEnsures ($3);
1246 else if (lltok_isRequires ($1))
1248 $$ = functionClause_createRequires ($3);
1255 DPRINTF (("FunctionclauseS: %s", functionClause_unparse ($$)));
1260 : BufConstraintList { $$ = functionConstraint_createBufferConstraint ($1); }
1261 | metaStateConstraint { $$ = functionConstraint_createMetaStateConstraint ($1); DPRINTF (("Made constraint: %s", functionConstraint_unparse ($$))); }
1265 : QEXITS { $$ = qual_createExits (); }
1266 | QMAYEXIT { $$ = qual_createMayExit (); }
1267 | QTRUEEXIT { $$ = qual_createTrueExit (); }
1268 | QFALSEEXIT { $$ = qual_createFalseExit (); }
1269 | QNEVEREXIT { $$ = qual_createNeverExit (); }
1273 : QCHECKED { $$ = qual_createChecked (); }
1274 | QCHECKMOD { $$ = qual_createCheckMod (); }
1275 | QUNCHECKED { $$ = qual_createUnchecked (); }
1276 | QCHECKEDSTRICT { $$ = qual_createCheckedStrict (); }
1280 : QOWNED { $$ = qual_createOwned (); }
1281 | QDEPENDENT { $$ = qual_createDependent (); }
1282 | QYIELD { $$ = qual_createYield (); }
1283 | QTEMP { $$ = qual_createTemp (); }
1284 | QONLY { $$ = qual_createOnly (); }
1285 | QKEEP { $$ = qual_createKeep (); }
1286 | QKEPT { $$ = qual_createKept (); }
1287 | QSHARED { $$ = qual_createShared (); }
1288 | QUNIQUE { $$ = qual_createUnique (); }
1289 | QNULL { $$ = qual_createNull (); }
1290 | QISNULL { $$ = qual_createIsNull (); }
1291 | QRELNULL { $$ = qual_createRelNull (); }
1292 | QNOTNULL { $$ = qual_createNotNull (); }
1293 | QEXPOSED { $$ = qual_createExposed (); }
1294 | QOBSERVER { $$ = qual_createObserver (); }
1295 | QNULLTERMINATED { $$ = qual_createNullTerminated (); }
1296 | CANNOTATION { $$ = qual_createMetaState ($1); }
1300 : QRETURNED { $$ = qual_createReturned (); }
1301 | QSEF { $$ = qual_createSef (); }
1305 : QUNUSED { $$ = qual_createUnused (); }
1306 | QEXTERNAL { $$ = qual_createExternal (); }
1310 : QTRUENULL { $$ = qual_createTrueNull (); }
1311 | QFALSENULL { $$ = qual_createFalseNull (); }
1315 : QABSTRACT { $$ = qual_createAbstract (); }
1316 | QCONCRETE { $$ = qual_createConcrete (); }
1317 | QMUTABLE { $$ = qual_createMutable (); }
1318 | QIMMUTABLE { $$ = qual_createImmutable (); }
1322 : QREFCOUNTED { $$ = qual_createRefCounted (); }
1323 | QREFS { $$ = qual_createRefs (); }
1324 | QKILLREF { $$ = qual_createKillRef (); }
1325 | QRELDEF { $$ = qual_createRelDef (); }
1326 | QNEWREF { $$ = qual_createNewRef (); }
1327 | QTEMPREF { $$ = qual_createTempRef (); }
1331 : QSHORT { $$ = qual_createShort (); }
1332 | QLONG { $$ = qual_createLong (); }
1333 | QSIGNED { $$ = qual_createSigned (); }
1334 | QUNSIGNED { $$ = qual_createUnsigned (); }
1338 : QOUT { $$ = qual_createOut (); }
1339 | QIN { $$ = qual_createIn (); }
1340 | QPARTIAL { $$ = qual_createPartial (); }
1341 | QSPECIAL { $$ = qual_createSpecial (); }
1345 : QCONST IsType { $$ = qual_createConst (); }
1346 | QVOLATILE IsType { $$ = qual_createVolatile (); }
1347 | QRESTRICT IsType { $$ = qual_createRestrict (); }
1348 | definedQualifier IsType { $$ = $1; }
1349 | stateQualifier IsType { $$ = $1; }
1350 | exitsQualifier IsType { $$ = $1; }
1351 | paramQualifier IsType { $$ = $1; }
1352 | checkQualifier IsType { $$ = $1; }
1353 | returnQualifier IsType { $$ = $1; }
1354 | visibilityQualifier IsType { $$ = $1; }
1355 | typedefQualifier IsType { $$ = $1; }
1356 | refcountQualifier IsType { $$ = $1; }
1360 ** This is copied into the mtgrammar!
1370 | QANYTYPE NotType { $$ = ctype_makeAnytype (); }
1371 | QINTEGRALTYPE NotType { $$ = ctype_anyintegral; }
1372 | QUNSIGNEDINTEGRALTYPE NotType { $$ = ctype_unsignedintegral; }
1373 | QSIGNEDINTEGRALTYPE NotType { $$ = ctype_signedintegral; }
1377 | typeModifier NotType { $$ = ctype_fromQual ($1); }
1381 : IsType completeTypeSpecifier IsType
1382 { $$ = qtype_resolve ($2); }
1385 completeTypeSpecifier
1386 : completeTypeSpecifierAux { $$ = $1; }
1387 | completeTypeSpecifierAux QALT altType QENDMACRO
1388 { $$ = qtype_mergeAlt ($1, $3); }
1393 | typeExpression TCOMMA altType
1394 { $$ = qtype_mergeAlt ($1, $3); }
1397 completeTypeSpecifierAux
1398 : storageSpecifier optCompleteType { $$ = qtype_addQual ($2, $1); }
1399 | typeQualifier optCompleteType { $$ = qtype_addQual ($2, $1); }
1400 | typeSpecifier optCompleteType { $$ = qtype_combine ($2, $1); }
1404 : /* empty */ { $$ = qtype_unknown (); }
1405 | completeTypeSpecifier { $$ = $1; }
1409 : /* empty */ { $$ = constraintList_undefined; }
1410 /* drl commenting before a CVS commit
1411 | QINVARIANT BufConstraintList QENDMACRO { $$ = $2 }
1416 : NotType CSTRUCT newId IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1417 CreateStructInnerScope
1418 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1421 { ctype ct; ct = declareStruct ($3, $8); setGlobalStructInfo(ct, $12); $$ = ct; }
1422 | NotType CUNION newId IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1423 CreateStructInnerScope
1424 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1426 { $$ = declareUnion ($3, $8); }
1427 | NotType CSTRUCT newId IsType TLBRACE TRBRACE
1428 { $$ = declareStruct ($3, uentryList_new ()); }
1429 | NotType CUNION newId IsType TLBRACE TRBRACE
1430 { $$ = declareUnion ($3, uentryList_new ()); }
1431 | NotType CSTRUCT IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1432 CreateStructInnerScope
1433 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1435 { $$ = declareUnnamedStruct ($7); }
1436 | NotType CUNION IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1437 CreateStructInnerScope structDeclList DeleteStructInnerScope
1438 { sRef_clearGlobalScopeSafe (); }
1440 { $$ = declareUnnamedUnion ($7); }
1441 | NotType CSTRUCT IsType TLBRACE TRBRACE
1442 { $$ = ctype_createUnnamedStruct (uentryList_new ()); }
1443 | NotType CUNION IsType TLBRACE TRBRACE
1444 { $$ = ctype_createUnnamedUnion (uentryList_new ()); }
1445 | NotType CSTRUCT newId NotType { $$ = handleStruct ($3); }
1446 | NotType CUNION newId NotType { $$ = handleUnion ($3); }
1450 : { g_expectingTypeName = FALSE; }
1455 | macroDef { $$ = uentryList_undefined; /* bogus! */ }
1456 | structDeclList structDecl { $$ = uentryList_mergeFields ($1, $2); }
1460 : completeTypeSpecifier NotType structNamedDeclList IsType TSEMI
1461 { $$ = fixUentryList ($3, $1); }
1462 | completeTypeSpecifier IsType TSEMI
1463 { $$ = fixUnnamedDecl ($1); }
1467 : structNamedDecl NotType
1468 { $$ = idDeclList_singleton ($1); }
1469 | structNamedDeclList TCOMMA structNamedDecl NotType
1470 { $$ = idDeclList_add ($1, $3); }
1473 structNamedDecl /* hack to get around namespace problems */
1474 : namedDecl { $$ = $1; }
1475 | TCOLON IsType constantExpr { $$ = idDecl_undefined; }
1476 | namedDecl TCOLON IsType constantExpr { $$ = $1; }
1477 /* Need the IsType in case there is a cast in the constant expression. */
1481 : NotType CENUM TLBRACE enumeratorList TRBRACE IsType
1482 { $$ = declareUnnamedEnum ($4); }
1483 | NotType CENUM newId TLBRACE { context_pushLoc (); } enumeratorList TRBRACE IsType
1484 { context_popLoc (); $$ = declareEnum ($3, $6); }
1485 | NotType CENUM newId IsType { $$ = handleEnum ($3); }
1490 { $$ = enumNameList_single ($1); }
1491 | enumeratorList TCOMMA enumerator
1492 { $$ = enumNameList_push ($1, $3); }
1493 | enumeratorList TCOMMA
1498 { uentry ue = uentry_makeEnumConstant ($1, ctype_unknown);
1499 usymtab_supGlobalEntry (ue);
1502 | newId TASSIGN IsType constantExpr
1503 { uentry ue = uentry_makeEnumInitializedConstant ($1, ctype_unknown, $4);
1504 usymtab_supGlobalEntry (ue);
1511 | optAbstractDeclBase { $$ = idDecl_create (cstring_undefined, qtype_create ($1)); }
1512 | pointers TYPE_NAME
1514 qtype qt = qtype_unknown ();
1515 qtype_adjustPointers ($1, qt);
1516 $$ = idDecl_create (cstring_copy (cscanner_observeLastIdentifier ()), qt);
1518 | pointers optNamedDecl
1519 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
1524 | pointers namedDeclBase
1525 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
1529 : paramTypeList { $$ = handleParamTypeList ($1); }
1530 | NotType paramIdList { $$ = handleParamIdList ($2); }
1534 : QCONST { $$ = qual_createConst (); }
1535 | QRESTRICT { $$ = qual_createRestrict (); }
1536 | QVOLATILE { $$ = qual_createVolatile (); }
1540 : innerMods { $$ = qualList_single ($1); }
1541 | innerModsList innerMods { $$ = qualList_add ($1, $2); }
1545 : TMULT { $$ = pointers_create ($1); }
1546 | TMULT innerModsList { $$ = pointers_createMods ($1, $2); }
1547 | TMULT pointers { $$ = pointers_extend (pointers_create ($1), $2); }
1548 | TMULT innerModsList pointers { $$ = pointers_extend (pointers_createMods ($1, $2), $3); }
1553 | idList TCOMMA CTOK_ELIPSIS { $$ = uentryList_add ($1, uentry_makeElipsisMarker ()); }
1557 : newId { $$ = uentryList_single (uentry_makeVariableLoc ($1, ctype_int)); }
1558 | idList TCOMMA newId { $$ = uentryList_add ($1, uentry_makeVariableLoc ($3, ctype_int)); }
1562 : CTOK_ELIPSIS { $$ = uentryList_single (uentry_makeElipsisMarker ()); }
1564 | paramList TCOMMA CTOK_ELIPSIS { $$ = uentryList_add ($1, uentry_makeElipsisMarker ()); }
1568 : { storeLoc (); } paramDecl { $$ = uentryList_single ($2); }
1569 | paramList TCOMMA { storeLoc (); } paramDecl
1570 { $$ = uentryList_add ($1, $4); }
1574 : IsType completeTypeSpecifier optNamedDecl IsType
1576 if (isFlipOldStyle ())
1578 llparseerror (cstring_makeLiteral ("Inconsistent function parameter syntax (mixing old and new style declaration)"));
1584 $$ = makeCurrentParam (idDecl_fixParamBase ($3, $2));
1586 | newId /* its an old-style declaration */
1588 idDecl tparam = idDecl_create ($1, qtype_unknown ());
1592 llparseerror (message ("Inconsistent function parameter syntax: %q",
1593 idDecl_unparse (tparam)));
1597 $$ = makeCurrentParam (tparam);
1598 idDecl_free (tparam);
1604 | completeType abstractDecl { $$ = qtype_newBase ($1, $2); }
1608 : pointers { $$ = ctype_adjustPointers ($1, ctype_unknown); }
1610 | pointers abstractDeclBase { $$ = ctype_adjustPointers ($1, $2); }
1614 : /* empty */ { $$ = ctype_unknown; }
1619 : IsType TLPAREN NotType abstractDecl TRPAREN
1620 { $$ = ctype_expectFunction ($4); }
1621 | TLSQBR TRSQBR { $$ = ctype_makeArray (ctype_unknown); }
1622 | TLSQBR constantExpr TRSQBR
1623 { $$ = ctype_makeFixedArray (ctype_unknown, exprNode_getLongValue ($2)); }
1624 | abstractDeclBase TLSQBR TRSQBR { $$ = ctype_makeInnerArray ($1); }
1625 | abstractDeclBase TLSQBR constantExpr TRSQBR
1626 { $$ = ctype_makeInnerFixedArray ($1, exprNode_getLongValue ($3)); }
1627 | IsType TLPAREN TRPAREN
1628 { $$ = ctype_makeFunction (ctype_unknown, uentryList_makeMissingParams ()); }
1629 | IsType TLPAREN paramTypeList TRPAREN
1630 { $$ = ctype_makeParamsFunction (ctype_unknown, $3); }
1631 | abstractDeclBase IsType TLPAREN TRPAREN
1632 { $$ = ctype_makeFunction ($1, uentryList_makeMissingParams ()); }
1633 | abstractDeclBase IsType TLPAREN paramTypeList TRPAREN
1634 { $$ = ctype_makeParamsFunction ($1, $4); }
1653 : iterDefStmtList { $$ = $1; }
1662 | iterDefStmtList iterDefStmt
1663 { $$ = exprNode_concat ($1, $2); }
1666 iterDefIterationStmt
1667 : iterWhilePred iterDefStmtList
1668 { $$ = exprNode_while ($1, $2); }
1669 | doHeader stmtErr WHILE TLPAREN expr TRPAREN TSEMI
1670 { $$ = exprNode_doWhile ($2, $5); }
1671 | doHeader stmtErr WHILE TLPAREN expr TRPAREN
1672 { $$ = exprNode_doWhile ($2, $5); }
1673 | forPred iterDefStmt
1674 { $$ = exprNode_for ($1, $2); }
1678 : CFOR TLPAREN optExpr TSEMI optExpr TSEMI
1679 { context_setProtectVars (); } optExpr { context_sizeofReleaseVars (); }
1681 { $$ = exprNode_forPred ($3, $5, $8);
1682 context_enterForClause ($5); }
1686 : ITER_NAME CreateInnerScope TLPAREN
1687 { setProcessingIterVars ($1); }
1689 { $$ = exprNode_iterStart ($1, $5); }
1690 | ITER_ENDNAME { $$ = exprNode_createId ($1); }
1697 | openScope initializerList { $$ = $1; DPRINTF (("def stmt: %s", exprNode_unparse ($$))); }
1702 | iterDefIterationStmt
1705 | TLPAREN iterDefStmt TRPAREN { $$ = $2; }
1706 | error { $$ = exprNode_makeError (); }
1710 : ifPred { exprNode_checkIfPred ($1); } iterDefStmt
1711 { /* don't: context_exitTrueClause ($1, $2); */
1712 $$ = exprNode_if ($1, $3);
1717 : CreateInnerScope TLBRACE { $$ = exprNode_createTok ($2); }
1721 : DeleteInnerScopeSafe TRBRACE { $$ = exprNode_createTok ($2); }
1738 | TLPAREN stmtErr TRPAREN { $$ = exprNode_addParens ($1, $2); }
1740 | error { $$ = exprNode_makeError (); }
1744 : newId TCOLON { $$ = exprNode_labelMarker ($1); }
1745 | QNOTREACHED stmt { $$ = exprNode_notReached ($2); }
1749 ** We allow more than one QFALLTHROUGH token to support mixed lint/splint markers.
1752 optExtraFallThroughs
1754 | QFALLTHROUGH optExtraFallThroughs { ; }
1757 /* Note that we can semantically check that the object to the case is
1758 indeed constant. In this case, we may not want to go through this effort */
1761 : CASE constantExpr { context_enterCaseClause ($2); }
1762 TCOLON { $$ = exprNode_caseMarker ($2, FALSE); }
1763 | QFALLTHROUGH optExtraFallThroughs CASE constantExpr { context_enterCaseClause ($4); }
1764 TCOLON { $$ = exprNode_caseMarker ($4, TRUE); }
1768 : DEFAULT { context_enterCaseClause (exprNode_undefined); }
1769 TCOLON { $$ = exprNode_defaultMarker ($1, FALSE); }
1770 | QFALLTHROUGH optExtraFallThroughs DEFAULT { context_enterCaseClause (exprNode_undefined); }
1771 TCOLON { $$ = exprNode_defaultMarker ($3, TRUE); }
1775 : TLPAREN compoundStmt TRPAREN { $$ = $2; }
1776 | CreateInnerScope compoundStmtAux
1777 { $$ = $2; context_exitInner ($2); }
1781 : CreateInnerScope compoundStmtAuxErr DeleteInnerScope { $$ = $2; }
1785 : { context_enterInnerContext (); }
1789 : { context_exitInnerPlain (); }
1792 CreateStructInnerScope
1793 : { context_enterStructInnerContext (); }
1796 DeleteStructInnerScope
1797 : { context_exitStructInnerContext (); }
1800 DeleteInnerScopeSafe
1801 : { context_exitInnerSafe (); }
1805 : TRBRACE { $$ = exprNode_createTok ($1); }
1806 | QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_createTok ($2)); }
1807 | stmtList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); }
1808 | stmtList QNOTREACHED TRBRACE
1809 { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); }
1810 | initializerList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); }
1811 | initializerList QNOTREACHED TRBRACE
1812 { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); }
1813 | initializerList stmtList TRBRACE
1814 { $$ = exprNode_updateLocation (exprNode_concat ($1, $2), lltok_getLoc ($3)); }
1815 | initializerList stmtList QNOTREACHED TRBRACE
1816 { $$ = exprNode_notReached (exprNode_updateLocation (exprNode_concat ($1, $2),
1817 lltok_getLoc ($3)));
1822 : TLBRACE compoundStmtRest
1823 { $$ = exprNode_makeBlock ($2); }
1828 { $$ = exprNode_createTok ($2); }
1829 | TLBRACE stmtListErr TRBRACE
1830 { $$ = exprNode_updateLocation ($2, lltok_getLoc ($3)); }
1831 | TLBRACE initializerList TRBRACE
1832 { $$ = exprNode_updateLocation ($2, lltok_getLoc ($3)); }
1833 | TLBRACE initializerList stmtList TRBRACE
1834 { $$ = exprNode_updateLocation (exprNode_concat ($2, $3), lltok_getLoc ($4)); }
1839 | stmtListErr stmtErr { $$ = exprNode_concat ($1, $2); }
1843 : initializer { $$ = $1; }
1844 | initializerList initializer { $$ = exprNode_concat ($1, $2); }
1848 : typeInitializer { $$ = $1; }
1849 | typeInitializerList TCOMMA typeInitializer { $$ = exprNode_concat ($1, $3); }
1853 : assignExpr { $$ = $1; }
1854 | TLBRACE typeInitializerList optComma TRBRACE { $$ = $2; }
1859 | stmtList stmt { $$ = exprNode_concat ($1, $2); }
1863 : TSEMI { $$ = exprNode_createTok ($1); }
1864 | expr TSEMI { $$ = exprNode_statement ($1, $2); }
1868 : TSEMI { $$ = exprNode_createTok ($1); }
1869 | expr TSEMI { $$ = exprNode_statement ($1, $2); }
1870 | expr { $$ = exprNode_checkExpr ($1); }
1874 : CIF TLPAREN expr TRPAREN
1876 exprNode_produceGuards ($3); context_enterTrueClause ($3);
1877 exprNode_checkIfPred ($3);
1882 ** not ANSI: | CIF TLPAREN compoundStmt TRPAREN
1883 ** { $$ = $3; context_enterTrueClause (); }
1890 context_exitTrueClause ($1, $2);
1891 $$ = exprNode_if ($1, $2);
1893 | ifPred stmt CELSE { context_enterFalseClause ($1); } stmt
1895 context_exitClause ($1, $2, $5);
1896 $$ = exprNode_ifelse ($1, $2, $5);
1898 | SWITCH TLPAREN expr { context_enterSwitch ($3); }
1899 TRPAREN stmt { $$ = exprNode_switch ($3, $6); }
1903 : WHILE TLPAREN expr TRPAREN
1904 { $$ = exprNode_whilePred ($3); context_enterWhileClause ($3); }
1905 /* not ANSI: | WHILE TLPAREN compoundStmt TRPAREN stmt { $$ = exprNode_while ($3, $5); } */
1909 : WHILE TLPAREN expr TRPAREN { $$ = exprNode_whilePred($3); }
1913 : ITER_NAME { context_enterIterClause (); }
1914 CreateInnerScope TLPAREN { setProcessingIterVars ($1); }
1916 compoundStmt endIter DeleteInnerScope
1918 $$ = exprNode_iter ($1, $6, $8, $9);
1924 : iterArgExpr { $$ = exprNodeList_singleton ($1); }
1925 | iterArgList { nextIterParam (); } TCOMMA iterArgExpr
1926 { $$ = exprNodeList_push ($1, $4); }
1930 : assignIterExpr { $$ = exprNode_iterExpr ($1); }
1931 | id { $$ = exprNode_iterId ($1); }
1932 | TYPE_NAME_OR_ID { uentry ue = coerceIterId ($1);
1934 if (uentry_isValid (ue))
1936 $$ = exprNode_iterId (ue);
1940 $$ = exprNode_iterNewId (cstring_copy (cscanner_observeLastIdentifier ()));
1943 | NEW_IDENTIFIER { $$ = exprNode_iterNewId ($1); }
1947 ** everything is the same, EXCEPT it cannot be a NEW_IDENTIFIER
1952 | cconstantExpr CCONSTANT { $$ = exprNode_combineLiterals ($1, $2); }
1957 | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
1962 | postfixExpr TLSQBR expr TRSQBR { $$ = exprNode_arrayFetch ($1, $3); }
1963 | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
1964 | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
1965 | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN
1966 { $$ = exprNode_vaArg ($1, $3, $5); }
1967 | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $3, $4); }
1968 | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
1969 | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
1970 | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
1975 | INC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
1976 | DEC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
1977 | TAMPERSAND castExpr { $$ = exprNode_preOp ($2, $1); }
1978 | TMULT castExpr { $$ = exprNode_preOp ($2, $1); }
1979 | TPLUS castExpr { $$ = exprNode_preOp ($2, $1); }
1980 | TMINUS castExpr { $$ = exprNode_preOp ($2, $1); }
1981 | TTILDE castExpr { $$ = exprNode_preOp ($2, $1); }
1982 | TEXCL castExpr { $$ = exprNode_preOp ($2, $1); }
1983 | sizeofExpr { $$ = $1; }
1988 | TLPAREN typeExpression TRPAREN castExpr { $$ = exprNode_cast ($1, $4, $2); }
1993 | timesExpr TMULT castExpr { $$ = exprNode_op ($1, $3, $2); }
1994 | timesExpr TDIV castExpr { $$ = exprNode_op ($1, $3, $2); }
1995 | timesExpr TPERCENT castExpr { $$ = exprNode_op ($1, $3, $2); }
2000 | plusExpr TPLUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
2001 | plusExpr TMINUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
2006 | shiftExpr LEFT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
2007 | shiftExpr RIGHT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
2012 | relationalExpr TLT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
2013 | relationalExpr TGT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
2014 | relationalExpr LE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
2015 | relationalExpr GE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
2019 : relationalIterExpr
2020 | equalityExpr EQ_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
2021 | equalityExpr NE_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
2026 | bitandExpr TAMPERSAND equalityExpr { $$ = exprNode_op ($1, $3, $2); }
2031 | xorExpr TCIRC bitandExpr { $$ = exprNode_op ($1, $3, $2); }
2036 | bitorExpr TBAR xorExpr { $$ = exprNode_op ($1, $3, $2); }
2041 | andExpr AND_OP bitorExpr { $$ = exprNode_op ($1, $3, $2); }
2046 | orExpr OR_OP andExpr { $$ = exprNode_op ($1, $3, $2); }
2051 | orExpr TQUEST { context_enterTrueClause ($1); }
2052 expr TCOLON { context_enterFalseClause ($1); } conditionalExpr
2053 { $$ = exprNode_cond ($1, $4, $7); }
2057 : conditionalIterExpr
2058 | unaryExpr TASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2059 | unaryExpr MUL_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2060 | unaryExpr DIV_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2061 | unaryExpr MOD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2062 | unaryExpr ADD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2063 | unaryExpr SUB_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2064 | unaryExpr LEFT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2065 | unaryExpr RIGHT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2066 | unaryExpr AND_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2067 | unaryExpr XOR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2068 | unaryExpr OR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
2072 : ITER_ENDNAME { $$ = $1; }
2073 | /* empty */ { $$ = uentry_undefined; }
2077 : DO { context_enterDoWhileClause (); $$ = $1; }
2082 { $$ = exprNode_while ($1, $2); context_exitWhileClause ($1, $2); }
2083 | doHeader stmt WHILE TLPAREN expr TRPAREN TSEMI
2084 { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); }
2086 { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); }
2090 : whilePred stmtErr { $$ = exprNode_while ($1, $2); context_exitWhileClause ($1, $2); }
2091 | doHeader stmtErr WHILE TLPAREN expr TRPAREN TSEMI
2092 { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); }
2093 | doHeader stmtErr WHILE TLPAREN expr TRPAREN
2094 { $$ = exprNode_doWhile ($2, $5); }
2095 | forPred stmtErr { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); }
2099 : GOTO newId TSEMI { $$ = exprNode_goto ($2); }
2100 | CONTINUE TSEMI { $$ = exprNode_continue ($1, BADTOK); }
2101 | QINNERCONTINUE CONTINUE TSEMI
2102 { $$ = exprNode_continue ($1, QINNERCONTINUE); }
2103 | BREAK TSEMI { $$ = exprNode_break ($1, BADTOK); }
2104 | QSWITCHBREAK BREAK TSEMI { $$ = exprNode_break ($2, QSWITCHBREAK); }
2105 | QLOOPBREAK BREAK TSEMI { $$ = exprNode_break ($2, QLOOPBREAK); }
2106 | QINNERBREAK BREAK TSEMI { $$ = exprNode_break ($2, QINNERBREAK); }
2107 | QSAFEBREAK BREAK TSEMI { $$ = exprNode_break ($2, QSAFEBREAK); }
2108 | RETURN TSEMI { $$ = exprNode_nullReturn ($1); }
2109 | RETURN expr TSEMI { $$ = exprNode_return ($2); }
2128 | ITER_NAME { $$ = uentry_getName ($1); }
2129 | ITER_ENDNAME { $$ = uentry_getName ($1); }
2130 | id { $$ = uentry_getName ($1); }
2131 | TYPE_NAME_OR_ID { $$ = $1; }
2136 | TYPE_NAME_OR_ID { $$ = ctype_unknown; }
2137 | CTYPEOF TLPAREN expr TRPAREN { $$ = exprNode_getType ($3); exprNode_free ($3); }
2138 | CTYPEOF TLPAREN typeExpression TRPAREN { $$ = qtype_getType ($3); }
2143 /*@-redecl@*/ /*@-namechecks@*/
2144 extern char *yytext;
2145 /*@=redecl@*/ /*@=namechecks@*/
2147 # include "bison.reset"
2149 void yyerror (/*@unused@*/ char *s)
2151 static bool givehint = FALSE;
2153 if (context_inIterDef ())
2155 llerror (FLG_SYNTAX, message ("Iter syntax not parseable: %s",
2156 context_inFunctionName ()));
2158 else if (context_inIterEnd ())
2160 llerror (FLG_SYNTAX, message ("Iter finalizer syntax not parseable: %s",
2161 context_inFunctionName ()));
2163 else if (context_inMacro ())
2165 llerror (FLG_SYNTAX, message ("Macro syntax not parseable: %s",
2166 context_inFunctionName ()));
2168 if (context_inUnknownMacro ())
2172 llhint (cstring_makeLiteral
2173 ("Precede macro definition with /*@notfunction@*/ "
2174 "to suppress checking and force expansion"));
2179 cscanner_swallowMacro ();
2180 context_exitAllClausesQuiet ();
2184 llparseerror (cstring_undefined);