23 |
|
|
24 |
# include "location.h" |
# include "location.h" |
25 |
# include "symlist.h" |
# include "symlist.h" |
26 |
|
|
27 |
# include "parse-gram.h" |
# include "parse-gram.h" |
28 |
|
|
29 |
typedef struct merger_list |
typedef struct merger_list |
30 |
{ |
{ |
31 |
struct merger_list* next; |
struct merger_list* next; |
32 |
struniq_t name; |
uniqstr name; |
33 |
struniq_t type; |
uniqstr type; |
34 |
} |
} merger_list; |
|
merger_list; |
|
35 |
|
|
36 |
/* From the scanner. */ |
/* From the scanner. */ |
37 |
extern FILE *gram_in; |
extern FILE *gram_in; |
41 |
void scanner_free (void); |
void scanner_free (void); |
42 |
void scanner_last_string_free (void); |
void scanner_last_string_free (void); |
43 |
|
|
44 |
# define YY_DECL int gram_lex (yystype *val, location_t *loc) |
# define YY_DECL int gram_lex (yystype *val, location *loc) |
45 |
YY_DECL; |
YY_DECL; |
46 |
|
|
47 |
|
|
50 |
int gram_parse (void); |
int gram_parse (void); |
51 |
|
|
52 |
/* The sort of braced code we are in. */ |
/* The sort of braced code we are in. */ |
53 |
typedef enum braced_code_e |
typedef enum |
54 |
{ |
{ |
55 |
action_braced_code, |
action_braced_code, |
56 |
destructor_braced_code, |
destructor_braced_code, |
57 |
printer_braced_code |
printer_braced_code |
58 |
} braced_code_t; |
} braced_code; |
59 |
/* FIXME: This is really a dirty hack which demonstrates that we |
/* FIXME: This is really a dirty hack which demonstrates that we |
60 |
should probably not try to parse the actions now. */ |
should probably not try to parse the actions now. */ |
61 |
extern braced_code_t current_braced_code; |
extern braced_code current_braced_code; |
62 |
|
|
63 |
|
|
64 |
/* From reader.c. */ |
/* From reader.c. */ |
65 |
void grammar_start_symbol_set (symbol_t *s, location_t l); |
void grammar_start_symbol_set (symbol *s, location loc); |
66 |
void prologue_augment (const char *prologue, location_t location); |
void prologue_augment (const char *prologue, location loc); |
67 |
void epilogue_augment (const char *epilogue, location_t location); |
void epilogue_augment (const char *epilogue, location loc); |
68 |
void grammar_symbol_append (symbol_t *s, location_t l); |
void grammar_symbol_append (symbol *s, location loc); |
69 |
void grammar_rule_begin (symbol_t *lhs, location_t l); |
void grammar_rule_begin (symbol *lhs, location loc); |
70 |
void grammar_rule_end (location_t l); |
void grammar_rule_end (location loc); |
71 |
void grammar_midrule_action (void); |
void grammar_midrule_action (void); |
72 |
void grammar_current_rule_prec_set (symbol_t *precsym, location_t l); |
void grammar_current_rule_prec_set (symbol *precsym, location loc); |
73 |
void grammar_current_rule_dprec_set (int dprec, location_t l); |
void grammar_current_rule_dprec_set (int dprec, location loc); |
74 |
void grammar_current_rule_merge_set (struniq_t name, location_t l); |
void grammar_current_rule_merge_set (uniqstr name, location loc); |
75 |
|
|
76 |
void grammar_current_rule_symbol_append (symbol_t *symbol, location_t l); |
void grammar_current_rule_symbol_append (symbol *sym, location loc); |
77 |
void grammar_current_rule_action_append (const char *action, location_t l); |
void grammar_current_rule_action_append (const char *action, location loc); |
78 |
extern symbol_list_t *current_rule; |
extern symbol_list *current_rule; |
79 |
void reader (void); |
void reader (void); |
80 |
void free_merger_functions (void); |
void free_merger_functions (void); |
81 |
|
|