]> andersk Git - splint.git/blobdiff - src/cscanner.l
Updating for cert move
[splint.git] / src / cscanner.l
index 9b0ab165f44b77535c2bb2a7e562c7a004f2fcb8..ae40852a0c7fb01c4772f226c781f1df63ebc460 100644 (file)
@@ -62,13 +62,8 @@ ULSuffix                ({U}{L}|{L}{U})
 # include "lclintMacros.nf"
 # include "basic.h"
 
-# ifdef SANITIZER
-# include "sgrammar.h"
-# include "sgrammar_tokens.h"
-# else
 # include "cgrammar.h"
 # include "cgrammar_tokens.h"
-# endif
 
 # include "fileIdList.h"
 # include "portab.h"
@@ -307,6 +302,9 @@ static void setTokLengthT (size_t len)
 "undef"                 { return (processSpec (QUNDEF)); }
 "killed"                { return (processSpec (QKILLED)); }
 "nullterminated"        { return (processSpec (QNULLTERMINATED));}
+"MaxSet"                { return (processSpec (QMAXSET));}
+"MaxRead"                { return (processSpec (QMAXREAD));}
+
 {Letter}({Letter}|{Digit})* { int tok; 
                              context_saveLocation (); 
                              setTokLength (longUnsigned_toInt (mstring_length (yytext))); 
@@ -566,7 +564,12 @@ struct skeyword s_parsetable[] = {
   { "releases", QRELEASES } ,
   { "pre", QPRECLAUSE } ,
   { "post", QPOSTCLAUSE } ,
-  { NULL, BADTOK } 
+  {"setBufferSize", QSETBUFFERSIZE},
+  {"bufferConstraint", QBUFFERCONSTRAINT},
+  {"ensuresConstraint", QENSURESCONSTRAINT},
+  {"setStringLength", QSETSTRINGLENGTH},
+  {"testinRange", QTESTINRANGE},
+  { NULL, BADTOK }
 } ;
 
 /*
@@ -609,6 +612,12 @@ struct skeyword s_keytable[] = {
   { "null", QNULL } ,
   { "relnull", QRELNULL } ,
   { "nullterminated", QNULLTERMINATED }, 
+  { "setBufferSize", QSETBUFFERSIZE },
+  { "bufferConstraint", QBUFFERCONSTRAINT },
+  { "ensuresConstraint", QENSURESCONSTRAINT },
+  { "testInRange", QTESTINRANGE},
+  { "MaxSet", QMAXSET},
+  { "MaxRead", QMAXREAD},
   { "reldef", QRELDEF } ,
   { "observer", QOBSERVER } ,
   { "exits", QEXITS } ,
@@ -1947,7 +1956,7 @@ static int handleLlSpecial ()
            {
              cstring flagname = thisflag;
              flagcode fflag = identifyFlag (flagname);
-
+               
              if (flagcode_isSkip (fflag))
                {
                  ;
@@ -1990,7 +1999,7 @@ static int handleLlSpecial ()
              else
                {
                  context_fileSetFlag (fflag, set);
-
+                 
                  if (flagcode_hasArgument (fflag))
                    {
                      if (ynm_isMaybe (set))
@@ -2030,7 +2039,7 @@ static int handleLlSpecial ()
                            }
                          
                          sfree (orest);
-
+                         
                          if (cstring_isUndefined (extra))
                            {
                              llerror 
@@ -2062,7 +2071,8 @@ static int handleLlSpecial ()
            }
          else
            {
-                   }
+             ;
+           }
 
          *s = c;
          while ((c == ' ') || (c == '\t') || (c == '\n'))
@@ -2229,8 +2239,7 @@ static int handleLlSpecial ()
                  if (usymtab_existsType (tname))
                    {
                      usymId uid = usymtab_getTypeId (tname);
-
-                                     context_addFileAccessType (uid);
+                     context_addFileAccessType (uid);
                    }
                  else
                    {
@@ -2782,6 +2791,22 @@ long processHex ()
       tval = (int) c - (int) 'A' + 10;
     } else if (c >= 'a' && c <= 'f') {
       tval = (int) c - (int) 'a' + 10;
+    } else if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
+      index++;
+      while (yytext[index] != '\0') {
+       if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
+         ;
+       } else {
+         voptgenerror
+           (FLG_SYNTAX, 
+            message ("Invalid character (%c) following specifier in hex constant: %s",
+                     c, cstring_fromChars (yytext)),
+            g_currentloc);
+       }
+       index++;
+      }
+
+      break;
     } else {
       voptgenerror
        (FLG_SYNTAX, 
This page took 0.070209 seconds and 4 git commands to generate.