]> andersk Git - splint.git/blobdiff - src/cscanner.l
*** empty log message ***
[splint.git] / src / cscanner.l
index 6300c36d3cdefecd6bd3e4892f9f85d22aa3d6d4..1634b7d4e036e67e9f5f7c35990ce6759627b672 100644 (file)
@@ -114,6 +114,8 @@ static /*@only@*/ cstring makeIdentifier (char *);
 /* 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);
@@ -269,6 +271,7 @@ static void setTokLengthT (size_t len)
 "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)); }
@@ -585,8 +588,6 @@ struct skeyword s_parsetable[] = {
   { "pre", QPRECLAUSE } ,
   { "post", QPOSTCLAUSE } ,
   { "setBufferSize", QSETBUFFERSIZE},
-  { "LRequires", QBUFFERCONSTRAINT},
-  { "LEnsures", QENSURESCONSTRAINT},
   { "setStringLength", QSETSTRINGLENGTH},
   { "testinRange", QTESTINRANGE},
   { "requires", QPRECLAUSE } ,
@@ -635,8 +636,6 @@ struct skeyword s_keytable[] = {
   { "relnull", QRELNULL } ,
   { "nullterminated", QNULLTERMINATED }, 
   { "setBufferSize", QSETBUFFERSIZE },
-  { "LRequires", QBUFFERCONSTRAINT },
-  { "LEnsures", QENSURESCONSTRAINT },
   { "testInRange", QTESTINRANGE},
   { "MaxSet", QMAXSET},
   { "MaxRead", QMAXREAD},
@@ -2516,7 +2515,24 @@ static int processIdentifier (cstring 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)) 
                {
@@ -2956,3 +2972,16 @@ processSpec (int tok)
       return (processIdentifier (makeIdentifier (yytext)));
     }
 }
+
+void cscanner_expectingMetaStateName ()
+{
+  llassert (!expectingMetaStateName);
+  llassert (context_inFunctionHeader ());
+  expectingMetaStateName = TRUE;
+}
+
+void cscanner_clearExpectingMetaStateName ()
+{
+  llassert (expectingMetaStateName);
+  expectingMetaStateName = FALSE;
+}
This page took 0.033115 seconds and 4 git commands to generate.