]> git.saurik.com Git - bison.git/blobdiff - src/scan-gram.l
Prototype support of %lex-param and %parse-param.
[bison.git] / src / scan-gram.l
index 3408f98d80773d386dd6fe05c8e1e1a316cab9b9..235272f1f90addccca08d84365d8f7dab039ec72 100644 (file)
@@ -107,18 +107,7 @@ blanks   [ \t\f]+
 %{
   /* At each yylex invocation, mark the current position as the
      start of the next token.  */
 %{
   /* At each yylex invocation, mark the current position as the
      start of the next token.  */
-#define TR_POS 0
-#if TR_POS
-  fprintf (stderr, "FOO1: %p: ", yylloc);
-  LOCATION_PRINT (stderr, *yylloc);
-  fprintf (stderr, "\n");
-#endif
   YY_STEP;
   YY_STEP;
-#if TR_POS
-  fprintf (stderr, "BAR1: ");
-  LOCATION_PRINT (stderr, *yylloc);
-  fprintf (stderr, "\n");
-#endif
 %}
 
 
 %}
 
 
@@ -137,7 +126,7 @@ blanks   [ \t\f]+
   "%expect"               return PERCENT_EXPECT;
   "%file-prefix"          return PERCENT_FILE_PREFIX;
   "%fixed"[-_]"output"[-_]"files"   return PERCENT_YACC;
   "%expect"               return PERCENT_EXPECT;
   "%file-prefix"          return PERCENT_FILE_PREFIX;
   "%fixed"[-_]"output"[-_]"files"   return PERCENT_YACC;
-  "%glr"[-_]"parser"     return PERCENT_GLR_PARSER;
+  "%glr-parser"           return PERCENT_GLR_PARSER;
   "%left"                 return PERCENT_LEFT;
   "%locations"            return PERCENT_LOCATIONS;
   "%merge"               return PERCENT_MERGE;
   "%left"                 return PERCENT_LEFT;
   "%locations"            return PERCENT_LOCATIONS;
   "%merge"               return PERCENT_MERGE;
@@ -146,10 +135,12 @@ blanks   [ \t\f]+
   "%nonassoc"             return PERCENT_NONASSOC;
   "%nterm"                return PERCENT_NTERM;
   "%output"               return PERCENT_OUTPUT;
   "%nonassoc"             return PERCENT_NONASSOC;
   "%nterm"                return PERCENT_NTERM;
   "%output"               return PERCENT_OUTPUT;
+  "%parse-param"          return PERCENT_PARSE_PARAM;
   "%prec"                 { rule_length--; return PERCENT_PREC; }
   "%printer"              return PERCENT_PRINTER;
   "%pure"[-_]"parser"     return PERCENT_PURE_PARSER;
   "%right"                return PERCENT_RIGHT;
   "%prec"                 { rule_length--; return PERCENT_PREC; }
   "%printer"              return PERCENT_PRINTER;
   "%pure"[-_]"parser"     return PERCENT_PURE_PARSER;
   "%right"                return PERCENT_RIGHT;
+  "%lex-param"            return PERCENT_LEX_PARAM;
   "%skeleton"             return PERCENT_SKELETON;
   "%start"                return PERCENT_START;
   "%term"                 return PERCENT_TOKEN;
   "%skeleton"             return PERCENT_SKELETON;
   "%start"                return PERCENT_START;
   "%term"                 return PERCENT_TOKEN;
@@ -163,6 +154,7 @@ blanks   [ \t\f]+
   "="                     return EQUAL;
   ":"                     { rule_length = 0; return COLON; }
   "|"                     { rule_length = 0; return PIPE; }
   "="                     return EQUAL;
   ":"                     { rule_length = 0; return COLON; }
   "|"                     { rule_length = 0; return PIPE; }
+  ","                     return COMMA;
   ";"                     return SEMICOLON;
 
   {eols}      YY_LINES; YY_STEP;
   ";"                     return SEMICOLON;
 
   {eols}      YY_LINES; YY_STEP;