static YYLTYPE lloc_default (YYLTYPE const *, int);
#define YY_LOCATION_PRINT(File, Loc) \
- location_print (File, Loc)
+ location_print (Loc, File)
static void version_check (location const *loc, char const *version);
-/* Request detailed syntax error messages, and pass them to GRAM_ERROR.
- FIXME: depends on the undocumented availability of YYLLOC. */
-#undef yyerror
-#define yyerror(Msg) \
- gram_error (&yylloc, Msg)
static void gram_error (location const *, char const *);
+/// A string that describes a char (e.g., 'a' -> "'a'").
static char const *char_name (char);
%}
}
%define api.prefix "gram_"
-%define api.pure
+%define api.pure full
%define locations
%define parse.error verbose
%define parse.lac full
symbol.prec
{ $$ = symbol_list_sym_new ($1, @1); }
| symbols.prec symbol.prec
- { $$ = symbol_list_prepend ($1, symbol_list_sym_new ($2, @2)); }
+ { $$ = symbol_list_append ($1, symbol_list_sym_new ($2, @2)); }
;
symbol.prec:
symbol
{ $$ = symbol_list_sym_new ($1, @1); }
| symbols.1 symbol
- { $$ = symbol_list_prepend ($1, symbol_list_sym_new ($2, @2)); }
+ { $$ = symbol_list_append ($1, symbol_list_sym_new ($2, @2)); }
;
generic_symlist:
generic_symlist_item { $$ = $1; }
-| generic_symlist generic_symlist_item { $$ = symbol_list_prepend ($1, $2); }
+| generic_symlist generic_symlist_item { $$ = symbol_list_append ($1, $2); }
;
generic_symlist_item:
/* One token definition. */
symbol_def:
TAG
- {
- current_type = $1;
- tag_seen = true;
- }
+ {
+ current_type = $1;
+ tag_seen = true;
+ }
| id
- {
- symbol_class_set ($1, current_class, @1, true);
- symbol_type_set ($1, current_type, @1);
- }
+ {
+ symbol_class_set ($1, current_class, @1, true);
+ symbol_type_set ($1, current_type, @1);
+ }
| id INT
{
symbol_class_set ($1, current_class, @1, true);