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 swallowMacro (void);
51 extern void yyerror (char *);
53 # include "splintMacros.nf"
55 # include "cscanner.h"
56 # include "cgrammar.h"
57 # include "exprChecks.h"
62 # define SHOWCSYM FALSE
65 ** This is necessary, or else when the bison-generated code #include's malloc.h,
66 ** there will be a parse error.
68 ** Unfortunately, it means the error checking on malloc, etc. is lost for allocations
69 ** in bison-generated files under Win32.
87 /*@dependent@*/ sRef sr;
90 /*@only@*/ functionClauseList funcclauselist;
91 /*@only@*/ functionClause funcclause;
92 /*@only@*/ flagSpec flagspec;
93 /*@only@*/ globalsClause globsclause;
94 /*@only@*/ modifiesClause modsclause;
95 /*@only@*/ warnClause warnclause;
96 /*@only@*/ stateClause stateclause;
98 /*@only@*/ functionConstraint fcnconstraint;
100 /*@only@*/ metaStateConstraint msconstraint;
101 /*@only@*/ metaStateSpecifier msspec;
102 /*@only@*/ metaStateExpression msexpr;
103 /*@observer@*/ metaStateInfo msinfo;
105 /*@only@*/ sRefList srlist;
106 /*@only@*/ globSet globset;
107 /*@only@*/ qtype qtyp;
108 /*@only@*/ cstring cname;
109 /*@observer@*/ annotationInfo annotation;
110 /*@only@*/ idDecl ntyp;
111 /*@only@*/ idDeclList ntyplist;
112 /*@only@*/ uentryList flist;
113 /*@owned@*/ uentryList entrylist;
114 /*@observer@*/ /*@dependent@*/ uentry entry;
115 /*@only@*/ uentry oentry;
116 /*@only@*/ exprNode expr;
117 /*@only@*/ enumNameList enumnamelist;
118 /*@only@*/ exprNodeList exprlist;
119 /*@only@*/ sRefSet srset;
120 /*@only@*/ cstringList cstringlist;
131 /* standard C tokens */
133 %token <tok> BADTOK SKIPTOK
134 %token <tok> CTOK_ELIPSIS CASE DEFAULT CIF CELSE SWITCH WHILE DO CFOR
135 %token <tok> GOTO CONTINUE BREAK RETURN
136 %token <tok> TSEMI TLBRACE TRBRACE TCOMMA TCOLON TASSIGN TLPAREN
137 %token <tok> TRPAREN TLSQBR TRSQBR TDOT TAMPERSAND TEXCL TTILDE
138 %token <tok> TMINUS TPLUS TMULT TDIV TPERCENT TLT TGT TCIRC TBAR TQUEST
139 %token <tok> CSIZEOF CALIGNOF CTYPEOF ARROW_OP CTYPEDEF COFFSETOF
140 %token <tok> INC_OP DEC_OP LEFT_OP RIGHT_OP
141 %token <tok> LE_OP GE_OP EQ_OP NE_OP AND_OP OR_OP
142 %token <tok> MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN SUB_ASSIGN
143 %token <tok> LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
144 %token <tok> CSTRUCT CUNION CENUM
145 %token <tok> VA_ARG VA_DCL
147 %token <tok> QGLOBALS
148 %token <tok> QMODIFIES
150 %token <tok> QCONSTANT
151 %token <tok> QFUNCTION
153 %token <tok> QDEFINES
155 %token <tok> QALLOCATES
157 %token <tok> QRELEASES
158 %token <tok> QPRECLAUSE
159 %token <tok> QPOSTCLAUSE
160 %token <tok> QINVARIANT
162 %token <tok> QUNDEF QKILLED
163 %token <tok> QENDMACRO
165 /* additional tokens introduced by splint pre-processor. */
166 %token <tok> LLMACRO LLMACROITER LLMACROEND TENDMACRO
168 /* break comments: */
169 %token <tok> QSWITCHBREAK QLOOPBREAK QINNERBREAK QSAFEBREAK
170 %token <tok> QINNERCONTINUE
172 /* case fall-through marker: */
173 %token <tok> QFALLTHROUGH
175 /* used in scanner only */
176 %token <tok> QLINTNOTREACHED
177 %token <tok> QLINTFALLTHROUGH
178 %token <tok> QLINTFALLTHRU
179 %token <tok> QARGSUSED
180 %token <tok> QPRINTFLIKE QLINTPRINTFLIKE QSCANFLIKE QMESSAGELIKE
182 /* not-reached marker: (used like a label) */
183 %token <tok> QNOTREACHED
185 /* type qualifiers: */
186 %token <tok> QCONST QVOLATILE QINLINE QEXTENSION QEXTERN QSTATIC QAUTO QREGISTER
187 %token <tok> QOUT QIN QYIELD QONLY QTEMP QSHARED QREF QUNIQUE
188 %token <tok> QCHECKED QUNCHECKED QCHECKEDSTRICT QCHECKMOD
189 %token <tok> QKEEP QKEPT QPARTIAL QSPECIAL QOWNED QDEPENDENT
190 %token <tok> QRETURNED QEXPOSED QNULL QOBSERVER QISNULL
191 %token <tok> QEXITS QMAYEXIT QNEVEREXIT QTRUEEXIT QFALSEEXIT
192 %token <tok> QLONG QSIGNED QUNSIGNED QSHORT QUNUSED QSEF QNOTNULL QRELNULL
193 %token <tok> QABSTRACT QCONCRETE QMUTABLE QIMMUTABLE
194 %token <tok> QTRUENULL QFALSENULL QEXTERNAL
195 %token <tok> QREFCOUNTED QREFS QNEWREF QTEMPREF QKILLREF QRELDEF
196 %token <ctyp> CGCHAR CBOOL CINT CGFLOAT CDOUBLE CVOID
197 %token <tok> QANYTYPE QINTEGRALTYPE QUNSIGNEDINTEGRALTYPE QSIGNEDINTEGRALTYPE
199 %token <tok> QNULLTERMINATED
200 %token <tok> QSETBUFFERSIZE
201 %token <tok> QSETSTRINGLENGTH
203 %token <tok> QMAXREAD
204 %token <tok> QTESTINRANGE
209 /* identifiers, literals */
210 %token <entry> IDENTIFIER
211 %token <cname> NEW_IDENTIFIER TYPE_NAME_OR_ID
212 %token <annotation> CANNOTATION
213 %token <expr> CCONSTANT
215 %type <flagspec> flagSpec
216 %type <expr> cconstantExpr
217 %token <entry> ITER_NAME ITER_ENDNAME
218 %type <entry> endIter
220 %type <funcclauselist> functionClauses functionClausesPlain
221 %type <funcclause> functionClause functionClause functionClausePlain
223 %type <globsclause> globalsClause globalsClausePlain
224 %type <modsclause> modifiesClause modifiesClausePlain nomodsClause
225 %type <warnclause> warnClause warnClausePlain optWarnClause
226 %type <funcclause> conditionClause conditionClausePlain
227 %type <stateclause> stateClause stateClausePlain
228 %type <msconstraint> metaStateConstraint
229 %type <fcnconstraint> functionConstraint
230 %type <msspec> metaStateSpecifier
231 %type <msexpr> metaStateExpression
233 %type <sr> globId globIdListExpr
234 %type <globset> globIdList
236 %token <ctyp> TYPE_NAME
237 %token <msinfo> METASTATE_NAME
238 %type <msinfo> metaStateName
239 %type <cname> enumerator newId /*@-varuse@*/ /* yacc declares yytranslate here */
240 %type <count> pointers /*@=varuse@*/
242 %type <tok> doHeader stateTag conditionTag startConditionClause
243 %type <typequal> exitsQualifier checkQualifier stateQualifier
244 paramQualifier returnQualifier visibilityQualifier
245 typedefQualifier refcountQualifier definedQualifier
247 /* type construction */
248 %type <ctyp> abstractDecl abstractDeclBase optAbstractDeclBase
249 %type <ctyp> suSpc enumSpc typeName typeSpecifier
251 %type <ntyp> namedDecl namedDeclBase optNamedDecl
252 %type <ntyp> plainNamedDecl plainNamedDeclBase
253 %type <ntyp> structNamedDecl
254 %type <ntyp> fcnDefHdrAux plainFcn fcnDefHdr
256 %type <oentry> paramDecl
259 %type <ntyplist> structNamedDeclList
261 %type <entrylist> genericParamList paramTypeList paramList idList paramIdList
262 %type <exprlist> argumentExprList iterArgList
263 %type <exprlist> initList namedInitializerList namedInitializerListAux
264 %type <flist> structDeclList structDecl
265 %type <srset> locModifies modList specClauseList optSpecClauseList
266 %type <sr> mExpr modListExpr specClauseListExpr
269 %type <con> BufConstraint
270 %type <tok> relationalOp
271 %type <tok> BufBinaryOp
272 %type <tok> bufferModifier
274 %type <conE> BufConstraintExpr
276 %type <conE> BufConstraintTerm
277 %type <sr> BufConstraintSrefExpr
279 %type <conL> BufConstraintList
281 %type <conL> optStructInvariant
283 %type <tok> BufUnaryOp
285 /*drl 1/6/2002 either /\ or && */
286 %type <tok> constraintSeperator
288 %type <enumnamelist> enumeratorList
289 %type <cstringlist> fieldDesignator
291 %type <expr> sizeofExpr sizeofExprAux offsetofExpr
292 %type <expr> openScope closeScope
293 %type <expr> instanceDecl namedInitializer optDeclarators
294 %type <expr> primaryExpr postfixExpr primaryIterExpr postfixIterExpr
295 %type <expr> unaryExpr castExpr timesExpr plusExpr
296 %type <expr> unaryIterExpr castIterExpr timesIterExpr plusIterExpr
297 %type <expr> shiftExpr relationalExpr equalityExpr bitandExpr
298 %type <expr> xorExpr bitorExpr andExpr
299 %type <expr> orExpr conditionalExpr assignExpr
300 %type <expr> shiftIterExpr relationalIterExpr equalityIterExpr bitandIterExpr
301 %type <expr> xorIterExpr bitorIterExpr andIterExpr
302 %type <expr> orIterExpr conditionalIterExpr assignIterExpr iterArgExpr
303 %type <expr> expr optExpr constantExpr
304 %type <expr> init macroBody iterBody endBody partialIterStmt iterSelectionStmt
305 %type <expr> stmt stmtList fcnBody iterStmt iterDefStmt iterDefStmtList
306 %type <expr> labeledStmt caseStmt defaultStmt
307 %type <expr> compoundStmt compoundStmtAux compoundStmtRest compoundStmtAuxErr
308 %type <expr> expressionStmt selectionStmt iterationStmt jumpStmt iterDefIterationStmt
309 %type <expr> stmtErr stmtListErr compoundStmtErr expressionStmtErr
310 %type <expr> iterationStmtErr initializerList typeInitializerList initializer
311 %type <expr> ifPred whilePred forPred iterWhilePred typeInitializer
313 %type <expr> designator designatorList designation
315 %type <typequal> storageSpecifier typeQualifier typeModifier globQual
316 %type <tquallist> optGlobQuals
317 %type <qtyp> completeType completeTypeSpecifier optCompleteType
318 %type <qtyp> completeTypeSpecifierAux altType typeExpression
329 : externalDef { context_checkGlobalScope (); }
330 | externalDefs externalDef { context_checkGlobalScope (); }
333 : fcnDef optSemi { uentry_clearDecl (); }
334 | constantDecl { uentry_clearDecl (); }
335 | fcnDecl { uentry_clearDecl (); }
336 | iterDecl { uentry_clearDecl (); }
337 | macroDef { uentry_clearDecl (); }
338 | initializer { //drl added 04/02/2002
341 exprNode_unparse($1);
343 if (exprNode_isDefined($1) && ( ($1)->kind == XPR_INIT) )
345 if ( ctype_isFunctionPointer (($1)->edata->init->id->typ->type ) )
347 outputCode(message("%s;\n", ctype_unparseFunctionPointer (($1)->edata->init->id->typ->type, qualList_unparse(($1)->edata->init->id->typ->quals), cstring_copy( ($1)->edata->init->id->id ) ))
350 else if ( ctype_isFunction (($1)->edata->init->id->typ->type ) )
352 outputCode(message("%s;\n", ctype_unparseFunction (($1)->edata->init->id->typ->type, cstring_copy( ($1)->edata->init->id->id ) ))
357 outputCode(message("%s;\n", exprNode_unparse(($1) ) ));
361 else if (exprNode_isDefined($1) )
363 outputCode(message("%s;\n", exprNode_unparse(($1) ) ));
367 /*drl try outputing nothing so that there is not an unnecessary semicolon*/
368 // outputCode(message("%s;\n", exprNode_unparse(($1) ) ));
373 uentry_checkDecl (); exprNode_free ($1); }
374 | TSEMI { uentry_clearDecl (); /* evans 2002-02-08: okay to have a null statement */ }
375 | error { uentry_clearDecl (); }
378 : QCONSTANT completeTypeSpecifier NotType namedDecl NotType optSemi IsType QENDMACRO
379 { checkConstant ($2, $4); }
380 | QCONSTANT completeTypeSpecifier NotType namedDecl NotType TASSIGN IsType init optDeclarators optSemi QENDMACRO
381 { checkValueConstant ($2, $4, $8) ; }
384 : QFUNCTION { context_enterFunctionHeader (); } plainFcn optSemi QENDMACRO
386 declareStaticFunction ($3); context_quietExitFunction ();
387 context_exitFunctionHeader ();
393 qtype qint = qtype_create (ctype_int);
394 $$ = idDecl_fixBase ($1, qint);
397 | completeTypeSpecifier NotType plainNamedDecl
398 { $$ = idDecl_fixBase ($3, $1); }
402 | pointers plainNamedDeclBase
403 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
406 : newId { $$ = idDecl_create ($1, qtype_unknown ()); }
407 | IsType TLPAREN NotType namedDecl IsType TRPAREN
408 { $$ = idDecl_expectFunction ($4); }
409 | namedDeclBase TLSQBR TRSQBR
410 { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); }
411 | namedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
413 exprNode_findValue ($4);
414 idDecl_notExpectingFunction ($1);
416 if (exprNode_hasValue ($4))
418 $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1),
419 exprNode_getLongValue ($4)));
423 $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1)));
426 | namedDeclBase PushType TLPAREN TRPAREN
427 { setCurrentParams (uentryList_missingParams); }
429 { /* need to support globals and modifies here! */
430 ctype ct = ctype_makeFunction (idDecl_getCtype ($1),
431 uentryList_makeMissingParams ());
433 $$ = idDecl_replaceCtype ($1, ct);
434 idDecl_addClauses ($$, $6);
436 /*drl 7/25/01 added*/
437 setImplictfcnConstraints();
439 | namedDeclBase PushType TLPAREN genericParamList TRPAREN
440 { setCurrentParams ($4); }
442 { setImplictfcnConstraints ();
443 clearCurrentParams ();
444 $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
445 idDecl_addClauses ($$, $7);
450 : newId { $$ = idDecl_create ($1, qtype_unknown ()); }
451 | IsType TLPAREN NotType plainNamedDecl IsType TRPAREN
452 { $$ = idDecl_expectFunction ($4); }
453 | plainNamedDeclBase TLSQBR TRSQBR
454 { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); }
455 | plainNamedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
459 if (exprNode_hasValue ($4)
460 && multiVal_isInt (exprNode_getValue ($4)))
462 value = (int) multiVal_forceInt (exprNode_getValue ($4));
469 $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1), value));
471 | plainNamedDeclBase PushType TLPAREN TRPAREN
472 { setCurrentParams (uentryList_missingParams); }
475 ctype ct = ctype_makeFunction (idDecl_getCtype ($1),
476 uentryList_makeMissingParams ());
478 $$ = idDecl_replaceCtype ($1, ct);
479 idDecl_addClauses ($$, $6);
482 | plainNamedDeclBase PushType TLPAREN genericParamList TRPAREN
483 { setCurrentParams ($4); }
486 clearCurrentParams ();
487 $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
488 idDecl_addClauses ($$, $7);
493 : QITER newId TLPAREN genericParamList TRPAREN
494 { setCurrentParams ($4); } functionClausesPlain
495 { clearCurrentParams (); } optSemi QENDMACRO
496 { declareCIter ($2, $4); }
499 : LLMACRO macroBody TENDMACRO { exprNode_checkMacroBody ($2); }
500 | LLMACROITER iterBody TENDMACRO { exprNode_checkIterBody ($2); }
501 | LLMACROEND endBody TENDMACRO { exprNode_checkIterEnd ($2); }
502 | LLMACRO TENDMACRO /* no stmt */ { exprChecks_checkEmptyMacroBody (); }
505 : fcnDefHdrAux { clabstract_declareFunction ($1);
506 DPRINTF (message ("fcnDefHdr is: %s", idDecl_unparseC($1) ) );
510 : metaStateSpecifier TASSIGN metaStateExpression
511 { $$ = metaStateConstraint_create ($1, $3); }
514 : BufConstraintSrefExpr { cscanner_expectingMetaStateName (); } TCOLON metaStateName
515 { cscanner_clearExpectingMetaStateName ();
516 $$ = metaStateSpecifier_create ($1, $4); }
517 | CTOK_ELIPSIS { cscanner_expectingMetaStateName (); } TCOLON metaStateName
518 { cscanner_clearExpectingMetaStateName ();
519 $$ = metaStateSpecifier_createElipsis ($4); }
522 : metaStateSpecifier { $$ = metaStateExpression_create ($1); }
523 | metaStateSpecifier TBAR metaStateExpression { $$ = metaStateExpression_createMerge ($1, $3); }
535 : BufConstraint constraintSeperator BufConstraintList { $$ = constraintList_add ($3, $1); }
536 | BufConstraint { $$ = constraintList_single ($1); }
539 : BufConstraintExpr relationalOp BufConstraintExpr {
540 $$ = constraint_makeConstraintLltok ($1, $2, $3);
541 DPRINTF(("Done BufConstraint1\n")); }
554 | BufUnaryOp TLPAREN BufConstraintExpr TRPAREN {$$ = constraintExpr_parseMakeUnaryOp ($1, $3); DPRINTF( ("Got BufConstraintExpr UNary Op ") ); }
555 | TLPAREN BufConstraintExpr BufBinaryOp BufConstraintExpr TRPAREN {
556 DPRINTF( ("Got BufConstraintExpr BINary Op ") );
557 $$ = constraintExpr_parseMakeBinaryOp ($2, $3, $4); }
560 : BufConstraintSrefExpr { $$ = constraintExpr_makeTermsRef ($1);}
561 | CCONSTANT { $$ = constraintExpr_makeIntLiteral (exprNode_getLongValue ($1)); }
563 BufConstraintSrefExpr
565 { /*@-onlytrans@*/ $$ = checkbufferConstraintClausesId ($1); /*@=onlytrans@*/ /*@i523@*/ }
567 { $$ = fixStateClausesId ($1); }
568 | BufConstraintSrefExpr TLSQBR TRSQBR
569 { $$ = sRef_makeAnyArrayFetch ($1); }
570 | BufConstraintSrefExpr TLSQBR CCONSTANT TRSQBR
574 t = cstring_toCharsSafe (exprNode_unparse($3));
577 $$ = sRef_makeArrayFetchKnown ($1, exprNode_getLongValue ($3));
579 | TMULT BufConstraintSrefExpr
580 { $$ = sRef_constructPointer ($2); }
581 | TLPAREN BufConstraintSrefExpr TRPAREN
583 | BufConstraintSrefExpr TDOT newId
584 { cstring_markOwned ($3); $$ = sRef_buildField ($1, $3); }
585 | BufConstraintSrefExpr ARROW_OP newId
586 { cstring_markOwned ($3); $$ = sRef_makeArrow ($1, $3); }
589 | BufConstraintTerm TLSQBR TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
590 | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
591 | TLPAREN specClauseListExpr TRPAREN { $$ = $2; }
592 | specClauseListExpr TDOT newId { cstring_markOwned ($3);
593 $$ = sRef_buildField ($1, $3); }
609 ** Function clauses can appear in any order.
613 : { $$ = functionClauseList_new (); }
614 | functionClause functionClauses
615 { $$ = functionClauseList_prepend ($2, $1); }
618 ** Inside macro definitions, there are no end macros.
623 { $$ = functionClauseList_new (); }
624 | functionClausePlain functionClausesPlain
625 { $$ = functionClauseList_prepend ($2, $1); }
628 : globalsClause { $$ = functionClause_createGlobals ($1); }
629 | modifiesClause { $$ = functionClause_createModifies ($1); }
630 | nomodsClause { $$ = functionClause_createModifies ($1); }
631 | stateClause { $$ = functionClause_createState ($1); }
632 | conditionClause { $$ = $1; }
633 | warnClause { $$ = functionClause_createWarn ($1); }
636 : globalsClausePlain { $$ = functionClause_createGlobals ($1); }
637 | modifiesClausePlain { $$ = functionClause_createModifies ($1); }
638 | nomodsClause { $$ = functionClause_createModifies ($1); }
639 | stateClausePlain { $$ = functionClause_createState ($1); }
640 | conditionClausePlain { $$ = $1; }
641 | warnClausePlain { $$ = functionClause_createWarn ($1); }
644 : globalsClausePlain QENDMACRO { $$ = $1; }
647 : QGLOBALS { setProcessingGlobalsList (); }
650 unsetProcessingGlobals ();
651 $$ = globalsClause_create ($1, $3);
655 : QNOMODS { $$ = modifiesClause_createNoMods ($1); }
658 : modifiesClausePlain QENDMACRO { $$ = $1; }
663 context_setProtectVars (); enterParamsTemp ();
664 sRef_setGlobalScopeSafe ();
669 sRef_clearGlobalScopeSafe ();
670 context_releaseVars ();
671 $$ = modifiesClause_create ($1, $3);
676 { $$ = flagSpec_createPlain ($1); }
677 | flagId TBAR flagSpec
678 { $$ = flagSpec_createOr ($1, $3); }
685 | /* empty */ { $$ = warnClause_undefined; }
688 : warnClausePlain QENDMACRO { $$ = $1; }
691 : QWARN flagSpec cconstantExpr
693 llassert (exprNode_knownStringValue ($3));
694 $$ = warnClause_create ($1, $2, cstring_copy (multiVal_forceString (exprNode_getValue ($3))));
698 { $$ = warnClause_create ($1, $2, cstring_undefined); }
701 : globIdListExpr { $$ = globSet_single ($1); }
702 | globIdList TCOMMA globIdListExpr { $$ = globSet_insert ($1, $3); }
705 : optGlobQuals globId { $$ = clabstract_createGlobal ($2, $1); }
708 : /* empty */ { $$ = qualList_undefined; }
709 | globQual optGlobQuals { $$ = qualList_add ($2, $1); }
712 : id { $$ = uentry_getSref ($1); }
713 | NEW_IDENTIFIER { $$ = clabstract_unrecognizedGlobal ($1); }
714 | initializer { $$ = clabstract_checkGlobal ($1); }
717 : QUNDEF { $$ = qual_createUndef (); }
718 | QKILLED { $$ = qual_createKilled (); }
719 | QOUT { $$ = qual_createOut (); }
720 | QIN { $$ = qual_createIn (); }
721 | QPARTIAL { $$ = qual_createPartial (); }
737 /**!!! deal with fred; fred (int); declarations! **/
738 qtype qint = qtype_create (ctype_int);
739 $$ = idDecl_fixBase ($1, qint);
742 | completeTypeSpecifier NotType namedDecl
743 { $$ = idDecl_fixBase ($3, $1); }
746 : TLBRACE { checkDoneParams (); context_enterInnerContext (); }
749 exprNode_checkFunctionBody ($3); $$ = $3;
750 context_exitInner ($3);
752 | { context_enterOldStyleScope (); } initializerList
753 { oldStyleDoneParams (); context_enterInnerContext (); }
756 exprNode_checkFunctionBody ($4);
757 $$ = $4; /* oldstyle */
758 context_exitInner ($4);
764 context_setFunctionDefined (exprNode_loc ($2));
765 exprNode_checkFunction (context_getHeader (), $2);
767 DPRINTF(message ("Header: %s\n", idDecl_unparseC($1) ) );
768 context_exitFunction ();
772 : modList optSemi { $$ = $1; }
773 | optSemi { $$ = sRefSet_new (); }
776 : id { $$ = uentry_getSref ($1); checkModifiesId ($1); }
777 | NEW_IDENTIFIER { $$ = fixModifiesId ($1); }
778 | modListExpr TLSQBR TRSQBR { $$ = modListArrayFetch ($1, sRef_undefined); }
779 | modListExpr TLSQBR mExpr TRSQBR { $$ = modListArrayFetch ($1, $3); }
780 | TMULT modListExpr { $$ = modListPointer ($2); }
781 | TLPAREN modListExpr TRPAREN { $$ = $2; }
782 | modListExpr TDOT newId { $$ = modListFieldAccess ($1, $3); }
783 | modListExpr ARROW_OP newId { $$ = modListArrowAccess ($1, $3); }
787 : modListExpr { $$ = $1; }
788 | cconstantExpr { $$ = sRef_makeUnknown (); /* sRef_makeConstant ($1); ? */ }
792 : modListExpr { $$ = sRefSet_single ($1); }
793 | modList TCOMMA modListExpr { $$ = sRefSet_insert ($1, $3); }
797 { $$ = checkStateClausesId ($1); }
799 { $$ = fixStateClausesId ($1); }
800 | specClauseListExpr TLSQBR TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
801 | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
802 | TMULT specClauseListExpr { $$ = sRef_constructPointer ($2); }
803 | TLPAREN specClauseListExpr TRPAREN { $$ = $2; }
804 | specClauseListExpr TDOT newId { cstring_markOwned ($3);
805 $$ = sRef_buildField ($1, $3); }
806 | specClauseListExpr ARROW_OP newId { cstring_markOwned ($3);
807 $$ = sRef_makeArrow ($1, $3); }
810 : /* empty */ { $$ = sRefSet_undefined }
815 { if (sRef_isValid ($1)) { $$ = sRefSet_single ($1); }
816 else { $$ = sRefSet_undefined; }
818 | specClauseList TCOMMA specClauseListExpr
819 { if (sRef_isValid ($3))
821 $$ = sRefSet_insert ($1, $3);
830 : id { int tmpMark1; $$ = exprNode_fromIdentifier ($1); }
831 | NEW_IDENTIFIER { $$ = exprNode_fromUIO ($1); }
833 | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
834 | TYPE_NAME_OR_ID { $$ = exprNode_fromIdentifier (coerceId ($1)); }
835 | QEXTENSION { $$ = exprNode_makeError (); }
836 | TLPAREN { exprChecks_inCompoundStatementExpression (); }
838 { exprChecks_leaveCompoundStatementExpression (); $$ = exprNode_compoundStatementExpression ($1, $3); }
842 | postfixExpr TLSQBR expr TRSQBR { $$ = exprNode_arrayFetch ($1, $3); }
843 | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
844 | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
845 | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN { $$ = exprNode_vaArg ($1, $3, $5); }
846 | postfixExpr NotType TDOT newId IsType {int tmpMark2; $$ = exprNode_fieldAccess ($1, $3, $4); }
847 | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
848 | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
849 | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
850 | TLPAREN typeExpression TRPAREN TLBRACE typeInitializerList optComma TRBRACE
851 { /* added for C99 */ $$ = exprNode_undefined; /*@i87 no checking */ }
854 : assignExpr { $$ = exprNodeList_singleton ($1); }
855 | argumentExprList TCOMMA assignExpr { $$ = exprNodeList_push ($1, $3); }
859 | INC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
860 | DEC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
861 | TAMPERSAND castExpr { $$ = exprNode_preOp ($2, $1); }
862 | TMULT castExpr { $$ = exprNode_preOp ($2, $1); }
863 | TPLUS castExpr { $$ = exprNode_preOp ($2, $1); }
864 | TMINUS castExpr { $$ = exprNode_preOp ($2, $1); }
865 | TTILDE castExpr { $$ = exprNode_preOp ($2, $1); }
866 | TEXCL castExpr { $$ = exprNode_preOp ($2, $1); }
867 | sizeofExpr { $$ = $1; }
868 | offsetofExpr { $$ = $1; }
871 : fieldDesignator TDOT newId { $$ = cstringList_add ($1, $3); }
872 | newId { $$ = cstringList_single ($1); }
875 : COFFSETOF IsType TLPAREN typeExpression NotType TCOMMA fieldDesignator TRPAREN IsType
876 { $$ = exprNode_offsetof ($4, $7); }
879 : IsType { context_setProtectVars (); }
880 sizeofExprAux { context_sizeofReleaseVars (); $$ = $3; }
883 : CSIZEOF TLPAREN typeExpression TRPAREN { $$ = exprNode_sizeofType ($3); }
884 | CSIZEOF unaryExpr { $$ = exprNode_sizeofExpr ($2); }
885 | CALIGNOF TLPAREN typeExpression TRPAREN { $$ = exprNode_alignofType ($3); }
886 | CALIGNOF unaryExpr { $$ = exprNode_alignofExpr ($2); }
890 | TLPAREN typeExpression TRPAREN castExpr
891 { $$ = exprNode_cast ($1, $4, $2); }
895 | timesExpr TMULT castExpr { $$ = exprNode_op ($1, $3, $2); }
896 | timesExpr TDIV castExpr { $$ = exprNode_op ($1, $3, $2); }
897 | timesExpr TPERCENT castExpr { $$ = exprNode_op ($1, $3, $2); }
901 | plusExpr TPLUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
902 | plusExpr TMINUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
906 | shiftExpr LEFT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
907 | shiftExpr RIGHT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
911 | relationalExpr TLT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
912 | relationalExpr TGT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
913 | relationalExpr LE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
914 | relationalExpr GE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
918 | equalityExpr EQ_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
919 | equalityExpr NE_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
923 | bitandExpr TAMPERSAND equalityExpr { $$ = exprNode_op ($1, $3, $2); }
927 | xorExpr TCIRC bitandExpr { $$ = exprNode_op ($1, $3, $2); }
932 | bitorExpr TBAR xorExpr { $$ = exprNode_op ($1, $3, $2); }
937 { exprNode_produceGuards ($1);
938 context_enterAndClause ($1);
942 $$ = exprNode_op ($1, $4, $2);
943 context_exitAndClause ($$, $4);
950 exprNode_produceGuards ($1);
951 context_enterOrClause ($1);
955 $$ = exprNode_op ($1, $4, $2);
956 context_exitOrClause ($$, $4);
961 | orExpr TQUEST { exprNode_produceGuards ($1); context_enterTrueClause ($1); } expr TCOLON
962 { context_enterFalseClause ($1); } conditionalExpr
963 { $$ = exprNode_cond ($1, $4, $7); context_exitClause ($1, $4, $7); }
967 | unaryExpr TASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
968 | unaryExpr MUL_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
969 | unaryExpr DIV_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
970 | unaryExpr MOD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
971 | unaryExpr ADD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
972 | unaryExpr SUB_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
973 | unaryExpr LEFT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
974 | unaryExpr RIGHT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
975 | unaryExpr AND_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
976 | unaryExpr XOR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
977 | unaryExpr OR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
981 | expr TCOMMA assignExpr { $$ = exprNode_comma ($1, $3); }
984 : /* empty */ { $$ = exprNode_undefined; }
990 /* instance_orTypeDecl_and_possible_initialization */
993 : instanceDecl { $$ = $1; }
994 | VA_DCL { doVaDcl (); $$ = exprNode_makeError (); }
995 | typeDecl { $$ = exprNode_makeError (); }
998 : completeTypeSpecifier IsType TSEMI
1000 if (willOutputCode )
1001 outputCode(message( "%s;\n", qtypetryToPrintStruct($1) ));
1003 $$ = exprNode_makeError (); }
1005 ** This causes r/r conflicts with function definitions.
1006 ** Instead we need to snarf one first. (gack)
1008 ** | completeTypeSpecifier { setProcessingVars ($1); }
1010 ** namedInitializerList IsType TSEMI
1011 ** { unsetProcessingVars (); }
1014 ** the solution is pretty ugly:
1016 | completeTypeSpecifier NotType namedDecl NotType
1018 setProcessingVars ($1);
1019 processNamedDecl ($3);
1021 IsType optDeclarators TSEMI IsType
1025 ct = idDecl_getCtype ($3);
1026 idDecl_setTyp ($3, qtype_copy ($1) );
1027 idDecl_replaceCtype($3, ct);
1029 unsetProcessingVars ();
1030 /*drl 04-17-2002 added exprNode_concat */
1031 $$ = exprNode_concat ($7, exprNode_makeEmptyInitialization ($3) );
1032 DPRINTF (("Empty initialization: %s", exprNode_unparse ($$)));
1034 | completeTypeSpecifier NotType namedDecl NotType TASSIGN
1035 { setProcessingVars ($1); processNamedDecl ($3); }
1036 IsType init optDeclarators TSEMI IsType
1040 ct = idDecl_getCtype ($3);
1041 idDecl_setTyp ($3, qtype_copy ($1) );
1042 idDecl_replaceCtype($3, ct);
1044 $$ = exprNode_concat ($9, exprNode_makeInitialization ($3, $8));
1045 unsetProcessingVars ();
1051 processNamedDecl ($1);
1052 $$ = exprNode_makeEmptyInitialization ($1);
1054 | namedDecl NotType TASSIGN { processNamedDecl ($1); } IsType init
1055 { $$ = exprNode_makeInitialization ($1, $6); }
1058 : CTYPEDEF completeTypeSpecifier { setProcessingTypedef ($2); }
1059 NotType namedInitializerList IsType optWarnClause TSEMI
1061 if ( willOutputCode )
1063 outputCode(message( "typedef %s;",
1064 // qtypetryToPrintStruct($2),
1065 exprNode_unparse(exprNodeList_head ($5) )
1069 clabstract_declareType ($5, $7); }
1070 | CTYPEDEF completeTypeSpecifier IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
1071 | CTYPEDEF namedInitializerList IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
1074 : { g_expectingTypeName = TRUE; }
1077 : { g_expectingTypeName = TRUE; context_pushLoc (); }
1079 namedInitializerList
1080 : namedInitializerListAux IsType { $$ = $1; }
1082 namedInitializerListAux
1083 : namedInitializer { $$ = exprNodeList_singleton ($1); }
1084 | namedInitializerList TCOMMA NotType namedInitializer { $$ = exprNodeList_push ($1, $4); }
1087 : /* empty */ { $$ = exprNode_makeError (); }
1088 | optDeclarators TCOMMA NotType namedInitializer { $$ = exprNode_concat ($1, $4); }
1092 | TLBRACE initList TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); }
1093 | TLBRACE initList TCOMMA TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); }
1094 | designation init { $$ = exprNode_undefined; }
1097 ** Splint parses these (added in ISO C99), but no checking yet...
1101 : designatorList TASSIGN { $$ = $1; }
1102 | newId TCOLON { $$ = exprNode_undefined;
1103 /* gcc extension, obsolete since 2.5 */ }
1106 : designator { $$ = exprNode_undefined; }
1107 | designatorList designator { $$ = exprNode_undefined; }
1110 : TLSQBR constantExpr TRSQBR { $$ = exprNode_undefined; }
1111 | TDOT newId { $$ = exprNode_undefined; }
1115 { $$ = exprNodeList_singleton ($1); }
1116 | initList TCOMMA init
1117 { $$ = exprNodeList_push ($1, $3); }
1120 ** need to do the storage class global hack so tags are
1121 ** declared with the right storage class.
1125 : QEXTERN { setStorageClass (SCEXTERN); $$ = qual_createExtern (); }
1126 | QINLINE { $$ = qual_createInline (); }
1127 | QSTATIC { setStorageClass (SCSTATIC); $$ = qual_createStatic (); }
1128 | QAUTO { $$ = qual_createAuto (); }
1129 | QREGISTER { $$ = qual_createRegister (); }
1132 : stateClausePlain QENDMACRO { $$ = $1; }
1137 context_setProtectVars ();
1139 sRef_setGlobalScopeSafe ();
1141 specClauseList optSemi IsType
1144 sRef_clearGlobalScopeSafe ();
1145 context_releaseVars ();
1146 $$ = stateClause_createPlain ($1, $4);
1150 : conditionClausePlain QENDMACRO { $$ = $1; }
1152 startConditionClause
1153 : conditionTag NotType { $$ = $1; context_enterFunctionHeader (); }
1155 conditionClausePlain
1156 : startConditionClause stateQualifier
1158 context_exitFunctionHeader ();
1159 context_setProtectVars ();
1161 sRef_setGlobalScopeSafe ();
1163 optSpecClauseList optSemi IsType
1166 sRef_clearGlobalScopeSafe ();
1167 context_releaseVars ();
1168 $$ = functionClause_createState (stateClause_create ($1, $2, $4));
1170 | startConditionClause
1172 context_setProtectVars ();
1174 sRef_setGlobalScopeSafe ();
1176 functionConstraint optSemi IsType
1178 context_exitFunctionHeader ();
1180 sRef_clearGlobalScopeSafe ();
1181 context_releaseVars ();
1182 DPRINTF (("done optGlobBufConstraintsAux\n"));
1184 if (lltok_isEnsures ($1))
1186 $$ = functionClause_createEnsures ($3);
1188 else if (lltok_isRequires ($1))
1190 $$ = functionClause_createRequires ($3);
1197 DPRINTF (("FunctionclauseS: %s", functionClause_unparse ($$)));
1201 : BufConstraintList { $$ = functionConstraint_createBufferConstraint ($1); }
1202 | metaStateConstraint { $$ = functionConstraint_createMetaStateConstraint ($1); DPRINTF (("Made constraint: %s", functionConstraint_unparse ($$))); }
1205 : QEXITS { $$ = qual_createExits (); }
1206 | QMAYEXIT { $$ = qual_createMayExit (); }
1207 | QTRUEEXIT { $$ = qual_createTrueExit (); }
1208 | QFALSEEXIT { $$ = qual_createFalseExit (); }
1209 | QNEVEREXIT { $$ = qual_createNeverExit (); }
1212 : QCHECKED { $$ = qual_createChecked (); }
1213 | QCHECKMOD { $$ = qual_createCheckMod (); }
1214 | QUNCHECKED { $$ = qual_createUnchecked (); }
1215 | QCHECKEDSTRICT { $$ = qual_createCheckedStrict (); }
1218 : QOWNED { $$ = qual_createOwned (); }
1219 | QDEPENDENT { $$ = qual_createDependent (); }
1220 | QYIELD { $$ = qual_createYield (); }
1221 | QTEMP { $$ = qual_createTemp (); }
1222 | QONLY { $$ = qual_createOnly (); }
1223 | QKEEP { $$ = qual_createKeep (); }
1224 | QKEPT { $$ = qual_createKept (); }
1225 | QSHARED { $$ = qual_createShared (); }
1226 | QUNIQUE { $$ = qual_createUnique (); }
1227 | QNULL { $$ = qual_createNull (); }
1228 | QISNULL { $$ = qual_createIsNull (); }
1229 | QRELNULL { $$ = qual_createRelNull (); }
1230 | QNOTNULL { $$ = qual_createNotNull (); }
1231 | QEXPOSED { $$ = qual_createExposed (); }
1232 | QOBSERVER { $$ = qual_createObserver (); }
1233 | QNULLTERMINATED { $$ = qual_createNullTerminated (); }
1234 | CANNOTATION { $$ = qual_createMetaState ($1); }
1238 : QRETURNED { $$ = qual_createReturned (); }
1239 | QSEF { $$ = qual_createSef (); }
1242 : QUNUSED { $$ = qual_createUnused (); }
1243 | QEXTERNAL { $$ = qual_createExternal (); }
1246 : QTRUENULL { $$ = qual_createTrueNull (); }
1247 | QFALSENULL { $$ = qual_createFalseNull (); }
1250 : QABSTRACT { $$ = qual_createAbstract (); }
1251 | QCONCRETE { $$ = qual_createConcrete (); }
1252 | QMUTABLE { $$ = qual_createMutable (); }
1253 | QIMMUTABLE { $$ = qual_createImmutable (); }
1256 : QREFCOUNTED { $$ = qual_createRefCounted (); }
1257 | QREFS { $$ = qual_createRefs (); }
1258 | QKILLREF { $$ = qual_createKillRef (); }
1259 | QRELDEF { $$ = qual_createRelDef (); }
1260 | QNEWREF { $$ = qual_createNewRef (); }
1261 | QTEMPREF { $$ = qual_createTempRef (); }
1264 : QSHORT { $$ = qual_createShort (); }
1265 | QLONG { $$ = qual_createLong (); }
1266 | QSIGNED { $$ = qual_createSigned (); }
1267 | QUNSIGNED { $$ = qual_createUnsigned (); }
1270 : QOUT { $$ = qual_createOut (); }
1271 | QIN { $$ = qual_createIn (); }
1272 | QPARTIAL { $$ = qual_createPartial (); }
1273 | QSPECIAL { $$ = qual_createSpecial (); }
1276 : QCONST IsType { $$ = qual_createConst (); }
1277 | QVOLATILE IsType { $$ = qual_createVolatile (); }
1278 | definedQualifier IsType { $$ = $1; }
1279 | stateQualifier IsType { $$ = $1; }
1280 | exitsQualifier IsType { $$ = $1; }
1281 | paramQualifier IsType { $$ = $1; }
1282 | checkQualifier IsType { $$ = $1; }
1283 | returnQualifier IsType { $$ = $1; }
1284 | visibilityQualifier IsType { $$ = $1; }
1285 | typedefQualifier IsType { $$ = $1; }
1286 | refcountQualifier IsType { $$ = $1; }
1289 ** This is copied into the mtgrammar!
1299 | QANYTYPE NotType { $$ = ctype_makeAnytype (); }
1300 | QINTEGRALTYPE NotType { $$ = ctype_anyintegral; }
1301 | QUNSIGNEDINTEGRALTYPE NotType { $$ = ctype_unsignedintegral; }
1302 | QSIGNEDINTEGRALTYPE NotType { $$ = ctype_signedintegral; }
1306 | typeModifier NotType { $$ = ctype_fromQual ($1); }
1309 : IsType completeTypeSpecifier IsType
1310 { $$ = qtype_resolve ($2); }
1312 completeTypeSpecifier
1313 : completeTypeSpecifierAux { $$ = $1; }
1314 | completeTypeSpecifierAux QALT altType QENDMACRO
1315 { $$ = qtype_mergeAlt ($1, $3); }
1319 | typeExpression TCOMMA altType
1320 { $$ = qtype_mergeAlt ($1, $3); }
1322 completeTypeSpecifierAux
1323 : storageSpecifier optCompleteType { $$ = qtype_addQual ($2, $1); }
1324 | typeQualifier optCompleteType { $$ = qtype_addQual ($2, $1); }
1325 | typeSpecifier optCompleteType { $$ = qtype_combine ($2, $1); }
1328 : /* empty */ { $$ = qtype_unknown (); }
1329 | completeTypeSpecifier { $$ = $1; }
1333 : /* empty */ { $$ = constraintList_undefined; }
1334 /* don't want to have support for structure invariant until we're
1336 | QINVARIANT BufConstraintList QENDMACRO { $$ = $2 }
1340 : NotType CSTRUCT newId IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1341 CreateStructInnerScope
1342 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1345 { ctype ct; ct = declareStruct ($3, $8); /* setGlobalStructInfo(ct, $12);*/ $$ = ct; }
1346 | NotType CUNION newId IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1347 CreateStructInnerScope
1348 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1350 { $$ = declareUnion ($3, $8); }
1351 | NotType CSTRUCT newId IsType TLBRACE TRBRACE
1352 { $$ = declareStruct ($3, uentryList_new ()); }
1353 | NotType CUNION newId IsType TLBRACE TRBRACE
1354 { $$ = declareUnion ($3, uentryList_new ()); }
1355 | NotType CSTRUCT IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1356 CreateStructInnerScope
1357 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1359 { $$ = declareUnnamedStruct ($7); }
1360 | NotType CUNION IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1361 CreateStructInnerScope structDeclList DeleteStructInnerScope
1362 { sRef_clearGlobalScopeSafe (); }
1364 { $$ = declareUnnamedUnion ($7); }
1365 | NotType CSTRUCT IsType TLBRACE TRBRACE
1366 { $$ = ctype_createUnnamedStruct (uentryList_new ()); }
1367 | NotType CUNION IsType TLBRACE TRBRACE
1368 { $$ = ctype_createUnnamedUnion (uentryList_new ()); }
1369 | NotType CSTRUCT newId NotType { $$ = handleStruct ($3); }
1370 | NotType CUNION newId NotType { $$ = handleUnion ($3); }
1373 : { g_expectingTypeName = FALSE; }
1377 | macroDef { $$ = uentryList_undefined; /* bogus! */ }
1378 | structDeclList structDecl { $$ = uentryList_mergeFields ($1, $2); }
1381 : completeTypeSpecifier NotType structNamedDeclList IsType TSEMI
1382 { $$ = fixUentryList ($3, $1); }
1383 | completeTypeSpecifier IsType TSEMI
1384 { $$ = fixUnnamedDecl ($1); }
1387 : structNamedDecl NotType
1388 { $$ = idDeclList_singleton ($1); }
1389 | structNamedDeclList TCOMMA structNamedDecl NotType
1390 { $$ = idDeclList_add ($1, $3); }
1392 structNamedDecl /* hack to get around namespace problems */
1393 : namedDecl { $$ = $1; }
1394 | TCOLON IsType constantExpr { $$ = idDecl_undefined; }
1395 | namedDecl TCOLON IsType constantExpr { $$ = $1; }
1396 /* Need the IsType in case there is a cast in the constant expression. */
1399 : NotType CENUM TLBRACE enumeratorList TRBRACE IsType
1400 { $$ = declareUnnamedEnum ($4); }
1401 | NotType CENUM newId TLBRACE { context_pushLoc (); } enumeratorList TRBRACE IsType
1402 { context_popLoc (); $$ = declareEnum ($3, $6); }
1403 | NotType CENUM newId IsType { $$ = handleEnum ($3); }
1407 { $$ = enumNameList_single ($1); }
1408 | enumeratorList TCOMMA enumerator
1409 { $$ = enumNameList_push ($1, $3); }
1410 | enumeratorList TCOMMA
1414 { uentry ue = uentry_makeEnumConstant ($1, ctype_unknown);
1415 usymtab_supGlobalEntry (ue);
1418 | newId TASSIGN IsType constantExpr
1419 { uentry ue = uentry_makeEnumInitializedConstant ($1, ctype_unknown, $4);
1420 usymtab_supGlobalEntry (ue);
1426 | optAbstractDeclBase { $$ = idDecl_create (cstring_undefined, qtype_create ($1)); }
1427 | pointers TYPE_NAME
1429 qtype qt = qtype_unknown ();
1431 qtype_adjustPointers ($1, qt);
1432 $$ = idDecl_create (cstring_copy (LastIdentifier ()), qt);
1434 | pointers optNamedDecl
1435 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
1439 | pointers namedDeclBase
1440 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
1443 : paramTypeList { $$ = handleParamTypeList ($1); }
1444 | NotType paramIdList { $$ = handleParamIdList ($2); }
1447 : QCONST {setInnerConstQual(); /* ignored for now */; }
1452 | innerModsList innerMods { ; }
1456 | TMULT innerModsList { $$ = 1; }
1457 | TMULT pointers { $$ = 1 + $2; }
1458 | TMULT innerModsList pointers { $$ = 1 + $3; }
1462 | idList TCOMMA CTOK_ELIPSIS { $$ = uentryList_add ($1, uentry_makeElipsisMarker ()); }
1465 : newId { $$ = uentryList_single (uentry_makeVariableLoc ($1, ctype_int)); }
1466 | idList TCOMMA newId { $$ = uentryList_add ($1, uentry_makeVariableLoc ($3, ctype_int)); }
1469 : CTOK_ELIPSIS { $$ = uentryList_single (uentry_makeElipsisMarker ()); }
1471 | paramList TCOMMA CTOK_ELIPSIS { $$ = uentryList_add ($1, uentry_makeElipsisMarker ()); }
1474 : { storeLoc (); } paramDecl { $$ = uentryList_single ($2); }
1475 | paramList TCOMMA { storeLoc (); } paramDecl
1476 { $$ = uentryList_add ($1, $4); }
1479 : IsType completeTypeSpecifier optNamedDecl IsType
1481 if (isFlipOldStyle ())
1483 llparseerror (cstring_makeLiteral ("Inconsistent function parameter syntax (mixing old and new style declaration)"));
1489 $$ = makeCurrentParam (idDecl_fixParamBase ($3, $2));
1491 | newId /* its an old-style declaration */
1493 idDecl tparam = idDecl_create ($1, qtype_unknown ());
1497 llparseerror (message ("Inconsistent function parameter syntax: %q",
1498 idDecl_unparse (tparam)));
1502 $$ = makeCurrentParam (tparam);
1503 idDecl_free (tparam);
1508 | completeType abstractDecl { $$ = qtype_newBase ($1, $2); }
1511 : pointers { $$ = ctype_adjustPointers ($1, ctype_unknown); }
1513 | pointers abstractDeclBase { $$ = ctype_adjustPointers ($1, $2); }
1516 : /* empty */ { $$ = ctype_unknown; }
1520 : IsType TLPAREN NotType abstractDecl TRPAREN
1521 { $$ = ctype_expectFunction ($4); }
1522 | TLSQBR TRSQBR { $$ = ctype_makeArray (ctype_unknown); }
1523 | TLSQBR constantExpr TRSQBR
1524 { $$ = ctype_makeFixedArray (ctype_unknown, exprNode_getLongValue ($2)); }
1525 | abstractDeclBase TLSQBR TRSQBR { $$ = ctype_makeInnerArray ($1); }
1526 | abstractDeclBase TLSQBR constantExpr TRSQBR
1527 { $$ = ctype_makeInnerFixedArray ($1, exprNode_getLongValue ($3)); }
1528 | IsType TLPAREN TRPAREN
1529 { $$ = ctype_makeFunction (ctype_unknown, uentryList_makeMissingParams ()); }
1530 | IsType TLPAREN paramTypeList TRPAREN
1531 { $$ = ctype_makeParamsFunction (ctype_unknown, $3); }
1532 | abstractDeclBase IsType TLPAREN TRPAREN
1533 { $$ = ctype_makeFunction ($1, uentryList_makeMissingParams ()); }
1534 | abstractDeclBase IsType TLPAREN paramTypeList TRPAREN
1535 { $$ = ctype_makeParamsFunction ($1, $4); }
1552 : iterDefStmtList { $$ = $1; }
1559 | iterDefStmtList iterDefStmt
1560 { $$ = exprNode_concat ($1, $2); }
1562 iterDefIterationStmt
1563 : iterWhilePred iterDefStmtList
1564 { $$ = exprNode_while ($1, $2); }
1565 | doHeader stmtErr WHILE TLPAREN expr TRPAREN TSEMI
1566 { $$ = exprNode_doWhile ($2, $5); }
1567 | doHeader stmtErr WHILE TLPAREN expr TRPAREN
1568 { $$ = exprNode_doWhile ($2, $5); }
1569 | forPred iterDefStmt
1570 { $$ = exprNode_for ($1, $2); }
1573 : CFOR TLPAREN optExpr TSEMI optExpr TSEMI
1574 { context_setProtectVars (); } optExpr { context_sizeofReleaseVars (); }
1576 { $$ = exprNode_forPred ($3, $5, $8);
1577 context_enterForClause ($5); }
1580 : ITER_NAME CreateInnerScope TLPAREN
1581 { setProcessingIterVars ($1); }
1583 { $$ = exprNode_iterStart ($1, $5); }
1584 | ITER_ENDNAME { $$ = exprNode_createId ($1); }
1590 | openScope initializerList { $$ = $1; DPRINTF (("def stmt: %s", exprNode_unparse ($$))); }
1595 | iterDefIterationStmt
1598 | TLPAREN iterDefStmt TRPAREN { $$ = $2; }
1599 | error { $$ = exprNode_makeError (); }
1602 : ifPred { exprNode_checkIfPred ($1); } iterDefStmt
1603 { /* don't: context_exitTrueClause ($1, $2); */
1604 $$ = exprNode_if ($1, $3);
1608 : CreateInnerScope TLBRACE { $$ = exprNode_createTok ($2); }
1611 : DeleteInnerScopeSafe TRBRACE { $$ = exprNode_createTok ($2); }
1626 | TLPAREN stmtErr TRPAREN { $$ = exprNode_addParens ($1, $2); }
1628 | error { $$ = exprNode_makeError (); }
1631 : newId TCOLON { $$ = exprNode_labelMarker ($1); }
1632 | QNOTREACHED stmt { $$ = exprNode_notReached ($2); }
1635 ** We allow more than one QFALLTHROUGH token to support mixed lint/splint markers.
1638 optExtraFallThroughs
1640 | QFALLTHROUGH optExtraFallThroughs { ; }
1642 /* Note that we can semantically check that the object to the case is
1643 indeed constant. In this case, we may not want to go through this effort */
1646 : CASE constantExpr { context_enterCaseClause ($2); }
1647 TCOLON { $$ = exprNode_caseMarker ($2, FALSE); }
1648 | QFALLTHROUGH optExtraFallThroughs CASE constantExpr { context_enterCaseClause ($4); }
1649 TCOLON { $$ = exprNode_caseMarker ($4, TRUE); }
1652 : DEFAULT { context_enterCaseClause (exprNode_undefined); }
1653 TCOLON { $$ = exprNode_defaultMarker ($1, FALSE); }
1654 | QFALLTHROUGH optExtraFallThroughs DEFAULT { context_enterCaseClause (exprNode_undefined); }
1655 TCOLON { $$ = exprNode_defaultMarker ($3, TRUE); }
1658 : TLPAREN compoundStmt TRPAREN { $$ = $2; }
1659 | CreateInnerScope compoundStmtAux
1660 { $$ = $2; context_exitInner ($2); }
1663 : CreateInnerScope compoundStmtAuxErr DeleteInnerScope { $$ = $2; }
1666 : { context_enterInnerContext (); }
1669 : { context_exitInnerPlain (); }
1671 CreateStructInnerScope
1672 : { context_enterStructInnerContext (); }
1674 DeleteStructInnerScope
1675 : { context_exitStructInnerContext (); }
1677 DeleteInnerScopeSafe
1678 : { context_exitInnerSafe (); }
1681 : TRBRACE { $$ = exprNode_createTok ($1); }
1682 | QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_createTok ($2)); }
1683 | stmtList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); }
1684 | stmtList QNOTREACHED TRBRACE
1685 { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); }
1686 | initializerList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); }
1687 | initializerList QNOTREACHED TRBRACE
1688 { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); }
1689 | initializerList stmtList TRBRACE
1690 { $$ = exprNode_updateLocation (exprNode_concat ($1, $2), lltok_getLoc ($3)); }
1691 | initializerList stmtList QNOTREACHED TRBRACE
1692 { $$ = exprNode_notReached (exprNode_updateLocation (exprNode_concat ($1, $2),
1693 lltok_getLoc ($3)));
1697 : TLBRACE compoundStmtRest
1698 { $$ = exprNode_makeBlock ($2); }
1702 { $$ = exprNode_createTok ($2); }
1703 | TLBRACE stmtListErr TRBRACE
1704 { $$ = exprNode_updateLocation ($2, lltok_getLoc ($3)); }
1705 | TLBRACE initializerList TRBRACE
1706 { $$ = exprNode_updateLocation ($2, lltok_getLoc ($3)); }
1707 | TLBRACE initializerList stmtList TRBRACE
1708 { $$ = exprNode_updateLocation (exprNode_concat ($2, $3), lltok_getLoc ($4)); }
1712 | stmtListErr stmtErr { $$ = exprNode_concat ($1, $2); }
1715 : initializer { $$ = $1; }
1716 | initializerList initializer { $$ = exprNode_concat ($1, $2); }
1719 : typeInitializer { $$ = $1; }
1720 | typeInitializerList TCOMMA typeInitializer { $$ = exprNode_concat ($1, $3); }
1723 : assignExpr { $$ = $1; }
1724 | TLBRACE typeInitializerList optComma TRBRACE { $$ = $2; }
1728 | stmtList stmt { $$ = exprNode_concat ($1, $2); }
1731 : TSEMI { $$ = exprNode_createTok ($1); }
1732 | expr TSEMI { $$ = exprNode_statement ($1, $2); }
1735 : TSEMI { $$ = exprNode_createTok ($1); }
1736 | expr TSEMI { $$ = exprNode_statement ($1, $2); }
1737 | expr { $$ = exprNode_checkExpr ($1); }
1740 : CIF TLPAREN expr TRPAREN
1742 exprNode_produceGuards ($3); context_enterTrueClause ($3);
1743 exprNode_checkIfPred ($3);
1748 ** not ANSI: | CIF TLPAREN compoundStmt TRPAREN
1749 ** { $$ = $3; context_enterTrueClause (); }
1755 context_exitTrueClause ($1, $2);
1756 $$ = exprNode_if ($1, $2);
1758 | ifPred stmt CELSE { context_enterFalseClause ($1); } stmt
1760 context_exitClause ($1, $2, $5);
1761 $$ = exprNode_ifelse ($1, $2, $5);
1763 | SWITCH TLPAREN expr { context_enterSwitch ($3); }
1764 TRPAREN stmt { $$ = exprNode_switch ($3, $6); }
1767 : WHILE TLPAREN expr TRPAREN
1768 { $$ = exprNode_whilePred ($3); context_enterWhileClause ($3); }
1769 /* not ANSI: | WHILE TLPAREN compoundStmt TRPAREN stmt { $$ = exprNode_while ($3, $5); } */
1772 : WHILE TLPAREN expr TRPAREN { $$ = exprNode_whilePred($3); }
1775 : ITER_NAME { context_enterIterClause (); }
1776 CreateInnerScope TLPAREN { setProcessingIterVars ($1); }
1778 compoundStmt endIter DeleteInnerScope
1780 $$ = exprNode_iter ($1, $6, $8, $9);
1785 : iterArgExpr { $$ = exprNodeList_singleton ($1); }
1786 | iterArgList { nextIterParam (); } TCOMMA iterArgExpr
1787 { $$ = exprNodeList_push ($1, $4); }
1790 : assignIterExpr { $$ = exprNode_iterExpr ($1); }
1791 | id { $$ = exprNode_iterId ($1); }
1792 | TYPE_NAME_OR_ID { uentry ue = coerceIterId ($1);
1794 if (uentry_isValid (ue))
1796 $$ = exprNode_iterId (ue);
1800 $$ = exprNode_iterNewId (cstring_copy (LastIdentifier ()));
1803 | NEW_IDENTIFIER { $$ = exprNode_iterNewId ($1); }
1806 ** everything is the same, EXCEPT it cannot be a NEW_IDENTIFIER
1811 | cconstantExpr CCONSTANT { $$ = exprNode_combineLiterals ($1, $2); }
1815 | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
1819 | postfixExpr TLSQBR expr TRSQBR { $$ = exprNode_arrayFetch ($1, $3); }
1820 | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
1821 | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
1822 | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN
1823 { $$ = exprNode_vaArg ($1, $3, $5); }
1824 | postfixExpr NotType TDOT newId IsType {int tmpMark1; $$ = exprNode_fieldAccess ($1, $3, $4); }
1825 | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
1826 | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
1827 | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
1831 | INC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
1832 | DEC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
1833 | TAMPERSAND castExpr { $$ = exprNode_preOp ($2, $1); }
1834 | TMULT castExpr { $$ = exprNode_preOp ($2, $1); }
1835 | TPLUS castExpr { $$ = exprNode_preOp ($2, $1); }
1836 | TMINUS castExpr { $$ = exprNode_preOp ($2, $1); }
1837 | TTILDE castExpr { $$ = exprNode_preOp ($2, $1); }
1838 | TEXCL castExpr { $$ = exprNode_preOp ($2, $1); }
1839 | sizeofExpr { $$ = $1; }
1843 | TLPAREN typeExpression TRPAREN castExpr { $$ = exprNode_cast ($1, $4, $2); }
1847 | timesExpr TMULT castExpr { $$ = exprNode_op ($1, $3, $2); }
1848 | timesExpr TDIV castExpr { $$ = exprNode_op ($1, $3, $2); }
1849 | timesExpr TPERCENT castExpr { $$ = exprNode_op ($1, $3, $2); }
1853 | plusExpr TPLUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
1854 | plusExpr TMINUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
1858 | shiftExpr LEFT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
1859 | shiftExpr RIGHT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
1863 | relationalExpr TLT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1864 | relationalExpr TGT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1865 | relationalExpr LE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1866 | relationalExpr GE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1869 : relationalIterExpr
1870 | equalityExpr EQ_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
1871 | equalityExpr NE_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
1875 | bitandExpr TAMPERSAND equalityExpr { $$ = exprNode_op ($1, $3, $2); }
1879 | xorExpr TCIRC bitandExpr { $$ = exprNode_op ($1, $3, $2); }
1884 | bitorExpr TBAR xorExpr { $$ = exprNode_op ($1, $3, $2); }
1888 | andExpr AND_OP bitorExpr { $$ = exprNode_op ($1, $3, $2); }
1892 | orExpr OR_OP andExpr { $$ = exprNode_op ($1, $3, $2); }
1896 | orExpr TQUEST { context_enterTrueClause ($1); }
1897 expr TCOLON { context_enterFalseClause ($1); } conditionalExpr
1898 { $$ = exprNode_cond ($1, $4, $7); }
1901 : conditionalIterExpr
1902 | unaryExpr TASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1903 | unaryExpr MUL_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1904 | unaryExpr DIV_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1905 | unaryExpr MOD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1906 | unaryExpr ADD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1907 | unaryExpr SUB_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1908 | unaryExpr LEFT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1909 | unaryExpr RIGHT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1910 | unaryExpr AND_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1911 | unaryExpr XOR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1912 | unaryExpr OR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1915 : ITER_ENDNAME { $$ = $1; }
1916 | /* empty */ { $$ = uentry_undefined; }
1919 : DO { context_enterDoWhileClause (); $$ = $1; }
1923 { $$ = exprNode_while ($1, $2); context_exitWhileClause ($1, $2); }
1924 | doHeader stmt WHILE TLPAREN expr TRPAREN TSEMI
1925 { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); }
1927 { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); }
1930 : whilePred stmtErr { $$ = exprNode_while ($1, $2); context_exitWhileClause ($1, $2); }
1931 | doHeader stmtErr WHILE TLPAREN expr TRPAREN TSEMI
1932 { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); }
1933 | doHeader stmtErr WHILE TLPAREN expr TRPAREN
1934 { $$ = exprNode_doWhile ($2, $5); }
1935 | forPred stmtErr { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); }
1938 : GOTO newId TSEMI { $$ = exprNode_goto ($2); }
1939 | CONTINUE TSEMI { $$ = exprNode_continue ($1, BADTOK); }
1940 | QINNERCONTINUE CONTINUE TSEMI
1941 { $$ = exprNode_continue ($1, QINNERCONTINUE); }
1942 | BREAK TSEMI { $$ = exprNode_break ($1, BADTOK); }
1943 | QSWITCHBREAK BREAK TSEMI { $$ = exprNode_break ($2, QSWITCHBREAK); }
1944 | QLOOPBREAK BREAK TSEMI { $$ = exprNode_break ($2, QLOOPBREAK); }
1945 | QINNERBREAK BREAK TSEMI { $$ = exprNode_break ($2, QINNERBREAK); }
1946 | QSAFEBREAK BREAK TSEMI { $$ = exprNode_break ($2, QSAFEBREAK); }
1947 | RETURN TSEMI { $$ = exprNode_nullReturn ($1); }
1948 | RETURN expr TSEMI { $$ = exprNode_return ($2); }
1964 | ITER_NAME { $$ = uentry_getName ($1); }
1965 | ITER_ENDNAME { $$ = uentry_getName ($1); }
1966 | id { $$ = uentry_getName ($1); }
1967 | TYPE_NAME_OR_ID { $$ = $1; }
1971 | TYPE_NAME_OR_ID { $$ = ctype_unknown; }
1972 | CTYPEOF TLPAREN expr TRPAREN { $$ = exprNode_getType ($3); exprNode_free ($3); }
1973 | CTYPEOF TLPAREN typeExpression TRPAREN { $$ = qtype_getType ($3); }
1977 /*@-redecl@*/ /*@-namechecks@*/
1978 extern char *yytext;
1979 /*@=redecl@*/ /*@=namechecks@*/
1981 # include "bison.reset"
1983 void yyerror (/*@unused@*/ char *s)
1985 static bool givehint = FALSE;
1987 if (context_inIterDef ())
1989 llerror (FLG_SYNTAX, message ("Iter syntax not parseable: %s",
1990 context_inFunctionName ()));
1992 else if (context_inIterEnd ())
1994 llerror (FLG_SYNTAX, message ("Iter finalizer syntax not parseable: %s",
1995 context_inFunctionName ()));
1997 else if (context_inMacro ())
1999 llerror (FLG_SYNTAX, message ("Macro syntax not parseable: %s",
2000 context_inFunctionName ()));
2002 if (context_inUnknownMacro ())
2006 llhint (cstring_makeLiteral
2007 ("Precede macro definition with /*@notfunction@*/ "
2008 "to suppress checking and force expansion"));
2014 context_exitAllClausesQuiet ();
2018 llparseerror (cstring_undefined);