]> git.saurik.com Git - bison.git/blobdiff - src/scan-gram.l
(main): Use exit to exit with failure.
[bison.git] / src / scan-gram.l
index 3408f98d80773d386dd6fe05c8e1e1a316cab9b9..fa24a1aaa95803c101633ed5703ce2e96c2c6c9a 100644 (file)
@@ -87,10 +87,10 @@ static int percent_percent_count = 0;
    Outside of well-formed rules, RULE_LENGTH has an undefined value.  */
 static int rule_length;
 
-static void handle_dollar PARAMS ((braced_code_t code_kind,
-                                  char *cp, location_t location));
-static void handle_at PARAMS ((braced_code_t code_kind,
-                              char *cp, location_t location));
+static void handle_dollar (braced_code_t code_kind,
+                          char *cp, location_t location);
+static void handle_at (braced_code_t code_kind,
+                      char *cp, location_t location);
 
 %}
 %x SC_COMMENT
@@ -107,18 +107,7 @@ blanks   [ \t\f]+
 %{
   /* 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;
-#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;
-  "%glr"[-_]"parser"     return PERCENT_GLR_PARSER;
+  "%glr-parser"           return PERCENT_GLR_PARSER;
   "%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;
+  "%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;
+  "%lex-param"            return PERCENT_LEX_PARAM;
   "%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 COMMA;
   ";"                     return SEMICOLON;
 
   {eols}      YY_LINES; YY_STEP;