#define YY_USER_INIT \
do { \
LOCATION_RESET (*yylloc); \
+ yylloc->file = infile; \
/* This is only to avoid GCC warnings. */ \
if (yycontrol) {;}; \
} while (0)
-#define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng)
-#define YY_LINES LOCATION_LINES (*yylloc, yyleng); lineno += yyleng;
-#define YY_STEP LOCATION_STEP (*yylloc)
-
+#define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng);
+#define YY_LINES LOCATION_LINES (*yylloc, yyleng);
+#define YY_STEP LOCATION_STEP (*yylloc);
/* STRING_OBSTACK -- Used to store all the characters that we need to
keep (to construct ID, STRINGS etc.). Use the following macros to
%x SC_ESCAPED_STRING SC_ESCAPED_CHARACTER
%x SC_BRACED_CODE SC_PROLOGUE SC_EPILOGUE
-id [.a-zA-Z][.a-zA-Z_0-9]*
+id [.a-zA-Z_][.a-zA-Z_0-9]*
int [0-9]+
eols (\n|\r|\n\r|\r\n)+
blanks [ \t\f]+
"%define" return PERCENT_DEFINE;
"%defines" return PERCENT_DEFINES;
"%destructor" return PERCENT_DESTRUCTOR;
+ "%dprec" return PERCENT_DPREC;
"%error"[-_]"verbose" return PERCENT_ERROR_VERBOSE;
"%expect" return PERCENT_EXPECT;
"%file-prefix" return PERCENT_FILE_PREFIX;
"%fixed"[-_]"output"[-_]"files" return PERCENT_YACC;
+ "%glr"[-_]"parser" return PERCENT_GLR_PARSER;
"%left" return PERCENT_LEFT;
"%locations" return PERCENT_LOCATIONS;
+ "%merge" return PERCENT_MERGE;
"%name"[-_]"prefix" return PERCENT_NAME_PREFIX;
"%no"[-_]"lines" return PERCENT_NO_LINES;
"%nonassoc" return PERCENT_NONASSOC;
{eols} YY_LINES; YY_STEP;
{blanks} YY_STEP;
{id} {
- yylval->symbol = getsym (yytext, *yylloc);
+ yylval->symbol = symbol_get (yytext, *yylloc);
return ID;
}
assert (yy_top_state () == INITIAL);
{
YY_OBS_FINISH;
- yylval->symbol = getsym (last_string, *yylloc);
+ yylval->symbol = symbol_get (last_string, *yylloc);
symbol_class_set (yylval->symbol, token_sym, *yylloc);
- symbol_user_token_number_set (yylval->symbol, last_string[1], *yylloc);
+ symbol_user_token_number_set (yylval->symbol,
+ (unsigned char) last_string[1], *yylloc);
YY_OBS_FREE;
yy_pop_state ();
return ID;
type_name = symbol_list_n_type_name_get (current_rule, location, 0);
if (!type_name && typed)
complain_at (location, _("$$ of `%s' has no declared type"),
- symbol_tag_get (current_rule->sym));
+ current_rule->sym->tag);
if (!type_name)
type_name = "";
obstack_fgrow1 (&string_obstack,
n);
if (!type_name && typed)
complain_at (location, _("$%d of `%s' has no declared type"),
- n, symbol_tag_get (current_rule->sym));
+ n, current_rule->sym->tag);
if (!type_name)
type_name = "";
obstack_fgrow3 (&string_obstack,
scanner_free (void)
{
obstack_free (&string_obstack, 0);
+ /* Reclaim Flex's buffers. */
+ yy_delete_buffer (YY_CURRENT_BUFFER);
}