+/* the following table dictates the action taken for the various
+ % directives. A setflag value causes the named flag to be
+ set. A retval action returns the code.
+*/
+struct percent_table_struct {
+ char *name;
+ void *setflag;
+ int retval;
+} percent_table[] =
+{
+ {"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}
+};
+
+/* Parse a token which starts with %.
+ Assumes the % has already been read and discarded. */