boundary_set (&@$.end, current_file, 1, 1);
}
-/* Only NUMBERS have a value. */
%union
{
symbol *symbol;
symbol_list *list;
int integer;
- char *chars;
+ char const *chars;
+ char *code;
assoc assoc;
uniqstr uniqstr;
unsigned char character;
%token PERCENT_TYPE "%type"
%token PERCENT_DESTRUCTOR "%destructor"
%token PERCENT_PRINTER "%printer"
-%token PERCENT_SYMBOL_DEFAULT
- "%symbol-default"
%token PERCENT_LEFT "%left"
%token PERCENT_RIGHT "%right"
%token PROLOGUE "%{...%}"
%token SEMICOLON ";"
%token TYPE "type"
+%token TYPE_TAG_ANY "<*>"
+%token TYPE_TAG_NONE "<>"
%type <character> CHAR
%printer { fputs (char_name ($$), stderr); } CHAR
/* braceless is not to be used for rule or symbol actions, as it
calls translate_code. */
-%type <chars> STRING "{...}" "%{...%}" EPILOGUE braceless content content.opt
+%type <chars> STRING "%{...%}" EPILOGUE braceless content content.opt
+%type <code> "{...}"
%printer { fputs (quotearg_style (c_quoting_style, $$), stderr); }
- STRING
+ STRING
%printer { fprintf (stderr, "{\n%s\n}", $$); }
- braceless content content.opt "{...}" "%{...%}" EPILOGUE
+ braceless content content.opt "{...}" "%{...%}" EPILOGUE
%type <uniqstr> TYPE ID ID_COLON
%printer { fprintf (stderr, "<%s>", $$); } TYPE
| "%debug" { debug_flag = true; }
| "%define" STRING content.opt { muscle_insert ($2, $3); }
| "%defines" { defines_flag = true; }
+| "%defines" STRING
+ {
+ defines_flag = true;
+ spec_defines_file = xstrdup ($2);
+ }
| "%error-verbose" { error_verbose = true; }
| "%expect" INT { expected_sr_conflicts = $2; }
| "%expect-rr" INT { expected_rr_conflicts = $2; }
-| "%file-prefix" "=" STRING { spec_file_prefix = $3; }
+| "%file-prefix" STRING { spec_file_prefix = $2; }
+| "%file-prefix" "=" STRING { spec_file_prefix = $3; } /* deprecated */
| "%glr-parser"
{
nondeterministic_parser = true;
}
| "%lex-param" "{...}" { add_param ("lex_param", $2, @2); }
| "%locations" { locations_flag = true; }
-| "%name-prefix" "=" STRING { spec_name_prefix = $3; }
+| "%name-prefix" STRING { spec_name_prefix = $2; }
+| "%name-prefix" "=" STRING { spec_name_prefix = $3; } /* deprecated */
| "%no-lines" { no_lines_flag = true; }
| "%nondeterministic-parser" { nondeterministic_parser = true; }
-| "%output" "=" STRING { spec_outfile = $3; }
+| "%output" STRING { spec_outfile = $2; }
+| "%output" "=" STRING { spec_outfile = $3; } /* deprecated */
| "%parse-param" "{...}" { add_param ("parse_param", $2, @2); }
| "%pure-parser" { pure_parser = true; }
| "%push-parser" { push_parser = true; }
symbol_list *list;
const char *action = translate_symbol_action ($2, @2);
for (list = $3; list; list = list->next)
- symbol_list_destructor_set (list, action, @2);
+ symbol_list_destructor_set (list, action, @2);
symbol_list_free ($3);
}
| "%printer" "{...}" generic_symlist
symbol_list *list;
const char *action = translate_symbol_action ($2, @2);
for (list = $3; list; list = list->next)
- symbol_list_printer_set (list, action, @2);
+ symbol_list_printer_set (list, action, @2);
symbol_list_free ($3);
}
| "%default-prec"
generic_symlist_item:
symbol { $$ = symbol_list_sym_new ($1, @1); }
| TYPE { $$ = symbol_list_type_new ($1, @1); }
-| "%symbol-default" { $$ = symbol_list_default_new (@1); }
+| "<*>" { $$ = symbol_list_default_tagged_new (@1); }
+| "<>" { $$ = symbol_list_default_tagless_new (@1); }
;
/* One token definition. */