X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/5320fffdd88676a57c42427f3db06d36d10d5a8c..bcd80897f3b414973fc34dc2ec57ce4df2e69253:/src/parse-gram.y diff --git a/src/parse-gram.y b/src/parse-gram.y index 016963a8..6e58835a 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -20,6 +20,7 @@ #include #include "system.h" +#include "c-ctype.h" #include "complain.h" #include "conflicts.h" #include "files.h" @@ -86,15 +87,15 @@ static char const *char_name (char); #define YYTYPE_UINT8 uint_fast8_t } -%verbose -%defines -%define locations +%define api.prefix "gram_" %define api.pure +%define locations %define parse.error verbose %define parse.lac full %define parse.trace -%name-prefix "gram_" +%defines %expect 0 +%verbose %initial-action { @@ -316,7 +317,6 @@ prologue_declaration: | "%expect" INT { expected_sr_conflicts = $2; } | "%expect-rr" INT { expected_rr_conflicts = $2; } | "%file-prefix" STRING { spec_file_prefix = $2; } -| "%file-prefix" "=" STRING { spec_file_prefix = $3; } /* deprecated */ | "%glr-parser" { nondeterministic_parser = true; @@ -333,11 +333,9 @@ prologue_declaration: } | "%language" STRING { language_argmatch ($2, grammar_prio, @1); } | "%name-prefix" STRING { spec_name_prefix = $2; } -| "%name-prefix" "=" STRING { spec_name_prefix = $3; } /* deprecated */ | "%no-lines" { no_lines_flag = true; } | "%nondeterministic-parser" { nondeterministic_parser = true; } | "%output" STRING { spec_outfile = $2; } -| "%output" "=" STRING { spec_outfile = $3; } /* deprecated */ | "%param" { current_param = $1; } params { current_param = param_none; } | "%require" STRING { version_check (&@2, $2); } | "%skeleton" STRING @@ -723,7 +721,6 @@ epilogue.opt: %% - /* Return the location of the left-hand side of a rule whose right-hand side is RHS[1] ... RHS[N]. Ignore empty nonterminals in the right-hand side, and return an empty location equal to the end @@ -776,17 +773,16 @@ add_param (param_type type, char *decl, location loc) /* Strip the surrounding '{' and '}', and any blanks just inside the braces. */ --p; - while (isspace ((unsigned char) *p)) + while (c_isspace ((unsigned char) *p)) --p; p[1] = '\0'; ++decl; - while (isspace ((unsigned char) *decl)) + while (c_isspace ((unsigned char) *decl)) ++decl; } if (! name_start) - complain_at (loc, complaint, - _("missing identifier in parameter declaration")); + complain (&loc, complaint, _("missing identifier in parameter declaration")); else { char *name = xmemdup0 (name_start, strspn (name_start, alphanum)); @@ -806,8 +802,8 @@ version_check (location const *loc, char const *version) { if (strverscmp (version, PACKAGE_VERSION) > 0) { - complain_at (*loc, complaint, "require bison %s, but have %s", - version, PACKAGE_VERSION); + complain (loc, complaint, "require bison %s, but have %s", + version, PACKAGE_VERSION); exit (EX_MISMATCH); } } @@ -815,7 +811,7 @@ version_check (location const *loc, char const *version) static void gram_error (location const *loc, char const *msg) { - complain_at (*loc, complaint, "%s", msg); + complain (loc, complaint, "%s", msg); } char const *