mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
* src/reader.h, src/reader.c (symbol_list, symbol_list_new)
(symbol_list_prepend, get_type_name): Move to... * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new) (symbol_list_prepend, symbol_list_n_type_name_get): here. Adjust all callers. (symbol_list_free): New. * src/scan-gram.l (handle_dollar): Takes a location. * tests/input.at (Invalid $n): Adjust.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "files.h"
|
||||
#include "getargs.h"
|
||||
#include "output.h"
|
||||
#include "symlist.h"
|
||||
#include "gram.h"
|
||||
#include "reader.h"
|
||||
#include "conflicts.h"
|
||||
@@ -88,7 +89,7 @@ int current_prec = 0;
|
||||
%union
|
||||
{
|
||||
symbol_t *symbol;
|
||||
symbol_list *list;
|
||||
symbol_list_t *list;
|
||||
int integer;
|
||||
char *string;
|
||||
associativity assoc;
|
||||
@@ -214,24 +215,24 @@ symbol_declaration:
|
||||
}
|
||||
| "%type" TYPE symbols.1
|
||||
{
|
||||
symbol_list *list;
|
||||
symbol_list_t *list;
|
||||
for (list = $3; list; list = list->next)
|
||||
symbol_type_set (list->sym, list->location, $2);
|
||||
LIST_FREE (symbol_list, $3);
|
||||
LIST_FREE (symbol_list_t, $3);
|
||||
}
|
||||
;
|
||||
|
||||
precedence_declaration:
|
||||
precedence_declarator type.opt symbols.1
|
||||
{
|
||||
symbol_list *list;
|
||||
symbol_list_t *list;
|
||||
++current_prec;
|
||||
for (list = $3; list; list = list->next)
|
||||
{
|
||||
symbol_type_set (list->sym, list->location, current_type);
|
||||
symbol_precedence_set (list->sym, list->location, current_prec, $1);
|
||||
}
|
||||
LIST_FREE (symbol_list, $3);
|
||||
LIST_FREE (symbol_list_t, $3);
|
||||
current_type = NULL;
|
||||
}
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user