summaryrefslogtreecommitdiff
path: root/gen.c
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-09-05 13:18:24 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-09-05 13:18:24 +0000
commitaa56ca543a13b4efe45ab7e7a8dec6901d82b12c (patch)
treecfc89e4a94bc1baf7a7fc7499064560cf3ecc007 /gen.c
parent9d1af472ea462d996c6267d5d88600733156c208 (diff)
Tables are now generated with %option tables-file=FILE.
Diffstat (limited to 'gen.c')
-rw-r--r--gen.c54
1 files changed, 46 insertions, 8 deletions
diff --git a/gen.c b/gen.c
index 14bd254..8a88514 100644
--- a/gen.c
+++ b/gen.c
@@ -271,10 +271,6 @@ struct yytbl_data *mkctbl (void)
tdata[curr++] = chk[tblend + 2];
tdata[curr++] = nxt[tblend + 2];
- /* TODO: deal with this:
- if (useecs)
- genecs ();
- */
return tbl;
}
@@ -620,7 +616,9 @@ void gen_find_action ()
}
}
-/* mkftbl - make the full table and return the struct */
+/* mkftbl - make the full table and return the struct .
+ * you should call mkecstbl() after this.
+ */
struct yytbl_data *mkftbl (void)
{
@@ -1505,16 +1503,56 @@ void make_tables ()
if (fullspd) {
genctbl ();
if (tablesext) {
- /* TODO: mkctbl(); */
+ struct yytbl_data *tbl;
+
+ tbl = mkctbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write ftbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+
+ if (useecs) {
+ tbl = mkecstbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_
+ ("Could not write ecstbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+ }
}
}
- else if (fulltbl)
+ else if (fulltbl) {
genftbl ();
+ if (tablesext) {
+ struct yytbl_data *tbl;
+
+ tbl = mkftbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write ftbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+
+ if (useecs) {
+ tbl = mkecstbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_
+ ("Could not write ecstbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+ }
+ }
+ }
else
gentabs ();
- if (do_yylineno)
+ if (do_yylineno) {
geneoltbl ();
+ /* TODO: call mkeoltbl() */
+ }
/* Definitions for backing up. We don't need them if REJECT
* is being used because then we use an alternative backin-up