Skip to content

Commit c6f1a33

Browse files
committed
Separate parser tables computation and output.
* src/output.c (nvectors, base_t, base, base_ninf, conflict_table) (conflict_list, conflict_list_cnt, table, check, table_ninf) (yydefgoto, yydefact, high): Move to... * src/tables.h, src/tables.c: here. * src/output.c (vector_number_t, VECTOR_NUMBER_MAX) (VECTOR_NUMBER_MIN, state_number_to_vector_number) (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN) (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX) (ACTION_MIN, actrow, order, nentries, pos, conflrow) (conflict_list_free, table_size, lowzero, table_grow, conflict_row) (action_row, save_row, token_actions, save_column, default_goto) (goto_actions, sort_actions, matching_state, pack_vector) (table_ninf_remap, pack_table, prepare_actions): Move to... * src/tables.c: here. * src/tables.h, src/tables.c(tables_generate, tables_free): New. * src/output.c (token_actions, output_base, output_conflicts) (output_check): Merge into... (prepare_actions): this. (actions_output): Rename as... (user_actions_output): this. * src/main.c (main): Call tables_generate and tables_free.
1 parent 1509d42 commit c6f1a33

File tree

9 files changed

+1031
-852
lines changed

9 files changed

+1031
-852
lines changed

ChangeLog

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
2002-07-31 Akim Demaille <[email protected]>
2+
3+
Separate parser tables computation and output.
4+
5+
* src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
6+
(conflict_list, conflict_list_cnt, table, check, table_ninf)
7+
(yydefgoto, yydefact, high): Move to...
8+
* src/tables.h, src/tables.c: here.
9+
* src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10+
(VECTOR_NUMBER_MIN, state_number_to_vector_number)
11+
(symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12+
(froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
13+
(ACTION_MIN, actrow, order, nentries, pos, conflrow)
14+
(conflict_list_free, table_size, lowzero, table_grow, conflict_row)
15+
(action_row, save_row, token_actions, save_column, default_goto)
16+
(goto_actions, sort_actions, matching_state, pack_vector)
17+
(table_ninf_remap, pack_table, prepare_actions): Move to...
18+
* src/tables.c: here.
19+
* src/tables.h, src/tables.c(tables_generate, tables_free): New.
20+
* src/output.c (token_actions, output_base, output_conflicts)
21+
(output_check): Merge into...
22+
(prepare_actions): this.
23+
(actions_output): Rename as...
24+
(user_actions_output): this.
25+
* src/main.c (main): Call tables_generate and tables_free.
26+
127
2002-07-31 Akim Demaille <[email protected]>
228

329
Steal GCC's --time-report support.

po/POTFILES.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ src/print.c
99
src/reader.c
1010
src/reduce.c
1111
src/scan-gram.c
12+
src/symlist.c
13+
src/symtab.c
14+
src/tables.c
1215

16+
lib/argmatch.c
1317
lib/error.c
1418
lib/getopt.c
1519
lib/obstack.c

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ bison_SOURCES = \
6363
symlist.c symlist.h \
6464
symtab.c symtab.h \
6565
system.h \
66+
tables.h tables.c \
6667
vcg.c vcg.h \
6768
vcg_defaults.h
6869

src/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "files.h"
3030
#include "complain.h"
3131
#include "derives.h"
32+
#include "tables.h"
3233
#include "output.h"
3334
#include "reader.h"
3435
#include "lalr.h"
@@ -131,12 +132,18 @@ main (int argc, char *argv[])
131132
timevar_pop (TV_GRAPH);
132133
}
133134

135+
/* Compute the parser tables. */
136+
timevar_push (TV_ACTIONS);
137+
tables_generate ();
138+
timevar_pop (TV_ACTIONS);
139+
134140
/* Output the tables and the parser to ftable. In file output. */
135141
timevar_push (TV_PARSER);
136142
output ();
137143
timevar_pop (TV_PARSER);
138144

139145
timevar_push (TV_FREE);
146+
tables_free ();
140147
states_free ();
141148
reduce_free ();
142149
conflicts_free ();

0 commit comments

Comments
 (0)