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.
This commit is contained in:
Akim Demaille
2002-07-31 21:52:00 +00:00
parent 1509d42fcb
commit c6f1a33c06
9 changed files with 1032 additions and 853 deletions

View File

@@ -29,6 +29,7 @@
#include "files.h"
#include "complain.h"
#include "derives.h"
#include "tables.h"
#include "output.h"
#include "reader.h"
#include "lalr.h"
@@ -131,12 +132,18 @@ main (int argc, char *argv[])
timevar_pop (TV_GRAPH);
}
/* Compute the parser tables. */
timevar_push (TV_ACTIONS);
tables_generate ();
timevar_pop (TV_ACTIONS);
/* Output the tables and the parser to ftable. In file output. */
timevar_push (TV_PARSER);
output ();
timevar_pop (TV_PARSER);
timevar_push (TV_FREE);
tables_free ();
states_free ();
reduce_free ();
conflicts_free ();