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
328 : externalDef { context_checkGlobalScope (); }
329 | externalDefs externalDef { context_checkGlobalScope (); }
332 : fcnDef optSemi { uentry_clearDecl (); }
333 | constantDecl { uentry_clearDecl (); }
334 | fcnDecl { uentry_clearDecl (); }
335 | iterDecl { uentry_clearDecl (); }
336 | macroDef { uentry_clearDecl (); }
337 | initializer { uentry_checkDecl (); exprNode_free ($1); }
338 | TSEMI { uentry_clearDecl (); lltok_free ($1); /* evans 2002-02-08: okay to have a null statement */ }
339 | error { uentry_clearDecl (); }
342 : QCONSTANT completeTypeSpecifier NotType namedDecl NotType optSemi IsType QENDMACRO
343 { checkConstant ($2, $4); lltok_free2 ($1, $8); }
344 | QCONSTANT completeTypeSpecifier NotType namedDecl NotType TASSIGN IsType init optDeclarators optSemi QENDMACRO
345 { checkValueConstant ($2, $4, $8); lltok_free3 ($1, $6, $11); }
348 : QFUNCTION { context_enterFunctionHeader (); } plainFcn optSemi QENDMACRO
350 declareStaticFunction ($3); context_quietExitFunction ();
351 context_exitFunctionHeader ();
352 lltok_free2 ($1, $5); /*!*/
358 qtype qint = qtype_create (ctype_int);
359 $$ = idDecl_fixBase ($1, qint);
362 | completeTypeSpecifier NotType plainNamedDecl
363 { $$ = idDecl_fixBase ($3, $1); }
367 | pointers plainNamedDeclBase
368 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
371 : newId { $$ = idDecl_create ($1, qtype_unknown ()); }
372 | IsType TLPAREN NotType namedDecl IsType TRPAREN
373 { $$ = idDecl_expectFunction ($4); lltok_free2 ($2, $6); }
374 | namedDeclBase TLSQBR TRSQBR
375 { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1))); lltok_free2 ($2, $3); }
376 | namedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
378 exprNode_findValue ($4);
379 idDecl_notExpectingFunction ($1);
381 if (exprNode_hasValue ($4))
383 $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1),
384 exprNode_getLongValue ($4)));
388 $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1)));
391 lltok_free2 ($2, $5);
393 | namedDeclBase PushType TLPAREN TRPAREN
394 { setCurrentParams (uentryList_missingParams); }
396 { /* need to support globals and modifies here! */
397 ctype ct = ctype_makeFunction (idDecl_getCtype ($1),
398 uentryList_makeMissingParams ());
400 $$ = idDecl_replaceCtype ($1, ct);
402 /*drl 7/25/01 added*/
403 setImplictfcnConstraints();
405 /* functionClauseList_ImplictConstraints($6); */
407 idDecl_addClauses ($$, $6);
409 lltok_free2 ($3, $4);
411 | namedDeclBase PushType TLPAREN genericParamList TRPAREN
412 { setCurrentParams ($4); }
415 setImplictfcnConstraints ();
416 /* functionClauseList_ImplictConstraints($7);*/
417 clearCurrentParams ();
418 $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
419 idDecl_addClauses ($$, $7);
421 lltok_free2 ($3, $5);
425 : newId { $$ = idDecl_create ($1, qtype_unknown ()); }
426 | IsType TLPAREN NotType plainNamedDecl IsType TRPAREN
427 { $$ = idDecl_expectFunction ($4); lltok_free2 ($2, $6); }
428 | plainNamedDeclBase TLSQBR TRSQBR
429 { $$ = idDecl_replaceCtype ($1, ctype_makeInnerArray (idDecl_getCtype ($1)));
430 lltok_free2 ($2, $3);
432 | plainNamedDeclBase TLSQBR IsType constantExpr TRSQBR NotType
436 if (exprNode_hasValue ($4)
437 && multiVal_isInt (exprNode_getValue ($4)))
439 value = (int) multiVal_forceInt (exprNode_getValue ($4));
446 $$ = idDecl_replaceCtype ($1, ctype_makeInnerFixedArray (idDecl_getCtype ($1), value));
447 lltok_free2 ($2, $5);
449 | plainNamedDeclBase PushType TLPAREN TRPAREN
450 { setCurrentParams (uentryList_missingParams); }
453 ctype ct = ctype_makeFunction (idDecl_getCtype ($1),
454 uentryList_makeMissingParams ());
456 $$ = idDecl_replaceCtype ($1, ct);
457 idDecl_addClauses ($$, $6);
459 lltok_free2 ($3, $4);
461 | plainNamedDeclBase PushType TLPAREN genericParamList TRPAREN
462 { setCurrentParams ($4); }
465 clearCurrentParams ();
466 $$ = idDecl_replaceCtype ($1, ctype_makeFunction (idDecl_getCtype ($1), $4));
467 idDecl_addClauses ($$, $7);
470 /*!! lltok_free2 ($3, $5); */
474 : QITER newId TLPAREN genericParamList TRPAREN
475 { setCurrentParams ($4); } functionClausesPlain
476 { clearCurrentParams (); } optSemi QENDMACRO
477 { declareCIter ($2, $4);
478 lltok_free3 ($1, $3, $5);
482 : LLMACRO macroBody TENDMACRO { exprNode_checkMacroBody ($2); lltok_free2 ($1, $3); }
483 | LLMACROITER iterBody TENDMACRO { exprNode_checkIterBody ($2); lltok_free2 ($1, $3); }
484 | LLMACROEND endBody TENDMACRO { exprNode_checkIterEnd ($2); lltok_free2 ($1, $3);}
485 | LLMACRO TENDMACRO /* no stmt */ { exprChecks_checkEmptyMacroBody (); lltok_free2 ($1, $2); }
488 : fcnDefHdrAux { clabstract_declareFunction ($1); }
491 : metaStateSpecifier TASSIGN metaStateExpression
492 { $$ = metaStateConstraint_create ($1, $3); lltok_free ($2); }
495 : BufConstraintSrefExpr { cscanner_expectingMetaStateName (); } TCOLON metaStateName
496 { cscanner_clearExpectingMetaStateName ();
497 $$ = metaStateSpecifier_create ($1, $4);
500 | CTOK_ELIPSIS { cscanner_expectingMetaStateName (); } TCOLON metaStateName
501 { cscanner_clearExpectingMetaStateName ();
502 $$ = metaStateSpecifier_createElipsis ($4);
503 lltok_free2 ($1, $3);
507 : metaStateSpecifier { $$ = metaStateExpression_create ($1); }
508 | metaStateSpecifier TBAR metaStateExpression { $$ = metaStateExpression_createMerge ($1, $3); lltok_free ($2); }
520 : BufConstraint constraintSeperator BufConstraintList { $$ = constraintList_add ($3, $1); }
521 | BufConstraint { $$ = constraintList_single ($1); }
524 : BufConstraintExpr relationalOp BufConstraintExpr {
525 $$ = makeConstraintParse3 ($1, $2, $3);
526 DPRINTF(("Done BufConstraint1\n")); }
539 | BufUnaryOp TLPAREN BufConstraintExpr TRPAREN {$$ = constraintExpr_parseMakeUnaryOp ($1, $3); DPRINTF( ("Got BufConstraintExpr UNary Op ") ); }
540 | TLPAREN BufConstraintExpr BufBinaryOp BufConstraintExpr TRPAREN {
541 DPRINTF( ("Got BufConstraintExpr BINary Op ") );
542 $$ = constraintExpr_parseMakeBinaryOp ($2, $3, $4); }
545 : BufConstraintSrefExpr { $$ = constraintExpr_makeTermsRef ($1);}
546 | CCONSTANT { $$ = constraintExpr_makeIntLiteral (exprNode_getLongValue ($1)); }
548 BufConstraintSrefExpr
550 { /*@-onlytrans@*/ $$ = checkbufferConstraintClausesId ($1); /*@=onlytrans@*/ /*@i523@*/ }
552 { $$ = fixStateClausesId ($1); }
553 | BufConstraintSrefExpr TLSQBR TRSQBR
554 { $$ = sRef_makeAnyArrayFetch ($1); }
555 | BufConstraintSrefExpr TLSQBR CCONSTANT TRSQBR
559 t = cstring_toCharsSafe (exprNode_unparse($3));
562 $$ = sRef_makeArrayFetchKnown ($1, exprNode_getLongValue ($3));
564 | TMULT BufConstraintSrefExpr
565 { $$ = sRef_constructPointer ($2); }
566 | TLPAREN BufConstraintSrefExpr TRPAREN
568 | BufConstraintSrefExpr TDOT newId
569 { cstring_markOwned ($3); $$ = sRef_buildField ($1, $3); }
570 | BufConstraintSrefExpr ARROW_OP newId
571 { cstring_markOwned ($3); $$ = sRef_makeArrow ($1, $3); }
574 | BufConstraintTerm TLSQBR TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
575 | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
576 | TLPAREN specClauseListExpr TRPAREN { $$ = $2; }
577 | specClauseListExpr TDOT newId { cstring_markOwned ($3);
578 $$ = sRef_buildField ($1, $3); }
594 ** Function clauses can appear in any order.
598 : { $$ = functionClauseList_new (); }
599 | functionClause functionClauses
600 { $$ = functionClauseList_prepend ($2, $1); }
603 ** Inside macro definitions, there are no end macros.
608 { $$ = functionClauseList_new (); }
609 | functionClausePlain functionClausesPlain
610 { $$ = functionClauseList_prepend ($2, $1); }
613 : globalsClause { $$ = functionClause_createGlobals ($1); }
614 | modifiesClause { $$ = functionClause_createModifies ($1); }
615 | nomodsClause { $$ = functionClause_createModifies ($1); }
616 | stateClause { $$ = functionClause_createState ($1); }
617 | conditionClause { $$ = $1; }
618 | warnClause { $$ = functionClause_createWarn ($1); }
621 : globalsClausePlain { $$ = functionClause_createGlobals ($1); }
622 | modifiesClausePlain { $$ = functionClause_createModifies ($1); }
623 | nomodsClause { $$ = functionClause_createModifies ($1); }
624 | stateClausePlain { $$ = functionClause_createState ($1); }
625 | conditionClausePlain { $$ = $1; }
626 | warnClausePlain { $$ = functionClause_createWarn ($1); }
629 : globalsClausePlain QENDMACRO { $$ = $1; }
632 : QGLOBALS { setProcessingGlobalsList (); }
635 unsetProcessingGlobals ();
636 $$ = globalsClause_create ($1, $3);
640 : QNOMODS { $$ = modifiesClause_createNoMods ($1); }
643 : modifiesClausePlain QENDMACRO { $$ = $1; }
648 context_setProtectVars (); enterParamsTemp ();
649 sRef_setGlobalScopeSafe ();
654 sRef_clearGlobalScopeSafe ();
655 context_releaseVars ();
656 $$ = modifiesClause_create ($1, $3);
661 { $$ = flagSpec_createPlain ($1); }
662 | flagId TBAR flagSpec
663 { $$ = flagSpec_createOr ($1, $3); }
670 | /* empty */ { $$ = warnClause_undefined; }
673 : warnClausePlain QENDMACRO { $$ = $1; }
676 : QWARN flagSpec cconstantExpr
678 llassert (exprNode_knownStringValue ($3));
679 $$ = warnClause_create ($1, $2, cstring_copy (multiVal_forceString (exprNode_getValue ($3))));
683 { $$ = warnClause_create ($1, $2, cstring_undefined); }
686 : globIdListExpr { $$ = globSet_single ($1); }
687 | globIdList TCOMMA globIdListExpr { $$ = globSet_insert ($1, $3); }
690 : optGlobQuals globId { $$ = clabstract_createGlobal ($2, $1); }
693 : /* empty */ { $$ = qualList_undefined; }
694 | globQual optGlobQuals { $$ = qualList_add ($2, $1); }
697 : id { $$ = uentry_getSref ($1); }
698 | NEW_IDENTIFIER { $$ = clabstract_unrecognizedGlobal ($1); }
699 | initializer { $$ = clabstract_checkGlobal ($1); }
702 : QUNDEF { $$ = qual_createUndef (); }
703 | QKILLED { $$ = qual_createKilled (); }
704 | QOUT { $$ = qual_createOut (); }
705 | QIN { $$ = qual_createIn (); }
706 | QPARTIAL { $$ = qual_createPartial (); }
722 /**!!! deal with fred; fred (int); declarations! **/
723 qtype qint = qtype_create (ctype_int);
724 $$ = idDecl_fixBase ($1, qint);
727 | completeTypeSpecifier NotType namedDecl
728 { $$ = idDecl_fixBase ($3, $1); }
731 : TLBRACE { checkDoneParams (); context_enterInnerContext (); }
734 exprNode_checkFunctionBody ($3); $$ = $3;
735 context_exitInner ($3);
737 | { context_enterOldStyleScope (); } initializerList
738 { oldStyleDoneParams (); context_enterInnerContext (); }
741 exprNode_checkFunctionBody ($4);
742 $$ = $4; /* oldstyle */
743 context_exitInner ($4);
749 context_setFunctionDefined (exprNode_loc ($2));
750 exprNode_checkFunction (context_getHeader (), $2);
753 context_exitFunction ();
757 : modList optSemi { $$ = $1; }
758 | optSemi { $$ = sRefSet_new (); }
761 : id { $$ = uentry_getSref ($1); checkModifiesId ($1); }
762 | NEW_IDENTIFIER { $$ = fixModifiesId ($1); }
763 | modListExpr TLSQBR TRSQBR { $$ = modListArrayFetch ($1, sRef_undefined); }
764 | modListExpr TLSQBR mExpr TRSQBR { $$ = modListArrayFetch ($1, $3); }
765 | TMULT modListExpr { $$ = modListPointer ($2); }
766 | TLPAREN modListExpr TRPAREN { $$ = $2; }
767 | modListExpr TDOT newId { $$ = modListFieldAccess ($1, $3); }
768 | modListExpr ARROW_OP newId { $$ = modListArrowAccess ($1, $3); }
772 : modListExpr { $$ = $1; }
773 | cconstantExpr { $$ = sRef_makeUnknown (); /* sRef_makeConstant ($1); ? */ }
777 : modListExpr { $$ = sRefSet_single ($1); }
778 | modList TCOMMA modListExpr { $$ = sRefSet_insert ($1, $3); }
782 { $$ = checkStateClausesId ($1); }
784 { $$ = fixStateClausesId ($1); }
785 | specClauseListExpr TLSQBR TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
786 | specClauseListExpr TLSQBR mExpr TRSQBR { $$ = sRef_makeAnyArrayFetch ($1); }
787 | TMULT specClauseListExpr { $$ = sRef_constructPointer ($2); }
788 | TLPAREN specClauseListExpr TRPAREN { $$ = $2; }
789 | specClauseListExpr TDOT newId { cstring_markOwned ($3);
790 $$ = sRef_buildField ($1, $3); }
791 | specClauseListExpr ARROW_OP newId { cstring_markOwned ($3);
792 $$ = sRef_makeArrow ($1, $3); }
795 : /* empty */ { $$ = sRefSet_undefined }
800 { if (sRef_isValid ($1)) { $$ = sRefSet_single ($1); }
801 else { $$ = sRefSet_undefined; }
803 | specClauseList TCOMMA specClauseListExpr
804 { if (sRef_isValid ($3))
806 $$ = sRefSet_insert ($1, $3);
815 : id { $$ = exprNode_fromIdentifier ($1); }
816 | NEW_IDENTIFIER { $$ = exprNode_fromUIO ($1); }
818 | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
819 | TYPE_NAME_OR_ID { $$ = exprNode_fromIdentifier (coerceId ($1)); }
820 | QEXTENSION { $$ = exprNode_makeError (); }
821 | TLPAREN { exprChecks_inCompoundStatementExpression (); }
823 { exprChecks_leaveCompoundStatementExpression (); $$ = exprNode_compoundStatementExpression ($1, $3); }
827 | postfixExpr TLSQBR expr TRSQBR { $$ = exprNode_arrayFetch ($1, $3); }
828 | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
829 | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
830 | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN { $$ = exprNode_vaArg ($1, $3, $5); }
831 | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $3, $4); }
832 | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
833 | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
834 | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
835 | TLPAREN typeExpression TRPAREN TLBRACE typeInitializerList optComma TRBRACE
836 { /* added for C99 */ $$ = exprNode_undefined; /*@i87 no checking */ }
839 : assignExpr { $$ = exprNodeList_singleton ($1); }
840 | argumentExprList TCOMMA assignExpr { $$ = exprNodeList_push ($1, $3); }
844 | INC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
845 | DEC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
846 | TAMPERSAND castExpr { $$ = exprNode_preOp ($2, $1); }
847 | TMULT castExpr { $$ = exprNode_preOp ($2, $1); }
848 | TPLUS castExpr { $$ = exprNode_preOp ($2, $1); }
849 | TMINUS castExpr { $$ = exprNode_preOp ($2, $1); }
850 | TTILDE castExpr { $$ = exprNode_preOp ($2, $1); }
851 | TEXCL castExpr { $$ = exprNode_preOp ($2, $1); }
852 | sizeofExpr { $$ = $1; }
853 | offsetofExpr { $$ = $1; }
856 : fieldDesignator TDOT newId { $$ = cstringList_add ($1, $3); lltok_free ($2); }
857 | fieldDesignator TLSQBR expr TRSQBR { $$ = $1; lltok_free2 ($2, $4); }
858 /* evans 2002-07-02: offsetof designators can use array indexes */
859 | newId { $$ = cstringList_single ($1); }
862 : COFFSETOF IsType TLPAREN typeExpression NotType TCOMMA fieldDesignator TRPAREN IsType
863 { $$ = exprNode_offsetof ($4, $7);
864 lltok_free3 ($1, $3, $6); lltok_free ($8); }
867 : IsType { context_setProtectVars (); }
868 sizeofExprAux { context_sizeofReleaseVars (); $$ = $3; }
871 : CSIZEOF TLPAREN typeExpression TRPAREN { $$ = exprNode_sizeofType ($3); lltok_free3 ($1, $2, $4); }
872 | CSIZEOF unaryExpr { $$ = exprNode_sizeofExpr ($2); lltok_free ($1); }
873 | CALIGNOF TLPAREN typeExpression TRPAREN { $$ = exprNode_alignofType ($3); lltok_free3 ($1, $2, $4); }
874 | CALIGNOF unaryExpr { $$ = exprNode_alignofExpr ($2); lltok_free ($1); }
878 | TLPAREN typeExpression TRPAREN castExpr
879 { $$ = exprNode_cast ($1, $4, $2); lltok_free ($3); }
883 | timesExpr TMULT castExpr { $$ = exprNode_op ($1, $3, $2); }
884 | timesExpr TDIV castExpr { $$ = exprNode_op ($1, $3, $2); }
885 | timesExpr TPERCENT castExpr { $$ = exprNode_op ($1, $3, $2); }
889 | plusExpr TPLUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
890 | plusExpr TMINUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
894 | shiftExpr LEFT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
895 | shiftExpr RIGHT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
899 | relationalExpr TLT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
900 | relationalExpr TGT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
901 | relationalExpr LE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
902 | relationalExpr GE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
906 | equalityExpr EQ_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
907 | equalityExpr NE_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
911 | bitandExpr TAMPERSAND equalityExpr { $$ = exprNode_op ($1, $3, $2); }
915 | xorExpr TCIRC bitandExpr { $$ = exprNode_op ($1, $3, $2); }
920 | bitorExpr TBAR xorExpr { $$ = exprNode_op ($1, $3, $2); }
925 { exprNode_produceGuards ($1);
926 context_enterAndClause ($1);
930 $$ = exprNode_op ($1, $4, $2);
931 context_exitAndClause ($$, $4);
938 exprNode_produceGuards ($1);
939 context_enterOrClause ($1);
943 $$ = exprNode_op ($1, $4, $2);
944 context_exitOrClause ($$, $4);
949 | orExpr TQUEST { exprNode_produceGuards ($1); context_enterTrueClause ($1); } expr TCOLON
950 { context_enterFalseClause ($1); } conditionalExpr
951 { $$ = exprNode_cond ($1, $4, $7); context_exitClause ($1, $4, $7); }
955 | unaryExpr TASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
956 | unaryExpr MUL_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
957 | unaryExpr DIV_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
958 | unaryExpr MOD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
959 | unaryExpr ADD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
960 | unaryExpr SUB_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
961 | unaryExpr LEFT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
962 | unaryExpr RIGHT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
963 | unaryExpr AND_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
964 | unaryExpr XOR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
965 | unaryExpr OR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
969 | expr TCOMMA assignExpr { $$ = exprNode_comma ($1, $3); }
972 : /* empty */ { $$ = exprNode_undefined; }
978 /* instance_orTypeDecl_and_possible_initialization */
981 : instanceDecl { $$ = $1; }
982 | VA_DCL { doVaDcl (); $$ = exprNode_makeError (); }
983 | typeDecl { $$ = exprNode_makeError (); }
986 : completeTypeSpecifier IsType TSEMI
987 { $$ = exprNode_makeError (); }
989 ** This causes r/r conflicts with function definitions.
990 ** Instead we need to snarf one first. (gack)
992 ** | completeTypeSpecifier { setProcessingVars ($1); }
994 ** namedInitializerList IsType TSEMI
995 ** { unsetProcessingVars (); }
998 ** the solution is pretty ugly:
1000 | completeTypeSpecifier NotType namedDecl NotType
1002 setProcessingVars ($1);
1003 processNamedDecl ($3);
1005 IsType optDeclarators TSEMI IsType
1007 unsetProcessingVars ();
1008 $$ = exprNode_makeEmptyInitialization ($3);
1009 DPRINTF (("Empty initialization: %s", exprNode_unparse ($$)));
1011 | completeTypeSpecifier NotType namedDecl NotType TASSIGN
1012 { setProcessingVars ($1); processNamedDecl ($3); }
1013 IsType init optDeclarators TSEMI IsType
1014 { $$ = exprNode_concat ($9, exprNode_makeInitialization ($3, $8));
1015 unsetProcessingVars ();
1021 processNamedDecl ($1);
1022 $$ = exprNode_makeEmptyInitialization ($1);
1024 | namedDecl NotType TASSIGN { processNamedDecl ($1); } IsType init
1025 { $$ = exprNode_makeInitialization ($1, $6); }
1028 : CTYPEDEF completeTypeSpecifier { setProcessingTypedef ($2); }
1029 NotType namedInitializerList IsType optWarnClause TSEMI
1030 { clabstract_declareType ($5, $7); }
1031 | CTYPEDEF completeTypeSpecifier IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
1032 | CTYPEDEF namedInitializerList IsType TSEMI { /* in the ANSI grammar, semantics unclear */ }
1035 : { g_expectingTypeName = TRUE; }
1038 : { g_expectingTypeName = TRUE; context_pushLoc (); }
1040 namedInitializerList
1041 : namedInitializerListAux IsType { $$ = $1; }
1043 namedInitializerListAux
1044 : namedInitializer { $$ = exprNodeList_singleton ($1); }
1045 | namedInitializerList TCOMMA NotType namedInitializer { $$ = exprNodeList_push ($1, $4); }
1048 : /* empty */ { $$ = exprNode_makeError (); }
1049 | optDeclarators TCOMMA NotType namedInitializer { $$ = exprNode_concat ($1, $4); }
1053 | TLBRACE initList TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); lltok_free ($3); }
1054 | TLBRACE initList TCOMMA TRBRACE { $$ = exprNode_makeInitBlock ($1, $2); lltok_free2 ($3, $4); }
1055 | designation init { $$ = exprNode_undefined; }
1058 ** Splint parses these (added in ISO C99), but no checking yet...
1062 : designatorList TASSIGN { $$ = $1; }
1063 | newId TCOLON { $$ = exprNode_undefined;
1064 /* gcc extension, obsolete since 2.5 */ }
1067 : designator { $$ = exprNode_undefined; }
1068 | designatorList designator { $$ = exprNode_undefined; }
1071 : TLSQBR constantExpr TRSQBR { $$ = exprNode_undefined; }
1072 | TDOT newId { $$ = exprNode_undefined; }
1076 { $$ = exprNodeList_singleton ($1); }
1077 | initList TCOMMA init
1078 { $$ = exprNodeList_push ($1, $3); }
1081 ** need to do the storage class global hack so tags are
1082 ** declared with the right storage class.
1086 : QEXTERN { setStorageClass (SCEXTERN); $$ = qual_createExtern (); }
1087 | QINLINE { $$ = qual_createInline (); }
1088 | QSTATIC { setStorageClass (SCSTATIC); $$ = qual_createStatic (); }
1089 | QAUTO { $$ = qual_createAuto (); }
1090 | QREGISTER { $$ = qual_createRegister (); }
1093 : stateClausePlain QENDMACRO { $$ = $1; }
1098 context_setProtectVars ();
1100 sRef_setGlobalScopeSafe ();
1102 specClauseList optSemi IsType
1105 sRef_clearGlobalScopeSafe ();
1106 context_releaseVars ();
1107 $$ = stateClause_createPlain ($1, $4);
1111 : conditionClausePlain QENDMACRO { $$ = $1; }
1113 startConditionClause
1114 : conditionTag NotType { $$ = $1; context_enterFunctionHeader (); }
1116 conditionClausePlain
1117 : startConditionClause stateQualifier
1119 context_exitFunctionHeader ();
1120 context_setProtectVars ();
1122 sRef_setGlobalScopeSafe ();
1124 optSpecClauseList optSemi IsType
1127 sRef_clearGlobalScopeSafe ();
1128 context_releaseVars ();
1129 $$ = functionClause_createState (stateClause_create ($1, $2, $4));
1131 | startConditionClause
1133 context_setProtectVars ();
1135 sRef_setGlobalScopeSafe ();
1137 functionConstraint optSemi IsType
1139 context_exitFunctionHeader ();
1141 sRef_clearGlobalScopeSafe ();
1142 context_releaseVars ();
1143 DPRINTF (("done optGlobBufConstraintsAux\n"));
1145 if (lltok_isEnsures ($1))
1147 $$ = functionClause_createEnsures ($3);
1149 else if (lltok_isRequires ($1))
1151 $$ = functionClause_createRequires ($3);
1158 DPRINTF (("FunctionclauseS: %s", functionClause_unparse ($$)));
1162 : BufConstraintList { $$ = functionConstraint_createBufferConstraint ($1); }
1163 | metaStateConstraint { $$ = functionConstraint_createMetaStateConstraint ($1); DPRINTF (("Made constraint: %s", functionConstraint_unparse ($$))); }
1166 : QEXITS { $$ = qual_createExits (); }
1167 | QMAYEXIT { $$ = qual_createMayExit (); }
1168 | QTRUEEXIT { $$ = qual_createTrueExit (); }
1169 | QFALSEEXIT { $$ = qual_createFalseExit (); }
1170 | QNEVEREXIT { $$ = qual_createNeverExit (); }
1173 : QCHECKED { $$ = qual_createChecked (); }
1174 | QCHECKMOD { $$ = qual_createCheckMod (); }
1175 | QUNCHECKED { $$ = qual_createUnchecked (); }
1176 | QCHECKEDSTRICT { $$ = qual_createCheckedStrict (); }
1179 : QOWNED { $$ = qual_createOwned (); }
1180 | QDEPENDENT { $$ = qual_createDependent (); }
1181 | QYIELD { $$ = qual_createYield (); }
1182 | QTEMP { $$ = qual_createTemp (); }
1183 | QONLY { $$ = qual_createOnly (); }
1184 | QKEEP { $$ = qual_createKeep (); }
1185 | QKEPT { $$ = qual_createKept (); }
1186 | QSHARED { $$ = qual_createShared (); }
1187 | QUNIQUE { $$ = qual_createUnique (); }
1188 | QNULL { $$ = qual_createNull (); }
1189 | QISNULL { $$ = qual_createIsNull (); }
1190 | QRELNULL { $$ = qual_createRelNull (); }
1191 | QNOTNULL { $$ = qual_createNotNull (); }
1192 | QEXPOSED { $$ = qual_createExposed (); }
1193 | QOBSERVER { $$ = qual_createObserver (); }
1194 | QNULLTERMINATED { $$ = qual_createNullTerminated (); }
1195 | CANNOTATION { $$ = qual_createMetaState ($1); }
1199 : QRETURNED { $$ = qual_createReturned (); }
1200 | QSEF { $$ = qual_createSef (); }
1203 : QUNUSED { $$ = qual_createUnused (); }
1204 | QEXTERNAL { $$ = qual_createExternal (); }
1207 : QTRUENULL { $$ = qual_createTrueNull (); }
1208 | QFALSENULL { $$ = qual_createFalseNull (); }
1211 : QABSTRACT { $$ = qual_createAbstract (); }
1212 | QCONCRETE { $$ = qual_createConcrete (); }
1213 | QMUTABLE { $$ = qual_createMutable (); }
1214 | QIMMUTABLE { $$ = qual_createImmutable (); }
1217 : QREFCOUNTED { $$ = qual_createRefCounted (); }
1218 | QREFS { $$ = qual_createRefs (); }
1219 | QKILLREF { $$ = qual_createKillRef (); }
1220 | QRELDEF { $$ = qual_createRelDef (); }
1221 | QNEWREF { $$ = qual_createNewRef (); }
1222 | QTEMPREF { $$ = qual_createTempRef (); }
1225 : QSHORT { $$ = qual_createShort (); }
1226 | QLONG { $$ = qual_createLong (); }
1227 | QSIGNED { $$ = qual_createSigned (); }
1228 | QUNSIGNED { $$ = qual_createUnsigned (); }
1231 : QOUT { $$ = qual_createOut (); }
1232 | QIN { $$ = qual_createIn (); }
1233 | QPARTIAL { $$ = qual_createPartial (); }
1234 | QSPECIAL { $$ = qual_createSpecial (); }
1237 : QCONST IsType { $$ = qual_createConst (); }
1238 | QVOLATILE IsType { $$ = qual_createVolatile (); }
1239 | QRESTRICT IsType { $$ = qual_createRestrict (); }
1240 | definedQualifier IsType { $$ = $1; }
1241 | stateQualifier IsType { $$ = $1; }
1242 | exitsQualifier IsType { $$ = $1; }
1243 | paramQualifier IsType { $$ = $1; }
1244 | checkQualifier IsType { $$ = $1; }
1245 | returnQualifier IsType { $$ = $1; }
1246 | visibilityQualifier IsType { $$ = $1; }
1247 | typedefQualifier IsType { $$ = $1; }
1248 | refcountQualifier IsType { $$ = $1; }
1251 ** This is copied into the mtgrammar!
1261 | QANYTYPE NotType { $$ = ctype_makeAnytype (); }
1262 | QINTEGRALTYPE NotType { $$ = ctype_anyintegral; }
1263 | QUNSIGNEDINTEGRALTYPE NotType { $$ = ctype_unsignedintegral; }
1264 | QSIGNEDINTEGRALTYPE NotType { $$ = ctype_signedintegral; }
1268 | typeModifier NotType { $$ = ctype_fromQual ($1); }
1271 : IsType completeTypeSpecifier IsType
1272 { $$ = qtype_resolve ($2); }
1274 completeTypeSpecifier
1275 : completeTypeSpecifierAux { $$ = $1; }
1276 | completeTypeSpecifierAux QALT altType QENDMACRO
1277 { $$ = qtype_mergeAlt ($1, $3); }
1281 | typeExpression TCOMMA altType
1282 { $$ = qtype_mergeAlt ($1, $3); }
1284 completeTypeSpecifierAux
1285 : storageSpecifier optCompleteType { $$ = qtype_addQual ($2, $1); }
1286 | typeQualifier optCompleteType { $$ = qtype_addQual ($2, $1); }
1287 | typeSpecifier optCompleteType { $$ = qtype_combine ($2, $1); }
1290 : /* empty */ { $$ = qtype_unknown (); }
1291 | completeTypeSpecifier { $$ = $1; }
1295 : /* empty */ { $$ = constraintList_undefined; }
1296 /* drl commenting before a CVS commit
1297 | QINVARIANT BufConstraintList QENDMACRO { $$ = $2 }
1300 : NotType CSTRUCT newId IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1301 CreateStructInnerScope
1302 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1305 { ctype ct; ct = declareStruct ($3, $8); setGlobalStructInfo(ct, $12); $$ = ct; }
1306 | NotType CUNION newId IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1307 CreateStructInnerScope
1308 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1310 { $$ = declareUnion ($3, $8); }
1311 | NotType CSTRUCT newId IsType TLBRACE TRBRACE
1312 { $$ = declareStruct ($3, uentryList_new ()); }
1313 | NotType CUNION newId IsType TLBRACE TRBRACE
1314 { $$ = declareUnion ($3, uentryList_new ()); }
1315 | NotType CSTRUCT IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1316 CreateStructInnerScope
1317 structDeclList DeleteStructInnerScope { sRef_clearGlobalScopeSafe (); }
1319 { $$ = declareUnnamedStruct ($7); }
1320 | NotType CUNION IsType TLBRACE { sRef_setGlobalScopeSafe (); }
1321 CreateStructInnerScope structDeclList DeleteStructInnerScope
1322 { sRef_clearGlobalScopeSafe (); }
1324 { $$ = declareUnnamedUnion ($7); }
1325 | NotType CSTRUCT IsType TLBRACE TRBRACE
1326 { $$ = ctype_createUnnamedStruct (uentryList_new ()); }
1327 | NotType CUNION IsType TLBRACE TRBRACE
1328 { $$ = ctype_createUnnamedUnion (uentryList_new ()); }
1329 | NotType CSTRUCT newId NotType { $$ = handleStruct ($3); }
1330 | NotType CUNION newId NotType { $$ = handleUnion ($3); }
1333 : { g_expectingTypeName = FALSE; }
1337 | macroDef { $$ = uentryList_undefined; /* bogus! */ }
1338 | structDeclList structDecl { $$ = uentryList_mergeFields ($1, $2); }
1341 : completeTypeSpecifier NotType structNamedDeclList IsType TSEMI
1342 { $$ = fixUentryList ($3, $1); }
1343 | completeTypeSpecifier IsType TSEMI
1344 { $$ = fixUnnamedDecl ($1); }
1347 : structNamedDecl NotType
1348 { $$ = idDeclList_singleton ($1); }
1349 | structNamedDeclList TCOMMA structNamedDecl NotType
1350 { $$ = idDeclList_add ($1, $3); }
1352 structNamedDecl /* hack to get around namespace problems */
1353 : namedDecl { $$ = $1; }
1354 | TCOLON IsType constantExpr { $$ = idDecl_undefined; }
1355 | namedDecl TCOLON IsType constantExpr { $$ = $1; }
1356 /* Need the IsType in case there is a cast in the constant expression. */
1359 : NotType CENUM TLBRACE enumeratorList TRBRACE IsType
1360 { $$ = declareUnnamedEnum ($4); }
1361 | NotType CENUM newId TLBRACE { context_pushLoc (); } enumeratorList TRBRACE IsType
1362 { context_popLoc (); $$ = declareEnum ($3, $6); }
1363 | NotType CENUM newId IsType { $$ = handleEnum ($3); }
1367 { $$ = enumNameList_single ($1); }
1368 | enumeratorList TCOMMA enumerator
1369 { $$ = enumNameList_push ($1, $3); }
1370 | enumeratorList TCOMMA
1374 { uentry ue = uentry_makeEnumConstant ($1, ctype_unknown);
1375 usymtab_supGlobalEntry (ue);
1378 | newId TASSIGN IsType constantExpr
1379 { uentry ue = uentry_makeEnumInitializedConstant ($1, ctype_unknown, $4);
1380 usymtab_supGlobalEntry (ue);
1386 | optAbstractDeclBase { $$ = idDecl_create (cstring_undefined, qtype_create ($1)); }
1387 | pointers TYPE_NAME
1389 qtype qt = qtype_unknown ();
1390 qtype_adjustPointers ($1, qt);
1391 $$ = idDecl_create (cstring_copy (cscanner_observeLastIdentifier ()), qt);
1393 | pointers optNamedDecl
1394 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
1398 | pointers namedDeclBase
1399 { $$ = $2; qtype_adjustPointers ($1, idDecl_getTyp ($$)); }
1402 : paramTypeList { $$ = handleParamTypeList ($1); }
1403 | NotType paramIdList { $$ = handleParamIdList ($2); }
1406 : QCONST { $$ = qual_createConst (); }
1407 | QRESTRICT { $$ = qual_createRestrict (); }
1408 | QVOLATILE { $$ = qual_createVolatile (); }
1411 : innerMods { $$ = qualList_single ($1); }
1412 | innerModsList innerMods { $$ = qualList_add ($1, $2); }
1415 : TMULT { $$ = pointers_create ($1); }
1416 | TMULT innerModsList { $$ = pointers_createMods ($1, $2); }
1417 | TMULT pointers { $$ = pointers_extend (pointers_create ($1), $2); }
1418 | TMULT innerModsList pointers { $$ = pointers_extend (pointers_createMods ($1, $2), $3); }
1422 | idList TCOMMA CTOK_ELIPSIS { $$ = uentryList_add ($1, uentry_makeElipsisMarker ()); }
1425 : newId { $$ = uentryList_single (uentry_makeVariableLoc ($1, ctype_int)); }
1426 | idList TCOMMA newId { $$ = uentryList_add ($1, uentry_makeVariableLoc ($3, ctype_int)); }
1429 : CTOK_ELIPSIS { $$ = uentryList_single (uentry_makeElipsisMarker ()); }
1431 | paramList TCOMMA CTOK_ELIPSIS { $$ = uentryList_add ($1, uentry_makeElipsisMarker ()); }
1434 : { storeLoc (); } paramDecl { $$ = uentryList_single ($2); }
1435 | paramList TCOMMA { storeLoc (); } paramDecl
1436 { $$ = uentryList_add ($1, $4); }
1439 : IsType completeTypeSpecifier optNamedDecl IsType
1441 if (isFlipOldStyle ())
1443 llparseerror (cstring_makeLiteral ("Inconsistent function parameter syntax (mixing old and new style declaration)"));
1449 $$ = makeCurrentParam (idDecl_fixParamBase ($3, $2));
1451 | newId /* its an old-style declaration */
1453 idDecl tparam = idDecl_create ($1, qtype_unknown ());
1457 llparseerror (message ("Inconsistent function parameter syntax: %q",
1458 idDecl_unparse (tparam)));
1462 $$ = makeCurrentParam (tparam);
1463 idDecl_free (tparam);
1468 | completeType abstractDecl { $$ = qtype_newBase ($1, $2); }
1471 : pointers { $$ = ctype_adjustPointers ($1, ctype_unknown); }
1473 | pointers abstractDeclBase { $$ = ctype_adjustPointers ($1, $2); }
1476 : /* empty */ { $$ = ctype_unknown; }
1480 : IsType TLPAREN NotType abstractDecl TRPAREN
1481 { $$ = ctype_expectFunction ($4); }
1482 | TLSQBR TRSQBR { $$ = ctype_makeArray (ctype_unknown); }
1483 | TLSQBR constantExpr TRSQBR
1484 { $$ = ctype_makeFixedArray (ctype_unknown, exprNode_getLongValue ($2)); }
1485 | abstractDeclBase TLSQBR TRSQBR { $$ = ctype_makeInnerArray ($1); }
1486 | abstractDeclBase TLSQBR constantExpr TRSQBR
1487 { $$ = ctype_makeInnerFixedArray ($1, exprNode_getLongValue ($3)); }
1488 | IsType TLPAREN TRPAREN
1489 { $$ = ctype_makeFunction (ctype_unknown, uentryList_makeMissingParams ()); }
1490 | IsType TLPAREN paramTypeList TRPAREN
1491 { $$ = ctype_makeParamsFunction (ctype_unknown, $3); }
1492 | abstractDeclBase IsType TLPAREN TRPAREN
1493 { $$ = ctype_makeFunction ($1, uentryList_makeMissingParams ()); }
1494 | abstractDeclBase IsType TLPAREN paramTypeList TRPAREN
1495 { $$ = ctype_makeParamsFunction ($1, $4); }
1512 : iterDefStmtList { $$ = $1; }
1519 | iterDefStmtList iterDefStmt
1520 { $$ = exprNode_concat ($1, $2); }
1522 iterDefIterationStmt
1523 : iterWhilePred iterDefStmtList
1524 { $$ = exprNode_while ($1, $2); }
1525 | doHeader stmtErr WHILE TLPAREN expr TRPAREN TSEMI
1526 { $$ = exprNode_doWhile ($2, $5); }
1527 | doHeader stmtErr WHILE TLPAREN expr TRPAREN
1528 { $$ = exprNode_doWhile ($2, $5); }
1529 | forPred iterDefStmt
1530 { $$ = exprNode_for ($1, $2); }
1533 : CFOR TLPAREN optExpr TSEMI optExpr TSEMI
1534 { context_setProtectVars (); } optExpr { context_sizeofReleaseVars (); }
1536 { $$ = exprNode_forPred ($3, $5, $8);
1537 context_enterForClause ($5); }
1540 : ITER_NAME CreateInnerScope TLPAREN
1541 { setProcessingIterVars ($1); }
1543 { $$ = exprNode_iterStart ($1, $5); }
1544 | ITER_ENDNAME { $$ = exprNode_createId ($1); }
1550 | openScope initializerList { $$ = $1; DPRINTF (("def stmt: %s", exprNode_unparse ($$))); }
1555 | iterDefIterationStmt
1558 | TLPAREN iterDefStmt TRPAREN { $$ = $2; }
1559 | error { $$ = exprNode_makeError (); }
1562 : ifPred { exprNode_checkIfPred ($1); } iterDefStmt
1563 { /* don't: context_exitTrueClause ($1, $2); */
1564 $$ = exprNode_if ($1, $3);
1568 : CreateInnerScope TLBRACE { $$ = exprNode_createTok ($2); }
1571 : DeleteInnerScopeSafe TRBRACE { $$ = exprNode_createTok ($2); }
1586 | TLPAREN stmtErr TRPAREN { $$ = exprNode_addParens ($1, $2); }
1588 | error { $$ = exprNode_makeError (); }
1591 : newId TCOLON { $$ = exprNode_labelMarker ($1); }
1592 | QNOTREACHED stmt { $$ = exprNode_notReached ($2); }
1595 ** We allow more than one QFALLTHROUGH token to support mixed lint/splint markers.
1598 optExtraFallThroughs
1600 | QFALLTHROUGH optExtraFallThroughs { ; }
1602 /* Note that we can semantically check that the object to the case is
1603 indeed constant. In this case, we may not want to go through this effort */
1606 : CASE constantExpr { context_enterCaseClause ($2); }
1607 TCOLON { $$ = exprNode_caseMarker ($2, FALSE); }
1608 | QFALLTHROUGH optExtraFallThroughs CASE constantExpr { context_enterCaseClause ($4); }
1609 TCOLON { $$ = exprNode_caseMarker ($4, TRUE); }
1612 : DEFAULT { context_enterCaseClause (exprNode_undefined); }
1613 TCOLON { $$ = exprNode_defaultMarker ($1, FALSE); }
1614 | QFALLTHROUGH optExtraFallThroughs DEFAULT { context_enterCaseClause (exprNode_undefined); }
1615 TCOLON { $$ = exprNode_defaultMarker ($3, TRUE); }
1618 : TLPAREN compoundStmt TRPAREN { $$ = $2; }
1619 | CreateInnerScope compoundStmtAux
1620 { $$ = $2; context_exitInner ($2); }
1623 : CreateInnerScope compoundStmtAuxErr DeleteInnerScope { $$ = $2; }
1626 : { context_enterInnerContext (); }
1629 : { context_exitInnerPlain (); }
1631 CreateStructInnerScope
1632 : { context_enterStructInnerContext (); }
1634 DeleteStructInnerScope
1635 : { context_exitStructInnerContext (); }
1637 DeleteInnerScopeSafe
1638 : { context_exitInnerSafe (); }
1641 : TRBRACE { $$ = exprNode_createTok ($1); }
1642 | QNOTREACHED TRBRACE { $$ = exprNode_notReached (exprNode_createTok ($2)); }
1643 | stmtList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); }
1644 | stmtList QNOTREACHED TRBRACE
1645 { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); }
1646 | initializerList TRBRACE { $$ = exprNode_updateLocation ($1, lltok_getLoc ($2)); }
1647 | initializerList QNOTREACHED TRBRACE
1648 { $$ = exprNode_notReached (exprNode_updateLocation ($1, lltok_getLoc ($3))); }
1649 | initializerList stmtList TRBRACE
1650 { $$ = exprNode_updateLocation (exprNode_concat ($1, $2), lltok_getLoc ($3)); }
1651 | initializerList stmtList QNOTREACHED TRBRACE
1652 { $$ = exprNode_notReached (exprNode_updateLocation (exprNode_concat ($1, $2),
1653 lltok_getLoc ($3)));
1657 : TLBRACE compoundStmtRest
1658 { $$ = exprNode_makeBlock ($2); }
1662 { $$ = exprNode_createTok ($2); }
1663 | TLBRACE stmtListErr TRBRACE
1664 { $$ = exprNode_updateLocation ($2, lltok_getLoc ($3)); }
1665 | TLBRACE initializerList TRBRACE
1666 { $$ = exprNode_updateLocation ($2, lltok_getLoc ($3)); }
1667 | TLBRACE initializerList stmtList TRBRACE
1668 { $$ = exprNode_updateLocation (exprNode_concat ($2, $3), lltok_getLoc ($4)); }
1672 | stmtListErr stmtErr { $$ = exprNode_concat ($1, $2); }
1675 : initializer { $$ = $1; }
1676 | initializerList initializer { $$ = exprNode_concat ($1, $2); }
1679 : typeInitializer { $$ = $1; }
1680 | typeInitializerList TCOMMA typeInitializer { $$ = exprNode_concat ($1, $3); }
1683 : assignExpr { $$ = $1; }
1684 | TLBRACE typeInitializerList optComma TRBRACE { $$ = $2; }
1688 | stmtList stmt { $$ = exprNode_concat ($1, $2); }
1691 : TSEMI { $$ = exprNode_createTok ($1); }
1692 | expr TSEMI { $$ = exprNode_statement ($1, $2); }
1695 : TSEMI { $$ = exprNode_createTok ($1); }
1696 | expr TSEMI { $$ = exprNode_statement ($1, $2); }
1697 | expr { $$ = exprNode_checkExpr ($1); }
1700 : CIF TLPAREN expr TRPAREN
1702 exprNode_produceGuards ($3); context_enterTrueClause ($3);
1703 exprNode_checkIfPred ($3);
1708 ** not ANSI: | CIF TLPAREN compoundStmt TRPAREN
1709 ** { $$ = $3; context_enterTrueClause (); }
1715 context_exitTrueClause ($1, $2);
1716 $$ = exprNode_if ($1, $2);
1718 | ifPred stmt CELSE { context_enterFalseClause ($1); } stmt
1720 context_exitClause ($1, $2, $5);
1721 $$ = exprNode_ifelse ($1, $2, $5);
1723 | SWITCH TLPAREN expr { context_enterSwitch ($3); }
1724 TRPAREN stmt { $$ = exprNode_switch ($3, $6); }
1727 : WHILE TLPAREN expr TRPAREN
1728 { $$ = exprNode_whilePred ($3); context_enterWhileClause ($3); }
1729 /* not ANSI: | WHILE TLPAREN compoundStmt TRPAREN stmt { $$ = exprNode_while ($3, $5); } */
1732 : WHILE TLPAREN expr TRPAREN { $$ = exprNode_whilePred($3); }
1735 : ITER_NAME { context_enterIterClause (); }
1736 CreateInnerScope TLPAREN { setProcessingIterVars ($1); }
1738 compoundStmt endIter DeleteInnerScope
1740 $$ = exprNode_iter ($1, $6, $8, $9);
1745 : iterArgExpr { $$ = exprNodeList_singleton ($1); }
1746 | iterArgList { nextIterParam (); } TCOMMA iterArgExpr
1747 { $$ = exprNodeList_push ($1, $4); }
1750 : assignIterExpr { $$ = exprNode_iterExpr ($1); }
1751 | id { $$ = exprNode_iterId ($1); }
1752 | TYPE_NAME_OR_ID { uentry ue = coerceIterId ($1);
1754 if (uentry_isValid (ue))
1756 $$ = exprNode_iterId (ue);
1760 $$ = exprNode_iterNewId (cstring_copy (cscanner_observeLastIdentifier ()));
1763 | NEW_IDENTIFIER { $$ = exprNode_iterNewId ($1); }
1766 ** everything is the same, EXCEPT it cannot be a NEW_IDENTIFIER
1771 | cconstantExpr CCONSTANT { $$ = exprNode_combineLiterals ($1, $2); }
1775 | TLPAREN expr TRPAREN { $$ = exprNode_addParens ($1, $2); }
1779 | postfixExpr TLSQBR expr TRSQBR { $$ = exprNode_arrayFetch ($1, $3); }
1780 | postfixExpr TLPAREN TRPAREN { $$ = exprNode_functionCall ($1, exprNodeList_new ()); }
1781 | postfixExpr TLPAREN argumentExprList TRPAREN { $$ = exprNode_functionCall ($1, $3); }
1782 | VA_ARG TLPAREN assignExpr TCOMMA typeExpression TRPAREN
1783 { $$ = exprNode_vaArg ($1, $3, $5); }
1784 | postfixExpr NotType TDOT newId IsType { $$ = exprNode_fieldAccess ($1, $3, $4); }
1785 | postfixExpr NotType ARROW_OP newId IsType { $$ = exprNode_arrowAccess ($1, $3, $4); }
1786 | postfixExpr INC_OP { $$ = exprNode_postOp ($1, $2); }
1787 | postfixExpr DEC_OP { $$ = exprNode_postOp ($1, $2); }
1791 | INC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
1792 | DEC_OP unaryExpr { $$ = exprNode_preOp ($2, $1); }
1793 | TAMPERSAND castExpr { $$ = exprNode_preOp ($2, $1); }
1794 | TMULT castExpr { $$ = exprNode_preOp ($2, $1); }
1795 | TPLUS castExpr { $$ = exprNode_preOp ($2, $1); }
1796 | TMINUS castExpr { $$ = exprNode_preOp ($2, $1); }
1797 | TTILDE castExpr { $$ = exprNode_preOp ($2, $1); }
1798 | TEXCL castExpr { $$ = exprNode_preOp ($2, $1); }
1799 | sizeofExpr { $$ = $1; }
1803 | TLPAREN typeExpression TRPAREN castExpr { $$ = exprNode_cast ($1, $4, $2); }
1807 | timesExpr TMULT castExpr { $$ = exprNode_op ($1, $3, $2); }
1808 | timesExpr TDIV castExpr { $$ = exprNode_op ($1, $3, $2); }
1809 | timesExpr TPERCENT castExpr { $$ = exprNode_op ($1, $3, $2); }
1813 | plusExpr TPLUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
1814 | plusExpr TMINUS timesExpr { $$ = exprNode_op ($1, $3, $2); }
1818 | shiftExpr LEFT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
1819 | shiftExpr RIGHT_OP plusExpr { $$ = exprNode_op ($1, $3, $2); }
1823 | relationalExpr TLT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1824 | relationalExpr TGT shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1825 | relationalExpr LE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1826 | relationalExpr GE_OP shiftExpr { $$ = exprNode_op ($1, $3, $2); }
1829 : relationalIterExpr
1830 | equalityExpr EQ_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
1831 | equalityExpr NE_OP relationalExpr { $$ = exprNode_op ($1, $3, $2); }
1835 | bitandExpr TAMPERSAND equalityExpr { $$ = exprNode_op ($1, $3, $2); }
1839 | xorExpr TCIRC bitandExpr { $$ = exprNode_op ($1, $3, $2); }
1844 | bitorExpr TBAR xorExpr { $$ = exprNode_op ($1, $3, $2); }
1848 | andExpr AND_OP bitorExpr { $$ = exprNode_op ($1, $3, $2); }
1852 | orExpr OR_OP andExpr { $$ = exprNode_op ($1, $3, $2); }
1856 | orExpr TQUEST { context_enterTrueClause ($1); }
1857 expr TCOLON { context_enterFalseClause ($1); } conditionalExpr
1858 { $$ = exprNode_cond ($1, $4, $7); }
1861 : conditionalIterExpr
1862 | unaryExpr TASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1863 | unaryExpr MUL_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1864 | unaryExpr DIV_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1865 | unaryExpr MOD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1866 | unaryExpr ADD_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1867 | unaryExpr SUB_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1868 | unaryExpr LEFT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1869 | unaryExpr RIGHT_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1870 | unaryExpr AND_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1871 | unaryExpr XOR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1872 | unaryExpr OR_ASSIGN assignExpr { $$ = exprNode_assign ($1, $3, $2); }
1875 : ITER_ENDNAME { $$ = $1; }
1876 | /* empty */ { $$ = uentry_undefined; }
1879 : DO { context_enterDoWhileClause (); $$ = $1; }
1883 { $$ = exprNode_while ($1, $2); context_exitWhileClause ($1, $2); }
1884 | doHeader stmt WHILE TLPAREN expr TRPAREN TSEMI
1885 { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); }
1887 { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); }
1890 : whilePred stmtErr { $$ = exprNode_while ($1, $2); context_exitWhileClause ($1, $2); }
1891 | doHeader stmtErr WHILE TLPAREN expr TRPAREN TSEMI
1892 { $$ = exprNode_statement (exprNode_doWhile ($2, $5), $7); }
1893 | doHeader stmtErr WHILE TLPAREN expr TRPAREN
1894 { $$ = exprNode_doWhile ($2, $5); }
1895 | forPred stmtErr { $$ = exprNode_for ($1, $2); context_exitForClause ($1, $2); }
1898 : GOTO newId TSEMI { $$ = exprNode_goto ($2); }
1899 | CONTINUE TSEMI { $$ = exprNode_continue ($1, BADTOK); }
1900 | QINNERCONTINUE CONTINUE TSEMI
1901 { $$ = exprNode_continue ($1, QINNERCONTINUE); }
1902 | BREAK TSEMI { $$ = exprNode_break ($1, BADTOK); }
1903 | QSWITCHBREAK BREAK TSEMI { $$ = exprNode_break ($2, QSWITCHBREAK); }
1904 | QLOOPBREAK BREAK TSEMI { $$ = exprNode_break ($2, QLOOPBREAK); }
1905 | QINNERBREAK BREAK TSEMI { $$ = exprNode_break ($2, QINNERBREAK); }
1906 | QSAFEBREAK BREAK TSEMI { $$ = exprNode_break ($2, QSAFEBREAK); }
1907 | RETURN TSEMI { $$ = exprNode_nullReturn ($1); }
1908 | RETURN expr TSEMI { $$ = exprNode_return ($2); }
1923 | ITER_NAME { $$ = uentry_getName ($1); }
1924 | ITER_ENDNAME { $$ = uentry_getName ($1); }
1925 | id { $$ = uentry_getName ($1); }
1926 | TYPE_NAME_OR_ID { $$ = $1; }
1930 | TYPE_NAME_OR_ID { $$ = ctype_unknown; }
1931 | CTYPEOF TLPAREN expr TRPAREN { $$ = exprNode_getType ($3); exprNode_free ($3); }
1932 | CTYPEOF TLPAREN typeExpression TRPAREN { $$ = qtype_getType ($3); }
1936 /*@-redecl@*/ /*@-namechecks@*/
1937 extern char *yytext;
1938 /*@=redecl@*/ /*@=namechecks@*/
1940 # include "bison.reset"
1942 void yyerror (/*@unused@*/ char *s)
1944 static bool givehint = FALSE;
1946 if (context_inIterDef ())
1948 llerror (FLG_SYNTAX, message ("Iter syntax not parseable: %s",
1949 context_inFunctionName ()));
1951 else if (context_inIterEnd ())
1953 llerror (FLG_SYNTAX, message ("Iter finalizer syntax not parseable: %s",
1954 context_inFunctionName ()));
1956 else if (context_inMacro ())
1958 llerror (FLG_SYNTAX, message ("Macro syntax not parseable: %s",
1959 context_inFunctionName ()));
1961 if (context_inUnknownMacro ())
1965 llhint (cstring_makeLiteral
1966 ("Precede macro definition with /*@notfunction@*/ "
1967 "to suppress checking and force expansion"));
1972 cscanner_swallowMacro ();
1973 context_exitAllClausesQuiet ();
1977 llparseerror (cstring_undefined);