X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/bc0f573730251da15be0e545f393d589538d6bfa..ab2a9f579366b0d4940b0ec2d3321d139a7f1f3d:/src/getargs.c?ds=sidebyside diff --git a/src/getargs.c b/src/getargs.c index d7e43850..e5b016a6 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -44,7 +44,7 @@ #include "complain.h" #include "files.h" #include "getargs.h" -#include "muscle_tab.h" +#include "muscle-tab.h" #include "uniqstr.h" bool defines_flag; @@ -186,6 +186,7 @@ static const char * const trace_args[] = "m4 - m4 traces", "skeleton - skeleton postprocessing", "time - time consumption", + "ielr - IELR conversion", "all - all of the above", 0 }; @@ -205,6 +206,7 @@ static const int trace_types[] = trace_m4, trace_skeleton, trace_time, + trace_ielr, trace_all }; @@ -221,7 +223,7 @@ static const char * const warnings_args[] = that argmatch_valid be more readable. */ "none - no warnings", "midrule-values - unset or unused midrule values", - "yacc - incompatibilities with POSIX YACC", + "yacc - incompatibilities with POSIX Yacc", "all - all of the above", "error - warnings are errors", 0 @@ -260,7 +262,8 @@ usage (int status) printf (_("Usage: %s [OPTION]... FILE\n"), program_name); fputs (_("\ -Generate LALR(1) and GLR parsers.\n\ +Generate a deterministic or GLR parser employing LALR(1), IELR(1), or\n\ +canonical LR(1) parser tables.\n\ \n\ "), stdout); @@ -288,7 +291,8 @@ Parser:\n\ -L, --language=LANGUAGE specify the output programming language\n\ (this is an experimental feature)\n\ -S, --skeleton=FILE specify the skeleton to use\n\ - -t, --debug instrument the parser for debugging\n\ + -t, --debug instrument the parser for tracing\n\ + same as `-Dparse.trace'\n\ --locations enable location support\n\ -D, --define=NAME[=VALUE] same as `%define NAME \"VALUE\"'\n\ -p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\ @@ -317,7 +321,7 @@ Output:\n\ fputs (_("\ Warning categories include:\n\ `midrule-values' unset or unused midrule values\n\ - `yacc' incompatibilities with POSIX YACC\n\ + `yacc' incompatibilities with POSIX Yacc\n\ `all' all the warnings\n\ `no-CATEGORY' turn off warnings in CATEGORY\n\ `none' turn off all the warnings\n\ @@ -616,7 +620,8 @@ getargs (int argc, char *argv[]) break; case 't': - muscle_percent_define_insert ("debug", command_line_location (), ""); + muscle_percent_define_insert ("parse.trace", + command_line_location (), ""); break; case 'v': @@ -666,3 +671,11 @@ getargs (int argc, char *argv[]) current_file = grammar_file = uniqstr_new (argv[optind]); MUSCLE_INSERT_C_STRING ("file_name", grammar_file); } + +void +tr (char *s, char from, char to) +{ + for (; *s; s++) + if (*s == from) + *s = to; +}