*/
# include "lclintMacros.nf"
+# include <unistd.h>
# include "basic.h"
# include "cgrammar.h"
/*@notfunction@*/
# define yyinput() (incColumn (), getc (yyin))
-/*@-noparams@*/
-/*@-incondefs@*/
-extern /*@external@*/ int read ();
-/*@=incondefs@*/
-/*@=noparams@*/
-
static /*@owned@*/ cstring lastidprocessed = cstring_undefined;
-
static int lminput (void);
static int tokLength = 0;
static bool inSpecPart = FALSE;
/* yes, this is exported! */
bool g_expectingTypeName = TRUE; /* beginning of file can be type name! */
+static bool expectingMetaStateName = FALSE;
+
static int returnInt (ctype, long);
static int returnFloat (ctype, double);
static int returnChar (char);
"static" { setTokLength (6); RETURN_TOK (QSTATIC); }
\"(\\.|[^\\"])*\"([ \t\n]*\"(\\.|[^\\"])*\")* { RETURN_EXPR (processString ()); }
+L\"(\\.|[^\\"])*\"([ \t\n]*\"(\\.|[^\\"])*\")* { RETURN_EXPR (processString ()); }
"out" { return (processSpec (QOUT)); }
"in" { return (processSpec (QIN)); }
"partial" { return (processSpec (QPARTIAL)); }
"killed" { return (processSpec (QKILLED)); }
"nullterminated" { return (processSpec (QNULLTERMINATED));}
"MaxSet" { return (processSpec (QMAXSET));}
-"MaxRead" { return (processSpec (QMAXREAD));}
+"MaxRead" { return (processSpec (QMAXREAD));}
+"maxSet" { return (processSpec (QMAXSET));}
+"maxRead" { return (processSpec (QMAXREAD));}
{Letter}({Letter}|{Digit})* { int tok;
context_saveLocation ();
{ "releases", QRELEASES } ,
{ "pre", QPRECLAUSE } ,
{ "post", QPOSTCLAUSE } ,
- {"setBufferSize", QSETBUFFERSIZE},
- {"LRequires", QBUFFERCONSTRAINT},
- {"LEnsures", QENSURESCONSTRAINT},
- {"setStringLength", QSETSTRINGLENGTH},
- {"testinRange", QTESTINRANGE},
+ { "setBufferSize", QSETBUFFERSIZE},
+ { "setStringLength", QSETSTRINGLENGTH},
+ { "testinRange", QTESTINRANGE},
{ "requires", QPRECLAUSE } ,
{ "ensures", QPOSTCLAUSE } ,
{ NULL, BADTOK }
{ "relnull", QRELNULL } ,
{ "nullterminated", QNULLTERMINATED },
{ "setBufferSize", QSETBUFFERSIZE },
- { "LRequires", QBUFFERCONSTRAINT },
- { "LEnsures", QENSURESCONSTRAINT },
{ "testInRange", QTESTINRANGE},
{ "MaxSet", QMAXSET},
{ "MaxRead", QMAXREAD},
e2 = usymtab_lookupExpose (fname);
ct = uentry_getType (e2);
-
if (uentry_isCodeDefined (e2)
&& fileloc_isUser (uentry_whereDefined (e2)))
{
uentry_showWhereSpecified (e2);
uentry_setType (e2, ctype_unknown);
- uentry_makeVarFunction (e2);
+ uentry_makeConstantFunction (e2);
uentry_setDefined (e2, g_currentloc);
uentry_setFunctionDefined (e2, g_currentloc);
context_enterUnknownMacro (e2);
&& !uentry_isElipsisMarker (uentryList_getN
(specparams, paramno)))
{
+ fileloc sloc = context_getSaveLocation ();
uentry decl = uentryList_getN (specparams, paramno);
sRef sr;
uentry_setParam (param);
- sr = sRef_makeParam (paramno, uentry_getType (param));
+ sr = sRef_makeParam (paramno, uentry_getType (param), stateInfo_makeLoc (sloc));
if (sRef_getNullState (sr) == NS_ABSNULL)
{
}
else
{
- sRef_setNullState (sr, NS_UNKNOWN, g_currentloc);
+ sRef_setNullState (sr, NS_UNKNOWN, sloc);
}
}
uentry_setSref (param, sr);
- uentry_setDeclaredForceOnly (param, context_getSaveLocation ());
+ uentry_setDeclaredForceOnly (param, sloc);
skipparam = isiter && uentry_isOut (uentryList_getN (specparams, paramno));
}
fileloc sloc = context_getSaveLocation ();
param = uentry_makeVariableSrefParam
- (paramname, ctype_unknown, sRef_makeParam (paramno, ctype_unknown));
+ (paramname, ctype_unknown, fileloc_copy (sloc),
+ sRef_makeParam (paramno, ctype_unknown, stateInfo_makeLoc (sloc)));
cstring_free (paramname);
sRef_setPosNull (uentry_getSref (param), sloc);
-
uentry_setDeclaredForce (param, sloc);
skipparam = FALSE;
if (!(fileId_isValid (fid)))
{
- if (isHeaderFile (fname))
+ if (context_inXHFile ())
+ {
+ fid = fileTable_addXHFile (context_fileTable (), fname);
+ }
+ else if (isHeaderFile (fname))
{
fid = fileTable_addHeaderFile (context_fileTable (), fname);
}
{
uentry le;
- DPRINTF (("Process identifier: %s / %s / %s", id, fileloc_unparse (g_currentloc),
- bool_unparse (context_inFunctionHeader ())));
+ if (context_getFlag (FLG_GRAMMAR))
+ {
+ lldiagmsg (message ("Process identifier: %s", id));
+ }
context_clearJustPopped ();
lastidprocessed = id;
}
else
{
- annotationInfo ainfo = context_lookupAnnotation (id);
+ annotationInfo ainfo;
+
+ if (expectingMetaStateName)
+ {
+ metaStateInfo msinfo = context_lookupMetaStateInfo (id);
+
+ if (metaStateInfo_isDefined (msinfo))
+ {
+ yylval.msinfo = msinfo;
+ return METASTATE_NAME;
+ }
+ else
+ {
+ DPRINTF (("Not meta state name: %s", cstring_toCharsSafe (id)));
+ }
+ }
+
+ ainfo = context_lookupAnnotation (id);
if (annotationInfo_isDefined (ainfo))
{
return (processIdentifier (makeIdentifier (yytext)));
}
}
+
+void cscanner_expectingMetaStateName ()
+{
+ llassert (!expectingMetaStateName);
+ llassert (context_inFunctionHeader ());
+ expectingMetaStateName = TRUE;
+}
+
+void cscanner_clearExpectingMetaStateName ()
+{
+ llassert (expectingMetaStateName);
+ expectingMetaStateName = FALSE;
+}