- {"token", NULL, TOKEN},
- {"term", NULL, TOKEN},
- {"nterm", NULL, NTERM},
- {"type", NULL, TYPE},
- {"guard", NULL, GUARD},
- {"union", NULL, UNION},
- {"expect", NULL, EXPECT},
- {"thong", NULL, THONG},
- {"start", NULL, START},
- {"left", NULL, LEFT},
- {"right", NULL, RIGHT},
- {"nonassoc", NULL, NONASSOC},
- {"binary", NULL, NONASSOC},
- {"semantic_parser", NULL, SEMANTIC_PARSER},
- {"pure_parser", NULL, PURE_PARSER},
- {"prec", NULL, PREC},
-
- {"no_lines", &nolinesflag, NOOP}, /* -l */
- {"raw", &rawtoknumflag, NOOP}, /* -r */
- {"token_table", &toknumflag, NOOP}, /* -k */
-
-#if 0
- /* These can be utilized after main is reoganized so
- open_files() is deferred 'til after read_declarations().
- But %{ and %union both put information into files
- that have to be opened before read_declarations().
- */
- {"yacc", &fixed_outfiles, NOOP}, /* -y */
- {"fixed_output_files", &fixed_outfiles, NOOP}, /* -y */
- {"defines", &definesflag, NOOP}, /* -d */
- {"no_parser", &noparserflag, NOOP}, /* -n */
- {"output_file", &spec_outfile, SETOPT}, /* -o */
- {"file_prefix", &spec_file_prefix, SETOPT}, /* -b */
- {"name_prefix", &spec_name_prefix, SETOPT}, /* -p */
-
- /* These would be acceptable, but they do not affect processing */
- {"verbose", &verboseflag, NOOP}, /* -v */
- {"debug", &debugflag, NOOP}, /* -t */
- /* {"help", <print usage stmt>, NOOP},*/ /* -h */
- /* {"version", <print version number> , NOOP},*/ /* -V */
-#endif
-
- {NULL, NULL, ILLEGAL}
+ const char *name;
+ void *set_flag;
+ token_t retval;
+};
+
+struct percent_table_struct percent_table[] =
+{
+ { "token", NULL, tok_token },
+ { "term", NULL, tok_token },
+ { "nterm", NULL, tok_nterm },
+ { "type", NULL, tok_type },
+ { "guard", NULL, tok_guard },
+ { "union", NULL, tok_union },
+ { "expect", NULL, tok_expect },
+ { "thong", NULL, tok_thong },
+ { "start", NULL, tok_start },
+ { "left", NULL, tok_left },
+ { "right", NULL, tok_right },
+ { "nonassoc", NULL, tok_nonassoc },
+ { "binary", NULL, tok_nonassoc },
+ { "prec", NULL, tok_prec },
+ { "locations", &locations_flag, tok_intopt }, /* -l */
+ { "no-lines", &no_lines_flag, tok_intopt }, /* -l */
+ { "raw", NULL, tok_obsolete }, /* -r */
+ { "token-table", &token_table_flag, tok_intopt }, /* -k */
+ { "yacc", &yacc_flag, tok_intopt }, /* -y */
+ { "fixed-output-files",&yacc_flag, tok_intopt }, /* -y */
+ { "defines", &defines_flag, tok_intopt }, /* -d */
+ { "no-parser", &no_parser_flag, tok_intopt }, /* -n */
+ { "graph", &graph_flag, tok_intopt }, /* -g */
+
+ /* FIXME: semantic parsers which will output an `include' of an
+ output file: be sure that the name included is indeed the name of
+ the output file. */
+ { "output", &spec_outfile, tok_stropt }, /* -o */
+ { "file-prefix", &spec_file_prefix, tok_stropt }, /* -b */
+ { "name-prefix", &spec_name_prefix, tok_stropt }, /* -p */
+
+ { "verbose", &verbose_flag, tok_intopt }, /* -v */
+ { "debug", &debug_flag, tok_intopt }, /* -t */
+ { "semantic-parser", &semantic_parser, tok_intopt },
+ { "pure-parser", &pure_parser, tok_intopt },
+
+ { NULL, NULL, tok_illegal}