aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/src
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-29 21:48:22 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-29 21:59:59 +0300
commitb21e05a2e32e36ae9cc9826acf98084ca4b52d7d (patch)
tree20d654fb0156f50e150944fc8108a3cada8ca6ec /contrib/tools/bison/src
parent0cf48e974f5542c3e65398c01b9b6baf8aa6c260 (diff)
downloadydb-b21e05a2e32e36ae9cc9826acf98084ca4b52d7d.tar.gz
Update contrib/tools/bison to 3.3.2
6215035f251de2d87363064fb4f07a2b14a3b4c8
Diffstat (limited to 'contrib/tools/bison/src')
-rw-r--r--contrib/tools/bison/src/AnnotationList.c2
-rw-r--r--contrib/tools/bison/src/AnnotationList.h2
-rw-r--r--contrib/tools/bison/src/InadequacyList.c2
-rw-r--r--contrib/tools/bison/src/InadequacyList.h2
-rw-r--r--contrib/tools/bison/src/LR0.c2
-rw-r--r--contrib/tools/bison/src/LR0.h2
-rw-r--r--contrib/tools/bison/src/Sbitset.c2
-rw-r--r--contrib/tools/bison/src/Sbitset.h2
-rw-r--r--contrib/tools/bison/src/assoc.c2
-rw-r--r--contrib/tools/bison/src/assoc.h4
-rw-r--r--contrib/tools/bison/src/closure.c5
-rw-r--r--contrib/tools/bison/src/closure.h2
-rw-r--r--contrib/tools/bison/src/complain.c44
-rw-r--r--contrib/tools/bison/src/complain.h14
-rw-r--r--contrib/tools/bison/src/conflicts.c150
-rw-r--r--contrib/tools/bison/src/conflicts.h5
-rw-r--r--contrib/tools/bison/src/derives.c2
-rw-r--r--contrib/tools/bison/src/derives.h4
-rw-r--r--contrib/tools/bison/src/files.c59
-rw-r--r--contrib/tools/bison/src/files.h9
-rw-r--r--contrib/tools/bison/src/fixits.c212
-rw-r--r--contrib/tools/bison/src/fixits.h35
-rw-r--r--contrib/tools/bison/src/flex-scanner.h3
-rw-r--r--contrib/tools/bison/src/getargs.c33
-rw-r--r--contrib/tools/bison/src/getargs.h16
-rw-r--r--contrib/tools/bison/src/gram.c2
-rw-r--r--contrib/tools/bison/src/gram.h9
-rw-r--r--contrib/tools/bison/src/graphviz.c4
-rw-r--r--contrib/tools/bison/src/graphviz.h3
-rw-r--r--contrib/tools/bison/src/ielr.c28
-rw-r--r--contrib/tools/bison/src/ielr.h2
-rw-r--r--contrib/tools/bison/src/lalr.c142
-rw-r--r--contrib/tools/bison/src/lalr.h2
-rw-r--r--contrib/tools/bison/src/location.c12
-rw-r--r--contrib/tools/bison/src/location.h6
-rw-r--r--contrib/tools/bison/src/main.c81
-rw-r--r--contrib/tools/bison/src/muscle-tab.c141
-rw-r--r--contrib/tools/bison/src/muscle-tab.h4
-rw-r--r--contrib/tools/bison/src/named-ref.c2
-rw-r--r--contrib/tools/bison/src/named-ref.h2
-rw-r--r--contrib/tools/bison/src/nullable.c4
-rw-r--r--contrib/tools/bison/src/nullable.h4
-rw-r--r--contrib/tools/bison/src/output.c165
-rw-r--r--contrib/tools/bison/src/output.h4
-rw-r--r--contrib/tools/bison/src/parse-gram.c1715
-rw-r--r--contrib/tools/bison/src/parse-gram.h132
-rw-r--r--contrib/tools/bison/src/print-xml.c3
-rw-r--r--contrib/tools/bison/src/print-xml.h3
-rw-r--r--contrib/tools/bison/src/print.c4
-rw-r--r--contrib/tools/bison/src/print.h3
-rw-r--r--contrib/tools/bison/src/print_graph.c4
-rw-r--r--contrib/tools/bison/src/print_graph.h4
-rw-r--r--contrib/tools/bison/src/reader.c62
-rw-r--r--contrib/tools/bison/src/reader.h10
-rw-r--r--contrib/tools/bison/src/reduce.c29
-rw-r--r--contrib/tools/bison/src/reduce.h7
-rw-r--r--contrib/tools/bison/src/relation.c2
-rw-r--r--contrib/tools/bison/src/relation.h4
-rw-r--r--contrib/tools/bison/src/scan-code.c146
-rw-r--r--contrib/tools/bison/src/scan-code.h4
-rw-r--r--contrib/tools/bison/src/scan-gram.c1459
-rw-r--r--contrib/tools/bison/src/scan-gram.h4
-rw-r--r--contrib/tools/bison/src/scan-skel.h4
-rw-r--r--contrib/tools/bison/src/state.c6
-rw-r--r--contrib/tools/bison/src/state.h12
-rw-r--r--contrib/tools/bison/src/symlist.c16
-rw-r--r--contrib/tools/bison/src/symlist.h12
-rw-r--r--contrib/tools/bison/src/symtab.c142
-rw-r--r--contrib/tools/bison/src/symtab.h15
-rw-r--r--contrib/tools/bison/src/system.h4
-rw-r--r--contrib/tools/bison/src/tables.c4
-rw-r--r--contrib/tools/bison/src/tables.h4
-rw-r--r--contrib/tools/bison/src/uniqstr.c4
-rw-r--r--contrib/tools/bison/src/uniqstr.h4
74 files changed, 3052 insertions, 2002 deletions
diff --git a/contrib/tools/bison/src/AnnotationList.c b/contrib/tools/bison/src/AnnotationList.c
index 34b9231068..4e29127c57 100644
--- a/contrib/tools/bison/src/AnnotationList.c
+++ b/contrib/tools/bison/src/AnnotationList.c
@@ -1,6 +1,6 @@
/* IELR's inadequacy annotation list.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/AnnotationList.h b/contrib/tools/bison/src/AnnotationList.h
index f770f6f0aa..ef3eeb6b0f 100644
--- a/contrib/tools/bison/src/AnnotationList.h
+++ b/contrib/tools/bison/src/AnnotationList.h
@@ -1,6 +1,6 @@
/* IELR's inadequacy annotation list.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/InadequacyList.c b/contrib/tools/bison/src/InadequacyList.c
index 4d36533f93..6caa14ea2f 100644
--- a/contrib/tools/bison/src/InadequacyList.c
+++ b/contrib/tools/bison/src/InadequacyList.c
@@ -1,6 +1,6 @@
/* IELR's inadequacy list.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/InadequacyList.h b/contrib/tools/bison/src/InadequacyList.h
index a05b99da84..bb52f7ae84 100644
--- a/contrib/tools/bison/src/InadequacyList.h
+++ b/contrib/tools/bison/src/InadequacyList.h
@@ -1,6 +1,6 @@
/* IELR's inadequacy list.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/LR0.c b/contrib/tools/bison/src/LR0.c
index 023f395552..d977d36455 100644
--- a/contrib/tools/bison/src/LR0.c
+++ b/contrib/tools/bison/src/LR0.c
@@ -1,6 +1,6 @@
/* Generate the LR(0) parser states for Bison.
- Copyright (C) 1984, 1986, 1989, 2000-2002, 2004-2015, 2018 Free
+ Copyright (C) 1984, 1986, 1989, 2000-2002, 2004-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/LR0.h b/contrib/tools/bison/src/LR0.h
index f7f6b63af9..3197ee9055 100644
--- a/contrib/tools/bison/src/LR0.h
+++ b/contrib/tools/bison/src/LR0.h
@@ -1,6 +1,6 @@
/* Generate the LR(0) parser states for Bison.
- Copyright (C) 1984, 1986, 1989, 2000-2002, 2009-2015, 2018 Free
+ Copyright (C) 1984, 1986, 1989, 2000-2002, 2009-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/Sbitset.c b/contrib/tools/bison/src/Sbitset.c
index b6ba379de6..aaa6819be0 100644
--- a/contrib/tools/bison/src/Sbitset.c
+++ b/contrib/tools/bison/src/Sbitset.c
@@ -1,6 +1,6 @@
/* A simple, memory-efficient bitset implementation.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/Sbitset.h b/contrib/tools/bison/src/Sbitset.h
index 82acdc5204..fc6347aa24 100644
--- a/contrib/tools/bison/src/Sbitset.h
+++ b/contrib/tools/bison/src/Sbitset.h
@@ -1,6 +1,6 @@
/* A simple, memory-efficient bitset implementation.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/assoc.c b/contrib/tools/bison/src/assoc.c
index 38d24e3498..fc1f937fb7 100644
--- a/contrib/tools/bison/src/assoc.c
+++ b/contrib/tools/bison/src/assoc.c
@@ -1,6 +1,6 @@
/* Associativity information.
- Copyright (C) 2002, 2005-2006, 2008-2015, 2018 Free Software
+ Copyright (C) 2002, 2005-2006, 2008-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/assoc.h b/contrib/tools/bison/src/assoc.h
index 661e1e541c..680e2fbcc6 100644
--- a/contrib/tools/bison/src/assoc.h
+++ b/contrib/tools/bison/src/assoc.h
@@ -1,7 +1,7 @@
/* Associativity information.
- Copyright (C) 2002, 2006, 2008-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2002, 2006, 2008-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/closure.c b/contrib/tools/bison/src/closure.c
index 6729d702ec..16be645229 100644
--- a/contrib/tools/bison/src/closure.c
+++ b/contrib/tools/bison/src/closure.c
@@ -1,7 +1,7 @@
/* Closures for Bison
- Copyright (C) 1984, 1989, 2000-2002, 2004-2005, 2007, 2009-2015, 2018
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 2000-2002, 2004-2005, 2007, 2009-2015,
+ 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -22,7 +22,6 @@
#include "system.h"
#include <bitset.h>
-#include <bitsetv-print.h>
#include <bitsetv.h>
#include "closure.h"
diff --git a/contrib/tools/bison/src/closure.h b/contrib/tools/bison/src/closure.h
index 1d728984fd..c75b8497e5 100644
--- a/contrib/tools/bison/src/closure.h
+++ b/contrib/tools/bison/src/closure.h
@@ -1,6 +1,6 @@
/* Subroutines for bison
- Copyright (C) 1984, 1989, 2000-2002, 2007, 2009-2015, 2018 Free
+ Copyright (C) 1984, 1989, 2000-2002, 2007, 2009-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/complain.c b/contrib/tools/bison/src/complain.c
index 6c1acf392e..50f65af54c 100644
--- a/contrib/tools/bison/src/complain.c
+++ b/contrib/tools/bison/src/complain.c
@@ -1,7 +1,7 @@
/* Declaration for error-reporting function for Bison.
- Copyright (C) 2000-2002, 2004-2006, 2009-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 2000-2002, 2004-2006, 2009-2015, 2018-2019 Free
+ Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@
#include "complain.h"
#include "files.h"
+#include "fixits.h"
#include "getargs.h"
#include "quote.h"
@@ -278,15 +279,18 @@ error_message (const location *loc, warnings flags, const char *prefix,
*indent_ptr = pos;
else if (*indent_ptr > pos)
fprintf (stderr, "%*s", *indent_ptr - pos, "");
- indent_ptr = 0;
+ indent_ptr = NULL;
}
if (prefix)
fprintf (stderr, "%s: ", prefix);
vfprintf (stderr, message, args);
- if (! (flags & silent))
+ /* Print the type of warning, only if this is not a sub message
+ (in which case the prefix is null). */
+ if (! (flags & silent) && prefix)
warnings_print_categories (flags, stderr);
+
{
size_t l = strlen (message);
if (l < 2 || message[l - 2] != ':' || message[l - 1] != ' ')
@@ -374,6 +378,14 @@ complain_args (location const *loc, warnings w, unsigned *indent,
}
}
+
+void
+bison_directive (location const *loc, char const *directive)
+{
+ complain (loc, Wyacc,
+ _("POSIX Yacc does not support %s"), directive);
+}
+
void
deprecated_directive (location const *loc, char const *old, char const *upd)
{
@@ -385,6 +397,9 @@ deprecated_directive (location const *loc, char const *old, char const *upd)
complain (loc, Wdeprecated,
_("deprecated directive: %s, use %s"),
quote (old), quote_n (1, upd));
+ /* Register updates only if -Wdeprecated is enabled. */
+ if (warnings_flag[warning_deprecated] != severity_disabled)
+ fixits_register (loc, upd);
}
void
@@ -392,7 +407,24 @@ duplicate_directive (char const *directive,
location first, location second)
{
unsigned i = 0;
- complain (&second, complaint, _("only one %s allowed per rule"), directive);
+ if (feature_flag & feature_caret)
+ complain_indent (&second, Wother, &i, _("duplicate directive"));
+ else
+ complain_indent (&second, Wother, &i, _("duplicate directive: %s"), quote (directive));
+ i += SUB_INDENT;
+ complain_indent (&first, Wother, &i, _("previous declaration"));
+ fixits_register (&second, "");
+}
+
+void
+duplicate_rule_directive (char const *directive,
+ location first, location second)
+{
+ unsigned i = 0;
+ complain_indent (&second, complaint, &i,
+ _("only one %s allowed per rule"), directive);
i += SUB_INDENT;
- complain_indent (&first, complaint, &i, _("previous declaration"));
+ complain_indent (&first, complaint, &i,
+ _("previous declaration"));
+ fixits_register (&second, "");
}
diff --git a/contrib/tools/bison/src/complain.h b/contrib/tools/bison/src/complain.h
index 599afb97c7..266992f6f4 100644
--- a/contrib/tools/bison/src/complain.h
+++ b/contrib/tools/bison/src/complain.h
@@ -1,6 +1,6 @@
/* Declaration for error-reporting function for Bison.
- Copyright (C) 2000-2002, 2006, 2009-2015, 2018 Free Software
+ Copyright (C) 2000-2002, 2006, 2009-2015, 2018-2019 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@@ -78,8 +78,7 @@ void complain_init (void);
typedef enum
{
- /**< Issue no warnings. */
- Wnone = 0,
+ Wnone = 0, /**< Issue no warnings. */
Wmidrule_values = 1 << warning_midrule_values,
Wyacc = 1 << warning_yacc,
@@ -120,14 +119,21 @@ void complain_indent (location const *loc, warnings flags, unsigned *indent,
__attribute__ ((__format__ (__printf__, 4, 5)));
+/** GNU Bison extension not valid with POSIX Yacc. */
+void bison_directive (location const *loc, char const *directive);
+
/** Report an obsolete syntax, suggest the updated one. */
void deprecated_directive (location const *loc,
char const *obsolete, char const *updated);
-/** Report a repeated directive for a rule. */
+/** Report a repeated directive. */
void duplicate_directive (char const *directive,
location first, location second);
+/** Report a repeated directive for a rule. */
+void duplicate_rule_directive (char const *directive,
+ location first, location second);
+
/** Warnings treated as errors shouldn't stop the execution as regular
errors should (because due to their nature, it is safe to go
on). Thus, there are three possible execution statuses. */
diff --git a/contrib/tools/bison/src/conflicts.c b/contrib/tools/bison/src/conflicts.c
index 6a6f88d90f..f81d831864 100644
--- a/contrib/tools/bison/src/conflicts.c
+++ b/contrib/tools/bison/src/conflicts.c
@@ -1,6 +1,6 @@
/* Find and resolve or report lookahead conflicts for bison,
- Copyright (C) 1984, 1989, 1992, 2000-2015, 2018 Free Software
+ Copyright (C) 1984, 1989, 1992, 2000-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -467,15 +467,13 @@ count_sr_conflicts (void)
-/*----------------------------------------------------------------.
-| Count the number of reduce/reduce conflicts. If ONE_PER_TOKEN, |
-| count one conflict for each token that has any reduce/reduce |
-| conflicts. Otherwise, count one conflict for each pair of |
-| conflicting reductions. |
-`----------------------------------------------------------------*/
+/*-----------------------------------------------------------------.
+| Count the number of reduce/reduce conflicts. Count one conflict |
+| for each reduction after the first for a given token. |
+`-----------------------------------------------------------------*/
static size_t
-count_state_rr_conflicts (state *s, bool one_per_token)
+count_state_rr_conflicts (state *s)
{
reductions *reds = s->reductions;
size_t res = 0;
@@ -485,25 +483,99 @@ count_state_rr_conflicts (state *s, bool one_per_token)
int count = 0;
for (int j = 0; j < reds->num; ++j)
count += bitset_test (reds->lookahead_tokens[j], i);
- if (count >= 2)
- res += one_per_token ? 1 : count-1;
+ if (2 <= count)
+ res += count-1;
}
return res;
}
static size_t
-count_rr_conflicts (bool one_per_token)
+count_rr_conflicts (void)
{
size_t res = 0;
/* Conflicts by state. */
for (state_number i = 0; i < nstates; ++i)
if (conflicts[i])
- res += count_state_rr_conflicts (states[i], one_per_token);
+ res += count_state_rr_conflicts (states[i]);
return res;
}
+/*------------------------------------------------------------------.
+| For a given rule, the number of shift/reduce conflicts in a given |
+| state. |
+`------------------------------------------------------------------*/
+
+static size_t
+count_rule_state_sr_conflicts (rule *r, state *s)
+{
+ size_t res = 0;
+ transitions *trans = s->transitions;
+ reductions *reds = s->reductions;
+
+ for (int i = 0; i < reds->num; ++i)
+ if (reds->rules[i] == r)
+ {
+ bitset lookaheads = reds->lookahead_tokens[i];
+ int j;
+ FOR_EACH_SHIFT (trans, j)
+ res += bitset_test (lookaheads, TRANSITION_SYMBOL (trans, j));
+ }
+
+ return res;
+}
+
+/*----------------------------------------------------------------------.
+| For a given rule, count the number of states for which it is involved |
+| in shift/reduce conflicts. |
+`----------------------------------------------------------------------*/
+
+static size_t
+count_rule_sr_conflicts (rule *r)
+{
+ size_t res = 0;
+ for (state_number i = 0; i < nstates; ++i)
+ if (conflicts[i])
+ res += count_rule_state_sr_conflicts (r, states[i]);
+ return res;
+}
+
+/*-----------------------------------------------------------------.
+| For a given rule, count the number of states in which it is |
+| involved in reduce/reduce conflicts. |
+`-----------------------------------------------------------------*/
+
+static size_t
+count_rule_state_rr_conflicts (rule *r, state *s)
+{
+ size_t res = 0;
+ const reductions *reds = s->reductions;
+ bitset lookaheads = bitset_create (ntokens, BITSET_FIXED);
+
+ for (int i = 0; i < reds->num; ++i)
+ if (reds->rules[i] == r)
+ for (int j = 0; j < reds->num; ++j)
+ if (reds->rules[j] != r)
+ {
+ bitset_and (lookaheads,
+ reds->lookahead_tokens[i],
+ reds->lookahead_tokens[j]);
+ res += bitset_count (lookaheads);
+ }
+ bitset_free (lookaheads);
+ return res;
+}
+
+static size_t
+count_rule_rr_conflicts (rule *r)
+{
+ size_t res = 0;
+ for (state_number i = 0; i < nstates; ++i)
+ res += count_rule_state_rr_conflicts (r, states[i]);
+ return res;
+}
+
/*-----------------------------------------------------------.
| Output the detailed description of states with conflicts. |
`-----------------------------------------------------------*/
@@ -518,7 +590,7 @@ conflicts_output (FILE *out)
if (conflicts[i])
{
int src = count_state_sr_conflicts (s);
- int rrc = count_state_rr_conflicts (s, true);
+ int rrc = count_state_rr_conflicts (s);
fprintf (out, _("State %d "), i);
if (src && rrc)
fprintf (out,
@@ -535,27 +607,56 @@ conflicts_output (FILE *out)
fputs ("\n\n", out);
}
-/*--------------------------------------------------------.
-| Total the number of S/R and R/R conflicts. Unlike the |
-| code in conflicts_output, however, count EACH pair of |
-| reductions for the same state and lookahead as one |
-| conflict. |
-`--------------------------------------------------------*/
+/*--------------------------------------------.
+| Total the number of S/R and R/R conflicts. |
+`--------------------------------------------*/
int
conflicts_total_count (void)
{
- return count_sr_conflicts () + count_rr_conflicts (false);
+ return count_sr_conflicts () + count_rr_conflicts ();
}
+/*------------------------------.
+| Reporting per-rule conflicts. |
+`------------------------------*/
+
+static void
+rule_conflicts_print (void)
+{
+ for (rule_number i = 0; i < nrules; i += 1)
+ {
+ rule *r = &rules[i];
+ int expected_sr = r->expected_sr_conflicts;
+ int expected_rr = r->expected_rr_conflicts;
+
+ if (expected_sr != -1 || expected_rr != -1)
+ {
+ int sr = count_rule_sr_conflicts (r);
+ if (sr != expected_sr && (sr != 0 || expected_sr != -1))
+ complain (&r->location, complaint,
+ _("shift/reduce conflicts for rule %d:"
+ " %d found, %d expected"),
+ r->user_number, sr, expected_sr);
+ int rr = count_rule_rr_conflicts (r);
+ if (rr != expected_rr && (rr != 0 || expected_rr != -1))
+ complain (&r->location, complaint,
+ _("reduce/reduce conflicts for rule %d:"
+ " %d found, %d expected"),
+ r->user_number, rr, expected_rr);
+ }
+ }
+}
-/*------------------------------------------.
-| Reporting the total number of conflicts. |
-`------------------------------------------*/
+/*---------------------------------.
+| Reporting numbers of conflicts. |
+`---------------------------------*/
void
conflicts_print (void)
{
+ rule_conflicts_print ();
+
if (! glr_parser && expected_rr_conflicts != -1)
{
complain (NULL, Wother, _("%%expect-rr applies only to GLR parsers"));
@@ -587,7 +688,7 @@ conflicts_print (void)
}
{
- int total = count_rr_conflicts (true);
+ int total = count_rr_conflicts ();
/* If %expect-rr is not used, but %expect is, then expect 0 rr. */
int expected =
(expected_rr_conflicts == -1 && expected_sr_conflicts != -1)
@@ -609,7 +710,6 @@ conflicts_print (void)
}
}
-
void
conflicts_free (void)
{
diff --git a/contrib/tools/bison/src/conflicts.h b/contrib/tools/bison/src/conflicts.h
index 22a177cbe4..c068e36da9 100644
--- a/contrib/tools/bison/src/conflicts.h
+++ b/contrib/tools/bison/src/conflicts.h
@@ -1,7 +1,7 @@
/* Find and resolve or report lookahead conflicts for bison,
- Copyright (C) 2000-2002, 2004, 2007, 2009-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 2000-2002, 2004, 2007, 2009-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -44,4 +44,5 @@ void conflicts_free (void);
/* Were there conflicts? */
extern int expected_sr_conflicts;
extern int expected_rr_conflicts;
+
#endif /* !CONFLICTS_H_ */
diff --git a/contrib/tools/bison/src/derives.c b/contrib/tools/bison/src/derives.c
index 7564b41153..7b7d5c94af 100644
--- a/contrib/tools/bison/src/derives.c
+++ b/contrib/tools/bison/src/derives.c
@@ -1,6 +1,6 @@
/* Match rules with nonterminals for bison,
- Copyright (C) 1984, 1989, 2000-2003, 2005, 2009-2015, 2018 Free
+ Copyright (C) 1984, 1989, 2000-2003, 2005, 2009-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/derives.h b/contrib/tools/bison/src/derives.h
index c4a701c034..521a10c60b 100644
--- a/contrib/tools/bison/src/derives.h
+++ b/contrib/tools/bison/src/derives.h
@@ -1,7 +1,7 @@
/* Match rules with nonterminals for bison,
- Copyright (C) 1984, 1989, 2000-2002, 2009-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1989, 2000-2002, 2009-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/files.c b/contrib/tools/bison/src/files.c
index 87136908ca..727a41af80 100644
--- a/contrib/tools/bison/src/files.c
+++ b/contrib/tools/bison/src/files.c
@@ -1,7 +1,7 @@
/* Open and close files for Bison.
- Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -43,7 +43,9 @@
char const *spec_outfile = NULL; /* for -o. */
char const *spec_file_prefix = NULL; /* for -b. */
+location spec_file_prefix_loc = EMPTY_LOCATION_INIT;
char const *spec_name_prefix = NULL; /* for -p. */
+location spec_name_prefix_loc = EMPTY_LOCATION_INIT;
char *spec_verbose_file = NULL; /* for --verbose. */
char *spec_graph_file = NULL; /* for -g. */
char *spec_xml_file = NULL; /* for -x. */
@@ -119,14 +121,12 @@ concat2 (char const *str1, char const *str2)
FILE *
xfopen (const char *name, const char *mode)
{
- FILE *ptr;
-
- ptr = fopen_safer (name, mode);
- if (!ptr)
+ FILE *res = fopen_safer (name, mode);
+ if (!res)
error (EXIT_FAILURE, get_errno (),
_("%s: cannot open"), quotearg_colon (name));
- return ptr;
+ return res;
}
/*-------------------------------------------------------------.
@@ -253,19 +253,18 @@ file_name_split (const char *file_name,
}
}
+/* Compute ALL_BUT_EXT and ALL_BUT_TAB_EXT from SPEC_OUTFILE or
+ GRAMMAR_FILE.
+
+ The precise -o name will be used for FTABLE. For other output
+ files, remove the ".c" or ".tab.c" suffix. */
static void
compute_file_name_parts (void)
{
- const char *base, *tab, *ext;
-
- /* Compute ALL_BUT_EXT and ALL_BUT_TAB_EXT from SPEC_OUTFILE
- or GRAMMAR_FILE.
-
- The precise -o name will be used for FTABLE. For other output
- files, remove the ".c" or ".tab.c" suffix. */
if (spec_outfile)
{
+ const char *base, *tab, *ext;
file_name_split (spec_outfile, &base, &tab, &ext);
dir_prefix = xstrndup (spec_outfile, base - spec_outfile);
@@ -285,6 +284,7 @@ compute_file_name_parts (void)
}
else
{
+ const char *base, *tab, *ext;
file_name_split (grammar_file, &base, &tab, &ext);
if (spec_file_prefix)
@@ -295,7 +295,7 @@ compute_file_name_parts (void)
last_component (spec_file_prefix) - spec_file_prefix);
all_but_tab_ext = xstrdup (spec_file_prefix);
}
- else if (yacc_flag)
+ else if (! location_empty (yacc_loc))
{
/* If --yacc, then the output is 'y.tab.c'. */
dir_prefix = xstrdup ("");
@@ -316,7 +316,7 @@ compute_file_name_parts (void)
all_but_ext = xstrdup (all_but_tab_ext);
/* Compute the extensions from the grammar file name. */
- if (ext && !yacc_flag)
+ if (ext && location_empty (yacc_loc))
compute_exts_from_gf (ext);
}
}
@@ -384,16 +384,13 @@ output_file_name_check (char **file_name, bool source)
conflict = true;
}
else
- {
- int i;
- for (i = 0; i < generated_files_size; i++)
- if (STREQ (generated_files[i].name, *file_name))
- {
- complain (NULL, Wother, _("conflicting outputs to file %s"),
- quote (generated_files[i].name));
- conflict = true;
- }
- }
+ for (int i = 0; i < generated_files_size; i++)
+ if (STREQ (generated_files[i].name, *file_name))
+ {
+ complain (NULL, Wother, _("conflicting outputs to file %s"),
+ quote (generated_files[i].name));
+ conflict = true;
+ }
if (conflict)
{
free (*file_name);
@@ -411,8 +408,7 @@ output_file_name_check (char **file_name, bool source)
void
unlink_generated_sources (void)
{
- int i;
- for (i = 0; i < generated_files_size; i++)
+ for (int i = 0; i < generated_files_size; i++)
if (generated_files[i].is_source)
/* Ignore errors. The file might not even exist. */
unlink (generated_files[i].name);
@@ -428,10 +424,7 @@ output_file_names_free (void)
free (spec_defines_file);
free (parser_file_name);
free (dir_prefix);
- {
- int i;
- for (i = 0; i < generated_files_size; i++)
- free (generated_files[i].name);
- }
+ for (int i = 0; i < generated_files_size; i++)
+ free (generated_files[i].name);
free (generated_files);
}
diff --git a/contrib/tools/bison/src/files.h b/contrib/tools/bison/src/files.h
index 9970e88b66..d5ee44c274 100644
--- a/contrib/tools/bison/src/files.h
+++ b/contrib/tools/bison/src/files.h
@@ -1,7 +1,7 @@
/* File names and variables for bison,
- Copyright (C) 1984, 1989, 2000-2002, 2006-2007, 2009-2015, 2018 Free
- Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 2000-2002, 2006-2007, 2009-2015, 2018-2019
+ Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -21,6 +21,7 @@
#ifndef FILES_H_
# define FILES_H_
+# include "location.h"
# include "uniqstr.h"
/* File name specified with -o for the output file, or 0 if no -o. */
@@ -31,9 +32,11 @@ extern char *parser_file_name;
/* Symbol prefix specified with -p, or 0 if no -p. */
extern const char *spec_name_prefix;
+extern location spec_name_prefix_loc;
/* File name prefix specified with -b, or 0 if no -b. */
extern char const *spec_file_prefix;
+extern location spec_file_prefix_loc;
/* --verbose. */
extern char *spec_verbose_file;
@@ -55,7 +58,7 @@ extern char *dir_prefix;
and therefore GCC warns about a name clash. */
extern uniqstr grammar_file;
-/* The current file name. Might change with %include, or with #line. */
+/* The current file name. Might change with #line. */
extern uniqstr current_file;
/* The computed base for output file names. */
diff --git a/contrib/tools/bison/src/fixits.c b/contrib/tools/bison/src/fixits.c
new file mode 100644
index 0000000000..5ffd793524
--- /dev/null
+++ b/contrib/tools/bison/src/fixits.c
@@ -0,0 +1,212 @@
+/* Support for fixing grammar files.
+
+ Copyright (C) 2019 Free Software Foundation, Inc.
+
+ This file is part of Bison, the GNU Compiler Compiler.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "fixits.h"
+
+#include "system.h"
+
+#include "error.h"
+#include "get-errno.h"
+#include "getargs.h"
+#include "gl_array_list.h"
+#include "gl_xlist.h"
+#include "progname.h"
+#include "quote.h"
+#include "quotearg.h"
+#include "vasnprintf.h"
+
+#include "files.h"
+
+typedef struct
+{
+ location location;
+ char *fix;
+} fixit;
+
+gl_list_t fixits = NULL;
+
+static fixit *
+fixit_new (location const *loc, char const* fix)
+{
+ fixit *res = xmalloc (sizeof *res);
+ res->location = *loc;
+ res->fix = xstrdup (fix);
+ return res;
+}
+
+
+static void
+fixit_free (fixit *f)
+{
+ free (f->fix);
+ free (f);
+}
+
+
+/* GCC and Clang follow the same pattern.
+ https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html
+ http://clang.llvm.org/docs/UsersManual.html#cmdoption-fdiagnostics-parseable-fixits */
+static void
+fixit_print (fixit const *f, FILE *out)
+{
+ fprintf (out, "fix-it:%s:{%d:%d-%d:%d}:%s\n",
+ quotearg_n_style (1, c_quoting_style, f->location.start.file),
+ f->location.start.line, f->location.start.column,
+ f->location.end.line, f->location.end.column,
+ quotearg_n_style (2, c_quoting_style, f->fix));
+}
+
+
+void
+fixits_register (location const *loc, char const* fix)
+{
+ if (!fixits)
+ fixits = gl_list_create_empty (GL_ARRAY_LIST,
+ /* equals */ NULL,
+ /* hashcode */ NULL,
+ (gl_listelement_dispose_fn) fixit_free,
+ true);
+ fixit *f = fixit_new (loc, fix);
+ gl_list_add_last (fixits, f);
+ if (feature_flag & feature_fixit_parsable)
+ fixit_print (f, stderr);
+}
+
+
+bool
+fixits_empty (void)
+{
+ return !fixits;
+}
+
+
+void
+fixits_run (void)
+{
+ if (!fixits)
+ return;
+
+ /* This is not unlike what is done in location_caret. */
+ uniqstr input = ((fixit *) gl_list_get_at (fixits, 0))->location.start.file;
+ /* Backup the file. */
+ char buf[256];
+ size_t len = sizeof (buf);
+ char *backup = asnprintf (buf, &len, "%s~", input);
+ if (!backup)
+ xalloc_die ();
+ if (rename (input, backup))
+ error (EXIT_FAILURE, get_errno (),
+ _("%s: cannot backup"), quotearg_colon (input));
+ FILE *in = xfopen (backup, "r");
+ FILE *out = xfopen (input, "w");
+ size_t line = 1;
+ size_t offset = 1;
+ fixit const *f = NULL;
+ gl_list_iterator_t iter = gl_list_iterator (fixits);
+ while (gl_list_iterator_next (&iter, (const void**) &f, NULL))
+ {
+ /* Look for the correct line. */
+ while (line < f->location.start.line)
+ {
+ int c = getc (in);
+ if (c == EOF)
+ break;
+ if (c == '\n')
+ {
+ ++line;
+ offset = 1;
+ }
+ putc (c, out);
+ }
+ /* Look for the right offset. */
+ while (offset < f->location.start.column)
+ {
+ int c = getc (in);
+ if (c == EOF)
+ break;
+ ++offset;
+ putc (c, out);
+ }
+
+ /* Paste the fix instead. */
+ fputs (f->fix, out);
+
+ /* Skip the bad input. */
+ while (line < f->location.end.line)
+ {
+ int c = getc (in);
+ if (c == EOF)
+ break;
+ if (c == '\n')
+ {
+ ++line;
+ offset = 1;
+ }
+ }
+ while (offset < f->location.end.column)
+ {
+ int c = getc (in);
+ if (c == EOF)
+ break;
+ ++offset;
+ }
+ /* If erasing the content of a full line, also remove the
+ end-of-line. */
+ if (f->fix[0] == 0 && f->location.start.column == 1)
+ {
+ int c = getc (in);
+ if (c == EOF)
+ break;
+ else if (c == '\n')
+ {
+ ++line;
+ offset = 1;
+ }
+ else
+ ungetc (c, in);
+ }
+ }
+ /* Paste the rest of the file. */
+ {
+ int c;
+ while ((c = getc (in)) != EOF)
+ putc (c, out);
+ }
+
+ gl_list_iterator_free (&iter);
+ xfclose (out);
+ xfclose (in);
+ fprintf (stderr, "%s: file %s was updated (backup: %s)\n",
+ program_name, quote_n (0, input), quote_n (1, backup));
+ if (backup != buf)
+ free (backup);
+}
+
+
+/* Free the registered fixits. */
+void fixits_free (void)
+{
+ if (fixits)
+ {
+ gl_list_free (fixits);
+ fixits = NULL;
+ }
+}
diff --git a/contrib/tools/bison/src/fixits.h b/contrib/tools/bison/src/fixits.h
new file mode 100644
index 0000000000..45c2780af8
--- /dev/null
+++ b/contrib/tools/bison/src/fixits.h
@@ -0,0 +1,35 @@
+/* Support for fixing grammar files.
+
+ Copyright (C) 2019 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef FIXITS_H_
+# define FIXITS_H_ 1
+
+# include "location.h"
+
+/* Declare a fix to apply. */
+void fixits_register (location const *loc, char const* update);
+
+/* Apply the fixits: update the source file. */
+void fixits_run (void);
+
+/* Whether there are no fixits. */
+bool fixits_empty (void);
+
+/* Free the registered fixits. */
+void fixits_free (void);
+
+#endif /* !FIXITS_H_ */
diff --git a/contrib/tools/bison/src/flex-scanner.h b/contrib/tools/bison/src/flex-scanner.h
index 66b6098e13..9e4408f49d 100644
--- a/contrib/tools/bison/src/flex-scanner.h
+++ b/contrib/tools/bison/src/flex-scanner.h
@@ -1,6 +1,7 @@
/* Common parts between scan-code.l, scan-gram.l, and scan-skel.l.
- Copyright (C) 2006, 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/getargs.c b/contrib/tools/bison/src/getargs.c
index 69486abff9..51d66be3f5 100644
--- a/contrib/tools/bison/src/getargs.c
+++ b/contrib/tools/bison/src/getargs.c
@@ -1,7 +1,7 @@
/* Parse command line arguments for Bison.
- Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -36,12 +36,13 @@
#include "quote.h"
#include "uniqstr.h"
-bool defines_flag;
-bool graph_flag;
-bool xml_flag;
-bool no_lines_flag;
-bool token_table_flag;
-bool yacc_flag; /* for -y */
+bool defines_flag = false;
+bool graph_flag = false;
+bool xml_flag = false;
+bool no_lines_flag = false;
+bool token_table_flag = false;
+location yacc_loc = EMPTY_LOCATION_INIT;
+bool update_flag = false; /* for -u */
bool nondeterministic_parser = false;
bool glr_parser = false;
@@ -54,6 +55,7 @@ static struct bison_language const valid_languages[] = {
/* lang, skeleton, ext, hdr, add_tab */
{ "c", "c-skel.m4", ".c", ".h", true },
{ "c++", "c++-skel.m4", ".cc", ".hh", true },
+ { "d", "d-skel.m4", ".d", ".d", false },
{ "java", "java-skel.m4", ".java", ".java", false },
{ "", "", "", "", false }
};
@@ -229,6 +231,7 @@ static const char * const feature_args[] =
{
"none",
"caret", "diagnostics-show-caret",
+ "fixit", "diagnostics-parseable-fixits",
"all",
0
};
@@ -237,6 +240,7 @@ static const int feature_types[] =
{
feature_none,
feature_caret, feature_caret,
+ feature_fixit_parsable, feature_fixit_parsable,
feature_all
};
@@ -282,7 +286,10 @@ Operation modes:\n\
-h, --help display this help and exit\n\
-V, --version output version information and exit\n\
--print-localedir output directory containing locale-dependent data\n\
+ and exit\n\
--print-datadir output directory containing skeletons and XSLT\n\
+ and exit\n\
+ -u, --update apply fixes to the source grammar file and exit\n\
-y, --yacc emulate POSIX Yacc\n\
-W, --warnings[=CATEGORY] report the warnings falling in CATEGORY\n\
-f, --feature[=FEATURE] activate miscellaneous features\n\
@@ -477,6 +484,7 @@ static char const short_options[] =
"p:"
"r:"
"t"
+ "u" /* --update */
"v"
"x::"
"y"
@@ -499,6 +507,7 @@ static struct option const long_options[] =
{ "version", no_argument, 0, 'V' },
{ "print-localedir", no_argument, 0, PRINT_LOCALEDIR_OPTION },
{ "print-datadir", no_argument, 0, PRINT_DATADIR_OPTION },
+ { "update", no_argument, 0, 'u' },
{ "warnings", optional_argument, 0, 'W' },
/* Parser. */
@@ -685,6 +694,10 @@ getargs (int argc, char *argv[])
MUSCLE_PERCENT_DEFINE_D);
break;
+ case 'u':
+ update_flag = true;
+ break;
+
case 'v':
report_flag |= report_states;
break;
@@ -699,8 +712,8 @@ getargs (int argc, char *argv[])
break;
case 'y':
- warning_argmatch ("error=yacc", 0, 6);
- yacc_flag = true;
+ warning_argmatch ("yacc", 0, 0);
+ yacc_loc = command_line_location ();
break;
case LOCATIONS_OPTION:
diff --git a/contrib/tools/bison/src/getargs.h b/contrib/tools/bison/src/getargs.h
index 4e127d4a59..b488091393 100644
--- a/contrib/tools/bison/src/getargs.h
+++ b/contrib/tools/bison/src/getargs.h
@@ -1,7 +1,7 @@
/* Parse command line arguments for bison.
- Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -39,9 +39,10 @@ extern bool graph_flag; /* for -g */
extern bool xml_flag; /* for -x */
extern bool no_lines_flag; /* for -l */
extern bool token_table_flag; /* for -k */
-extern bool yacc_flag; /* for -y */
+extern location yacc_loc; /* for -y */
+extern bool update_flag; /* for -u */
-extern const char *m4_path;
+extern const char* m4_path;
/* GLR_PARSER is true if the input file says to use the GLR
(Generalized LR) parser, and to output some additional information
@@ -115,9 +116,10 @@ extern int trace_flag;
enum feature
{
- feature_none = 0, /**< No additional feature. */
- feature_caret = 1 << 0, /**< Enhance the output of errors with carets. */
- feature_all = ~0 /**< All above features. */
+ feature_none = 0, /**< No additional feature. */
+ feature_caret = 1 << 0, /**< Output errors with carets. */
+ feature_fixit_parsable = 1 << 1, /**< Issue instructions to fix the sources. */
+ feature_all = ~0 /**< All above features. */
};
/** What additional features to use. */
extern int feature_flag;
diff --git a/contrib/tools/bison/src/gram.c b/contrib/tools/bison/src/gram.c
index fd07719e86..7f2c943961 100644
--- a/contrib/tools/bison/src/gram.c
+++ b/contrib/tools/bison/src/gram.c
@@ -1,6 +1,6 @@
/* Allocate input grammar variables for Bison.
- Copyright (C) 1984, 1986, 1989, 2001-2003, 2005-2015, 2018 Free
+ Copyright (C) 1984, 1986, 1989, 2001-2003, 2005-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/gram.h b/contrib/tools/bison/src/gram.h
index 4ecf4bf2b5..83dd8aacf7 100644
--- a/contrib/tools/bison/src/gram.h
+++ b/contrib/tools/bison/src/gram.h
@@ -1,7 +1,7 @@
/* Data definitions for internal representation of Bison's input.
- Copyright (C) 1984, 1986, 1989, 1992, 2001-2007, 2009-2015, 2018 Free
- Software Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 2001-2007, 2009-2015, 2018-2019
+ Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -196,6 +196,11 @@ typedef struct
bool useful;
bool is_predicate;
+ /* Counts of the numbers of expected conflicts for this rule, or -1 if none
+ given. */
+ int expected_sr_conflicts;
+ int expected_rr_conflicts;
+
const char *action;
location action_location;
} rule;
diff --git a/contrib/tools/bison/src/graphviz.c b/contrib/tools/bison/src/graphviz.c
index a5e3a5e9ab..75e4a6e6a8 100644
--- a/contrib/tools/bison/src/graphviz.c
+++ b/contrib/tools/bison/src/graphviz.c
@@ -1,7 +1,7 @@
/* Output Graphviz specification of a state machine generated by Bison.
- Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/graphviz.h b/contrib/tools/bison/src/graphviz.h
index f2aaa91feb..cceb1fbd3d 100644
--- a/contrib/tools/bison/src/graphviz.h
+++ b/contrib/tools/bison/src/graphviz.h
@@ -1,6 +1,7 @@
/* Output Graphviz specification of a state machine generated by Bison.
- Copyright (C) 2006, 2010-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/ielr.c b/contrib/tools/bison/src/ielr.c
index 5eb7d312dc..867b8a0a2a 100644
--- a/contrib/tools/bison/src/ielr.c
+++ b/contrib/tools/bison/src/ielr.c
@@ -1,6 +1,6 @@
/* IELR main implementation.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -50,7 +50,7 @@ ielr_compute_ritem_sees_lookahead_set (void)
{
bitset result = bitset_create (nritems, BITSET_FIXED);
unsigned i = nritems-1;
- while (i>0)
+ while (0 < i)
{
--i;
while (!item_number_is_rule_number (ritem[i])
@@ -59,7 +59,7 @@ ielr_compute_ritem_sees_lookahead_set (void)
bitset_set (result, i--);
if (!item_number_is_rule_number (ritem[i]) && ISVAR (ritem[i]))
bitset_set (result, i--);
- while (!item_number_is_rule_number (ritem[i]) && i>0)
+ while (!item_number_is_rule_number (ritem[i]) && 0 < i)
--i;
}
if (trace_flag & trace_ielr)
@@ -205,8 +205,7 @@ ielr_compute_follow_kernel_items (bitset ritem_sees_lookahead_set,
{
size_t nitems = states[from_state[i]]->nitems;
item_number *items = states[from_state[i]]->items;
- size_t j;
- for (j = 0; j < nitems; ++j)
+ for (size_t j = 0; j < nitems; ++j)
/* If this item has this goto and if all subsequent symbols in this
RHS (if any) are nullable nonterminals, then record this item as
one whose lookahead set is included in this goto's follows. */
@@ -298,11 +297,8 @@ ielr_compute_predecessors (void)
for (state_number i = 0; i < nstates; ++i)
predecessor_counts[i] = 0;
for (state_number i = 0; i < nstates; ++i)
- {
- int j;
- for (j = 0; j < states[i]->transitions->num; ++j)
- ++predecessor_counts[states[i]->transitions->states[j]->number];
- }
+ for (int j = 0; j < states[i]->transitions->num; ++j)
+ ++predecessor_counts[states[i]->transitions->states[j]->number];
for (state_number i = 0; i < nstates; ++i)
{
result[i] = xnmalloc (predecessor_counts[i]+1, sizeof *result[i]);
@@ -530,7 +526,8 @@ ielr_compute_annotation_lists (bitsetv follow_kernel_items,
free (annotation_counts);
}
-typedef struct state_list {
+typedef struct state_list
+{
struct state_list *next;
state *state;
/** Has this state been recomputed as a successor of another state? */
@@ -683,7 +680,6 @@ ielr_compute_state (bitsetv follow_kernel_items, bitsetv always_follows,
{
state_list *lr0_isocore = t->state_list->lr0Isocore;
state_list **this_isocorep;
- bool has_lookaheads;
/* Determine whether there's an isocore of t with which these lookaheads can
be merged. */
@@ -750,7 +746,7 @@ ielr_compute_state (bitsetv follow_kernel_items, bitsetv always_follows,
}
}
- has_lookaheads = false;
+ bool has_lookaheads = false;
for (size_t i = 0; i < lr0_isocore->state->nitems; ++i)
if (!bitset_empty_p (lookaheads[i]))
{
@@ -894,10 +890,9 @@ ielr_compute_state (bitsetv follow_kernel_items, bitsetv always_follows,
(*last_statep)->lookaheads = NULL;
if (has_lookaheads)
{
- size_t i;
(*last_statep)->lookaheads =
xnmalloc (t->nitems, sizeof (*last_statep)->lookaheads);
- for (i = 0; i < t->nitems; ++i)
+ for (size_t i = 0; i < t->nitems; ++i)
{
if (bitset_empty_p (lookaheads[i]))
(*last_statep)->lookaheads[i] = NULL;
@@ -1046,8 +1041,7 @@ ielr_split_states (bitsetv follow_kernel_items, bitsetv always_follows,
state_list *node = first_state;
if (node->lookaheads)
{
- size_t i;
- for (i = 0; i < node->state->nitems; ++i)
+ for (size_t i = 0; i < node->state->nitems; ++i)
if (node->lookaheads[i])
bitset_free (node->lookaheads[i]);
free (node->lookaheads);
diff --git a/contrib/tools/bison/src/ielr.h b/contrib/tools/bison/src/ielr.h
index c080fdf0d3..17dcb2c8c8 100644
--- a/contrib/tools/bison/src/ielr.h
+++ b/contrib/tools/bison/src/ielr.h
@@ -1,6 +1,6 @@
/* IELR main implementation.
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/lalr.c b/contrib/tools/bison/src/lalr.c
index 109aa0f4d9..0f1149d7fb 100644
--- a/contrib/tools/bison/src/lalr.c
+++ b/contrib/tools/bison/src/lalr.c
@@ -1,6 +1,6 @@
/* Compute lookahead criteria for Bison.
- Copyright (C) 1984, 1986, 1989, 2000-2015, 2018 Free Software
+ Copyright (C) 1984, 1986, 1989, 2000-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -40,10 +40,10 @@
#include "relation.h"
#include "symtab.h"
-goto_number *goto_map;
-goto_number ngotos;
-state_number *from_state;
-state_number *to_state;
+goto_number *goto_map = NULL;
+goto_number ngotos = 0;
+state_number *from_state = NULL;
+state_number *to_state = NULL;
bitsetv goto_follows = NULL;
/* Linked list of goto numbers. */
@@ -70,16 +70,14 @@ static goto_list **lookback;
void
set_goto_map (void)
{
- state_number s;
goto_number *temp_map = xnmalloc (nvars + 1, sizeof *temp_map);
goto_map = xcalloc (nvars + 1, sizeof *goto_map);
ngotos = 0;
- for (s = 0; s < nstates; ++s)
+ for (state_number s = 0; s < nstates; ++s)
{
transitions *sp = states[s]->transitions;
- int i;
- for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i)
+ for (int i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i)
{
ngotos++;
@@ -92,14 +90,13 @@ set_goto_map (void)
{
goto_number k = 0;
- int i;
- for (i = ntokens; i < nsyms; i++)
+ for (symbol_number i = ntokens; i < nsyms; ++i)
{
temp_map[i - ntokens] = k;
k += goto_map[i - ntokens];
}
- for (i = ntokens; i < nsyms; i++)
+ for (symbol_number i = ntokens; i < nsyms; ++i)
goto_map[i - ntokens] = temp_map[i - ntokens];
goto_map[nsyms - ntokens] = ngotos;
@@ -109,11 +106,10 @@ set_goto_map (void)
from_state = xcalloc (ngotos, sizeof *from_state);
to_state = xcalloc (ngotos, sizeof *to_state);
- for (s = 0; s < nstates; ++s)
+ for (state_number s = 0; s < nstates; ++s)
{
- transitions *sp = states[s]->transitions;
- int i;
- for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i)
+ const transitions *sp = states[s]->transitions;
+ for (int i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i)
{
goto_number k = temp_map[TRANSITION_SYMBOL (sp, i) - ntokens]++;
from_state[k] = s;
@@ -133,11 +129,9 @@ map_goto (state_number s0, symbol_number sym)
for (;;)
{
- goto_number middle;
- state_number s;
aver (low <= high);
- middle = (low + high) / 2;
- s = from_state[middle];
+ goto_number middle = (low + high) / 2;
+ state_number s = from_state[middle];
if (s == s0)
return middle;
else if (s < s0)
@@ -155,20 +149,18 @@ initialize_F (void)
goto_number *edge = xnmalloc (ngotos + 1, sizeof *edge);
goto_number nedges = 0;
- goto_number i;
-
goto_follows = bitsetv_create (ngotos, ntokens, BITSET_FIXED);
- for (i = 0; i < ngotos; i++)
+ for (goto_number i = 0; i < ngotos; ++i)
{
state_number stateno = to_state[i];
- transitions *sp = states[stateno]->transitions;
+ const transitions *sp = states[stateno]->transitions;
int j;
FOR_EACH_SHIFT (sp, j)
bitset_set (goto_follows[i], TRANSITION_SYMBOL (sp, j));
- for (; j < sp->num; j++)
+ for (; j < sp->num; ++j)
{
symbol_number sym = TRANSITION_SYMBOL (sp, j);
if (nullable[sym - ntokens])
@@ -188,7 +180,7 @@ initialize_F (void)
relation_digraph (reads, ngotos, &goto_follows);
- for (i = 0; i < ngotos; i++)
+ for (goto_number i = 0; i < ngotos; ++i)
free (reads[i]);
free (reads);
@@ -213,19 +205,16 @@ build_relations (void)
{
goto_number *edge = xnmalloc (ngotos + 1, sizeof *edge);
state_number *states1 = xnmalloc (ritem_longest_rhs () + 1, sizeof *states1);
- goto_number i;
includes = xnmalloc (ngotos, sizeof *includes);
- for (i = 0; i < ngotos; i++)
+ for (goto_number i = 0; i < ngotos; ++i)
{
int nedges = 0;
symbol_number symbol1 = states[to_state[i]]->accessing_symbol;
- rule **rulep;
- for (rulep = derives[symbol1 - ntokens]; *rulep; rulep++)
+ for (rule **rulep = derives[symbol1 - ntokens]; *rulep; rulep++)
{
- bool done;
int length = 1;
item_number const *rp;
state *s = states[from_state[i]];
@@ -242,7 +231,7 @@ build_relations (void)
add_lookback_edge (s, *rulep, i);
length--;
- done = false;
+ bool done = false;
while (!done)
{
done = true;
@@ -265,9 +254,8 @@ build_relations (void)
includes[i] = NULL;
else
{
- int j;
includes[i] = xnmalloc (nedges + 1, sizeof includes[i][0]);
- for (j = 0; j < nedges; j++)
+ for (int j = 0; j < nedges; ++j)
includes[i][j] = edge[j];
includes[i][nedges] = END_NODE;
}
@@ -284,11 +272,9 @@ build_relations (void)
static void
compute_FOLLOWS (void)
{
- goto_number i;
-
relation_digraph (includes, ngotos, &goto_follows);
- for (i = 0; i < ngotos; i++)
+ for (goto_number i = 0; i < ngotos; ++i)
free (includes[i]);
free (includes);
@@ -298,15 +284,12 @@ compute_FOLLOWS (void)
static void
compute_lookahead_tokens (void)
{
- size_t i;
- goto_list *sp;
-
- for (i = 0; i < nLA; i++)
- for (sp = lookback[i]; sp; sp = sp->next)
+ for (size_t i = 0; i < nLA; ++i)
+ for (goto_list *sp = lookback[i]; sp; sp = sp->next)
bitset_or (LA[i], LA[i], goto_follows[sp->value]);
/* Free LOOKBACK. */
- for (i = 0; i < nLA; i++)
+ for (size_t i = 0; i < nLA; ++i)
LIST_FREE (goto_list, lookback[i]);
free (lookback);
@@ -346,7 +329,7 @@ state_lookahead_tokens_count (state *s, bool default_reduction_only_for_accept)
&& default_reduction_only_for_accept))
n_lookahead_tokens += rp->num;
else
- s->consistent = 1;
+ s->consistent = true;
return n_lookahead_tokens;
}
@@ -359,8 +342,6 @@ state_lookahead_tokens_count (state *s, bool default_reduction_only_for_accept)
void
initialize_LA (void)
{
- state_number i;
- bitsetv pLA;
bool default_reduction_only_for_accept;
{
char *default_reductions =
@@ -371,7 +352,7 @@ initialize_LA (void)
/* Compute the total number of reductions requiring a lookahead. */
nLA = 0;
- for (i = 0; i < nstates; i++)
+ for (state_number i = 0; i < nstates; ++i)
nLA +=
state_lookahead_tokens_count (states[i],
default_reduction_only_for_accept);
@@ -379,11 +360,11 @@ initialize_LA (void)
if (!nLA)
nLA = 1;
- pLA = LA = bitsetv_create (nLA, ntokens, BITSET_FIXED);
+ bitsetv pLA = LA = bitsetv_create (nLA, ntokens, BITSET_FIXED);
/* Initialize the members LOOKAHEAD_TOKENS for each state whose reductions
require lookahead tokens. */
- for (i = 0; i < nstates; i++)
+ for (state_number i = 0; i < nstates; ++i)
{
int count =
state_lookahead_tokens_count (states[i],
@@ -404,34 +385,30 @@ initialize_LA (void)
static void
lookahead_tokens_print (FILE *out)
{
- state_number i;
fprintf (out, "Lookahead tokens: BEGIN\n");
- for (i = 0; i < nstates; ++i)
+ for (state_number i = 0; i < nstates; ++i)
{
- reductions *reds = states[i]->reductions;
- bitset_iterator iter;
+ const reductions *reds = states[i]->reductions;
int n_lookahead_tokens = 0;
if (reds->lookahead_tokens)
- {
- int j;
- for (j = 0; j < reds->num; ++j)
- if (reds->lookahead_tokens[j])
- ++n_lookahead_tokens;
- }
+ for (int j = 0; j < reds->num; ++j)
+ if (reds->lookahead_tokens[j])
+ ++n_lookahead_tokens;
fprintf (out, "State %d: %d lookahead tokens\n",
i, n_lookahead_tokens);
if (reds->lookahead_tokens)
- {
- int j, k;
- for (j = 0; j < reds->num; ++j)
+ for (int j = 0; j < reds->num; ++j)
+ {
+ bitset_iterator iter;
+ int k;
BITSET_FOR_EACH (iter, reds->lookahead_tokens[j], k, 0)
fprintf (out, " on %d (%s) -> rule %d\n",
k, symbols[k]->tag,
reds->rules[j]->number);
- }
+ }
}
fprintf (out, "Lookahead tokens: END\n");
}
@@ -458,25 +435,23 @@ lalr_update_state_numbers (state_number old_to_new[], state_number nstates_old)
goto_number ngotos_reachable = 0;
symbol_number nonterminal = 0;
aver (nsyms == nvars + ntokens);
- {
- goto_number i;
- for (i = 0; i < ngotos; ++i)
- {
- while (i == goto_map[nonterminal])
- goto_map[nonterminal++] = ngotos_reachable;
- /* If old_to_new[from_state[i]] = nstates_old, remove this goto
- entry. */
- if (old_to_new[from_state[i]] != nstates_old)
- {
- /* from_state[i] is not removed, so it and thus to_state[i] are
- reachable, so to_state[i] != nstates_old. */
- aver (old_to_new[to_state[i]] != nstates_old);
- from_state[ngotos_reachable] = old_to_new[from_state[i]];
- to_state[ngotos_reachable] = old_to_new[to_state[i]];
- ++ngotos_reachable;
- }
- }
- }
+
+ for (goto_number i = 0; i < ngotos; ++i)
+ {
+ while (i == goto_map[nonterminal])
+ goto_map[nonterminal++] = ngotos_reachable;
+ /* If old_to_new[from_state[i]] = nstates_old, remove this goto
+ entry. */
+ if (old_to_new[from_state[i]] != nstates_old)
+ {
+ /* from_state[i] is not removed, so it and thus to_state[i] are
+ reachable, so to_state[i] != nstates_old. */
+ aver (old_to_new[to_state[i]] != nstates_old);
+ from_state[ngotos_reachable] = old_to_new[from_state[i]];
+ to_state[ngotos_reachable] = old_to_new[to_state[i]];
+ ++ngotos_reachable;
+ }
+ }
while (nonterminal <= nvars)
{
aver (ngotos == goto_map[nonterminal]);
@@ -489,8 +464,7 @@ lalr_update_state_numbers (state_number old_to_new[], state_number nstates_old)
void
lalr_free (void)
{
- state_number s;
- for (s = 0; s < nstates; ++s)
+ for (state_number s = 0; s < nstates; ++s)
states[s]->reductions->lookahead_tokens = NULL;
bitsetv_free (LA);
}
diff --git a/contrib/tools/bison/src/lalr.h b/contrib/tools/bison/src/lalr.h
index 898053f5c9..b06b3051ec 100644
--- a/contrib/tools/bison/src/lalr.h
+++ b/contrib/tools/bison/src/lalr.h
@@ -1,7 +1,7 @@
/* Compute lookahead criteria for bison,
Copyright (C) 1984, 1986, 1989, 2000, 2002, 2004, 2006-2007,
- 2009-2015, 2018 Free Software Foundation, Inc.
+ 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/location.c b/contrib/tools/bison/src/location.c
index e75e67e331..6876890c02 100644
--- a/contrib/tools/bison/src/location.c
+++ b/contrib/tools/bison/src/location.c
@@ -1,6 +1,7 @@
/* Locations for Bison
- Copyright (C) 2002, 2005-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -208,13 +209,20 @@ location_caret (location loc, FILE *out)
/* Print the carets (at least one), with the same indent as above.*/
fprintf (out, " %*s", loc.start.column - 1, "");
for (i = loc.start.column; i == loc.start.column || i < len; ++i)
- putc ('^', out);
+ putc (i == loc.start.column ? '^' : '~', out);
}
putc ('\n', out);
}
}
}
+bool
+location_empty (location loc)
+{
+ return !loc.start.file && !loc.start.line && !loc.start.column
+ && !loc.end.file && !loc.end.line && !loc.end.column;
+}
+
void
boundary_set_from_string (boundary *bound, char *loc_str)
{
diff --git a/contrib/tools/bison/src/location.h b/contrib/tools/bison/src/location.h
index 106048dd07..39e0507d96 100644
--- a/contrib/tools/bison/src/location.h
+++ b/contrib/tools/bison/src/location.h
@@ -1,6 +1,7 @@
/* Locations for Bison
- Copyright (C) 2002, 2004-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -125,6 +126,9 @@ location_cmp (location a, location b)
return res;
}
+/* Whether this is the empty location. */
+bool location_empty (location loc);
+
/* LOC_STR must be formatted as 'file:line.column', it will be modified. */
void boundary_set_from_string (boundary *bound, char *loc_str);
diff --git a/contrib/tools/bison/src/main.c b/contrib/tools/bison/src/main.c
index 957005ceaa..164712f484 100644
--- a/contrib/tools/bison/src/main.c
+++ b/contrib/tools/bison/src/main.c
@@ -1,7 +1,7 @@
/* Top level entry point of Bison.
Copyright (C) 1984, 1986, 1989, 1992, 1995, 2000-2002, 2004-2015,
- 2018 Free Software Foundation, Inc.
+ 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -21,11 +21,12 @@
#include <config.h>
#include "system.h"
-#include <bitset_stats.h>
#include <bitset.h>
+#include <bitset/stats.h>
#include <configmake.h>
#include <progname.h>
#include <quotearg.h>
+#include <relocatable.h> /* relocate2 */
#include <timevar.h>
#include "LR0.h"
@@ -34,6 +35,7 @@
#include "conflicts.h"
#include "derives.h"
#include "files.h"
+#include "fixits.h"
#include "getargs.h"
#include "gram.h"
#include "lalr.h"
@@ -58,6 +60,7 @@
int
main (int argc, char *argv[])
{
+#define DEPENDS_ON_LIBINTL 1
set_program_name (argv[0]);
setlocale (LC_ALL, "");
@@ -144,31 +147,34 @@ main (int argc, char *argv[])
print_precedence_warnings ();
- /* Output file names. */
- compute_output_file_names ();
-
- /* Output the detailed report on the grammar. */
- if (report_flag)
- {
- timevar_push (tv_report);
- print_results ();
- timevar_pop (tv_report);
- }
-
- /* Output the graph. */
- if (graph_flag)
- {
- timevar_push (tv_graph);
- print_graph ();
- timevar_pop (tv_graph);
- }
-
- /* Output xml. */
- if (xml_flag)
+ if (!update_flag)
{
- timevar_push (tv_xml);
- print_xml ();
- timevar_pop (tv_xml);
+ /* Output file names. */
+ compute_output_file_names ();
+
+ /* Output the detailed report on the grammar. */
+ if (report_flag)
+ {
+ timevar_push (tv_report);
+ print_results ();
+ timevar_pop (tv_report);
+ }
+
+ /* Output the graph. */
+ if (graph_flag)
+ {
+ timevar_push (tv_graph);
+ print_graph ();
+ timevar_pop (tv_graph);
+ }
+
+ /* Output xml. */
+ if (xml_flag)
+ {
+ timevar_push (tv_xml);
+ print_xml ();
+ timevar_pop (tv_xml);
+ }
}
/* Stop if there were errors, to avoid trashing previous output
@@ -182,9 +188,12 @@ main (int argc, char *argv[])
timevar_pop (tv_free);
/* Output the tables and the parser to ftable. In file output. */
- timevar_push (tv_parser);
- output ();
- timevar_pop (tv_parser);
+ if (!update_flag)
+ {
+ timevar_push (tv_parser);
+ output ();
+ timevar_pop (tv_parser);
+ }
timevar_push (tv_free);
nullable_free ();
@@ -200,7 +209,6 @@ main (int argc, char *argv[])
contains things such as user actions, prologue, epilogue etc. */
gram_scanner_free ();
muscle_free ();
- uniqstrs_free ();
code_scanner_free ();
skel_scanner_free ();
quotearg_free ();
@@ -217,5 +225,18 @@ main (int argc, char *argv[])
cleanup_caret ();
+ /* Fix input file now, even if there are errors: that's less
+ warnings in the following runs. */
+ if (!fixits_empty ())
+ {
+ if (update_flag)
+ fixits_run ();
+ else
+ complain (NULL, Wother,
+ _("fix-its can be applied. Rerun with option '--update'."));
+ fixits_free ();
+ }
+ uniqstrs_free ();
+
return complaint_status ? EXIT_FAILURE : EXIT_SUCCESS;
}
diff --git a/contrib/tools/bison/src/muscle-tab.c b/contrib/tools/bison/src/muscle-tab.c
index d4c195cb9d..8a1b00fc63 100644
--- a/contrib/tools/bison/src/muscle-tab.c
+++ b/contrib/tools/bison/src/muscle-tab.c
@@ -1,6 +1,6 @@
/* Muscle table manager for Bison.
- Copyright (C) 2001-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -24,6 +24,7 @@
#include "complain.h"
#include "files.h"
+#include "fixits.h"
#include "getargs.h"
#include "muscle-tab.h"
#include "quote.h"
@@ -407,10 +408,16 @@ muscle_user_name_list_grow (char const *key, char const *user_name,
static
char *
-define_directive (char const *assignment, char const *value)
+define_directive (char const *assignment,
+ muscle_kind kind,
+ char const *value)
{
char *eq = strchr (assignment, '=');
- char const *fmt = !eq && value && *value ? "%%define %s %s" : "%%define %s";
+ char const *fmt
+ = eq || !value || !*value ? "%%define %s"
+ : kind == muscle_code ? "%%define %s {%s}"
+ : kind == muscle_string ? "%%define %s \"%s\""
+ : "%%define %s %s";
char *res = xmalloc (strlen (fmt) + strlen (assignment)
+ (value ? strlen (value) : 0));
sprintf (res, fmt, assignment, value);
@@ -423,32 +430,46 @@ define_directive (char const *assignment, char const *value)
/** If the \a variable name is obsolete, return the name to use,
* otherwise \a variable. If the \a value is obsolete, update it too.
*
- * Allocates the returned value. */
+ * Allocates the returned value if needed, otherwise the returned
+ * value is exactly \a variable. */
static
-char *
-muscle_percent_variable_update (char const *variable, location variable_loc,
- char const **value)
+char const *
+muscle_percent_variable_update (char const *variable,
+ muscle_kind kind,
+ char const **value,
+ char **old, char **upd)
{
typedef struct
{
const char *obsolete;
const char *updated;
+ muscle_kind kind;
} conversion_type;
const conversion_type conversion[] =
- {
- { "api.push_pull", "api.push-pull", },
- { "api.tokens.prefix", "api.token.prefix", },
- { "lex_symbol", "api.token.constructor", },
- { "location_type", "api.location.type", },
- { "lr.default-reductions", "lr.default-reduction", },
- { "lr.keep-unreachable-states", "lr.keep-unreachable-state", },
- { "lr.keep_unreachable_states", "lr.keep-unreachable-state", },
- { "namespace", "api.namespace", },
- { "stype", "api.value.type", },
- { "variant=", "api.value.type=variant", },
- { "variant=true", "api.value.type=variant", },
- { NULL, NULL, }
- };
+ {
+ { "%error-verbose", "parse.error=verbose", muscle_keyword },
+ { "%error_verbose", "parse.error=verbose", muscle_keyword },
+ { "abstract", "api.parser.abstract", muscle_keyword },
+ { "annotations", "api.parser.annotations", muscle_code },
+ { "api.push_pull", "api.push-pull", muscle_keyword },
+ { "api.tokens.prefix", "api.token.prefix", muscle_code },
+ { "extends", "api.parser.extends", muscle_keyword },
+ { "final", "api.parser.final", muscle_keyword },
+ { "implements", "api.parser.implements", muscle_keyword },
+ { "lex_symbol", "api.token.constructor", -1 },
+ { "location_type", "api.location.type", muscle_code },
+ { "lr.default-reductions", "lr.default-reduction", muscle_keyword },
+ { "lr.keep-unreachable-states", "lr.keep-unreachable-state", muscle_keyword },
+ { "lr.keep_unreachable_states", "lr.keep-unreachable-state", muscle_keyword },
+ { "namespace", "api.namespace", muscle_code },
+ { "parser_class_name", "api.parser.class", muscle_code },
+ { "public", "api.parser.public", muscle_keyword },
+ { "strictfp", "api.parser.strictfp", muscle_keyword },
+ { "stype", "api.value.type", -1 },
+ { "variant=", "api.value.type=variant", -1 },
+ { "variant=true", "api.value.type=variant", -1 },
+ { NULL, NULL, -1, }
+ };
for (conversion_type const *c = conversion; c->obsolete; ++c)
{
@@ -458,22 +479,25 @@ muscle_percent_variable_update (char const *variable, location variable_loc,
&& STREQ (eq + 1, *value))
: STREQ (c->obsolete, variable))
{
- char *old = define_directive (c->obsolete, *value);
- char *upd = define_directive (c->updated, *value);
- deprecated_directive (&variable_loc, old, upd);
- free (old);
- free (upd);
- char *res = xstrdup (c->updated);
- char *eq2 = strchr (res, '=');
- if (eq2)
- {
- *eq2 = '\0';
- *value = eq2 + 1;
- }
- return res;
+ /* Generate the deprecation warning. */
+ *old = c->obsolete[0] == '%'
+ ? xstrdup (c->obsolete)
+ : define_directive (c->obsolete, kind, *value);
+ *upd = define_directive (c->updated, c->kind, *value);
+ /* Update the variable and its value. */
+ {
+ char *res = xstrdup (c->updated);
+ char *eq2 = strchr (res, '=');
+ if (eq2)
+ {
+ *eq2 = '\0';
+ *value = eq2 + 1;
+ }
+ return res;
+ }
}
}
- return xstrdup (variable);
+ return variable;
}
void
@@ -483,7 +507,11 @@ muscle_percent_define_insert (char const *var, location variable_loc,
muscle_percent_define_how how)
{
/* Backward compatibility. */
- char *variable = muscle_percent_variable_update (var, variable_loc, &value);
+ char *old = NULL;
+ char *upd = NULL;
+ char const *variable
+ = muscle_percent_variable_update (var, kind,
+ &value, &old, &upd);
uniqstr name = muscle_name (variable, NULL);
uniqstr loc_name = muscle_name (variable, "loc");
uniqstr syncline_name = muscle_name (variable, "syncline");
@@ -491,21 +519,33 @@ muscle_percent_define_insert (char const *var, location variable_loc,
uniqstr kind_name = muscle_name (variable, "kind");
/* Command-line options are processed before the grammar file. */
- if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
- && muscle_find_const (name))
+ bool warned = false;
+ if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE)
{
- muscle_percent_define_how how_old = atoi (muscle_find_const (how_name));
- if (how_old == MUSCLE_PERCENT_DEFINE_F)
- goto end;
- unsigned i = 0;
- complain_indent (&variable_loc, complaint, &i,
- _("%%define variable %s redefined"),
- quote (variable));
- i += SUB_INDENT;
- location loc = muscle_percent_define_get_loc (variable);
- complain_indent (&loc, complaint, &i, _("previous definition"));
+ char const *current_value = muscle_find_const (name);
+ if (current_value)
+ {
+ muscle_percent_define_how how_old
+ = atoi (muscle_find_const (how_name));
+ if (how_old == MUSCLE_PERCENT_DEFINE_F)
+ goto end;
+ unsigned i = 0;
+ /* If assigning the same value, make it a warning. */
+ warnings warn = STREQ (value, current_value) ? Wother : complaint;
+ complain_indent (&variable_loc, warn, &i,
+ _("%%define variable %s redefined"),
+ quote (variable));
+ i += SUB_INDENT;
+ location loc = muscle_percent_define_get_loc (variable);
+ complain_indent (&loc, warn, &i, _("previous definition"));
+ fixits_register (&variable_loc, "");
+ warned = true;
+ }
}
+ if (!warned && old && upd)
+ deprecated_directive (&variable_loc, old, upd);
+
MUSCLE_INSERT_STRING (name, value);
muscle_insert (loc_name, "");
muscle_location_grow (loc_name, variable_loc);
@@ -516,7 +556,10 @@ muscle_percent_define_insert (char const *var, location variable_loc,
MUSCLE_INSERT_INT (how_name, how);
MUSCLE_INSERT_STRING (kind_name, muscle_kind_string (kind));
end:
- free (variable);
+ free (old);
+ free (upd);
+ if (variable != var)
+ free ((char *) variable);
}
/* This is used for backward compatibility, e.g., "%define api.pure"
diff --git a/contrib/tools/bison/src/muscle-tab.h b/contrib/tools/bison/src/muscle-tab.h
index b1c59506a1..70c45db57c 100644
--- a/contrib/tools/bison/src/muscle-tab.h
+++ b/contrib/tools/bison/src/muscle-tab.h
@@ -1,7 +1,7 @@
/* Muscle table manager for Bison,
- Copyright (C) 2001-2003, 2006-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2001-2003, 2006-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/named-ref.c b/contrib/tools/bison/src/named-ref.c
index ac5af1c8e9..b9f49c4f63 100644
--- a/contrib/tools/bison/src/named-ref.c
+++ b/contrib/tools/bison/src/named-ref.c
@@ -1,6 +1,6 @@
/* Named symbol references for Bison
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/named-ref.h b/contrib/tools/bison/src/named-ref.h
index f42036facb..bc9f99fac3 100644
--- a/contrib/tools/bison/src/named-ref.h
+++ b/contrib/tools/bison/src/named-ref.h
@@ -1,6 +1,6 @@
/* Named symbol references for Bison
- Copyright (C) 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/nullable.c b/contrib/tools/bison/src/nullable.c
index 0dffd575b0..7d6cf9c885 100644
--- a/contrib/tools/bison/src/nullable.c
+++ b/contrib/tools/bison/src/nullable.c
@@ -1,7 +1,7 @@
/* Calculate which nonterminals can expand into the null string for Bison.
- Copyright (C) 1984, 1989, 2000-2006, 2009-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1989, 2000-2006, 2009-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/nullable.h b/contrib/tools/bison/src/nullable.h
index 8b6cfddd23..60caf3db22 100644
--- a/contrib/tools/bison/src/nullable.h
+++ b/contrib/tools/bison/src/nullable.h
@@ -1,7 +1,7 @@
/* Part of the bison parser generator,
- Copyright (C) 2000, 2002, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2000, 2002, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/output.c b/contrib/tools/bison/src/output.c
index 5009fe7f7b..ae0dc5834f 100644
--- a/contrib/tools/bison/src/output.c
+++ b/contrib/tools/bison/src/output.c
@@ -1,7 +1,7 @@
/* Output the generated parsing program for Bison.
- Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -26,6 +26,7 @@
#include <get-errno.h>
#include <path-join.h>
#include <quotearg.h>
+#include <relocatable.h> /* relocate2 */
#include <spawn-pipe.h>
#include <timevar.h>
#include <wait-process.h>
@@ -37,6 +38,7 @@
#include "muscle-tab.h"
#include "output.h"
#include "reader.h"
+#include "reduce.h"
#include "scan-code.h" /* max_left_semantic_context */
#include "scan-skel.h"
#include "symtab.h"
@@ -65,6 +67,9 @@ default_pkgdatadir()
static struct obstack format_obstack;
+/* Memory allocated by relocate2, to free. */
+static char *relocate_buffer = NULL;
+
/*-------------------------------------------------------------------.
| Create a function NAME which associates to the muscle NAME the |
@@ -77,11 +82,8 @@ static struct obstack format_obstack;
#define GENERATE_MUSCLE_INSERT_TABLE(Name, Type) \
\
static void \
-Name (char const *name, \
- Type *table_data, \
- Type first, \
- int begin, \
- int end) \
+Name (char const *name, Type *table_data, Type first, \
+ int begin, int end) \
{ \
Type min = first; \
Type max = first; \
@@ -115,11 +117,12 @@ Name (char const *name, \
MUSCLE_INSERT_LONG_INT (obstack_finish0 (&format_obstack), lmax); \
}
-GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_unsigned_int_table, unsigned)
+GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_unsigned_table, unsigned)
GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_int_table, int)
GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_base_table, base_number)
GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_rule_number_table, rule_number)
GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_symbol_number_table, symbol_number)
+GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_item_number_table, item_number)
GENERATE_MUSCLE_INSERT_TABLE (muscle_insert_state_number_table, state_number)
/*----------------------------------------------------------------.
@@ -156,6 +159,46 @@ string_output (FILE *out, char const *string)
}
+/*----------------------------.
+| Prepare the symbols names. |
+`----------------------------*/
+
+static void
+prepare_symbol_names (char const *muscle_name)
+{
+ /* We assume that the table will be output starting at column 2. */
+ int j = 2;
+ struct quoting_options *qo = clone_quoting_options (0);
+ set_quoting_style (qo, c_quoting_style);
+ set_quoting_flags (qo, QA_SPLIT_TRIGRAPHS);
+ for (int i = 0; i < nsyms; i++)
+ {
+ char *cp = quotearg_alloc (symbols[i]->tag, -1, qo);
+ /* Width of the next token, including the two quotes, the
+ comma and the space. */
+ int width = strlen (cp) + 2;
+
+ if (j + width > 75)
+ {
+ obstack_sgrow (&format_obstack, "\n ");
+ j = 1;
+ }
+
+ if (i)
+ obstack_1grow (&format_obstack, ' ');
+ obstack_escape (&format_obstack, cp);
+ free (cp);
+ obstack_1grow (&format_obstack, ',');
+ j += width;
+ }
+ free (qo);
+ obstack_sgrow (&format_obstack, " ]b4_null[");
+
+ /* Finish table and store. */
+ muscle_insert (muscle_name, obstack_finish0 (&format_obstack));
+}
+
+
/*------------------------------------------------------------------.
| Prepare the muscles related to the symbols: translate, tname, and |
| toknum. |
@@ -176,38 +219,7 @@ prepare_symbols (void)
1, max_user_token_number + 1);
/* tname -- token names. */
- {
- /* We assume that the table will be output starting at column 2. */
- int j = 2;
- struct quoting_options *qo = clone_quoting_options (0);
- set_quoting_style (qo, c_quoting_style);
- set_quoting_flags (qo, QA_SPLIT_TRIGRAPHS);
- for (int i = 0; i < nsyms; i++)
- {
- char *cp = quotearg_alloc (symbols[i]->tag, -1, qo);
- /* Width of the next token, including the two quotes, the
- comma and the space. */
- int width = strlen (cp) + 2;
-
- if (j + width > 75)
- {
- obstack_sgrow (&format_obstack, "\n ");
- j = 1;
- }
-
- if (i)
- obstack_1grow (&format_obstack, ' ');
- obstack_escape (&format_obstack, cp);
- free (cp);
- obstack_1grow (&format_obstack, ',');
- j += width;
- }
- free (qo);
- obstack_sgrow (&format_obstack, " ]b4_null[");
-
- /* Finish table and store. */
- muscle_insert ("tname", obstack_finish0 (&format_obstack));
- }
+ prepare_symbol_names ("tname");
/* Output YYTOKNUM. */
{
@@ -221,14 +233,16 @@ prepare_symbols (void)
}
-/*----------------------------------------------------------------.
-| Prepare the muscles related to the rules: r1, r2, rline, dprec, |
-| merger, immediate. |
-`----------------------------------------------------------------*/
+/*-------------------------------------------------------------.
+| Prepare the muscles related to the rules: rhs, prhs, r1, r2, |
+| rline, dprec, merger, immediate. |
+`-------------------------------------------------------------*/
static void
prepare_rules (void)
{
+ unsigned *prhs = xnmalloc (nrules, sizeof *prhs);
+ item_number *rhs = xnmalloc (nritems, sizeof *rhs);
unsigned *rline = xnmalloc (nrules, sizeof *rline);
symbol_number *r1 = xnmalloc (nrules, sizeof *r1);
unsigned *r2 = xnmalloc (nrules, sizeof *r2);
@@ -236,14 +250,24 @@ prepare_rules (void)
int *merger = xnmalloc (nrules, sizeof *merger);
int *immediate = xnmalloc (nrules, sizeof *immediate);
+ /* Index in RHS. */
+ unsigned i = 0;
for (rule_number r = 0; r < nrules; ++r)
{
+ /* Index of rule R in RHS. */
+ prhs[r] = i;
+ /* RHS of the rule R. */
+ for (item_number *rhsp = rules[r].rhs; 0 <= *rhsp; ++rhsp)
+ rhs[i++] = *rhsp;
+ /* Separator in RHS. */
+ rhs[i++] = -1;
+
+ /* Line where rule was defined. */
+ rline[r] = rules[r].location.start.line;
/* LHS of the rule R. */
r1[r] = rules[r].lhs->number;
/* Length of rule R's RHS. */
r2[r] = rule_rhs_length (&rules[r]);
- /* Line where rule was defined. */
- rline[r] = rules[r].location.start.line;
/* Dynamic precedence (GLR). */
dprec[r] = rules[r].dprec;
/* Merger-function index (GLR). */
@@ -251,10 +275,13 @@ prepare_rules (void)
/* Immediate reduction flags (GLR). */
immediate[r] = rules[r].is_predicate;
}
+ aver (i == nritems);
- muscle_insert_unsigned_int_table ("rline", rline, 0, 0, nrules);
+ muscle_insert_item_number_table ("rhs", rhs, ritem[0], 1, nritems);
+ muscle_insert_unsigned_table ("prhs", prhs, 0, 0, nrules);
+ muscle_insert_unsigned_table ("rline", rline, 0, 0, nrules);
muscle_insert_symbol_number_table ("r1", r1, 0, 0, nrules);
- muscle_insert_unsigned_int_table ("r2", r2, 0, 0, nrules);
+ muscle_insert_unsigned_table ("r2", r2, 0, 0, nrules);
muscle_insert_int_table ("dprec", dprec, 0, 0, nrules);
muscle_insert_int_table ("merger", merger, 0, 0, nrules);
muscle_insert_int_table ("immediate", immediate, 0, 0, nrules);
@@ -262,6 +289,8 @@ prepare_rules (void)
MUSCLE_INSERT_INT ("rules_number", nrules);
MUSCLE_INSERT_INT ("max_left_semantic_context", max_left_semantic_context);
+ free (prhs);
+ free (rhs);
free (rline);
free (r1);
free (r2);
@@ -407,6 +436,14 @@ merger_output (FILE *out)
static void
prepare_symbol_definitions (void)
{
+ /* Map "orig NUM" to new numbers. See data/README. */
+ for (symbol_number i = ntokens; i < nsyms + nuseless_nonterminals; ++i)
+ {
+ obstack_printf (&format_obstack, "symbol(orig %d, number)", i);
+ const char *key = obstack_finish0 (&format_obstack);
+ MUSCLE_INSERT_INT (key, nterm_map ? nterm_map[i - ntokens] : i);
+ }
+
for (int i = 0; i < nsyms; ++i)
{
symbol *sym = symbols[i];
@@ -519,10 +556,10 @@ prepare_actions (void)
parser, so we could avoid accidents by not writing them out in
that case. Nevertheless, it seems even better to be able to use
the GLR skeletons even without the non-deterministic tables. */
- muscle_insert_unsigned_int_table ("conflict_list_heads", conflict_table,
- conflict_table[0], 1, high + 1);
- muscle_insert_unsigned_int_table ("conflicting_rules", conflict_list,
- 0, 1, conflict_list_cnt);
+ muscle_insert_unsigned_table ("conflict_list_heads", conflict_table,
+ conflict_table[0], 1, high + 1);
+ muscle_insert_unsigned_table ("conflicting_rules", conflict_list,
+ 0, 1, conflict_list_cnt);
}
@@ -552,11 +589,12 @@ output_skeleton (void)
/* Compute the names of the package data dir and skeleton files. */
char const *m4 = (m4 = getenv ("M4")) ? m4 : M4;
char const *datadir = pkgdatadir ();
+ char *skeldir = xpath_join (datadir, "skeletons");
char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4");
- char *m4bison = xpath_join (datadir, "bison.m4");
+ char *m4bison = xpath_join (skeldir, "bison.m4");
char *skel = (IS_PATH_WITH_DIR (skeleton)
? xstrdup (skeleton)
- : xpath_join (datadir, skeleton));
+ : xpath_join (skeldir, skeleton));
/* Test whether m4sugar.m4 is readable, to check for proper
installation. A faulty installation can cause deadlock, so a
@@ -611,6 +649,7 @@ output_skeleton (void)
true, filter_fd);
}
+ free (skeldir);
free (m4sugar);
free (m4bison);
free (skel);
@@ -656,7 +695,7 @@ prepare (void)
MUSCLE_INSERT_BOOL ("tag_seen_flag", tag_seen);
MUSCLE_INSERT_BOOL ("token_table_flag", token_table_flag);
MUSCLE_INSERT_BOOL ("use_push_for_pull_flag", use_push_for_pull_flag);
- MUSCLE_INSERT_BOOL ("yacc_flag", yacc_flag);
+ MUSCLE_INSERT_BOOL ("yacc_flag", !location_empty (yacc_loc));
/* File names. */
if (spec_name_prefix)
@@ -683,10 +722,12 @@ prepare (void)
/* About the skeletons. */
{
- /* b4_pkgdatadir is used inside m4_include in the skeletons, so digraphs
+ /* b4_skeletonsdir is used inside m4_include in the skeletons, so digraphs
would never be expanded. Hopefully no one has M4-special characters in
his Bison installation path. */
- MUSCLE_INSERT_STRING_RAW ("pkgdatadir", pkgdatadir ());
+ char *skeldir = xpath_join (pkgdatadir (), "skeletons");
+ MUSCLE_INSERT_STRING_RAW ("skeletonsdir", skeldir);
+ free (skeldir);
}
}
@@ -717,11 +758,17 @@ output (void)
unlink_generated_sources ();
obstack_free (&format_obstack, NULL);
+ free (relocate_buffer);
}
char const *
pkgdatadir (void)
{
- char const *cp = getenv ("BISON_PKGDATADIR");
- return cp ? cp : PKGDATADIR;
+ if (relocate_buffer)
+ return relocate_buffer;
+ else
+ {
+ char const *cp = getenv ("BISON_PKGDATADIR");
+ return cp ? cp : relocate2 (PKGDATADIR, &relocate_buffer);
+ }
}
diff --git a/contrib/tools/bison/src/output.h b/contrib/tools/bison/src/output.h
index ba47a89c4d..c308bf5630 100644
--- a/contrib/tools/bison/src/output.h
+++ b/contrib/tools/bison/src/output.h
@@ -1,7 +1,7 @@
/* Output the generated parsing program for bison,
- Copyright (C) 2000-2003, 2006-2007, 2009-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 2000-2003, 2006-2007, 2009-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/parse-gram.c b/contrib/tools/bison/src/parse-gram.c
index 82ac533466..fb5add9c28 100644
--- a/contrib/tools/bison/src/parse-gram.c
+++ b/contrib/tools/bison/src/parse-gram.c
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.1.91.31-00793. */
+/* A Bison parser, made by GNU Bison 3.2.90.23-0bbcb-dirty. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -47,7 +48,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.1.91.31-00793"
+#define YYBISON_VERSION "3.2.90.23-0bbcb-dirty"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -62,12 +63,12 @@
#define YYPULL 1
/* "%code top" blocks. */
-#line 27 "src/parse-gram.y" /* yacc.c:316 */
+#line 27 "src/parse-gram.y" /* yacc.c:315 */
/* On column 0 to please syntax-check. */
#include <config.h>
-#line 71 "src/parse-gram.c" /* yacc.c:316 */
+#line 72 "src/parse-gram.c" /* yacc.c:315 */
/* Substitute the type names. */
#define YYSTYPE GRAM_STYPE
#define YYLTYPE GRAM_LTYPE
@@ -120,11 +121,11 @@
extern int gram_debug;
#endif
/* "%code requires" blocks. */
-#line 21 "src/parse-gram.y" /* yacc.c:353 */
+#line 21 "src/parse-gram.y" /* yacc.c:352 */
#include "symlist.h"
#include "symtab.h"
-#line 222 "src/parse-gram.y" /* yacc.c:353 */
+#line 239 "src/parse-gram.y" /* yacc.c:352 */
typedef enum
{
@@ -133,10 +134,16 @@ extern int gram_debug;
param_parse = 1 << 1,
param_both = param_lex | param_parse
} param_type;
-#line 645 "src/parse-gram.y" /* yacc.c:353 */
-#include "muscle-tab.h"
+#line 682 "src/parse-gram.y" /* yacc.c:352 */
-#line 140 "src/parse-gram.c" /* yacc.c:353 */
+ #include "muscle-tab.h"
+ typedef struct
+ {
+ char const *chars;
+ muscle_kind kind;
+ } value_type;
+
+#line 147 "src/parse-gram.c" /* yacc.c:352 */
/* Token type. */
#ifndef GRAM_TOKENTYPE
@@ -207,35 +214,90 @@ extern int gram_debug;
union GRAM_STYPE
{
-#line 183 "src/parse-gram.y" /* yacc.c:353 */
-unsigned char character;
-#line 187 "src/parse-gram.y" /* yacc.c:353 */
-char *code;
-#line 192 "src/parse-gram.y" /* yacc.c:353 */
-uniqstr uniqstr;
-#line 200 "src/parse-gram.y" /* yacc.c:353 */
-int integer;
-#line 204 "src/parse-gram.y" /* yacc.c:353 */
-symbol *symbol;
-#line 209 "src/parse-gram.y" /* yacc.c:353 */
-assoc assoc;
-#line 212 "src/parse-gram.y" /* yacc.c:353 */
-symbol_list *list;
-#line 215 "src/parse-gram.y" /* yacc.c:353 */
-named_ref *named_ref;
-#line 242 "src/parse-gram.y" /* yacc.c:353 */
-param_type param;
-#line 409 "src/parse-gram.y" /* yacc.c:353 */
-code_props_type code_type;
-#line 647 "src/parse-gram.y" /* yacc.c:353 */
-
- struct
- {
- char const *chars;
- muscle_kind kind;
- } value;
-#line 239 "src/parse-gram.c" /* yacc.c:353 */
+ /* precedence_declarator */
+ assoc precedence_declarator;
+ /* "string" */
+ char* STRING;
+ /* "{...}" */
+ char* BRACED_CODE;
+ /* "%?{...}" */
+ char* BRACED_PREDICATE;
+ /* "epilogue" */
+ char* EPILOGUE;
+ /* "%{...%}" */
+ char* PROLOGUE;
+ /* code_props_type */
+ code_props_type code_props_type;
+ /* "integer" */
+ int INT;
+ /* int.opt */
+ int yytype_79;
+ /* named_ref.opt */
+ named_ref* yytype_91;
+ /* "%param" */
+ param_type PERCENT_PARAM;
+ /* token_decl */
+ symbol* token_decl;
+ /* token_decl_for_prec */
+ symbol* token_decl_for_prec;
+ /* id */
+ symbol* id;
+ /* id_colon */
+ symbol* id_colon;
+ /* symbol */
+ symbol* symbol;
+ /* string_as_id */
+ symbol* string_as_id;
+ /* string_as_id.opt */
+ symbol* yytype_98;
+ /* generic_symlist */
+ symbol_list* generic_symlist;
+ /* generic_symlist_item */
+ symbol_list* generic_symlist_item;
+ /* nterm_decls */
+ symbol_list* nterm_decls;
+ /* token_decls */
+ symbol_list* token_decls;
+ /* token_decl.1 */
+ symbol_list* yytype_77;
+ /* token_decls_for_prec */
+ symbol_list* token_decls_for_prec;
+ /* token_decl_for_prec.1 */
+ symbol_list* yytype_81;
+ /* symbol_decls */
+ symbol_list* symbol_decls;
+ /* symbol_decl.1 */
+ symbol_list* yytype_84;
+ /* "%error-verbose" */
+ uniqstr PERCENT_ERROR_VERBOSE;
+ /* "%<flag>" */
+ uniqstr PERCENT_FLAG;
+ /* "%file-prefix" */
+ uniqstr PERCENT_FILE_PREFIX;
+ /* "%name-prefix" */
+ uniqstr PERCENT_NAME_PREFIX;
+ /* "%yacc" */
+ uniqstr PERCENT_YACC;
+ /* "[identifier]" */
+ uniqstr BRACKETED_ID;
+ /* "identifier" */
+ uniqstr ID;
+ /* "identifier:" */
+ uniqstr ID_COLON;
+ /* "<tag>" */
+ uniqstr TAG;
+ /* tag.opt */
+ uniqstr yytype_71;
+ /* tag */
+ uniqstr tag;
+ /* variable */
+ uniqstr variable;
+ /* "char" */
+ unsigned char CHAR;
+ /* value */
+ value_type value;
+#line 301 "src/parse-gram.c" /* yacc.c:352 */
};
typedef union GRAM_STYPE GRAM_STYPE;
@@ -265,7 +327,7 @@ int gram_parse (void);
/* Unqualified %code blocks. */
-#line 33 "src/parse-gram.y" /* yacc.c:356 */
+#line 33 "src/parse-gram.y" /* yacc.c:355 */
#include "system.h"
#include <errno.h>
@@ -279,8 +341,9 @@ int gram_parse (void);
#include "named-ref.h"
#include "quotearg.h"
#include "reader.h"
- #include "scan-gram.h"
#include "scan-code.h"
+ #include "scan-gram.h"
+ #include "vasnprintf.h"
#include "xmemdup0.h"
static int current_prec = 0;
@@ -288,7 +351,6 @@ int gram_parse (void);
static named_ref *current_lhs_named_ref;
static symbol *current_lhs_symbol;
static symbol_class current_class = unknown_sym;
- static uniqstr current_type = NULL;
/** Set the new current left-hand side symbol, possibly common
* to several right-hand side parts of rule.
@@ -318,7 +380,26 @@ int gram_parse (void);
string from the scanner (should be CODE). */
static char const *translate_code_braceless (char *code, location loc);
- static void version_check (location const *loc, char const *version);
+ /* Handle a %error-verbose directive. */
+ static void handle_error_verbose (location const *loc, char const *directive);
+
+ /* Handle a %file-prefix directive. */
+ static void handle_file_prefix (location const *loc,
+ location const *dir_loc,
+ char const *directive, char const *value);
+
+ /* Handle a %name-prefix directive. */
+ static void handle_name_prefix (location const *loc,
+ char const *directive, char const *value);
+
+ /* Handle a %require directive. */
+ static void handle_require (location const *loc, char const *version);
+
+ /* Handle a %skeleton directive. */
+ static void handle_skeleton (location const *loc, char const *skel);
+
+ /* Handle a %yacc directive. */
+ static void handle_yacc (location const *loc, char const *directive);
static void gram_error (location const *, char const *);
@@ -329,7 +410,7 @@ int gram_parse (void);
#define YYTYPE_INT8 int_fast8_t
#define YYTYPE_UINT16 uint_fast16_t
#define YYTYPE_UINT8 uint_fast8_t
-#line 232 "src/parse-gram.y" /* yacc.c:356 */
+#line 249 "src/parse-gram.y" /* yacc.c:355 */
/** Add a lex-param and/or a parse-param.
*
@@ -340,7 +421,7 @@ int gram_parse (void);
static void add_param (param_type type, char *decl, location loc);
static param_type current_param = param_none;
-#line 344 "src/parse-gram.c" /* yacc.c:356 */
+#line 425 "src/parse-gram.c" /* yacc.c:355 */
#ifdef short
# undef short
@@ -552,27 +633,27 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 164
+#define YYLAST 229
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 58
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 37
+#define YYNNTS 42
/* YYNRULES -- Number of rules. */
-#define YYNRULES 110
+#define YYNRULES 121
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 145
+#define YYNSTATES 164
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 312
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
+ as returned by yylex. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -613,18 +694,19 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 265, 265, 274, 275, 279, 280, 286, 290, 295,
- 296, 301, 307, 308, 309, 310, 315, 320, 321, 322,
- 323, 324, 325, 325, 326, 327, 351, 352, 353, 354,
- 358, 359, 368, 369, 370, 374, 385, 389, 393, 401,
- 412, 413, 423, 424, 430, 442, 442, 447, 447, 452,
- 462, 476, 477, 478, 479, 483, 484, 489, 491, 496,
- 501, 511, 513, 518, 519, 523, 524, 528, 529, 530,
- 535, 540, 545, 551, 557, 568, 569, 578, 579, 585,
- 586, 587, 594, 594, 602, 603, 604, 609, 612, 614,
- 616, 618, 620, 622, 624, 629, 630, 640, 641, 666,
- 667, 668, 669, 681, 683, 692, 697, 698, 703, 711,
- 712
+ 0, 281, 281, 290, 291, 295, 296, 302, 306, 311,
+ 312, 317, 318, 319, 320, 321, 326, 331, 332, 333,
+ 334, 335, 336, 336, 337, 338, 339, 340, 341, 342,
+ 343, 347, 348, 357, 358, 362, 373, 377, 381, 389,
+ 399, 400, 410, 411, 417, 430, 430, 435, 435, 440,
+ 444, 454, 455, 456, 457, 461, 462, 467, 468, 472,
+ 473, 477, 478, 479, 492, 501, 505, 509, 517, 518,
+ 522, 535, 536, 548, 552, 556, 564, 566, 571, 578,
+ 588, 592, 596, 604, 605, 613, 614, 620, 621, 622,
+ 629, 629, 637, 638, 639, 644, 647, 649, 651, 653,
+ 655, 657, 659, 661, 663, 668, 669, 678, 702, 703,
+ 704, 705, 717, 719, 734, 739, 740, 745, 754, 755,
+ 759, 760
};
#endif
@@ -649,12 +731,14 @@ static const char *const yytname[] =
"\"integer\"", "\"%param\"", "\"%union\"", "\"%empty\"", "$accept",
"input", "prologue_declarations", "prologue_declaration", "$@1",
"params", "grammar_declaration", "code_props_type", "union_name",
- "symbol_declaration", "$@2", "$@3", "precedence_declaration",
- "precedence_declarator", "tag.opt", "symbols.prec", "symbol.prec",
- "symbols.1", "generic_symlist", "generic_symlist_item", "tag",
- "symbol_def", "symbol_defs.1", "grammar", "rules_or_grammar_declaration",
- "rules", "$@4", "rhses.1", "rhs", "named_ref.opt", "variable", "value",
- "id", "id_colon", "symbol", "string_as_id", "epilogue.opt", YY_NULLPTR
+ "symbol_declaration", "$@2", "$@3", "precedence_declarator", "tag.opt",
+ "generic_symlist", "generic_symlist_item", "tag", "nterm_decls",
+ "token_decls", "token_decl.1", "token_decl", "int.opt",
+ "token_decls_for_prec", "token_decl_for_prec.1", "token_decl_for_prec",
+ "symbol_decls", "symbol_decl.1", "grammar",
+ "rules_or_grammar_declaration", "rules", "$@4", "rhses.1", "rhs",
+ "named_ref.opt", "variable", "value", "id", "id_colon", "symbol",
+ "string_as_id", "string_as_id.opt", "epilogue.opt", YY_NULLPTR
};
#endif
@@ -672,35 +756,37 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -116
+#define YYPACT_NINF -123
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-116)))
+ (!!((Yystate) == (-123)))
-#define YYTABLE_NINF -110
+#define YYTABLE_NINF -121
#define yytable_value_is_error(Yytable_value) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-static const yytype_int8 yypact[] =
+static const yytype_int16 yypact[] =
{
- -116, 16, 108, -116, -116, -116, -27, -116, -116, -116,
- -116, -116, -116, -24, -116, 23, 29, -116, -29, -21,
- -116, 36, -116, 3, 38, 42, -116, -116, -116, 44,
- 47, 71, 31, -116, -116, -116, 55, -116, -116, -116,
- 30, -116, -116, 39, -116, -116, 26, -22, -22, 31,
- -116, 48, -116, -116, 1, -116, -116, -116, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -116, -116, -116,
- -116, 45, -116, 50, 2, -116, -116, 57, 49, -116,
- 63, 41, -116, 31, -116, -116, -22, -2, -22, 31,
- -116, -116, -116, -116, -116, -116, -116, -116, 46, -116,
- -116, -116, -116, -116, 64, -116, -116, -116, -116, 41,
- -116, -116, -116, 31, -116, 51, -116, 101, -116, -116,
- -116, -116, -116, -116, -116, -116, -116, -20, 40, -116,
- -116, 31, 53, 58, -116, -116, 82, 57, 40, -116,
- -116, -116, 57, -116, -116
+ -123, 6, 109, -123, -21, -123, -123, 2, -123, -123,
+ -123, -123, -123, -123, -11, -123, -7, 46, -123, 3,
+ 13, -123, 77, -123, 43, 87, 88, -123, -123, -123,
+ 91, 92, 94, 32, -123, -123, -123, 162, -123, -123,
+ -123, 53, -123, -123, 61, -123, 30, -123, -15, -15,
+ -123, -123, -123, 32, 50, 32, -123, -123, -123, -123,
+ 64, -123, 23, -123, -123, -123, -123, -123, -123, -123,
+ -123, -123, -123, -123, 54, -123, 55, 8, -123, -123,
+ 65, 68, -123, 69, 18, 32, 60, 32, -123, 70,
+ -123, 16, 72, 16, -123, 70, -123, 72, 32, 32,
+ -123, -123, -123, -123, -123, -123, -123, -123, 105, -123,
+ -123, -123, -123, -123, 110, -123, -123, -123, -123, 18,
+ -123, -123, -123, 32, 32, -123, -123, -123, 16, 16,
+ -123, 147, 32, -123, -123, -123, -123, 32, 16, -123,
+ -123, 37, 172, -123, -123, 32, 97, 101, 99, 100,
+ -123, -123, -123, 116, 65, 172, -123, -123, -123, -123,
+ -123, 65, -123, -123
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -708,39 +794,43 @@ static const yytype_int8 yypact[] =
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 3, 0, 0, 1, 47, 45, 0, 40, 41, 51,
- 52, 53, 54, 0, 36, 0, 9, 11, 0, 0,
- 7, 0, 15, 0, 0, 0, 37, 19, 20, 0,
- 0, 0, 0, 26, 27, 28, 0, 6, 29, 22,
- 42, 4, 5, 0, 33, 32, 55, 0, 0, 0,
- 38, 0, 98, 97, 99, 10, 12, 13, 14, 16,
- 17, 18, 21, 24, 25, 108, 104, 103, 106, 34,
- 107, 0, 105, 0, 0, 77, 79, 95, 0, 43,
- 0, 0, 56, 0, 70, 75, 48, 71, 46, 49,
- 61, 39, 101, 102, 100, 8, 81, 80, 0, 78,
- 2, 96, 82, 31, 23, 44, 67, 68, 69, 35,
- 63, 66, 65, 50, 57, 59, 76, 72, 73, 62,
- 110, 87, 30, 64, 58, 60, 74, 83, 84, 87,
- 86, 0, 0, 0, 90, 91, 0, 95, 85, 92,
- 93, 94, 95, 88, 89
+ 3, 0, 0, 1, 0, 47, 45, 0, 40, 41,
+ 51, 52, 53, 54, 0, 36, 0, 9, 11, 0,
+ 0, 7, 0, 15, 0, 0, 0, 37, 19, 20,
+ 0, 0, 0, 0, 26, 27, 28, 0, 6, 30,
+ 22, 42, 4, 5, 0, 33, 0, 29, 0, 0,
+ 117, 113, 112, 0, 49, 80, 115, 83, 116, 38,
+ 0, 107, 108, 10, 12, 13, 14, 16, 17, 18,
+ 21, 24, 25, 34, 0, 114, 0, 0, 85, 87,
+ 105, 0, 43, 0, 0, 0, 50, 73, 76, 71,
+ 79, 0, 48, 65, 68, 71, 46, 64, 81, 0,
+ 84, 39, 110, 111, 109, 8, 89, 88, 0, 86,
+ 2, 106, 90, 32, 23, 44, 61, 62, 63, 35,
+ 57, 60, 59, 74, 0, 77, 72, 78, 66, 0,
+ 69, 118, 82, 121, 95, 31, 58, 75, 67, 119,
+ 70, 91, 92, 95, 94, 0, 0, 0, 0, 0,
+ 98, 56, 99, 0, 105, 93, 100, 101, 102, 103,
+ 104, 105, 96, 97
};
/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int8 yypgoto[] =
+static const yytype_int16 yypgoto[] =
{
- -116, -116, -116, -116, -116, -116, 120, -116, -116, -116,
- -116, -116, -116, -116, 77, -116, 34, -116, -116, 43,
- -116, -50, 100, -116, 75, -116, -116, -116, 21, -115,
- -116, -116, 22, -116, -32, -82, -116
+ -123, -123, -123, -123, -123, -123, 155, -123, -123, -123,
+ -123, -123, -123, -123, -123, 41, -123, -123, 112, -84,
+ -62, 67, -123, -83, -64, -123, -43, -123, 103, -123,
+ -123, -123, 33, -122, -123, -123, -45, -123, -33, -35,
+ -123, -123
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 1, 2, 41, 78, 104, 73, 43, 80, 44,
- 48, 47, 45, 46, 136, 113, 114, 89, 109, 110,
- 111, 85, 86, 74, 75, 76, 121, 127, 128, 102,
- 54, 95, 68, 77, 112, 70, 100
+ -1, 1, 2, 42, 81, 114, 76, 44, 83, 45,
+ 49, 48, 46, 153, 119, 120, 121, 96, 92, 93,
+ 94, 127, 86, 87, 88, 54, 55, 77, 78, 79,
+ 134, 141, 142, 112, 62, 105, 56, 80, 57, 58,
+ 140, 110
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -748,65 +838,79 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 69, 65, -109, 71, 92, 118, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 50, 3, 90, 13, 14,
- 66, 51, 143, 67, 49, 56, 52, 144, 129, 84,
- 130, 26, 55, 57, 65, 126, 116, 32, 116, 58,
- 93, 60, 59, 65, 65, 61, 94, 62, 72, 98,
- 63, 115, 117, 131, 132, 133, 71, 119, 40, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 53, 87,
- 87, 13, 14, 66, 64, 79, 67, 82, 81, -55,
- 134, 115, 66, 66, 26, 67, 67, 91, 103, 120,
- 32, 82, 106, 107, 108, 96, 137, 135, 101, 139,
- 97, 72, 105, 122, 65, 125, 137, 140, 87, 141,
- 87, 40, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 142, 42, 83, 13, 14, 15, 16, 17, 18,
+ 73, 89, 123, 95, 95, 50, 3, 128, -120, 74,
+ 98, 90, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 50, 100, 125, 14, 15, 102, 51, 59, 47,
+ 52, 130, 162, 50, 60, 50, 91, 27, 61, 163,
+ 89, 137, 89, 33, 51, 138, 95, 52, 95, 63,
+ 90, 122, 90, 53, 75, 108, 132, 64, 51, 125,
+ 51, 52, 103, 52, 41, 100, 130, 65, 104, 116,
+ 117, 118, 51, 125, 51, 52, 130, 52, 89, 89,
+ 66, 85, 67, 95, 95, 143, 122, 144, 90, 90,
+ 68, 69, 89, 95, 70, 71, 139, 72, 82, 100,
+ 84, 99, 90, 101, 106, 107, 111, 113, 115, 154,
+ 4, 124, 156, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 154, 129, 126, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 124, 88, 99,
- 138, 0, 123, 0, 0, 36, 0, 37, 38, 0,
- 0, 0, 0, 39, 40
+ 29, 30, 31, 32, 33, 34, 35, 36, 133, 135,
+ 50, 157, 158, 159, 160, 161, 37, 43, 38, 39,
+ 136, 97, 131, 74, 40, 41, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 50, 155, 0, 14, 15,
+ 109, 0, 0, 0, 0, 145, 146, 147, 0, 0,
+ 0, 27, 0, 148, 149, 0, 0, 33, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 75, 0,
+ 0, -55, 150, 0, 51, 0, 0, 52, 41, 0,
+ 0, 0, 0, 151, 0, 0, 0, 0, 0, 152
};
static const yytype_int16 yycheck[] =
{
- 32, 3, 0, 1, 3, 87, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 39, 0, 49, 16, 17,
- 42, 45, 137, 45, 51, 54, 3, 142, 48, 51,
- 50, 29, 3, 54, 3, 117, 86, 35, 88, 3,
- 39, 3, 39, 3, 3, 3, 45, 3, 46, 47,
- 3, 83, 54, 13, 14, 15, 1, 89, 56, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 45, 47,
- 48, 16, 17, 42, 3, 45, 45, 51, 39, 39,
- 40, 113, 42, 42, 29, 45, 45, 39, 39, 43,
- 35, 51, 51, 52, 53, 50, 128, 57, 41, 131,
- 50, 46, 39, 39, 3, 54, 138, 54, 86, 51,
- 88, 56, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 39, 2, 46, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 113, 48, 74,
- 129, -1, 109, -1, -1, 47, -1, 49, 50, -1,
- -1, -1, -1, 55, 56
+ 33, 46, 85, 48, 49, 3, 0, 91, 0, 1,
+ 53, 46, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 3, 55, 87, 16, 17, 3, 42, 39, 50,
+ 45, 93, 154, 3, 45, 3, 51, 29, 45, 161,
+ 85, 124, 87, 35, 42, 129, 91, 45, 93, 3,
+ 85, 84, 87, 51, 46, 47, 99, 54, 42, 123,
+ 42, 45, 39, 45, 56, 98, 128, 54, 45, 51,
+ 52, 53, 42, 137, 42, 45, 138, 45, 123, 124,
+ 3, 51, 39, 128, 129, 48, 119, 50, 123, 124,
+ 3, 3, 137, 138, 3, 3, 131, 3, 45, 132,
+ 39, 51, 137, 39, 50, 50, 41, 39, 39, 142,
+ 1, 51, 145, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 155, 51, 54, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 43, 39,
+ 3, 54, 51, 54, 54, 39, 47, 2, 49, 50,
+ 119, 49, 95, 1, 55, 56, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 3, 143, -1, 16, 17,
+ 77, -1, -1, -1, -1, 13, 14, 15, -1, -1,
+ -1, 29, -1, 21, 22, -1, -1, 35, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 46, -1,
+ -1, 39, 40, -1, 42, -1, -1, 45, 56, -1,
+ -1, -1, -1, 51, -1, -1, -1, -1, -1, 57
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 59, 60, 0, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 47, 49, 50, 55,
- 56, 61, 64, 65, 67, 70, 71, 69, 68, 51,
- 39, 45, 3, 45, 88, 3, 54, 54, 3, 39,
- 3, 3, 3, 3, 3, 3, 42, 45, 90, 92,
- 93, 1, 46, 64, 81, 82, 83, 91, 62, 45,
- 66, 39, 51, 72, 51, 79, 80, 90, 80, 75,
- 92, 39, 3, 39, 45, 89, 50, 50, 47, 82,
- 94, 41, 87, 39, 63, 39, 51, 52, 53, 76,
- 77, 78, 92, 73, 74, 92, 79, 54, 93, 92,
- 43, 84, 39, 77, 74, 54, 93, 85, 86, 48,
- 50, 13, 14, 15, 40, 57, 72, 92, 86, 92,
- 54, 51, 39, 87, 87
+ 0, 59, 60, 0, 1, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 47, 49, 50,
+ 55, 56, 61, 64, 65, 67, 70, 50, 69, 68,
+ 3, 42, 45, 51, 83, 84, 94, 96, 97, 39,
+ 45, 45, 92, 3, 54, 54, 3, 39, 3, 3,
+ 3, 3, 3, 96, 1, 46, 64, 85, 86, 87,
+ 95, 62, 45, 66, 39, 51, 80, 81, 82, 94,
+ 97, 51, 76, 77, 78, 94, 75, 76, 84, 51,
+ 96, 39, 3, 39, 45, 93, 50, 50, 47, 86,
+ 99, 41, 91, 39, 63, 39, 51, 52, 53, 72,
+ 73, 74, 96, 81, 51, 82, 54, 79, 77, 51,
+ 78, 79, 84, 43, 88, 39, 73, 81, 77, 97,
+ 98, 89, 90, 48, 50, 13, 14, 15, 21, 22,
+ 40, 51, 57, 71, 96, 90, 96, 54, 51, 54,
+ 54, 39, 91, 91
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
@@ -815,15 +919,16 @@ static const yytype_uint8 yyr1[] =
0, 58, 59, 60, 60, 61, 61, 61, 61, 61,
61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
61, 61, 62, 61, 61, 61, 61, 61, 61, 61,
- 63, 63, 64, 64, 64, 64, 64, 64, 64, 64,
+ 61, 63, 63, 64, 64, 64, 64, 64, 64, 64,
65, 65, 66, 66, 64, 68, 67, 69, 67, 67,
- 70, 71, 71, 71, 71, 72, 72, 73, 73, 74,
- 74, 75, 75, 76, 76, 77, 77, 78, 78, 78,
- 79, 79, 79, 79, 79, 80, 80, 81, 81, 82,
- 82, 82, 84, 83, 85, 85, 85, 86, 86, 86,
- 86, 86, 86, 86, 86, 87, 87, 88, 88, 89,
- 89, 89, 89, 90, 90, 91, 92, 92, 93, 94,
- 94
+ 67, 70, 70, 70, 70, 71, 71, 72, 72, 73,
+ 73, 74, 74, 74, 75, 76, 76, 76, 77, 77,
+ 78, 79, 79, 80, 80, 80, 81, 81, 82, 82,
+ 83, 83, 83, 84, 84, 85, 85, 86, 86, 86,
+ 88, 87, 89, 89, 89, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 91, 91, 92, 93, 93,
+ 93, 93, 94, 94, 95, 96, 96, 97, 98, 98,
+ 99, 99
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
@@ -831,16 +936,17 @@ static const yytype_uint8 yyr2[] =
{
0, 2, 4, 0, 2, 1, 1, 1, 3, 1,
2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
- 1, 2, 0, 3, 2, 2, 1, 1, 1, 1,
- 2, 1, 1, 1, 2, 3, 1, 1, 2, 3,
- 1, 1, 0, 1, 3, 0, 3, 0, 3, 3,
- 3, 1, 1, 1, 1, 0, 1, 1, 2, 1,
- 2, 1, 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 1, 2, 2, 3, 1, 2, 1, 2, 1,
- 2, 2, 0, 4, 1, 3, 2, 0, 3, 4,
- 2, 2, 3, 3, 3, 0, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 2
+ 1, 2, 0, 3, 2, 2, 1, 1, 1, 2,
+ 1, 2, 1, 1, 2, 3, 1, 1, 2, 3,
+ 1, 1, 0, 1, 3, 0, 3, 0, 3, 2,
+ 2, 1, 1, 1, 1, 0, 1, 1, 2, 1,
+ 1, 1, 1, 1, 1, 1, 2, 3, 1, 2,
+ 3, 0, 1, 1, 2, 3, 1, 2, 2, 1,
+ 1, 2, 3, 1, 2, 1, 2, 1, 2, 2,
+ 0, 4, 1, 3, 2, 0, 3, 4, 2, 2,
+ 3, 3, 3, 3, 3, 0, 1, 1, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
+ 0, 2
};
@@ -856,23 +962,23 @@ static const yytype_uint8 yyr2[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- YY_LAC_DISCARD ("YYBACKUP"); \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (&yylloc, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ YY_LAC_DISCARD ("YYBACKUP"); \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (&yylloc, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
/* Error token number */
#define YYTERROR 1
@@ -995,82 +1101,106 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YY
# endif
switch (yytype)
{
- case 3: /* "string" */
-#line 189 "src/parse-gram.y" /* yacc.c:681 */
- { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).code)), yyo); }
-#line 1002 "src/parse-gram.c" /* yacc.c:681 */
+ case 3: /* "string" */
+#line 207 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).STRING)), yyo); }
+#line 1108 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 20: /* "%error-verbose" */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).PERCENT_ERROR_VERBOSE), yyo); }
+#line 1114 "src/parse-gram.c" /* yacc.c:680 */
break;
case 23: /* "%<flag>" */
-#line 197 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%%%s", ((*yyvaluep).uniqstr)); }
-#line 1008 "src/parse-gram.c" /* yacc.c:681 */
+#line 218 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%%%s", ((*yyvaluep).PERCENT_FLAG)); }
+#line 1120 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 24: /* "%file-prefix" */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).PERCENT_FILE_PREFIX), yyo); }
+#line 1126 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 28: /* "%name-prefix" */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).PERCENT_NAME_PREFIX), yyo); }
+#line 1132 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 38: /* "%yacc" */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).PERCENT_YACC), yyo); }
+#line 1138 "src/parse-gram.c" /* yacc.c:680 */
break;
case 39: /* "{...}" */
-#line 190 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).code)); }
-#line 1014 "src/parse-gram.c" /* yacc.c:681 */
+#line 208 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).BRACED_CODE)); }
+#line 1144 "src/parse-gram.c" /* yacc.c:680 */
break;
case 40: /* "%?{...}" */
-#line 190 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).code)); }
-#line 1020 "src/parse-gram.c" /* yacc.c:681 */
+#line 208 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).BRACED_PREDICATE)); }
+#line 1150 "src/parse-gram.c" /* yacc.c:680 */
break;
case 41: /* "[identifier]" */
-#line 195 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "[%s]", ((*yyvaluep).uniqstr)); }
-#line 1026 "src/parse-gram.c" /* yacc.c:681 */
+#line 216 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "[%s]", ((*yyvaluep).BRACKETED_ID)); }
+#line 1156 "src/parse-gram.c" /* yacc.c:680 */
break;
case 42: /* "char" */
-#line 185 "src/parse-gram.y" /* yacc.c:681 */
- { fputs (char_name (((*yyvaluep).character)), yyo); }
-#line 1032 "src/parse-gram.c" /* yacc.c:681 */
+#line 204 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (char_name (((*yyvaluep).CHAR)), yyo); }
+#line 1162 "src/parse-gram.c" /* yacc.c:680 */
break;
case 43: /* "epilogue" */
-#line 190 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).code)); }
-#line 1038 "src/parse-gram.c" /* yacc.c:681 */
+#line 208 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).EPILOGUE)); }
+#line 1168 "src/parse-gram.c" /* yacc.c:680 */
break;
case 45: /* "identifier" */
-#line 194 "src/parse-gram.y" /* yacc.c:681 */
- { fputs (((*yyvaluep).uniqstr), yyo); }
-#line 1044 "src/parse-gram.c" /* yacc.c:681 */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).ID), yyo); }
+#line 1174 "src/parse-gram.c" /* yacc.c:680 */
break;
case 46: /* "identifier:" */
-#line 196 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s:", ((*yyvaluep).uniqstr)); }
-#line 1050 "src/parse-gram.c" /* yacc.c:681 */
+#line 217 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s:", ((*yyvaluep).ID_COLON)); }
+#line 1180 "src/parse-gram.c" /* yacc.c:680 */
break;
case 49: /* "%{...%}" */
-#line 190 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).code)); }
-#line 1056 "src/parse-gram.c" /* yacc.c:681 */
+#line 208 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "{\n%s\n}", ((*yyvaluep).PROLOGUE)); }
+#line 1186 "src/parse-gram.c" /* yacc.c:680 */
break;
case 51: /* "<tag>" */
-#line 198 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "<%s>", ((*yyvaluep).uniqstr)); }
-#line 1062 "src/parse-gram.c" /* yacc.c:681 */
+#line 219 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "<%s>", ((*yyvaluep).TAG)); }
+#line 1192 "src/parse-gram.c" /* yacc.c:680 */
break;
case 54: /* "integer" */
-#line 202 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%d", ((*yyvaluep).integer)); }
-#line 1068 "src/parse-gram.c" /* yacc.c:681 */
+#line 222 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%d", ((*yyvaluep).INT)); }
+#line 1198 "src/parse-gram.c" /* yacc.c:680 */
break;
case 55: /* "%param" */
-#line 245 "src/parse-gram.y" /* yacc.c:681 */
+#line 261 "src/parse-gram.y" /* yacc.c:680 */
{
- switch (((*yyvaluep).param))
+ switch (((*yyvaluep).PERCENT_PARAM))
{
#define CASE(In, Out) \
case param_ ## In: fputs ("%" #Out, yyo); break
@@ -1081,35 +1211,107 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YY
case param_none: aver (false); break;
}
}
-#line 1085 "src/parse-gram.c" /* yacc.c:681 */
+#line 1215 "src/parse-gram.c" /* yacc.c:680 */
break;
case 65: /* code_props_type */
-#line 410 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s", code_props_type_string (((*yyvaluep).code_type))); }
-#line 1091 "src/parse-gram.c" /* yacc.c:681 */
+#line 397 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", code_props_type_string (((*yyvaluep).code_props_type))); }
+#line 1221 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 71: /* tag.opt */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).yytype_71), yyo); }
+#line 1227 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 72: /* generic_symlist */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).generic_symlist), yyo); }
+#line 1233 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 73: /* generic_symlist_item */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).generic_symlist_item), yyo); }
+#line 1239 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 74: /* symbol.prec */
-#line 206 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
-#line 1097 "src/parse-gram.c" /* yacc.c:681 */
+ case 74: /* tag */
+#line 219 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "<%s>", ((*yyvaluep).tag)); }
+#line 1245 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 78: /* tag */
-#line 198 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "<%s>", ((*yyvaluep).uniqstr)); }
-#line 1103 "src/parse-gram.c" /* yacc.c:681 */
+ case 75: /* nterm_decls */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).nterm_decls), yyo); }
+#line 1251 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 88: /* variable */
-#line 194 "src/parse-gram.y" /* yacc.c:681 */
- { fputs (((*yyvaluep).uniqstr), yyo); }
-#line 1109 "src/parse-gram.c" /* yacc.c:681 */
+ case 76: /* token_decls */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).token_decls), yyo); }
+#line 1257 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 89: /* value */
-#line 656 "src/parse-gram.y" /* yacc.c:681 */
+ case 77: /* token_decl.1 */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).yytype_77), yyo); }
+#line 1263 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 78: /* token_decl */
+#line 225 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", ((*yyvaluep).token_decl) ? ((*yyvaluep).token_decl)->tag : "<NULL>"); }
+#line 1269 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 79: /* int.opt */
+#line 222 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%d", ((*yyvaluep).yytype_79)); }
+#line 1275 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 80: /* token_decls_for_prec */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).token_decls_for_prec), yyo); }
+#line 1281 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 81: /* token_decl_for_prec.1 */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).yytype_81), yyo); }
+#line 1287 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 82: /* token_decl_for_prec */
+#line 225 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", ((*yyvaluep).token_decl_for_prec) ? ((*yyvaluep).token_decl_for_prec)->tag : "<NULL>"); }
+#line 1293 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 83: /* symbol_decls */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).symbol_decls), yyo); }
+#line 1299 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 84: /* symbol_decl.1 */
+#line 231 "src/parse-gram.y" /* yacc.c:680 */
+ { symbol_list_syms_print (((*yyvaluep).yytype_84), yyo); }
+#line 1305 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 92: /* variable */
+#line 215 "src/parse-gram.y" /* yacc.c:680 */
+ { fputs (((*yyvaluep).variable), yyo); }
+#line 1311 "src/parse-gram.c" /* yacc.c:680 */
+ break;
+
+ case 93: /* value */
+#line 692 "src/parse-gram.y" /* yacc.c:680 */
{
switch (((*yyvaluep).value).kind)
{
@@ -1118,33 +1320,38 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YY
case muscle_string: fprintf (yyo, "\"%s\"", ((*yyvaluep).value).chars); break;
}
}
-#line 1122 "src/parse-gram.c" /* yacc.c:681 */
+#line 1324 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 90: /* id */
-#line 206 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
-#line 1128 "src/parse-gram.c" /* yacc.c:681 */
+ case 94: /* id */
+#line 225 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", ((*yyvaluep).id) ? ((*yyvaluep).id)->tag : "<NULL>"); }
+#line 1330 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 91: /* id_colon */
-#line 207 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s:", ((*yyvaluep).symbol)->tag); }
-#line 1134 "src/parse-gram.c" /* yacc.c:681 */
+ case 95: /* id_colon */
+#line 226 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s:", ((*yyvaluep).id_colon)->tag); }
+#line 1336 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 92: /* symbol */
-#line 206 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
-#line 1140 "src/parse-gram.c" /* yacc.c:681 */
+ case 96: /* symbol */
+#line 225 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", ((*yyvaluep).symbol) ? ((*yyvaluep).symbol)->tag : "<NULL>"); }
+#line 1342 "src/parse-gram.c" /* yacc.c:680 */
break;
- case 93: /* string_as_id */
-#line 206 "src/parse-gram.y" /* yacc.c:681 */
- { fprintf (yyo, "%s", ((*yyvaluep).symbol)->tag); }
-#line 1146 "src/parse-gram.c" /* yacc.c:681 */
+ case 97: /* string_as_id */
+#line 225 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", ((*yyvaluep).string_as_id) ? ((*yyvaluep).string_as_id)->tag : "<NULL>"); }
+#line 1348 "src/parse-gram.c" /* yacc.c:680 */
break;
+ case 98: /* string_as_id.opt */
+#line 225 "src/parse-gram.y" /* yacc.c:680 */
+ { fprintf (yyo, "%s", ((*yyvaluep).yytype_98) ? ((*yyvaluep).yytype_98)->tag : "<NULL>"); }
+#line 1354 "src/parse-gram.c" /* yacc.c:680 */
+ break;
default:
break;
@@ -1210,7 +1417,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
+ &yyvsp[(yyi + 1) - (yynrhs)]
, &(yylsp[(yyi + 1) - (yynrhs)]) );
YYFPRINTF (stderr, "\n");
}
@@ -1546,7 +1753,10 @@ yytnamerr (char *yyres, const char *yystr)
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
- /* Fall through. */
+ else
+ goto append;
+
+ append:
default:
if (yyres)
yyres[yyn] = *yyp;
@@ -1643,10 +1853,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yyarg[yycount++] = yytname[yyx];
{
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
}
}
@@ -1674,9 +1884,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
{
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
if (*yymsg_alloc < yysize)
@@ -1724,7 +1935,65 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
- YYUSE (yytype);
+ switch (yytype)
+ {
+ case 72: /* generic_symlist */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).generic_symlist)); }
+#line 1944 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 73: /* generic_symlist_item */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).generic_symlist_item)); }
+#line 1950 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 75: /* nterm_decls */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).nterm_decls)); }
+#line 1956 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 76: /* token_decls */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).token_decls)); }
+#line 1962 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 77: /* token_decl.1 */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).yytype_77)); }
+#line 1968 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 80: /* token_decls_for_prec */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).token_decls_for_prec)); }
+#line 1974 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 81: /* token_decl_for_prec.1 */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).yytype_81)); }
+#line 1980 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 83: /* symbol_decls */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).symbol_decls)); }
+#line 1986 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ case 84: /* symbol_decl.1 */
+#line 230 "src/parse-gram.y" /* yacc.c:1257 */
+ { symbol_list_free (((*yyvaluep).yytype_84)); }
+#line 1992 "src/parse-gram.c" /* yacc.c:1257 */
+ break;
+
+ default:
+ break;
+ }
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
@@ -1836,7 +2105,7 @@ YYLTYPE yylloc = yyloc_default;
yychar = YYEMPTY; /* Cause a token to be read. */
/* User initialization code. */
-#line 109 "src/parse-gram.y" /* yacc.c:1429 */
+#line 129 "src/parse-gram.y" /* yacc.c:1431 */
{
/* Bison's grammar can initial empty locations, hence a default
location is needed. */
@@ -1844,27 +2113,35 @@ YYLTYPE yylloc = yyloc_default;
boundary_set (&yylloc.end, current_file, 1, 1);
}
-#line 1848 "src/parse-gram.c" /* yacc.c:1429 */
+#line 2117 "src/parse-gram.c" /* yacc.c:1431 */
yylsp[0] = yylloc;
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
*yyssp = (yytype_int16) yystate;
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
@@ -1886,10 +2163,7 @@ YYLTYPE yylloc = yyloc_default;
yyvs = yyvs1;
yyls = yyls1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -1906,12 +2180,11 @@ YYLTYPE yylloc = yyloc_default;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls_alloc, yyls);
-# undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
@@ -1923,6 +2196,7 @@ YYLTYPE yylloc = yyloc_default;
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1931,11 +2205,11 @@ YYLTYPE yylloc = yyloc_default;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -2013,7 +2287,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -2038,683 +2312,714 @@ yyreduce:
switch (yyn)
{
case 6:
-#line 281 "src/parse-gram.y" /* yacc.c:1645 */
+#line 297 "src/parse-gram.y" /* yacc.c:1652 */
{
muscle_code_grow (union_seen ? "post_prologue" : "pre_prologue",
- translate_code ((yyvsp[0].code), (yylsp[0]), true), (yylsp[0]));
+ translate_code ((yyvsp[0].PROLOGUE), (yylsp[0]), true), (yylsp[0]));
code_scanner_last_string_free ();
}
-#line 2048 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2322 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 7:
-#line 287 "src/parse-gram.y" /* yacc.c:1645 */
+#line 303 "src/parse-gram.y" /* yacc.c:1652 */
{
- muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true);
+ muscle_percent_define_ensure ((yyvsp[0].PERCENT_FLAG), (yylsp[0]), true);
}
-#line 2056 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2330 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 8:
-#line 291 "src/parse-gram.y" /* yacc.c:1645 */
+#line 307 "src/parse-gram.y" /* yacc.c:1652 */
{
- muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].value).kind, (yyvsp[0].value).chars,
+ muscle_percent_define_insert ((yyvsp[-1].variable), (yyloc), (yyvsp[0].value).kind, (yyvsp[0].value).chars,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}
-#line 2065 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2339 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 9:
-#line 295 "src/parse-gram.y" /* yacc.c:1645 */
+#line 311 "src/parse-gram.y" /* yacc.c:1652 */
{ defines_flag = true; }
-#line 2071 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2345 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 10:
-#line 297 "src/parse-gram.y" /* yacc.c:1645 */
+#line 313 "src/parse-gram.y" /* yacc.c:1652 */
{
defines_flag = true;
- spec_defines_file = xstrdup ((yyvsp[0].code));
+ spec_defines_file = xstrdup ((yyvsp[0].STRING));
}
-#line 2080 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2354 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 11:
-#line 302 "src/parse-gram.y" /* yacc.c:1645 */
- {
- muscle_percent_define_insert ("parse.error", (yylsp[0]), muscle_keyword,
- "verbose",
- MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
- }
-#line 2090 "src/parse-gram.c" /* yacc.c:1645 */
+#line 317 "src/parse-gram.y" /* yacc.c:1652 */
+ { handle_error_verbose (&(yyloc), (yyvsp[0].PERCENT_ERROR_VERBOSE)); }
+#line 2360 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 12:
-#line 307 "src/parse-gram.y" /* yacc.c:1645 */
- { expected_sr_conflicts = (yyvsp[0].integer); }
-#line 2096 "src/parse-gram.c" /* yacc.c:1645 */
+#line 318 "src/parse-gram.y" /* yacc.c:1652 */
+ { expected_sr_conflicts = (yyvsp[0].INT); }
+#line 2366 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 13:
-#line 308 "src/parse-gram.y" /* yacc.c:1645 */
- { expected_rr_conflicts = (yyvsp[0].integer); }
-#line 2102 "src/parse-gram.c" /* yacc.c:1645 */
+#line 319 "src/parse-gram.y" /* yacc.c:1652 */
+ { expected_rr_conflicts = (yyvsp[0].INT); }
+#line 2372 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 14:
-#line 309 "src/parse-gram.y" /* yacc.c:1645 */
- { spec_file_prefix = (yyvsp[0].code); }
-#line 2108 "src/parse-gram.c" /* yacc.c:1645 */
+#line 320 "src/parse-gram.y" /* yacc.c:1652 */
+ { handle_file_prefix (&(yyloc), &(yylsp[-1]), (yyvsp[-1].PERCENT_FILE_PREFIX), (yyvsp[0].STRING)); }
+#line 2378 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 15:
-#line 311 "src/parse-gram.y" /* yacc.c:1645 */
+#line 322 "src/parse-gram.y" /* yacc.c:1652 */
{
nondeterministic_parser = true;
glr_parser = true;
}
-#line 2117 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2387 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 16:
-#line 316 "src/parse-gram.y" /* yacc.c:1645 */
+#line 327 "src/parse-gram.y" /* yacc.c:1652 */
{
- muscle_code_grow ("initial_action", translate_code ((yyvsp[0].code), (yylsp[0]), false), (yylsp[0]));
+ muscle_code_grow ("initial_action", translate_code ((yyvsp[0].BRACED_CODE), (yylsp[0]), false), (yylsp[0]));
code_scanner_last_string_free ();
}
-#line 2126 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2396 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 17:
-#line 320 "src/parse-gram.y" /* yacc.c:1645 */
- { language_argmatch ((yyvsp[0].code), grammar_prio, (yylsp[-1])); }
-#line 2132 "src/parse-gram.c" /* yacc.c:1645 */
+#line 331 "src/parse-gram.y" /* yacc.c:1652 */
+ { language_argmatch ((yyvsp[0].STRING), grammar_prio, (yylsp[-1])); }
+#line 2402 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 18:
-#line 321 "src/parse-gram.y" /* yacc.c:1645 */
- { spec_name_prefix = (yyvsp[0].code); }
-#line 2138 "src/parse-gram.c" /* yacc.c:1645 */
+#line 332 "src/parse-gram.y" /* yacc.c:1652 */
+ { handle_name_prefix (&(yyloc), (yyvsp[-1].PERCENT_NAME_PREFIX), (yyvsp[0].STRING)); }
+#line 2408 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 19:
-#line 322 "src/parse-gram.y" /* yacc.c:1645 */
+#line 333 "src/parse-gram.y" /* yacc.c:1652 */
{ no_lines_flag = true; }
-#line 2144 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2414 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 20:
-#line 323 "src/parse-gram.y" /* yacc.c:1645 */
+#line 334 "src/parse-gram.y" /* yacc.c:1652 */
{ nondeterministic_parser = true; }
-#line 2150 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2420 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 21:
-#line 324 "src/parse-gram.y" /* yacc.c:1645 */
- { spec_outfile = (yyvsp[0].code); }
-#line 2156 "src/parse-gram.c" /* yacc.c:1645 */
+#line 335 "src/parse-gram.y" /* yacc.c:1652 */
+ { spec_outfile = (yyvsp[0].STRING); }
+#line 2426 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 22:
-#line 325 "src/parse-gram.y" /* yacc.c:1645 */
- { current_param = (yyvsp[0].param); }
-#line 2162 "src/parse-gram.c" /* yacc.c:1645 */
+#line 336 "src/parse-gram.y" /* yacc.c:1652 */
+ { current_param = (yyvsp[0].PERCENT_PARAM); }
+#line 2432 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 23:
-#line 325 "src/parse-gram.y" /* yacc.c:1645 */
+#line 336 "src/parse-gram.y" /* yacc.c:1652 */
{ current_param = param_none; }
-#line 2168 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2438 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 24:
-#line 326 "src/parse-gram.y" /* yacc.c:1645 */
- { version_check (&(yylsp[0]), (yyvsp[0].code)); }
-#line 2174 "src/parse-gram.c" /* yacc.c:1645 */
+#line 337 "src/parse-gram.y" /* yacc.c:1652 */
+ { handle_require (&(yylsp[0]), (yyvsp[0].STRING)); }
+#line 2444 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 25:
-#line 328 "src/parse-gram.y" /* yacc.c:1645 */
- {
- char const *skeleton_user = (yyvsp[0].code);
- if (strchr (skeleton_user, '/'))
- {
- size_t dir_length = strlen (current_file);
- char *skeleton_build;
- while (dir_length && current_file[dir_length - 1] != '/')
- --dir_length;
- while (dir_length && current_file[dir_length - 1] == '/')
- --dir_length;
- skeleton_build =
- xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
- if (dir_length > 0)
- {
- memcpy (skeleton_build, current_file, dir_length);
- skeleton_build[dir_length++] = '/';
- }
- strcpy (skeleton_build + dir_length, skeleton_user);
- skeleton_user = uniqstr_new (skeleton_build);
- free (skeleton_build);
- }
- skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1]));
- }
-#line 2202 "src/parse-gram.c" /* yacc.c:1645 */
+#line 338 "src/parse-gram.y" /* yacc.c:1652 */
+ { handle_skeleton (&(yylsp[0]), (yyvsp[0].STRING)); }
+#line 2450 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 26:
-#line 351 "src/parse-gram.y" /* yacc.c:1645 */
+#line 339 "src/parse-gram.y" /* yacc.c:1652 */
{ token_table_flag = true; }
-#line 2208 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2456 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 27:
-#line 352 "src/parse-gram.y" /* yacc.c:1645 */
+#line 340 "src/parse-gram.y" /* yacc.c:1652 */
{ report_flag |= report_states; }
-#line 2214 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2462 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 28:
-#line 353 "src/parse-gram.y" /* yacc.c:1645 */
- { yacc_flag = true; }
-#line 2220 "src/parse-gram.c" /* yacc.c:1645 */
+#line 341 "src/parse-gram.y" /* yacc.c:1652 */
+ { handle_yacc (&(yyloc), (yyvsp[0].PERCENT_YACC)); }
+#line 2468 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 30:
-#line 358 "src/parse-gram.y" /* yacc.c:1645 */
- { add_param (current_param, (yyvsp[0].code), (yylsp[0])); }
-#line 2226 "src/parse-gram.c" /* yacc.c:1645 */
+ case 29:
+#line 342 "src/parse-gram.y" /* yacc.c:1652 */
+ { current_class = unknown_sym; yyerrok; }
+#line 2474 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 31:
-#line 359 "src/parse-gram.y" /* yacc.c:1645 */
- { add_param (current_param, (yyvsp[0].code), (yylsp[0])); }
-#line 2232 "src/parse-gram.c" /* yacc.c:1645 */
+#line 347 "src/parse-gram.y" /* yacc.c:1652 */
+ { add_param (current_param, (yyvsp[0].BRACED_CODE), (yylsp[0])); }
+#line 2480 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 32:
+#line 348 "src/parse-gram.y" /* yacc.c:1652 */
+ { add_param (current_param, (yyvsp[0].BRACED_CODE), (yylsp[0])); }
+#line 2486 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 34:
-#line 371 "src/parse-gram.y" /* yacc.c:1645 */
+#line 359 "src/parse-gram.y" /* yacc.c:1652 */
{
grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0]));
}
-#line 2240 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2494 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 35:
-#line 375 "src/parse-gram.y" /* yacc.c:1645 */
+#line 363 "src/parse-gram.y" /* yacc.c:1652 */
{
code_props code;
- code_props_symbol_action_init (&code, (yyvsp[-1].code), (yylsp[-1]));
+ code_props_symbol_action_init (&code, (yyvsp[-1].BRACED_CODE), (yylsp[-1]));
code_props_translate_code (&code);
{
- for (symbol_list *list = (yyvsp[0].list); list; list = list->next)
- symbol_list_code_props_set (list, (yyvsp[-2].code_type), &code);
- symbol_list_free ((yyvsp[0].list));
+ for (symbol_list *list = (yyvsp[0].generic_symlist); list; list = list->next)
+ symbol_list_code_props_set (list, (yyvsp[-2].code_props_type), &code);
+ symbol_list_free ((yyvsp[0].generic_symlist));
}
}
-#line 2255 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2509 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 36:
-#line 386 "src/parse-gram.y" /* yacc.c:1645 */
+#line 374 "src/parse-gram.y" /* yacc.c:1652 */
{
default_prec = true;
}
-#line 2263 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2517 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 37:
-#line 390 "src/parse-gram.y" /* yacc.c:1645 */
+#line 378 "src/parse-gram.y" /* yacc.c:1652 */
{
default_prec = false;
}
-#line 2271 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2525 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 38:
-#line 394 "src/parse-gram.y" /* yacc.c:1645 */
+#line 382 "src/parse-gram.y" /* yacc.c:1652 */
{
/* Do not invoke muscle_percent_code_grow here since it invokes
muscle_user_name_list_grow. */
muscle_code_grow ("percent_code()",
- translate_code_braceless ((yyvsp[0].code), (yylsp[0])), (yylsp[0]));
+ translate_code_braceless ((yyvsp[0].BRACED_CODE), (yylsp[0])), (yylsp[0]));
code_scanner_last_string_free ();
}
-#line 2283 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2537 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 39:
-#line 402 "src/parse-gram.y" /* yacc.c:1645 */
+#line 390 "src/parse-gram.y" /* yacc.c:1652 */
{
- muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), translate_code_braceless ((yyvsp[0].code), (yylsp[0])), (yylsp[0]));
+ muscle_percent_code_grow ((yyvsp[-1].ID), (yylsp[-1]), translate_code_braceless ((yyvsp[0].BRACED_CODE), (yylsp[0])), (yylsp[0]));
code_scanner_last_string_free ();
}
-#line 2292 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2546 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 40:
-#line 412 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.code_type) = destructor; }
-#line 2298 "src/parse-gram.c" /* yacc.c:1645 */
+#line 399 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.code_props_type) = destructor; }
+#line 2552 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 41:
-#line 413 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.code_type) = printer; }
-#line 2304 "src/parse-gram.c" /* yacc.c:1645 */
+#line 400 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.code_props_type) = printer; }
+#line 2558 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 42:
-#line 423 "src/parse-gram.y" /* yacc.c:1645 */
+#line 410 "src/parse-gram.y" /* yacc.c:1652 */
{}
-#line 2310 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2564 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 43:
-#line 424 "src/parse-gram.y" /* yacc.c:1645 */
+#line 411 "src/parse-gram.y" /* yacc.c:1652 */
{ muscle_percent_define_insert ("api.value.union.name",
- (yylsp[0]), muscle_keyword, (yyvsp[0].uniqstr),
+ (yylsp[0]), muscle_keyword, (yyvsp[0].ID),
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); }
-#line 2318 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2572 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 44:
-#line 431 "src/parse-gram.y" /* yacc.c:1645 */
+#line 418 "src/parse-gram.y" /* yacc.c:1652 */
{
union_seen = true;
- muscle_code_grow ("union_members", translate_code_braceless ((yyvsp[0].code), (yylsp[0])), (yylsp[0]));
+ muscle_code_grow ("union_members", translate_code_braceless ((yyvsp[0].BRACED_CODE), (yylsp[0])), (yylsp[0]));
code_scanner_last_string_free ();
}
-#line 2328 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2582 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 45:
-#line 442 "src/parse-gram.y" /* yacc.c:1645 */
+#line 430 "src/parse-gram.y" /* yacc.c:1652 */
{ current_class = nterm_sym; }
-#line 2334 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2588 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 46:
-#line 443 "src/parse-gram.y" /* yacc.c:1645 */
+#line 431 "src/parse-gram.y" /* yacc.c:1652 */
{
current_class = unknown_sym;
- current_type = NULL;
+ symbol_list_free ((yyvsp[0].nterm_decls));
}
-#line 2343 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2597 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 47:
-#line 447 "src/parse-gram.y" /* yacc.c:1645 */
+#line 435 "src/parse-gram.y" /* yacc.c:1652 */
{ current_class = token_sym; }
-#line 2349 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2603 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 48:
-#line 448 "src/parse-gram.y" /* yacc.c:1645 */
+#line 436 "src/parse-gram.y" /* yacc.c:1652 */
{
current_class = unknown_sym;
- current_type = NULL;
+ symbol_list_free ((yyvsp[0].token_decls));
}
-#line 2358 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2612 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 49:
-#line 453 "src/parse-gram.y" /* yacc.c:1645 */
+#line 441 "src/parse-gram.y" /* yacc.c:1652 */
{
- tag_seen = true;
- for (symbol_list *list = (yyvsp[0].list); list; list = list->next)
- symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1]));
- symbol_list_free ((yyvsp[0].list));
+ symbol_list_free ((yyvsp[0].symbol_decls));
}
-#line 2369 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2620 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 50:
-#line 463 "src/parse-gram.y" /* yacc.c:1645 */
+#line 445 "src/parse-gram.y" /* yacc.c:1652 */
{
++current_prec;
- for (symbol_list *list = (yyvsp[0].list); list; list = list->next)
- {
- symbol_type_set (list->content.sym, current_type, (yylsp[-1]));
- symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-2].assoc), (yylsp[-2]));
- }
- symbol_list_free ((yyvsp[0].list));
- current_type = NULL;
+ for (symbol_list *list = (yyvsp[0].token_decls_for_prec); list; list = list->next)
+ symbol_precedence_set (list->content.sym, current_prec, (yyvsp[-1].precedence_declarator), (yylsp[-1]));
+ symbol_list_free ((yyvsp[0].token_decls_for_prec));
}
-#line 2384 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2631 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 51:
-#line 476 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.assoc) = left_assoc; }
-#line 2390 "src/parse-gram.c" /* yacc.c:1645 */
+#line 454 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.precedence_declarator) = left_assoc; }
+#line 2637 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 52:
-#line 477 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.assoc) = right_assoc; }
-#line 2396 "src/parse-gram.c" /* yacc.c:1645 */
+#line 455 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.precedence_declarator) = right_assoc; }
+#line 2643 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 53:
-#line 478 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.assoc) = non_assoc; }
-#line 2402 "src/parse-gram.c" /* yacc.c:1645 */
+#line 456 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.precedence_declarator) = non_assoc; }
+#line 2649 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 54:
-#line 479 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.assoc) = precedence_assoc; }
-#line 2408 "src/parse-gram.c" /* yacc.c:1645 */
+#line 457 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.precedence_declarator) = precedence_assoc; }
+#line 2655 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 55:
-#line 483 "src/parse-gram.y" /* yacc.c:1645 */
- { current_type = NULL; }
-#line 2414 "src/parse-gram.c" /* yacc.c:1645 */
+#line 461 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_71) = NULL; }
+#line 2661 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 56:
-#line 484 "src/parse-gram.y" /* yacc.c:1645 */
- { current_type = (yyvsp[0].uniqstr); tag_seen = true; }
-#line 2420 "src/parse-gram.c" /* yacc.c:1645 */
- break;
-
- case 57:
-#line 490 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
-#line 2426 "src/parse-gram.c" /* yacc.c:1645 */
+#line 462 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_71) = (yyvsp[0].TAG); }
+#line 2667 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 58:
-#line 492 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_append ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
-#line 2432 "src/parse-gram.c" /* yacc.c:1645 */
+#line 468 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.generic_symlist) = symbol_list_append ((yyvsp[-1].generic_symlist), (yyvsp[0].generic_symlist_item)); }
+#line 2673 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 59:
-#line 497 "src/parse-gram.y" /* yacc.c:1645 */
- {
- (yyval.symbol) = (yyvsp[0].symbol);
- symbol_class_set ((yyvsp[0].symbol), token_sym, (yylsp[0]), false);
- }
-#line 2441 "src/parse-gram.c" /* yacc.c:1645 */
+#line 472 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.generic_symlist_item) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
+#line 2679 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 60:
-#line 502 "src/parse-gram.y" /* yacc.c:1645 */
- {
- (yyval.symbol) = (yyvsp[-1].symbol);
- symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
- symbol_class_set ((yyvsp[-1].symbol), token_sym, (yylsp[-1]), false);
- }
-#line 2451 "src/parse-gram.c" /* yacc.c:1645 */
- break;
-
- case 61:
-#line 512 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
-#line 2457 "src/parse-gram.c" /* yacc.c:1645 */
+#line 473 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.generic_symlist_item) = symbol_list_type_new ((yyvsp[0].tag), (yylsp[0])); }
+#line 2685 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 62:
-#line 514 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_append ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
-#line 2463 "src/parse-gram.c" /* yacc.c:1645 */
+#line 478 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.tag) = uniqstr_new ("*"); }
+#line 2691 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 63:
-#line 518 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = (yyvsp[0].list); }
-#line 2469 "src/parse-gram.c" /* yacc.c:1645 */
- break;
-
- case 64:
-#line 519 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_append ((yyvsp[-1].list), (yyvsp[0].list)); }
-#line 2475 "src/parse-gram.c" /* yacc.c:1645 */
+#line 479 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.tag) = uniqstr_new (""); }
+#line 2697 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 65:
-#line 523 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
-#line 2481 "src/parse-gram.c" /* yacc.c:1645 */
+#line 502 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ (yyval.token_decls) = (yyvsp[0].yytype_77);
+ }
+#line 2705 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 66:
-#line 524 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); }
-#line 2487 "src/parse-gram.c" /* yacc.c:1645 */
+#line 506 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ (yyval.token_decls) = symbol_list_type_set ((yyvsp[0].yytype_77), (yyvsp[-1].TAG), (yylsp[-1]));
+ }
+#line 2713 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 67:
+#line 510 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ (yyval.token_decls) = symbol_list_append ((yyvsp[-2].token_decls), symbol_list_type_set ((yyvsp[0].yytype_77), (yyvsp[-1].TAG), (yylsp[-1])));
+ }
+#line 2721 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 68:
-#line 529 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.uniqstr) = uniqstr_new ("*"); }
-#line 2493 "src/parse-gram.c" /* yacc.c:1645 */
+#line 517 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_77) = symbol_list_sym_new ((yyvsp[0].token_decl), (yylsp[0])); }
+#line 2727 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 69:
-#line 530 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.uniqstr) = uniqstr_new (""); }
-#line 2499 "src/parse-gram.c" /* yacc.c:1645 */
+#line 518 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_77) = symbol_list_append ((yyvsp[-1].yytype_77), symbol_list_sym_new ((yyvsp[0].token_decl), (yylsp[0]))); }
+#line 2733 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 70:
-#line 536 "src/parse-gram.y" /* yacc.c:1645 */
+#line 523 "src/parse-gram.y" /* yacc.c:1652 */
{
- current_type = (yyvsp[0].uniqstr);
- tag_seen = true;
+ (yyval.token_decl) = (yyvsp[-2].id);
+ symbol_class_set ((yyvsp[-2].id), current_class, (yylsp[-2]), true);
+ if (0 <= (yyvsp[-1].yytype_79))
+ symbol_user_token_number_set ((yyvsp[-2].id), (yyvsp[-1].yytype_79), (yylsp[-1]));
+ if ((yyvsp[0].yytype_98))
+ symbol_make_alias ((yyvsp[-2].id), (yyvsp[0].yytype_98), (yylsp[0]));
}
-#line 2508 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2746 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 71:
-#line 541 "src/parse-gram.y" /* yacc.c:1645 */
+#line 535 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_79) = -1; }
+#line 2752 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 73:
+#line 549 "src/parse-gram.y" /* yacc.c:1652 */
{
- symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true);
- symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0]));
+ (yyval.token_decls_for_prec) = (yyvsp[0].yytype_81);
}
-#line 2517 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2760 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 72:
-#line 546 "src/parse-gram.y" /* yacc.c:1645 */
+ case 74:
+#line 553 "src/parse-gram.y" /* yacc.c:1652 */
{
- symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
- symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
- symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0]));
+ (yyval.token_decls_for_prec) = symbol_list_type_set ((yyvsp[0].yytype_81), (yyvsp[-1].TAG), (yylsp[-1]));
}
-#line 2527 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2768 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 73:
-#line 552 "src/parse-gram.y" /* yacc.c:1645 */
+ case 75:
+#line 557 "src/parse-gram.y" /* yacc.c:1652 */
{
- symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true);
- symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1]));
- symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc));
+ (yyval.token_decls_for_prec) = symbol_list_append ((yyvsp[-2].token_decls_for_prec), symbol_list_type_set ((yyvsp[0].yytype_81), (yyvsp[-1].TAG), (yylsp[-1])));
}
-#line 2537 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2776 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 74:
-#line 558 "src/parse-gram.y" /* yacc.c:1645 */
+ case 76:
+#line 565 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_81) = symbol_list_sym_new ((yyvsp[0].token_decl_for_prec), (yylsp[0])); }
+#line 2782 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 77:
+#line 567 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_81) = symbol_list_append ((yyvsp[-1].yytype_81), symbol_list_sym_new ((yyvsp[0].token_decl_for_prec), (yylsp[0]))); }
+#line 2788 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 78:
+#line 572 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ (yyval.token_decl_for_prec) = (yyvsp[-1].id);
+ symbol_class_set ((yyvsp[-1].id), token_sym, (yylsp[-1]), false);
+ if (0 <= (yyvsp[0].yytype_79))
+ symbol_user_token_number_set ((yyvsp[-1].id), (yyvsp[0].yytype_79), (yylsp[0]));
+ }
+#line 2799 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 80:
+#line 589 "src/parse-gram.y" /* yacc.c:1652 */
{
- symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true);
- symbol_type_set ((yyvsp[-2].symbol), current_type, (yylsp[-2]));
- symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1]));
- symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc));
+ (yyval.symbol_decls) = (yyvsp[0].yytype_84);
}
-#line 2548 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2807 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 81:
-#line 588 "src/parse-gram.y" /* yacc.c:1645 */
+#line 593 "src/parse-gram.y" /* yacc.c:1652 */
{
- yyerrok;
+ (yyval.symbol_decls) = symbol_list_type_set ((yyvsp[0].yytype_84), (yyvsp[-1].TAG), (yylsp[-1]));
}
-#line 2556 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2815 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 82:
-#line 594 "src/parse-gram.y" /* yacc.c:1645 */
- { current_lhs ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); }
-#line 2562 "src/parse-gram.c" /* yacc.c:1645 */
+#line 597 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ (yyval.symbol_decls) = symbol_list_append ((yyvsp[-2].symbol_decls), symbol_list_type_set ((yyvsp[0].yytype_84), (yyvsp[-1].TAG), (yylsp[-1])));
+ }
+#line 2823 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 83:
-#line 595 "src/parse-gram.y" /* yacc.c:1645 */
- {
- /* Free the current lhs. */
- current_lhs (0, (yylsp[-3]), 0);
- }
-#line 2571 "src/parse-gram.c" /* yacc.c:1645 */
+#line 604 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_84) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); }
+#line 2829 "src/parse-gram.c" /* yacc.c:1652 */
break;
case 84:
-#line 602 "src/parse-gram.y" /* yacc.c:1645 */
+#line 605 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_84) = symbol_list_append ((yyvsp[-1].yytype_84), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); }
+#line 2835 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 89:
+#line 623 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ yyerrok;
+ }
+#line 2843 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 90:
+#line 629 "src/parse-gram.y" /* yacc.c:1652 */
+ { current_lhs ((yyvsp[-1].id_colon), (yylsp[-1]), (yyvsp[0].yytype_91)); }
+#line 2849 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 91:
+#line 630 "src/parse-gram.y" /* yacc.c:1652 */
+ {
+ /* Free the current lhs. */
+ current_lhs (0, (yylsp[-3]), 0);
+ }
+#line 2858 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 92:
+#line 637 "src/parse-gram.y" /* yacc.c:1652 */
{ grammar_current_rule_end ((yylsp[0])); }
-#line 2577 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2864 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 85:
-#line 603 "src/parse-gram.y" /* yacc.c:1645 */
+ case 93:
+#line 638 "src/parse-gram.y" /* yacc.c:1652 */
{ grammar_current_rule_end ((yylsp[0])); }
-#line 2583 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2870 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 87:
-#line 610 "src/parse-gram.y" /* yacc.c:1645 */
+ case 95:
+#line 645 "src/parse-gram.y" /* yacc.c:1652 */
{ grammar_current_rule_begin (current_lhs_symbol, current_lhs_location,
current_lhs_named_ref); }
-#line 2590 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2877 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 88:
-#line 613 "src/parse-gram.y" /* yacc.c:1645 */
- { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); }
-#line 2596 "src/parse-gram.c" /* yacc.c:1645 */
+ case 96:
+#line 648 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].yytype_91)); }
+#line 2883 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 89:
-#line 615 "src/parse-gram.y" /* yacc.c:1645 */
- { grammar_current_rule_action_append ((yyvsp[-1].code), (yylsp[-1]), (yyvsp[0].named_ref), current_type); }
-#line 2602 "src/parse-gram.c" /* yacc.c:1645 */
+ case 97:
+#line 650 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_action_append ((yyvsp[-1].BRACED_CODE), (yylsp[-1]), (yyvsp[0].yytype_91), (yyvsp[-2].yytype_71)); }
+#line 2889 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 90:
-#line 617 "src/parse-gram.y" /* yacc.c:1645 */
- { grammar_current_rule_predicate_append ((yyvsp[0].code), (yylsp[0])); }
-#line 2608 "src/parse-gram.c" /* yacc.c:1645 */
+ case 98:
+#line 652 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_predicate_append ((yyvsp[0].BRACED_PREDICATE), (yylsp[0])); }
+#line 2895 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 91:
-#line 619 "src/parse-gram.y" /* yacc.c:1645 */
+ case 99:
+#line 654 "src/parse-gram.y" /* yacc.c:1652 */
{ grammar_current_rule_empty_set ((yylsp[0])); }
-#line 2614 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2901 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 92:
-#line 621 "src/parse-gram.y" /* yacc.c:1645 */
+ case 100:
+#line 656 "src/parse-gram.y" /* yacc.c:1652 */
{ grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); }
-#line 2620 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2907 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 93:
-#line 623 "src/parse-gram.y" /* yacc.c:1645 */
- { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); }
-#line 2626 "src/parse-gram.c" /* yacc.c:1645 */
+ case 101:
+#line 658 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_dprec_set ((yyvsp[0].INT), (yylsp[0])); }
+#line 2913 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 94:
-#line 625 "src/parse-gram.y" /* yacc.c:1645 */
- { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); }
-#line 2632 "src/parse-gram.c" /* yacc.c:1645 */
+ case 102:
+#line 660 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_merge_set ((yyvsp[0].TAG), (yylsp[0])); }
+#line 2919 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 95:
-#line 629 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.named_ref) = 0; }
-#line 2638 "src/parse-gram.c" /* yacc.c:1645 */
+ case 103:
+#line 662 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_expect_sr ((yyvsp[0].INT), (yylsp[0])); }
+#line 2925 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 96:
-#line 630 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.named_ref) = named_ref_new ((yyvsp[0].uniqstr), (yylsp[0])); }
-#line 2644 "src/parse-gram.c" /* yacc.c:1645 */
+ case 104:
+#line 664 "src/parse-gram.y" /* yacc.c:1652 */
+ { grammar_current_rule_expect_rr ((yyvsp[0].INT), (yylsp[0])); }
+#line 2931 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 98:
-#line 641 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].code)); }
-#line 2650 "src/parse-gram.c" /* yacc.c:1645 */
+ case 105:
+#line 668 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_91) = 0; }
+#line 2937 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 99:
-#line 666 "src/parse-gram.y" /* yacc.c:1645 */
+ case 106:
+#line 669 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_91) = named_ref_new ((yyvsp[0].BRACKETED_ID), (yylsp[0])); }
+#line 2943 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 108:
+#line 702 "src/parse-gram.y" /* yacc.c:1652 */
{ (yyval.value).kind = muscle_keyword; (yyval.value).chars = ""; }
-#line 2656 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2949 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 100:
-#line 667 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.value).kind = muscle_keyword; (yyval.value).chars = (yyvsp[0].uniqstr); }
-#line 2662 "src/parse-gram.c" /* yacc.c:1645 */
+ case 109:
+#line 703 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.value).kind = muscle_keyword; (yyval.value).chars = (yyvsp[0].ID); }
+#line 2955 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 101:
-#line 668 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.value).kind = muscle_string; (yyval.value).chars = (yyvsp[0].code); }
-#line 2668 "src/parse-gram.c" /* yacc.c:1645 */
+ case 110:
+#line 704 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.value).kind = muscle_string; (yyval.value).chars = (yyvsp[0].STRING); }
+#line 2961 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 102:
-#line 669 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.value).kind = muscle_code; (yyval.value).chars = strip_braces ((yyvsp[0].code)); }
-#line 2674 "src/parse-gram.c" /* yacc.c:1645 */
+ case 111:
+#line 705 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.value).kind = muscle_code; (yyval.value).chars = strip_braces ((yyvsp[0].BRACED_CODE)); }
+#line 2967 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 103:
-#line 682 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
-#line 2680 "src/parse-gram.c" /* yacc.c:1645 */
+ case 112:
+#line 718 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.id) = symbol_from_uniqstr ((yyvsp[0].ID), (yylsp[0])); }
+#line 2973 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 104:
-#line 684 "src/parse-gram.y" /* yacc.c:1645 */
+ case 113:
+#line 720 "src/parse-gram.y" /* yacc.c:1652 */
{
- (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
- symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
- symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
+ if (current_class == nterm_sym)
+ {
+ gram_error (&(yylsp[0]),
+ _("character literals cannot be nonterminals"));
+ YYERROR;
+ }
+ (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR)), (yylsp[0]));
+ symbol_class_set ((yyval.id), token_sym, (yylsp[0]), false);
+ symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR), (yylsp[0]));
}
-#line 2690 "src/parse-gram.c" /* yacc.c:1645 */
+#line 2989 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 105:
-#line 692 "src/parse-gram.y" /* yacc.c:1645 */
- { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
-#line 2696 "src/parse-gram.c" /* yacc.c:1645 */
+ case 114:
+#line 734 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.id_colon) = symbol_from_uniqstr ((yyvsp[0].ID_COLON), (yylsp[0])); }
+#line 2995 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 108:
-#line 704 "src/parse-gram.y" /* yacc.c:1645 */
+ case 117:
+#line 746 "src/parse-gram.y" /* yacc.c:1652 */
{
- (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].code)), (yylsp[0]));
- symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
+ (yyval.string_as_id) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].STRING)), (yylsp[0]));
+ symbol_class_set ((yyval.string_as_id), token_sym, (yylsp[0]), false);
}
-#line 2705 "src/parse-gram.c" /* yacc.c:1645 */
+#line 3004 "src/parse-gram.c" /* yacc.c:1652 */
break;
- case 110:
-#line 713 "src/parse-gram.y" /* yacc.c:1645 */
+ case 118:
+#line 754 "src/parse-gram.y" /* yacc.c:1652 */
+ { (yyval.yytype_98) = NULL; }
+#line 3010 "src/parse-gram.c" /* yacc.c:1652 */
+ break;
+
+ case 121:
+#line 761 "src/parse-gram.y" /* yacc.c:1652 */
{
- muscle_code_grow ("epilogue", translate_code ((yyvsp[0].code), (yylsp[0]), true), (yylsp[0]));
+ muscle_code_grow ("epilogue", translate_code ((yyvsp[0].EPILOGUE), (yylsp[0]), true), (yylsp[0]));
code_scanner_last_string_free ();
}
-#line 2714 "src/parse-gram.c" /* yacc.c:1645 */
+#line 3019 "src/parse-gram.c" /* yacc.c:1652 */
break;
-#line 2718 "src/parse-gram.c" /* yacc.c:1645 */
+#line 3023 "src/parse-gram.c" /* yacc.c:1652 */
default: break;
}
if (yychar_backup != yychar)
@@ -2835,12 +3140,10 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
-
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
@@ -2911,6 +3214,7 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -2918,6 +3222,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
+
#if 1
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
@@ -2928,6 +3233,10 @@ yyexhaustedlab:
/* Fall through. */
#endif
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result. |
+`-----------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -2959,7 +3268,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 719 "src/parse-gram.y" /* yacc.c:1903 */
+#line 767 "src/parse-gram.y" /* yacc.c:1918 */
/* Return the location of the left-hand side of a rule whose
@@ -3065,7 +3374,74 @@ add_param (param_type type, char *decl, location loc)
static void
-version_check (location const *loc, char const *version)
+handle_error_verbose (location const *loc, char const *directive)
+{
+ bison_directive (loc, directive);
+ muscle_percent_define_insert (directive, *loc, muscle_keyword, "",
+ MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
+}
+
+
+static void
+handle_file_prefix (location const *loc,
+ location const *dir_loc,
+ char const *directive, char const *value)
+{
+ bison_directive (loc, directive);
+ bool warned = false;
+
+ if (location_empty (spec_file_prefix_loc))
+ {
+ spec_file_prefix_loc = *loc;
+ spec_file_prefix = value;
+ }
+ else
+ {
+ duplicate_directive (directive, spec_file_prefix_loc, *loc);
+ warned = true;
+ }
+
+ if (!warned
+ && STRNEQ (directive, "%file-prefix"))
+ deprecated_directive (dir_loc, directive, "%file-prefix");
+}
+
+static void
+handle_name_prefix (location const *loc,
+ char const *directive, char const *value)
+{
+ bison_directive (loc, directive);
+
+ char buf1[1024];
+ size_t len1 = sizeof (buf1);
+ char *old = asnprintf (buf1, &len1, "%s\"%s\"", directive, value);
+ if (!old)
+ xalloc_die ();
+
+ if (location_empty (spec_name_prefix_loc))
+ {
+ spec_name_prefix = value;
+ spec_name_prefix_loc = *loc;
+
+ char buf2[1024];
+ size_t len2 = sizeof (buf2);
+ char *new = asnprintf (buf2, &len2, "%%define api.prefix {%s}", value);
+ if (!new)
+ xalloc_die ();
+ deprecated_directive (loc, old, new);
+ if (new != buf2)
+ free (new);
+ }
+ else
+ duplicate_directive (old, spec_file_prefix_loc, *loc);
+
+ if (old != buf1)
+ free (old);
+}
+
+
+static void
+handle_require (location const *loc, char const *version)
{
/* Changes of behavior are only on minor version changes, so "3.0.5"
is the same as "3.0". */
@@ -3103,15 +3479,54 @@ version_check (location const *loc, char const *version)
}
static void
-gram_error (location const *loc, char const *msg)
+handle_skeleton (location const *loc, char const *skel)
{
- complain (loc, complaint, "%s", msg);
+ char const *skeleton_user = skel;
+ if (strchr (skeleton_user, '/'))
+ {
+ size_t dir_length = strlen (current_file);
+ while (dir_length && current_file[dir_length - 1] != '/')
+ --dir_length;
+ while (dir_length && current_file[dir_length - 1] == '/')
+ --dir_length;
+ char *skeleton_build =
+ xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
+ if (dir_length > 0)
+ {
+ memcpy (skeleton_build, current_file, dir_length);
+ skeleton_build[dir_length++] = '/';
+ }
+ strcpy (skeleton_build + dir_length, skeleton_user);
+ skeleton_user = uniqstr_new (skeleton_build);
+ free (skeleton_build);
+ }
+ skeleton_arg (skeleton_user, grammar_prio, *loc);
}
-char const *
-token_name (int type)
+static void
+handle_yacc (location const *loc, char const *directive)
+{
+ bison_directive (loc, directive);
+ bool warned = false;
+
+ if (location_empty (yacc_loc))
+ yacc_loc = *loc;
+ else
+ {
+ duplicate_directive (directive, yacc_loc, *loc);
+ warned = true;
+ }
+
+ if (!warned
+ && STRNEQ (directive, "%fixed-output-files")
+ && STRNEQ (directive, "%yacc"))
+ deprecated_directive (loc, directive, "%fixed-output-files");
+}
+
+static void
+gram_error (location const *loc, char const *msg)
{
- return yytname[YYTRANSLATE (type)];
+ complain (loc, complaint, "%s", msg);
}
static char const *
diff --git a/contrib/tools/bison/src/parse-gram.h b/contrib/tools/bison/src/parse-gram.h
index fe656f1d25..935488ff28 100644
--- a/contrib/tools/bison/src/parse-gram.h
+++ b/contrib/tools/bison/src/parse-gram.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.1.91.31-00793. */
+/* A Bison parser, made by GNU Bison 3.2.90.23-0bbcb-dirty. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -51,11 +52,11 @@
extern int gram_debug;
#endif
/* "%code requires" blocks. */
-#line 21 "src/parse-gram.y" /* yacc.c:1906 */
+#line 21 "src/parse-gram.y" /* yacc.c:1921 */
#include "symlist.h"
#include "symtab.h"
-#line 222 "src/parse-gram.y" /* yacc.c:1906 */
+#line 239 "src/parse-gram.y" /* yacc.c:1921 */
typedef enum
{
@@ -64,10 +65,16 @@ extern int gram_debug;
param_parse = 1 << 1,
param_both = param_lex | param_parse
} param_type;
-#line 645 "src/parse-gram.y" /* yacc.c:1906 */
-#include "muscle-tab.h"
+#line 682 "src/parse-gram.y" /* yacc.c:1921 */
-#line 71 "src/parse-gram.h" /* yacc.c:1906 */
+ #include "muscle-tab.h"
+ typedef struct
+ {
+ char const *chars;
+ muscle_kind kind;
+ } value_type;
+
+#line 78 "src/parse-gram.h" /* yacc.c:1921 */
/* Token type. */
#ifndef GRAM_TOKENTYPE
@@ -138,35 +145,90 @@ extern int gram_debug;
union GRAM_STYPE
{
-#line 183 "src/parse-gram.y" /* yacc.c:1906 */
-unsigned char character;
-#line 187 "src/parse-gram.y" /* yacc.c:1906 */
-char *code;
-#line 192 "src/parse-gram.y" /* yacc.c:1906 */
-uniqstr uniqstr;
-#line 200 "src/parse-gram.y" /* yacc.c:1906 */
-int integer;
-#line 204 "src/parse-gram.y" /* yacc.c:1906 */
-symbol *symbol;
-#line 209 "src/parse-gram.y" /* yacc.c:1906 */
-assoc assoc;
-#line 212 "src/parse-gram.y" /* yacc.c:1906 */
-symbol_list *list;
-#line 215 "src/parse-gram.y" /* yacc.c:1906 */
-named_ref *named_ref;
-#line 242 "src/parse-gram.y" /* yacc.c:1906 */
-param_type param;
-#line 409 "src/parse-gram.y" /* yacc.c:1906 */
-code_props_type code_type;
-#line 647 "src/parse-gram.y" /* yacc.c:1906 */
-
- struct
- {
- char const *chars;
- muscle_kind kind;
- } value;
-#line 170 "src/parse-gram.h" /* yacc.c:1906 */
+ /* precedence_declarator */
+ assoc precedence_declarator;
+ /* "string" */
+ char* STRING;
+ /* "{...}" */
+ char* BRACED_CODE;
+ /* "%?{...}" */
+ char* BRACED_PREDICATE;
+ /* "epilogue" */
+ char* EPILOGUE;
+ /* "%{...%}" */
+ char* PROLOGUE;
+ /* code_props_type */
+ code_props_type code_props_type;
+ /* "integer" */
+ int INT;
+ /* int.opt */
+ int yytype_79;
+ /* named_ref.opt */
+ named_ref* yytype_91;
+ /* "%param" */
+ param_type PERCENT_PARAM;
+ /* token_decl */
+ symbol* token_decl;
+ /* token_decl_for_prec */
+ symbol* token_decl_for_prec;
+ /* id */
+ symbol* id;
+ /* id_colon */
+ symbol* id_colon;
+ /* symbol */
+ symbol* symbol;
+ /* string_as_id */
+ symbol* string_as_id;
+ /* string_as_id.opt */
+ symbol* yytype_98;
+ /* generic_symlist */
+ symbol_list* generic_symlist;
+ /* generic_symlist_item */
+ symbol_list* generic_symlist_item;
+ /* nterm_decls */
+ symbol_list* nterm_decls;
+ /* token_decls */
+ symbol_list* token_decls;
+ /* token_decl.1 */
+ symbol_list* yytype_77;
+ /* token_decls_for_prec */
+ symbol_list* token_decls_for_prec;
+ /* token_decl_for_prec.1 */
+ symbol_list* yytype_81;
+ /* symbol_decls */
+ symbol_list* symbol_decls;
+ /* symbol_decl.1 */
+ symbol_list* yytype_84;
+ /* "%error-verbose" */
+ uniqstr PERCENT_ERROR_VERBOSE;
+ /* "%<flag>" */
+ uniqstr PERCENT_FLAG;
+ /* "%file-prefix" */
+ uniqstr PERCENT_FILE_PREFIX;
+ /* "%name-prefix" */
+ uniqstr PERCENT_NAME_PREFIX;
+ /* "%yacc" */
+ uniqstr PERCENT_YACC;
+ /* "[identifier]" */
+ uniqstr BRACKETED_ID;
+ /* "identifier" */
+ uniqstr ID;
+ /* "identifier:" */
+ uniqstr ID_COLON;
+ /* "<tag>" */
+ uniqstr TAG;
+ /* tag.opt */
+ uniqstr yytype_71;
+ /* tag */
+ uniqstr tag;
+ /* variable */
+ uniqstr variable;
+ /* "char" */
+ unsigned char CHAR;
+ /* value */
+ value_type value;
+#line 232 "src/parse-gram.h" /* yacc.c:1921 */
};
typedef union GRAM_STYPE GRAM_STYPE;
diff --git a/contrib/tools/bison/src/print-xml.c b/contrib/tools/bison/src/print-xml.c
index 3f4bc5be87..b251e1504c 100644
--- a/contrib/tools/bison/src/print-xml.c
+++ b/contrib/tools/bison/src/print-xml.c
@@ -1,6 +1,7 @@
/* Print an xml on generated parser, for Bison,
- Copyright (C) 2007, 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/print-xml.h b/contrib/tools/bison/src/print-xml.h
index abdb76355e..122c5595e7 100644
--- a/contrib/tools/bison/src/print-xml.h
+++ b/contrib/tools/bison/src/print-xml.h
@@ -1,6 +1,7 @@
/* Output an xml of the generated parser, for Bison.
- Copyright (C) 2007, 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/print.c b/contrib/tools/bison/src/print.c
index dd751d5765..60bb2b3658 100644
--- a/contrib/tools/bison/src/print.c
+++ b/contrib/tools/bison/src/print.c
@@ -1,7 +1,7 @@
/* Print information on generated parser, for bison,
- Copyright (C) 1984, 1986, 1989, 2000-2005, 2007, 2009-2015, 2018 Free
- Software Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 2000-2005, 2007, 2009-2015, 2018-2019
+ Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/print.h b/contrib/tools/bison/src/print.h
index 61bc20552f..8352006250 100644
--- a/contrib/tools/bison/src/print.h
+++ b/contrib/tools/bison/src/print.h
@@ -1,6 +1,7 @@
/* Print information on generated parser, for bison,
- Copyright (C) 2000, 2009-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2009-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/print_graph.c b/contrib/tools/bison/src/print_graph.c
index aea418cc32..ec03278686 100644
--- a/contrib/tools/bison/src/print_graph.c
+++ b/contrib/tools/bison/src/print_graph.c
@@ -1,7 +1,7 @@
/* Output a graph of the generated parser, for Bison.
- Copyright (C) 2001-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2001-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/print_graph.h b/contrib/tools/bison/src/print_graph.h
index 4081b63d86..a3e2b6763f 100644
--- a/contrib/tools/bison/src/print_graph.h
+++ b/contrib/tools/bison/src/print_graph.h
@@ -1,7 +1,7 @@
/* Output a graph of the generated parser, for Bison.
- Copyright (C) 2000, 2006, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2000, 2006, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/reader.c b/contrib/tools/bison/src/reader.c
index d073d4ed57..8d373416df 100644
--- a/contrib/tools/bison/src/reader.c
+++ b/contrib/tools/bison/src/reader.c
@@ -1,7 +1,7 @@
/* Input parser for Bison
Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000-2003, 2005-2007,
- 2009-2015, 2018 Free Software Foundation, Inc.
+ 2009-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -45,9 +45,6 @@ merger_list *merge_functions;
/* Was %union seen? */
bool union_seen = false;
-/* Was a tag seen? */
-bool tag_seen = false;
-
/* Should rules have a default precedence? */
bool default_prec = true;
@@ -114,13 +111,11 @@ record_merge_function_type (int merger, uniqstr type, location declaration_loc)
if (merger <= 0)
return;
- int merger_find;
- merger_list *merge_function;
-
if (type == NULL)
type = uniqstr_new ("");
- merger_find = 1;
+ merger_list *merge_function;
+ int merger_find = 1;
for (merge_function = merge_functions;
merge_function != NULL && merger_find != merger;
merge_function = merge_function->next)
@@ -430,6 +425,11 @@ grammar_midrule_action (void)
current_rule->action_props.is_predicate);
code_props_none_init (&current_rule->action_props);
+ midrule->expected_sr_conflicts = current_rule->expected_sr_conflicts;
+ midrule->expected_rr_conflicts = current_rule->expected_rr_conflicts;
+ current_rule->expected_sr_conflicts = -1;
+ current_rule->expected_rr_conflicts = -1;
+
if (previous_rule_end)
previous_rule_end->next = midrule;
else
@@ -467,8 +467,8 @@ grammar_current_rule_prec_set (symbol *precsym, location loc)
not defined separately as a token. */
symbol_class_set (precsym, token_sym, loc, false);
if (current_rule->ruleprec)
- duplicate_directive ("%prec",
- current_rule->ruleprec->location, loc);
+ duplicate_rule_directive ("%prec",
+ current_rule->ruleprec->location, loc);
else
current_rule->ruleprec = precsym;
}
@@ -483,8 +483,8 @@ grammar_current_rule_empty_set (location loc)
if (warning_is_unset (Wempty_rule))
warning_argmatch ("empty-rule", 0, 0);
if (current_rule->percent_empty_loc.start.file)
- duplicate_directive ("%empty",
- current_rule->percent_empty_loc, loc);
+ duplicate_rule_directive ("%empty",
+ current_rule->percent_empty_loc, loc);
else
current_rule->percent_empty_loc = loc;
}
@@ -501,8 +501,8 @@ grammar_current_rule_dprec_set (int dprec, location loc)
complain (&loc, complaint, _("%s must be followed by positive number"),
"%dprec");
else if (current_rule->dprec != 0)
- duplicate_directive ("%dprec",
- current_rule->dprec_location, loc);
+ duplicate_rule_directive ("%dprec",
+ current_rule->dprec_location, loc);
else
{
current_rule->dprec = dprec;
@@ -520,8 +520,8 @@ grammar_current_rule_merge_set (uniqstr name, location loc)
complain (&loc, Wother, _("%s affects only GLR parsers"),
"%merge");
if (current_rule->merger != 0)
- duplicate_directive ("%merge",
- current_rule->merger_declaration_location, loc);
+ duplicate_rule_directive ("%merge",
+ current_rule->merger_declaration_location, loc);
else
{
current_rule->merger = get_merge_function (name);
@@ -573,6 +573,27 @@ grammar_current_rule_predicate_append (const char *pred, location loc)
/* is_predicate */ true);
}
+/* Set the expected number of shift-reduce (reduce-reduce) conflicts for
+ * the current rule. If a midrule is encountered later, the count
+ * is transferred to it and reset in the current rule to -1. */
+
+void
+grammar_current_rule_expect_sr (int count, location loc)
+{
+ (void) loc;
+ current_rule->expected_sr_conflicts = count;
+}
+
+void
+grammar_current_rule_expect_rr (int count, location loc)
+{
+ if (! glr_parser)
+ complain (&loc, Wother, _("%s affects only GLR parsers"),
+ "%expect-rr");
+ else
+ current_rule->expected_rr_conflicts = count;
+}
+
/*---------------------------------------------------------------.
| Convert the rules into the representation using RRHS, RLHS and |
@@ -583,13 +604,11 @@ static void
packgram (void)
{
unsigned itemno = 0;
- rule_number ruleno = 0;
-
ritem = xnmalloc (nritems + 1, sizeof *ritem);
-
/* This sentinel is used by build_relations in gram.c. */
*ritem++ = 0;
+ rule_number ruleno = 0;
rules = xnmalloc (nrules, sizeof *rules);
for (symbol_list *p = grammar; p; p = p->next)
@@ -626,6 +645,8 @@ packgram (void)
rules[ruleno].action = lhs->action_props.code;
rules[ruleno].action_location = lhs->action_props.location;
rules[ruleno].is_predicate = lhs->action_props.is_predicate;
+ rules[ruleno].expected_sr_conflicts = p->expected_sr_conflicts;
+ rules[ruleno].expected_rr_conflicts = p->expected_rr_conflicts;
/* Traverse the rhs. */
{
@@ -720,11 +741,10 @@ prepare_percent_define_front_end_variables (void)
/* Set %define front-end variable defaults. */
muscle_percent_define_default ("lr.keep-unreachable-state", "false");
{
- char *lr_type;
/* IELR would be a better default, but LALR is historically the
default. */
muscle_percent_define_default ("lr.type", "lalr");
- lr_type = muscle_percent_define_get ("lr.type");
+ char *lr_type = muscle_percent_define_get ("lr.type");
if (STRNEQ (lr_type, "canonical-lr"))
muscle_percent_define_default ("lr.default-reduction", "most");
else
diff --git a/contrib/tools/bison/src/reader.h b/contrib/tools/bison/src/reader.h
index 70128be09d..9f59dc0053 100644
--- a/contrib/tools/bison/src/reader.h
+++ b/contrib/tools/bison/src/reader.h
@@ -1,7 +1,7 @@
/* Input parser for Bison
- Copyright (C) 2000-2003, 2005-2007, 2009-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 2000-2003, 2005-2007, 2009-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -38,7 +38,6 @@ typedef struct merger_list
/* From the parser. */
extern int gram_debug;
int gram_parse (void);
-char const *token_name (int type);
/* From reader.c. */
@@ -52,6 +51,8 @@ void grammar_current_rule_empty_set (location loc);
void grammar_current_rule_prec_set (symbol *precsym, location loc);
void grammar_current_rule_dprec_set (int dprec, location loc);
void grammar_current_rule_merge_set (uniqstr name, location loc);
+void grammar_current_rule_expect_sr (int count, location loc);
+void grammar_current_rule_expect_rr (int count, location loc);
void grammar_current_rule_symbol_append (symbol *sym, location loc,
named_ref *nref);
/* Attach an ACTION to the current rule. */
@@ -67,9 +68,6 @@ extern merger_list *merge_functions;
/* Was %union seen? */
extern bool union_seen;
-/* Was a tag seen? */
-extern bool tag_seen;
-
/* Should rules have a default precedence? */
extern bool default_prec;
diff --git a/contrib/tools/bison/src/reduce.c b/contrib/tools/bison/src/reduce.c
index ee5118eae5..ff2f2325c0 100644
--- a/contrib/tools/bison/src/reduce.c
+++ b/contrib/tools/bison/src/reduce.c
@@ -1,7 +1,7 @@
/* Grammar reduction for Bison.
- Copyright (C) 1988-1989, 2000-2003, 2005-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1988-1989, 2000-2003, 2005-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -259,22 +259,23 @@ reduce_grammar_tables (void)
| Remove useless nonterminals. |
`------------------------------*/
+symbol_number *nterm_map = NULL;
+
static void
nonterminals_reduce (void)
{
+ nterm_map = xnmalloc (nvars, sizeof *nterm_map);
/* Map the nonterminals to their new index: useful first, useless
afterwards. Kept for later report. */
-
- symbol_number *nontermmap = xnmalloc (nvars, sizeof *nontermmap);
{
symbol_number n = ntokens;
for (symbol_number i = ntokens; i < nsyms; ++i)
if (bitset_test (V, i))
- nontermmap[i - ntokens] = n++;
+ nterm_map[i - ntokens] = n++;
for (symbol_number i = ntokens; i < nsyms; ++i)
if (!bitset_test (V, i))
{
- nontermmap[i - ntokens] = n++;
+ nterm_map[i - ntokens] = n++;
if (symbols[i]->content->status != used)
complain (&symbols[i]->location, Wother,
_("nonterminal useless in grammar: %s"),
@@ -282,32 +283,30 @@ nonterminals_reduce (void)
}
}
-
/* Shuffle elements of tables indexed by symbol number. */
{
symbol **symbols_sorted = xnmalloc (nvars, sizeof *symbols_sorted);
for (symbol_number i = ntokens; i < nsyms; ++i)
- symbols[i]->content->number = nontermmap[i - ntokens];
+ symbols[i]->content->number = nterm_map[i - ntokens];
for (symbol_number i = ntokens; i < nsyms; ++i)
- symbols_sorted[nontermmap[i - ntokens] - ntokens] = symbols[i];
+ symbols_sorted[nterm_map[i - ntokens] - ntokens] = symbols[i];
for (symbol_number i = ntokens; i < nsyms; ++i)
symbols[i] = symbols_sorted[i - ntokens];
free (symbols_sorted);
}
+ /* Update nonterminal numbers in the RHS of the rules. LHS are
+ pointers to the symbol structure, they don't need renumbering. */
{
for (rule_number r = 0; r < nrules; ++r)
for (item_number *rhsp = rules[r].rhs; 0 <= *rhsp; ++rhsp)
if (ISVAR (*rhsp))
- *rhsp = symbol_number_as_item_number (nontermmap[*rhsp
- - ntokens]);
- accept->content->number = nontermmap[accept->content->number - ntokens];
+ *rhsp = symbol_number_as_item_number (nterm_map[*rhsp - ntokens]);
+ accept->content->number = nterm_map[accept->content->number - ntokens];
}
nsyms -= nuseless_nonterminals;
nvars -= nuseless_nonterminals;
-
- free (nontermmap);
}
@@ -433,4 +432,6 @@ reduce_free (void)
bitset_free (V);
bitset_free (V1);
bitset_free (P);
+ free (nterm_map);
+ nterm_map = NULL;
}
diff --git a/contrib/tools/bison/src/reduce.h b/contrib/tools/bison/src/reduce.h
index b1baa892bf..9814962d76 100644
--- a/contrib/tools/bison/src/reduce.h
+++ b/contrib/tools/bison/src/reduce.h
@@ -1,6 +1,6 @@
/* Grammar reduction for Bison.
- Copyright (C) 2000-2002, 2007, 2009-2015, 2018 Free Software
+ Copyright (C) 2000-2002, 2007, 2009-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -32,6 +32,11 @@ bool reduce_nonterminal_useless_in_grammar (const sym_content *sym);
void reduce_free (void);
+/** Map initial nterm numbers to the new ones. Built by
+ * reduce_grammar. Size nvars + nuseless_nonterminals. */
+extern symbol_number *nterm_map;
+
extern unsigned nuseless_nonterminals;
extern unsigned nuseless_productions;
+
#endif /* !REDUCE_H_ */
diff --git a/contrib/tools/bison/src/relation.c b/contrib/tools/bison/src/relation.c
index 148f55400c..4371501d47 100644
--- a/contrib/tools/bison/src/relation.c
+++ b/contrib/tools/bison/src/relation.c
@@ -1,6 +1,6 @@
/* Binary relations.
- Copyright (C) 2002, 2004-2005, 2009-2015, 2018 Free Software
+ Copyright (C) 2002, 2004-2005, 2009-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/relation.h b/contrib/tools/bison/src/relation.h
index cc940f93e4..e6b59ff869 100644
--- a/contrib/tools/bison/src/relation.h
+++ b/contrib/tools/bison/src/relation.h
@@ -1,7 +1,7 @@
/* Binary relations.
- Copyright (C) 2002, 2004, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2002, 2004, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/scan-code.c b/contrib/tools/bison/src/scan-code.c
index d8b9ad64f2..39b16dc3fe 100644
--- a/contrib/tools/bison/src/scan-code.c
+++ b/contrib/tools/bison/src/scan-code.c
@@ -856,7 +856,7 @@ char *yytext;
#line 1 "/Users/akim/src/gnu/bison/src/scan-code.l"
/* Bison Action Scanner -*- C -*-
- Copyright (C) 2006-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -874,24 +874,24 @@ char *yytext;
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define YY_NO_INPUT 1
#line 24 "/Users/akim/src/gnu/bison/src/scan-code.l"
-/* Work around a bug in flex 2.5.31. See Debian bug 333231
- <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
-#undef code_wrap
-#define code_wrap() 1
-
-#define FLEX_PREFIX(Id) code_ ## Id
-#include <src/flex-scanner.h>
+#include <c-ctype.h>
+#include <get-errno.h>
+#include <quote.h>
#include <src/complain.h>
-#include <src/reader.h>
#include <src/getargs.h>
#include <src/muscle-tab.h>
+#include <src/reader.h>
#include <src/scan-code.h>
#include <src/symlist.h>
-#include <c-ctype.h>
-#include <get-errno.h>
-#include <quote.h>
+#define FLEX_PREFIX(Id) code_ ## Id
+#include <src/flex-scanner.h>
+
+/* Work around a bug in flex 2.5.31. See Debian bug 333231
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
+#undef code_wrap
+#define code_wrap() 1
/* The current calling start condition: SC_RULE_ACTION or
SC_SYMBOL_ACTION. */
@@ -2991,14 +2991,12 @@ handle_action_dollar (symbol_list *rule, char *text, location dollar_loc)
effective_rule_length = symbol_list_length (rule->next);
}
- /* Get the type name if explicit. */
+ /* The type name if explicit, otherwise left null. */
char const *type_name = NULL;
char *cp = fetch_type_name (text + 1, &type_name, dollar_loc);
-
int n = parse_ref (cp, effective_rule, effective_rule_length,
rule->midrule_parent_rhs_index, text, dollar_loc, '$');
-
- /* End type_name. */
+ /* End type_name. Don't do it ealier: parse_ref depends on TEXT. */
if (type_name)
cp[-1] = '\0';
@@ -3008,63 +3006,75 @@ handle_action_dollar (symbol_list *rule, char *text, location dollar_loc)
break;
case LHS_REF:
- if (!type_name)
- type_name = symbol_list_n_type_name_get (rule, 0);
-
- if (!type_name)
- {
- if (union_seen | tag_seen)
- {
- if (rule->midrule_parent_rule)
- complain (&dollar_loc, complaint,
- _("$$ for the midrule at $%d of %s"
- " has no declared type"),
- rule->midrule_parent_rhs_index,
- quote (effective_rule->content.sym->tag));
- else
- complain (&dollar_loc, complaint,
- _("$$ of %s has no declared type"),
- quote (rule->content.sym->tag));
- }
- else
- untyped_var_seen = true;
- }
+ {
+ symbol_list *sym = symbol_list_n_get (rule, 0);
+ if (!type_name
+ && !sym->content.sym->content->type_name)
+ {
+ if (union_seen | tag_seen)
+ {
+ if (rule->midrule_parent_rule)
+ complain (&dollar_loc, complaint,
+ _("$$ for the midrule at $%d of %s"
+ " has no declared type"),
+ rule->midrule_parent_rhs_index,
+ quote (effective_rule->content.sym->tag));
+ else
+ complain (&dollar_loc, complaint,
+ _("$$ of %s has no declared type"),
+ quote (rule->content.sym->tag));
+ }
+ else
+ untyped_var_seen = true;
+ }
- obstack_sgrow (&obstack_for_string, "]b4_lhs_value(");
- obstack_quote (&obstack_for_string, type_name);
- obstack_sgrow (&obstack_for_string, ")[");
- rule->action_props.is_value_used = true;
+ obstack_printf (&obstack_for_string, "]b4_lhs_value(orig %d, ",
+ sym->content.sym->content->number);
+ obstack_quote (&obstack_for_string, type_name);
+ obstack_sgrow (&obstack_for_string, ")[");
+ rule->action_props.is_value_used = true;
+ }
break;
+ /* Reference to a RHS symbol. */
default:
- if (max_left_semantic_context < 1 - n)
- max_left_semantic_context = 1 - n;
- if (!type_name && 0 < n)
- type_name = symbol_list_n_type_name_get (effective_rule, n);
- if (!type_name)
- {
- if (union_seen | tag_seen)
- complain (&dollar_loc, complaint,
- _("$%s of %s has no declared type"), cp,
- quote (effective_rule->content.sym->tag));
- else
- untyped_var_seen = true;
- }
+ {
+ if (max_left_semantic_context < 1 - n)
+ max_left_semantic_context = 1 - n;
+ symbol_list *sym = 0 < n ? symbol_list_n_get (effective_rule, n) : NULL;
+ if (!type_name
+ && (!sym || !sym->content.sym->content->type_name))
+ {
+ if (union_seen | tag_seen)
+ complain (&dollar_loc, complaint,
+ _("$%s of %s has no declared type"), cp,
+ quote (effective_rule->content.sym->tag));
+ else
+ untyped_var_seen = true;
+ }
- obstack_printf (&obstack_for_string,
- "]b4_rhs_value(%d, %d, ", effective_rule_length, n);
- obstack_quote (&obstack_for_string, type_name);
- obstack_sgrow (&obstack_for_string, ")[");
- if (0 < n)
- {
- symbol_list *sym = symbol_list_n_get (effective_rule, n);
- if (muscle_percent_define_ifdef ("api.value.automove")
- && sym->action_props.is_value_used)
- complain (&dollar_loc, Wother,
- _("multiple occurrences of $%d with api.value.automove"),
- n);
- sym->action_props.is_value_used = true;
- }
+ obstack_printf (&obstack_for_string,
+ "]b4_rhs_value(%d, %d, ",
+ effective_rule_length, n);
+ if (sym)
+ obstack_printf (&obstack_for_string, "%s%d, ",
+ sym->content.sym->content->class == nterm_sym ? "orig " : "",
+ sym->content.sym->content->number);
+ else
+ obstack_sgrow (&obstack_for_string, "[], ");
+
+ obstack_quote (&obstack_for_string, type_name);
+ obstack_sgrow (&obstack_for_string, ")[");
+ if (0 < n)
+ {
+ if (muscle_percent_define_ifdef ("api.value.automove")
+ && sym->action_props.is_value_used)
+ complain (&dollar_loc, Wother,
+ _("multiple occurrences of $%d with api.value.automove"),
+ n);
+ sym->action_props.is_value_used = true;
+ }
+ }
break;
}
}
diff --git a/contrib/tools/bison/src/scan-code.h b/contrib/tools/bison/src/scan-code.h
index c3df29c0ce..483fe9ba56 100644
--- a/contrib/tools/bison/src/scan-code.h
+++ b/contrib/tools/bison/src/scan-code.h
@@ -1,7 +1,7 @@
/* Bison code properties structure and scanner.
- Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/scan-gram.c b/contrib/tools/bison/src/scan-gram.c
index 8fbead0af7..49d9541887 100644
--- a/contrib/tools/bison/src/scan-gram.c
+++ b/contrib/tools/bison/src/scan-gram.c
@@ -691,8 +691,8 @@ static void yynoreturn yy_fatal_error ( const char* msg );
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
(yy_c_buf_p) = yy_cp;
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
-#define YY_NUM_RULES 130
-#define YY_END_OF_BUFFER 131
+#define YY_NUM_RULES 129
+#define YY_END_OF_BUFFER 130
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -700,71 +700,71 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_accept[579] =
+static const flex_int16_t yy_accept[573] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 93, 93, 113, 113, 113, 113, 0, 0,
- 0, 0, 131, 80, 2, 2, 71, 80, 70, 80,
- 1, 66, 80, 67, 67, 65, 77, 63, 66, 79,
- 73, 64, 80, 90, 90, 128, 95, 94, 128, 81,
- 97, 96, 84, 2, 1, 84, 83, 82, 84, 99,
- 99, 100, 98, 81, 129, 119, 128, 118, 128, 128,
- 128, 122, 125, 126, 128, 92, 128, 117, 116, 128,
- 115, 114, 87, 2, 1, 85, 87, 87, 86, 87,
-
- 88, 2, 1, 88, 88, 80, 78, 62, 0, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 72, 66, 66,
- 4, 3, 69, 67, 69, 0, 76, 0, 89, 112,
- 110, 101, 112, 103, 104, 105, 106, 107, 108, 112,
- 109, 112, 99, 99, 100, 127, 120, 121, 0, 123,
- 0, 122, 124, 0, 91, 0, 0, 93, 113, 113,
- 113, 113, 87, 85, 62, 0, 74, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
-
- 62, 62, 62, 62, 62, 62, 62, 62, 3, 69,
- 68, 75, 0, 101, 0, 0, 102, 0, 0, 0,
+ 0, 0, 92, 92, 112, 112, 112, 112, 0, 0,
+ 0, 0, 130, 79, 2, 2, 70, 79, 69, 79,
+ 1, 65, 79, 66, 66, 64, 76, 62, 65, 78,
+ 72, 63, 79, 89, 89, 127, 94, 93, 127, 80,
+ 96, 95, 83, 2, 1, 83, 82, 81, 83, 98,
+ 98, 99, 97, 80, 128, 118, 127, 117, 127, 127,
+ 127, 121, 124, 125, 127, 91, 127, 116, 115, 127,
+ 114, 113, 86, 2, 1, 84, 86, 86, 85, 86,
+
+ 87, 2, 1, 87, 87, 79, 77, 61, 0, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 71, 65, 65,
+ 4, 3, 68, 66, 68, 0, 75, 0, 88, 111,
+ 109, 100, 111, 102, 103, 104, 105, 106, 107, 111,
+ 108, 111, 98, 98, 99, 126, 119, 120, 0, 122,
+ 0, 121, 123, 0, 90, 0, 0, 92, 112, 112,
+ 112, 112, 86, 84, 61, 0, 73, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+
+ 61, 61, 61, 61, 61, 61, 61, 61, 3, 68,
+ 67, 74, 0, 100, 0, 0, 101, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 0, 101,
- 0, 0, 62, 7, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 23, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
-
- 62, 62, 36, 62, 62, 62, 62, 62, 62, 44,
- 62, 47, 62, 62, 50, 0, 0, 0, 62, 8,
- 62, 62, 62, 13, 14, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 26, 62, 62, 62, 62, 62,
- 62, 62, 62, 32, 62, 34, 62, 62, 62, 62,
- 62, 62, 41, 62, 43, 45, 48, 62, 0, 0,
- 111, 6, 62, 10, 62, 62, 62, 16, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 33, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 0, 62, 11, 62, 62,
-
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 0,
- 59, 62, 62, 38, 62, 62, 40, 62, 62, 62,
- 49, 5, 0, 62, 62, 62, 62, 62, 62, 62,
- 62, 62, 62, 62, 62, 22, 62, 62, 62, 62,
- 62, 29, 62, 58, 30, 62, 62, 62, 62, 62,
- 42, 62, 62, 0, 62, 62, 62, 62, 62, 17,
- 53, 62, 62, 62, 62, 62, 24, 25, 62, 62,
- 62, 62, 62, 62, 62, 62, 62, 62, 62, 0,
- 0, 62, 62, 12, 62, 62, 62, 62, 62, 21,
-
- 62, 62, 62, 62, 62, 62, 62, 37, 62, 62,
- 62, 62, 62, 62, 62, 62, 18, 62, 62, 62,
- 27, 56, 62, 62, 62, 35, 39, 60, 46, 61,
- 9, 51, 62, 62, 0, 54, 62, 62, 62, 0,
- 56, 62, 62, 62, 15, 52, 62, 62, 62, 62,
- 62, 62, 62, 62, 20, 62, 62, 62, 62, 62,
- 28, 57, 62, 62, 62, 62, 62, 62, 62, 19,
- 55, 62, 62, 62, 62, 62, 31, 0
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 0, 100,
+ 0, 0, 61, 7, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 22, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+
+ 61, 61, 34, 61, 61, 61, 61, 61, 61, 42,
+ 61, 45, 61, 61, 48, 0, 0, 0, 61, 8,
+ 61, 61, 61, 13, 14, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 25, 61, 61, 61, 61, 61,
+ 61, 61, 30, 61, 32, 61, 61, 61, 61, 61,
+ 61, 39, 61, 41, 43, 46, 61, 0, 0, 110,
+ 6, 61, 10, 61, 61, 61, 15, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 31, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 0, 61, 11, 61, 61, 61, 61,
+
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 0, 58, 61, 61,
+ 36, 61, 61, 38, 61, 61, 61, 47, 5, 0,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 21, 61, 61, 61, 61, 27, 61, 57,
+ 28, 61, 61, 61, 61, 61, 40, 61, 61, 0,
+ 61, 61, 61, 61, 61, 16, 53, 61, 61, 61,
+ 61, 61, 23, 24, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 0, 0, 61, 61, 12, 61,
+ 61, 61, 61, 61, 20, 61, 61, 61, 61, 61,
+
+ 61, 35, 61, 61, 61, 61, 61, 61, 61, 61,
+ 17, 61, 61, 61, 50, 61, 61, 61, 33, 37,
+ 59, 44, 60, 9, 51, 61, 61, 0, 54, 61,
+ 61, 61, 50, 50, 61, 61, 61, 49, 52, 61,
+ 61, 61, 50, 61, 61, 61, 61, 61, 19, 61,
+ 61, 61, 61, 61, 26, 56, 61, 61, 61, 61,
+ 61, 61, 61, 18, 55, 61, 61, 61, 61, 61,
+ 29, 0
} ;
static const YY_CHAR yy_ec[256] =
@@ -809,149 +809,147 @@ static const YY_CHAR yy_meta[59] =
9, 9, 9, 9, 4, 4, 4, 1
} ;
-static const flex_int16_t yy_base[605] =
+static const flex_int16_t yy_base[599] =
{ 0,
- 0, 1001, 997, 996, 56, 57, 58, 61, 63, 90,
+ 0, 998, 994, 993, 56, 57, 58, 61, 63, 90,
76, 87, 70, 97, 117, 121, 66, 130, 140, 144,
- 79, 107, 99, 109, 153, 159, 148, 152, 201, 998,
- 182, 258, 1004, 0, 1009, 1009, 1009, 265, 1009, 1009,
- 1009, 320, 153, 313, 153, 1009, 61, 1009, 330, 1009,
- 1009, 1009, 961, 1009, 988, 1009, 1009, 1009, 383, 1009,
- 1009, 1009, 1009, 1009, 1009, 161, 1009, 1009, 959, 988,
- 110, 979, 1009, 986, 1009, 1009, 940, 1009, 169, 144,
- 254, 1009, 1009, 1009, 250, 1009, 187, 1009, 1009, 265,
- 1009, 1009, 0, 1009, 0, 0, 261, 1009, 1009, 954,
-
- 1009, 1009, 1009, 266, 953, 0, 1009, 0, 320, 954,
- 948, 241, 293, 952, 949, 946, 250, 953, 294, 937,
- 303, 245, 150, 311, 943, 950, 953, 1009, 436, 0,
- 1009, 0, 0, 346, 480, 962, 1009, 943, 1009, 1009,
- 1009, 342, 0, 1009, 1009, 1009, 1009, 1009, 1009, 0,
- 1009, 0, 970, 330, 961, 1009, 1009, 1009, 365, 1009,
- 369, 1009, 1009, 374, 1009, 378, 382, 951, 1009, 388,
- 950, 392, 0, 0, 0, 398, 1009, 934, 942, 374,
- 928, 929, 926, 927, 360, 924, 931, 926, 368, 935,
- 920, 924, 398, 930, 915, 916, 333, 915, 915, 923,
-
- 924, 927, 910, 916, 910, 915, 906, 919, 0, 0,
- 0, 1009, 908, 402, 0, 0, 0, 423, 431, 453,
+ 79, 107, 99, 109, 153, 159, 148, 152, 201, 995,
+ 182, 258, 1001, 0, 1006, 1006, 1006, 265, 1006, 1006,
+ 1006, 320, 153, 313, 153, 1006, 61, 1006, 330, 1006,
+ 1006, 1006, 958, 1006, 985, 1006, 1006, 1006, 383, 1006,
+ 1006, 1006, 1006, 1006, 1006, 161, 1006, 1006, 956, 985,
+ 110, 976, 1006, 983, 1006, 1006, 937, 1006, 169, 144,
+ 254, 1006, 1006, 1006, 250, 1006, 187, 1006, 1006, 265,
+ 1006, 1006, 0, 1006, 0, 0, 261, 1006, 1006, 951,
+
+ 1006, 1006, 1006, 266, 950, 0, 1006, 0, 320, 951,
+ 945, 241, 293, 949, 946, 943, 250, 950, 294, 934,
+ 303, 245, 150, 311, 940, 947, 950, 1006, 436, 0,
+ 1006, 0, 0, 346, 480, 959, 1006, 940, 1006, 1006,
+ 1006, 342, 0, 1006, 1006, 1006, 1006, 1006, 1006, 0,
+ 1006, 0, 967, 330, 958, 1006, 1006, 1006, 365, 1006,
+ 369, 1006, 1006, 374, 1006, 378, 382, 948, 1006, 388,
+ 947, 392, 0, 0, 0, 398, 1006, 931, 939, 374,
+ 925, 926, 923, 924, 360, 921, 928, 923, 368, 932,
+ 917, 921, 398, 927, 912, 913, 333, 912, 912, 920,
+
+ 921, 924, 907, 913, 907, 912, 903, 916, 0, 0,
+ 0, 1006, 905, 402, 0, 0, 0, 423, 431, 453,
410, 459, 443, 465, 390, 471, 475, 479, 483, 379,
- 919, 914, 898, 81, 898, 911, 896, 900, 908, 907,
- 906, 929, 890, 901, 888, 925, 904, 897, 898, 415,
- 448, 412, 885, 886, 420, 897, 886, 893, 877, 888,
- 884, 877, 881, 887, 886, 876, 887, 885, 882, 1009,
- 0, 0, 869, 0, 878, 864, 870, 865, 878, 857,
- 862, 875, 896, 872, 860, 865, 853, 0, 857, 852,
- 865, 333, 864, 859, 862, 857, 847, 859, 851, 842,
-
- 849, 855, 854, 839, 467, 848, 837, 850, 835, 0,
- 840, 0, 839, 837, 0, 876, 0, 0, 826, 0,
- 837, 842, 826, 0, 0, 475, 826, 829, 477, 842,
- 841, 840, 839, 830, 0, 823, 822, 830, 822, 828,
- 820, 814, 812, 0, 811, 0, 848, 824, 822, 811,
- 810, 807, 0, 804, 0, 479, 0, 804, 484, 0,
- 1009, 0, 802, 802, 816, 797, 796, 480, 799, 801,
- 800, 796, 801, 804, 793, 795, 791, 790, 805, 800,
- 803, 798, 788, 796, 516, 785, 794, 781, 796, 795,
- 790, 780, 774, 773, 786, 519, 495, 0, 771, 784,
-
- 783, 770, 769, 780, 764, 763, 764, 800, 775, 778,
- 765, 772, 771, 755, 756, 753, 754, 768, 753, 525,
- 1009, 768, 755, 0, 750, 749, 0, 752, 763, 762,
- 0, 1009, 787, 746, 745, 745, 741, 740, 739, 738,
- 748, 734, 733, 746, 749, 0, 737, 730, 741, 740,
- 734, 0, 733, 0, 0, 731, 725, 738, 722, 721,
- 0, 736, 735, 761, 718, 717, 716, 730, 729, 0,
- 0, 721, 714, 713, 710, 723, 0, 0, 716, 715,
- 704, 703, 712, 719, 714, 705, 701, 683, 679, 710,
- 499, 675, 673, 0, 663, 660, 651, 639, 619, 0,
-
- 616, 611, 607, 511, 513, 615, 615, 0, 607, 606,
- 617, 616, 615, 614, 598, 540, 536, 538, 537, 546,
- 545, 549, 539, 538, 543, 0, 0, 0, 0, 0,
- 0, 0, 546, 545, 556, 1009, 531, 533, 535, 569,
- 1009, 531, 530, 527, 0, 0, 538, 532, 524, 531,
- 529, 513, 516, 515, 0, 499, 498, 491, 467, 461,
- 0, 0, 459, 439, 435, 434, 389, 381, 378, 0,
- 0, 390, 366, 347, 350, 307, 0, 1009, 590, 601,
- 612, 623, 634, 645, 656, 662, 671, 682, 693, 702,
- 708, 713, 722, 729, 286, 277, 259, 187, 179, 173,
-
- 135, 133, 87, 738
+ 916, 911, 895, 81, 895, 908, 893, 897, 905, 904,
+ 903, 926, 887, 898, 885, 922, 901, 894, 895, 415,
+ 448, 412, 882, 883, 420, 894, 883, 890, 874, 885,
+ 881, 874, 878, 884, 883, 873, 884, 882, 879, 1006,
+ 0, 0, 866, 0, 875, 861, 867, 862, 875, 854,
+ 859, 872, 893, 869, 857, 862, 850, 0, 854, 849,
+ 862, 333, 861, 856, 859, 854, 844, 856, 848, 839,
+
+ 846, 852, 851, 836, 467, 845, 834, 847, 832, 0,
+ 837, 0, 836, 834, 0, 873, 0, 0, 823, 0,
+ 834, 839, 823, 0, 0, 475, 823, 826, 477, 839,
+ 838, 837, 836, 827, 0, 820, 828, 820, 826, 818,
+ 812, 810, 0, 809, 0, 846, 822, 820, 809, 808,
+ 805, 0, 802, 0, 479, 0, 802, 484, 0, 1006,
+ 0, 800, 800, 814, 795, 794, 480, 797, 799, 798,
+ 794, 799, 802, 791, 793, 789, 804, 799, 802, 797,
+ 787, 795, 516, 784, 793, 780, 795, 794, 789, 779,
+ 773, 772, 785, 519, 495, 0, 770, 783, 782, 769,
+
+ 768, 779, 763, 762, 763, 799, 774, 777, 764, 771,
+ 755, 756, 753, 754, 768, 753, 525, 1006, 768, 755,
+ 0, 750, 749, 0, 752, 763, 762, 0, 1006, 787,
+ 746, 745, 745, 741, 740, 739, 738, 748, 734, 733,
+ 746, 749, 0, 737, 730, 741, 735, 0, 734, 0,
+ 0, 732, 726, 739, 723, 722, 0, 737, 736, 762,
+ 719, 718, 717, 731, 730, 0, 0, 722, 715, 714,
+ 711, 724, 0, 0, 717, 706, 705, 714, 721, 716,
+ 715, 714, 707, 706, 741, 499, 710, 709, 0, 699,
+ 698, 689, 690, 681, 0, 678, 663, 511, 513, 668,
+
+ 664, 0, 654, 652, 663, 660, 661, 647, 612, 608,
+ 536, 605, 601, 610, 545, 603, 600, 605, 0, 0,
+ 0, 0, 0, 0, 0, 608, 607, 549, 1006, 531,
+ 533, 595, 556, 569, 591, 590, 527, 0, 0, 538,
+ 532, 524, 576, 531, 529, 513, 516, 515, 0, 499,
+ 498, 491, 467, 461, 0, 0, 459, 439, 435, 434,
+ 389, 381, 378, 0, 0, 390, 366, 347, 350, 307,
+ 0, 1006, 581, 592, 603, 614, 625, 636, 647, 653,
+ 662, 673, 684, 693, 699, 704, 713, 720, 286, 277,
+ 259, 187, 179, 173, 135, 133, 87, 729
+
} ;
-static const flex_int16_t yy_def[605] =
+static const flex_int16_t yy_def[599] =
{ 0,
- 578, 1, 579, 579, 580, 580, 580, 580, 581, 581,
- 582, 582, 580, 580, 580, 580, 580, 580, 580, 580,
- 580, 580, 580, 580, 580, 580, 580, 580, 578, 29,
- 583, 583, 578, 584, 578, 578, 578, 578, 578, 578,
- 578, 585, 578, 586, 586, 578, 578, 578, 585, 578,
- 578, 578, 584, 578, 578, 578, 578, 578, 587, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 588,
- 588, 578, 578, 588, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 589,
- 578, 578, 590, 578, 590, 591, 578, 578, 578, 590,
-
- 578, 578, 578, 578, 578, 584, 578, 592, 578, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 578, 585, 49,
- 578, 593, 594, 586, 594, 578, 578, 578, 578, 578,
- 578, 578, 595, 578, 578, 578, 578, 578, 578, 596,
- 578, 597, 588, 588, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 590, 591, 592, 578, 578, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
-
- 592, 592, 592, 592, 592, 592, 592, 592, 593, 594,
- 135, 578, 578, 578, 598, 599, 597, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 589,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 578, 578,
- 600, 601, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
-
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 578, 602, 603, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 578, 596,
- 578, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 578, 592, 592, 592, 592,
-
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 578,
- 578, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 578, 578, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 604, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 604,
- 604, 592, 592, 592, 592, 592, 592, 592, 592, 592,
-
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 578, 578, 592, 592, 592, 578,
- 578, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
- 592, 592, 592, 592, 592, 592, 592, 0, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
-
- 578, 578, 578, 578
+ 572, 1, 573, 573, 574, 574, 574, 574, 575, 575,
+ 576, 576, 574, 574, 574, 574, 574, 574, 574, 574,
+ 574, 574, 574, 574, 574, 574, 574, 574, 572, 29,
+ 577, 577, 572, 578, 572, 572, 572, 572, 572, 572,
+ 572, 579, 572, 580, 580, 572, 572, 572, 579, 572,
+ 572, 572, 578, 572, 572, 572, 572, 572, 581, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 582,
+ 582, 572, 572, 582, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 583,
+ 572, 572, 584, 572, 584, 585, 572, 572, 572, 584,
+
+ 572, 572, 572, 572, 572, 578, 572, 586, 572, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 572, 579, 49,
+ 572, 587, 588, 580, 588, 572, 572, 572, 572, 572,
+ 572, 572, 589, 572, 572, 572, 572, 572, 572, 590,
+ 572, 591, 582, 582, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 584, 585, 586, 572, 572, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+
+ 586, 586, 586, 586, 586, 586, 586, 586, 587, 588,
+ 135, 572, 572, 572, 592, 593, 591, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 583,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 572, 572,
+ 594, 595, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 572, 596, 597, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 572, 590, 572,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 572, 586, 586, 586, 586, 586, 586,
+
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 572, 572, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 572, 572,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 598,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 598, 598, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 572, 572, 586,
+ 586, 586, 572, 572, 586, 586, 586, 586, 586, 586,
+ 586, 586, 572, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 586, 586, 586, 586, 586, 586, 586, 586, 586,
+ 586, 0, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572
+
} ;
-static const flex_int16_t yy_nxt[1068] =
+static const flex_int16_t yy_nxt[1065] =
{ 0,
34, 35, 36, 34, 35, 37, 34, 38, 39, 40,
41, 34, 42, 43, 44, 45, 45, 34, 46, 47,
@@ -962,12 +960,12 @@ static const flex_int16_t yy_nxt[1068] =
61, 58, 58, 61, 64, 36, 62, 64, 75, 62,
136, 76, 75, 65, 78, 76, 66, 77, 78, 79,
67, 75, 137, 79, 59, 59, 59, 71, 85, 59,
- 68, 64, 36, 361, 64, 72, 69, 73, 71, 75,
+ 68, 64, 36, 360, 64, 72, 69, 73, 71, 75,
65, 86, 76, 66, 77, 78, 72, 67, 73, 75,
79, 86, 276, 60, 60, 60, 85, 68, 60, 75,
277, 154, 76, 75, 80, 78, 76, 87, 80, 78,
- 79, 153, 75, 74, 79, 76, 81, 87, 78, 360,
+ 79, 153, 75, 74, 79, 76, 81, 87, 78, 359,
81, 318, 75, 79, 74, 76, 75, 80, 78, 76,
91, 80, 78, 79, 91, 88, 92, 79, 89, 81,
92, 88, 131, 81, 89, 160, 132, 134, 134, 134,
@@ -989,90 +987,90 @@ static const flex_int16_t yy_nxt[1068] =
113, 114, 115, 108, 116, 108, 117, 118, 119, 120,
121, 108, 122, 123, 124, 125, 126, 108, 127, 128,
106, 176, 176, 106, 176, 192, 106, 134, 134, 134,
- 578, 129, 129, 578, 196, 182, 578, 106, 193, 135,
- 183, 154, 106, 194, 336, 184, 203, 578, 106, 106,
- 197, 153, 578, 198, 577, 204, 214, 214, 578, 578,
- 134, 134, 134, 337, 205, 135, 218, 219, 256, 218,
+ 572, 129, 129, 572, 196, 182, 572, 106, 193, 135,
+ 183, 154, 106, 194, 336, 184, 203, 572, 106, 106,
+ 197, 153, 572, 198, 571, 204, 214, 214, 572, 572,
+ 134, 134, 134, 336, 205, 135, 218, 219, 256, 218,
220, 221, 257, 220, 177, 222, 223, 106, 222, 224,
- 225, 578, 224, 167, 168, 576, 167, 578, 141, 227,
- 171, 141, 227, 229, 230, 575, 229, 142, 142, 176,
+ 225, 572, 224, 167, 168, 570, 167, 572, 141, 227,
+ 171, 141, 227, 229, 230, 569, 229, 142, 142, 176,
176, 240, 176, 165, 245, 141, 233, 172, 143, 250,
- 234, 141, 241, 574, 144, 145, 270, 270, 166, 146,
- 246, 573, 235, 572, 218, 219, 147, 218, 251, 571,
- 148, 160, 149, 150, 151, 152, 106, 570, 161, 106,
- 157, 252, 106, 297, 158, 569, 298, 129, 129, 293,
+ 234, 141, 241, 568, 144, 145, 270, 270, 166, 146,
+ 246, 567, 235, 566, 218, 219, 147, 218, 251, 565,
+ 148, 160, 149, 150, 151, 152, 106, 564, 161, 106,
+ 157, 252, 106, 297, 158, 563, 298, 129, 129, 293,
162, 301, 177, 106, 220, 221, 294, 220, 106, 159,
222, 223, 163, 222, 106, 106, 224, 225, 302, 224,
- 568, 164, 167, 168, 567, 167, 227, 171, 350, 227,
- 227, 171, 295, 227, 229, 230, 366, 229, 370, 296,
- 393, 402, 566, 106, 211, 211, 211, 351, 396, 396,
-
- 396, 432, 565, 211, 491, 367, 434, 371, 564, 394,
- 403, 211, 211, 211, 211, 211, 211, 420, 420, 420,
- 420, 432, 523, 433, 524, 435, 420, 420, 420, 420,
- 563, 562, 561, 396, 396, 396, 421, 535, 535, 535,
- 535, 524, 547, 524, 548, 421, 540, 540, 540, 540,
- 540, 540, 540, 540, 560, 559, 536, 535, 535, 535,
- 535, 548, 558, 548, 557, 541, 556, 555, 554, 541,
- 540, 540, 540, 540, 553, 552, 536, 551, 550, 549,
- 546, 545, 544, 543, 542, 539, 538, 537, 534, 541,
- 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
-
- 54, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 63, 63, 63, 63, 63, 63, 63, 63,
- 63, 63, 63, 70, 70, 70, 70, 70, 70, 70,
- 70, 70, 70, 70, 101, 101, 101, 101, 101, 101,
- 101, 101, 101, 101, 101, 106, 533, 532, 531, 106,
- 106, 530, 529, 528, 527, 106, 130, 526, 525, 522,
- 130, 130, 130, 521, 130, 520, 130, 133, 133, 519,
- 133, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 153, 153, 153, 153, 153, 153, 153, 518,
- 153, 153, 153, 169, 169, 169, 169, 169, 169, 169,
-
- 169, 169, 173, 517, 516, 173, 173, 515, 514, 173,
- 513, 173, 174, 174, 174, 491, 174, 175, 175, 175,
- 512, 175, 209, 209, 511, 209, 209, 209, 209, 209,
- 209, 209, 209, 210, 210, 210, 510, 210, 490, 490,
- 509, 490, 490, 490, 490, 490, 490, 490, 490, 508,
- 507, 506, 505, 504, 503, 502, 501, 500, 499, 498,
- 497, 496, 495, 494, 493, 492, 491, 489, 488, 487,
- 486, 485, 484, 483, 482, 481, 480, 479, 478, 477,
- 476, 475, 474, 473, 472, 471, 470, 469, 468, 467,
- 466, 465, 464, 463, 462, 461, 460, 459, 458, 457,
-
- 456, 455, 454, 453, 452, 451, 450, 449, 448, 447,
- 446, 445, 444, 443, 442, 441, 440, 439, 438, 437,
- 436, 431, 430, 429, 428, 427, 426, 425, 424, 423,
- 422, 419, 418, 417, 416, 415, 414, 413, 412, 411,
- 410, 409, 408, 407, 406, 405, 404, 401, 400, 399,
- 398, 397, 395, 392, 391, 390, 389, 388, 387, 386,
- 385, 384, 383, 382, 381, 380, 379, 378, 377, 376,
- 375, 374, 373, 372, 369, 368, 365, 364, 363, 362,
- 359, 358, 357, 356, 355, 354, 353, 352, 349, 348,
- 347, 346, 345, 344, 343, 342, 341, 340, 339, 338,
-
- 335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
- 325, 324, 323, 322, 321, 320, 319, 316, 315, 314,
- 313, 312, 311, 310, 309, 308, 307, 306, 305, 304,
- 303, 300, 299, 292, 291, 290, 289, 288, 287, 286,
- 285, 284, 283, 282, 281, 280, 279, 278, 275, 274,
- 273, 269, 268, 267, 266, 265, 264, 263, 262, 261,
- 260, 259, 258, 255, 254, 253, 249, 248, 247, 244,
- 243, 242, 239, 238, 237, 236, 232, 231, 228, 226,
- 155, 154, 213, 212, 208, 207, 206, 195, 191, 187,
- 186, 185, 179, 178, 138, 138, 156, 154, 155, 154,
-
- 138, 139, 138, 578, 100, 55, 55, 53, 33, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578
+ 562, 164, 167, 168, 561, 167, 227, 171, 349, 227,
+ 227, 171, 295, 227, 229, 230, 365, 229, 369, 296,
+ 391, 400, 560, 106, 211, 211, 211, 350, 394, 394,
+
+ 394, 429, 559, 211, 486, 366, 431, 370, 558, 392,
+ 401, 211, 211, 211, 211, 211, 211, 417, 417, 417,
+ 417, 429, 516, 430, 517, 432, 417, 417, 417, 417,
+ 557, 556, 555, 394, 394, 394, 418, 528, 528, 528,
+ 528, 517, 540, 517, 541, 418, 533, 533, 533, 533,
+ 528, 528, 528, 528, 554, 553, 529, 533, 533, 533,
+ 533, 541, 552, 541, 551, 534, 550, 549, 548, 529,
+ 543, 543, 543, 543, 547, 546, 534, 543, 543, 543,
+ 543, 54, 54, 54, 54, 54, 54, 54, 54, 54,
+ 54, 54, 56, 56, 56, 56, 56, 56, 56, 56,
+
+ 56, 56, 56, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 70, 70, 70, 70, 70, 70,
+ 70, 70, 70, 70, 70, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 101, 101, 106, 545, 544, 542,
+ 106, 106, 539, 538, 537, 536, 106, 130, 535, 532,
+ 531, 130, 130, 130, 530, 130, 527, 130, 133, 133,
+ 526, 133, 140, 140, 140, 140, 140, 140, 140, 140,
+ 140, 140, 140, 153, 153, 153, 153, 153, 153, 153,
+ 525, 153, 153, 153, 169, 169, 169, 169, 169, 169,
+ 169, 169, 169, 173, 524, 523, 173, 173, 522, 521,
+
+ 173, 520, 173, 174, 174, 174, 519, 174, 175, 175,
+ 175, 518, 175, 209, 209, 515, 209, 209, 209, 209,
+ 209, 209, 209, 209, 210, 210, 210, 514, 210, 485,
+ 485, 513, 485, 485, 485, 485, 485, 485, 485, 485,
+ 512, 511, 510, 509, 508, 507, 486, 506, 505, 504,
+ 503, 502, 501, 500, 499, 498, 497, 496, 495, 494,
+ 493, 492, 491, 490, 489, 488, 487, 486, 484, 483,
+ 482, 481, 480, 479, 478, 477, 476, 475, 474, 473,
+ 472, 471, 470, 469, 468, 467, 466, 465, 464, 463,
+ 462, 461, 460, 459, 458, 457, 456, 455, 454, 453,
+
+ 452, 451, 450, 449, 448, 447, 446, 445, 444, 443,
+ 442, 441, 440, 439, 438, 437, 436, 435, 434, 433,
+ 428, 427, 426, 425, 424, 423, 422, 421, 420, 419,
+ 416, 415, 414, 413, 412, 411, 410, 409, 408, 407,
+ 406, 405, 404, 403, 402, 399, 398, 397, 396, 395,
+ 393, 390, 389, 388, 387, 386, 385, 384, 383, 382,
+ 381, 380, 379, 378, 377, 376, 375, 374, 373, 372,
+ 371, 368, 367, 364, 363, 362, 361, 358, 357, 356,
+ 355, 354, 353, 352, 351, 348, 347, 346, 345, 344,
+ 343, 342, 341, 340, 339, 338, 337, 335, 334, 333,
+
+ 332, 331, 330, 329, 328, 327, 326, 325, 324, 323,
+ 322, 321, 320, 319, 316, 315, 314, 313, 312, 311,
+ 310, 309, 308, 307, 306, 305, 304, 303, 300, 299,
+ 292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
+ 282, 281, 280, 279, 278, 275, 274, 273, 269, 268,
+ 267, 266, 265, 264, 263, 262, 261, 260, 259, 258,
+ 255, 254, 253, 249, 248, 247, 244, 243, 242, 239,
+ 238, 237, 236, 232, 231, 228, 226, 155, 154, 213,
+ 212, 208, 207, 206, 195, 191, 187, 186, 185, 179,
+ 178, 138, 138, 156, 154, 155, 154, 138, 139, 138,
+
+ 572, 100, 55, 55, 53, 33, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572
} ;
-static const flex_int16_t yy_chk[1068] =
+static const flex_int16_t yy_chk[1065] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -1083,18 +1081,18 @@ static const flex_int16_t yy_chk[1068] =
7, 5, 6, 8, 9, 9, 7, 9, 17, 8,
47, 17, 13, 9, 17, 13, 9, 13, 13, 17,
9, 21, 47, 13, 5, 6, 7, 11, 21, 8,
- 9, 10, 10, 603, 10, 11, 10, 11, 12, 14,
+ 9, 10, 10, 597, 10, 11, 10, 11, 12, 14,
10, 23, 14, 10, 14, 14, 12, 10, 12, 22,
14, 24, 234, 5, 6, 7, 22, 10, 8, 15,
234, 71, 15, 16, 15, 15, 16, 23, 16, 16,
- 15, 71, 18, 11, 16, 18, 15, 24, 18, 602,
- 16, 601, 19, 18, 12, 19, 20, 19, 19, 20,
+ 15, 71, 18, 11, 16, 18, 15, 24, 18, 596,
+ 16, 595, 19, 18, 12, 19, 20, 19, 19, 20,
27, 20, 20, 19, 28, 25, 27, 20, 25, 19,
28, 26, 43, 20, 26, 80, 43, 45, 45, 45,
- 66, 15, 80, 15, 66, 16, 27, 16, 79, 600,
- 28, 25, 79, 31, 31, 599, 31, 26, 87, 87,
- 123, 87, 31, 598, 19, 31, 19, 79, 20, 123,
+ 66, 15, 80, 15, 66, 16, 27, 16, 79, 594,
+ 28, 25, 79, 31, 31, 593, 31, 26, 87, 87,
+ 123, 87, 31, 592, 19, 31, 19, 79, 20, 123,
20, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
@@ -1102,95 +1100,95 @@ static const flex_int16_t yy_chk[1068] =
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 32,
- 32, 81, 32, 85, 32, 597, 90, 90, 32, 90,
+ 32, 81, 32, 85, 32, 591, 90, 90, 32, 90,
97, 32, 38, 81, 97, 104, 112, 38, 85, 104,
- 122, 117, 81, 596, 122, 117, 112, 38, 38, 38,
- 38, 38, 595, 90, 117, 38, 38, 38, 38, 38,
+ 122, 117, 81, 590, 122, 117, 112, 38, 38, 38,
+ 38, 38, 589, 90, 117, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
42, 109, 109, 42, 109, 119, 42, 44, 44, 44,
49, 42, 42, 49, 121, 113, 49, 42, 119, 44,
113, 154, 42, 119, 292, 113, 124, 49, 42, 42,
- 121, 154, 49, 121, 576, 124, 142, 142, 49, 49,
+ 121, 154, 49, 121, 570, 124, 142, 142, 49, 49,
134, 134, 134, 292, 124, 44, 159, 159, 197, 159,
161, 161, 197, 161, 109, 164, 164, 42, 164, 166,
- 166, 230, 166, 167, 167, 575, 167, 49, 59, 170,
- 170, 59, 170, 172, 172, 574, 172, 59, 59, 176,
+ 166, 230, 166, 167, 167, 569, 167, 49, 59, 170,
+ 170, 59, 170, 172, 172, 568, 172, 59, 59, 176,
176, 185, 176, 225, 189, 59, 180, 230, 59, 193,
- 180, 59, 185, 573, 59, 59, 214, 214, 225, 59,
- 189, 572, 180, 569, 218, 218, 59, 218, 193, 568,
- 59, 221, 59, 59, 59, 59, 129, 567, 221, 129,
- 219, 193, 129, 252, 219, 566, 252, 129, 129, 250,
+ 180, 59, 185, 567, 59, 59, 214, 214, 225, 59,
+ 189, 566, 180, 563, 218, 218, 59, 218, 193, 562,
+ 59, 221, 59, 59, 59, 59, 129, 561, 221, 129,
+ 219, 193, 129, 252, 219, 560, 252, 129, 129, 250,
223, 255, 176, 129, 220, 220, 250, 220, 129, 219,
222, 222, 223, 222, 129, 129, 224, 224, 255, 224,
- 565, 223, 226, 226, 564, 226, 227, 227, 305, 227,
+ 559, 223, 226, 226, 558, 226, 227, 227, 305, 227,
228, 228, 251, 228, 229, 229, 326, 229, 329, 251,
- 356, 368, 563, 129, 135, 135, 135, 305, 359, 359,
-
- 359, 491, 560, 135, 491, 326, 397, 329, 559, 356,
- 368, 135, 135, 135, 135, 135, 135, 385, 385, 385,
- 385, 396, 504, 396, 505, 397, 420, 420, 420, 420,
- 558, 557, 556, 396, 396, 396, 385, 517, 517, 517,
- 517, 504, 537, 505, 538, 420, 521, 521, 521, 521,
- 522, 522, 522, 522, 554, 553, 517, 535, 535, 535,
- 535, 537, 552, 538, 551, 521, 550, 549, 548, 522,
- 540, 540, 540, 540, 547, 544, 535, 543, 542, 539,
- 534, 533, 525, 524, 523, 520, 519, 518, 516, 540,
- 579, 579, 579, 579, 579, 579, 579, 579, 579, 579,
-
- 579, 580, 580, 580, 580, 580, 580, 580, 580, 580,
- 580, 580, 581, 581, 581, 581, 581, 581, 581, 581,
+ 355, 367, 557, 129, 135, 135, 135, 305, 358, 358,
+
+ 358, 486, 554, 135, 486, 326, 395, 329, 553, 355,
+ 367, 135, 135, 135, 135, 135, 135, 383, 383, 383,
+ 383, 394, 498, 394, 499, 395, 417, 417, 417, 417,
+ 552, 551, 550, 394, 394, 394, 383, 511, 511, 511,
+ 511, 498, 530, 499, 531, 417, 515, 515, 515, 515,
+ 528, 528, 528, 528, 548, 547, 511, 533, 533, 533,
+ 533, 530, 546, 531, 545, 515, 544, 542, 541, 528,
+ 534, 534, 534, 534, 540, 537, 533, 543, 543, 543,
+ 543, 573, 573, 573, 573, 573, 573, 573, 573, 573,
+ 573, 573, 574, 574, 574, 574, 574, 574, 574, 574,
+
+ 574, 574, 574, 575, 575, 575, 575, 575, 575, 575,
+ 575, 575, 575, 575, 576, 576, 576, 576, 576, 576,
+ 576, 576, 576, 576, 576, 577, 577, 577, 577, 577,
+ 577, 577, 577, 577, 577, 577, 578, 536, 535, 532,
+ 578, 578, 527, 526, 518, 517, 578, 579, 516, 514,
+ 513, 579, 579, 579, 512, 579, 510, 579, 580, 580,
+ 509, 580, 581, 581, 581, 581, 581, 581, 581, 581,
581, 581, 581, 582, 582, 582, 582, 582, 582, 582,
- 582, 582, 582, 582, 583, 583, 583, 583, 583, 583,
- 583, 583, 583, 583, 583, 584, 515, 514, 513, 584,
- 584, 512, 511, 510, 509, 584, 585, 507, 506, 503,
- 585, 585, 585, 502, 585, 501, 585, 586, 586, 499,
- 586, 587, 587, 587, 587, 587, 587, 587, 587, 587,
- 587, 587, 588, 588, 588, 588, 588, 588, 588, 498,
- 588, 588, 588, 589, 589, 589, 589, 589, 589, 589,
-
- 589, 589, 590, 497, 496, 590, 590, 495, 493, 590,
- 492, 590, 591, 591, 591, 490, 591, 592, 592, 592,
- 489, 592, 593, 593, 488, 593, 593, 593, 593, 593,
- 593, 593, 593, 594, 594, 594, 487, 594, 604, 604,
- 486, 604, 604, 604, 604, 604, 604, 604, 604, 485,
- 484, 483, 482, 481, 480, 479, 476, 475, 474, 473,
- 472, 469, 468, 467, 466, 465, 464, 463, 462, 460,
- 459, 458, 457, 456, 453, 451, 450, 449, 448, 447,
- 445, 444, 443, 442, 441, 440, 439, 438, 437, 436,
- 435, 434, 433, 430, 429, 428, 426, 425, 423, 422,
-
- 419, 418, 417, 416, 415, 414, 413, 412, 411, 410,
- 409, 408, 407, 406, 405, 404, 403, 402, 401, 400,
- 399, 395, 394, 393, 392, 391, 390, 389, 388, 387,
- 386, 384, 383, 382, 381, 380, 379, 378, 377, 376,
- 375, 374, 373, 372, 371, 370, 369, 367, 366, 365,
- 364, 363, 358, 354, 352, 351, 350, 349, 348, 347,
- 345, 343, 342, 341, 340, 339, 338, 337, 336, 334,
- 333, 332, 331, 330, 328, 327, 323, 322, 321, 319,
- 316, 314, 313, 311, 309, 308, 307, 306, 304, 303,
- 302, 301, 300, 299, 298, 297, 296, 295, 294, 293,
-
- 291, 290, 289, 287, 286, 285, 284, 283, 282, 281,
- 280, 279, 278, 277, 276, 275, 273, 269, 268, 267,
- 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
- 256, 254, 253, 249, 248, 247, 246, 245, 244, 243,
- 242, 241, 240, 239, 238, 237, 236, 235, 233, 232,
- 231, 213, 208, 207, 206, 205, 204, 203, 202, 201,
- 200, 199, 198, 196, 195, 194, 192, 191, 190, 188,
- 187, 186, 184, 183, 182, 181, 179, 178, 171, 168,
- 155, 153, 138, 136, 127, 126, 125, 120, 118, 116,
- 115, 114, 111, 110, 105, 100, 77, 74, 72, 70,
-
- 69, 55, 53, 33, 30, 4, 3, 2, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
- 578, 578, 578, 578, 578, 578, 578
+ 508, 582, 582, 582, 583, 583, 583, 583, 583, 583,
+ 583, 583, 583, 584, 507, 506, 584, 584, 505, 504,
+
+ 584, 503, 584, 585, 585, 585, 501, 585, 586, 586,
+ 586, 500, 586, 587, 587, 497, 587, 587, 587, 587,
+ 587, 587, 587, 587, 588, 588, 588, 496, 588, 598,
+ 598, 494, 598, 598, 598, 598, 598, 598, 598, 598,
+ 493, 492, 491, 490, 488, 487, 485, 484, 483, 482,
+ 481, 480, 479, 478, 477, 476, 475, 472, 471, 470,
+ 469, 468, 465, 464, 463, 462, 461, 460, 459, 458,
+ 456, 455, 454, 453, 452, 449, 447, 446, 445, 444,
+ 442, 441, 440, 439, 438, 437, 436, 435, 434, 433,
+ 432, 431, 430, 427, 426, 425, 423, 422, 420, 419,
+
+ 416, 415, 414, 413, 412, 411, 410, 409, 408, 407,
+ 406, 405, 404, 403, 402, 401, 400, 399, 398, 397,
+ 393, 392, 391, 390, 389, 388, 387, 386, 385, 384,
+ 382, 381, 380, 379, 378, 377, 376, 375, 374, 373,
+ 372, 371, 370, 369, 368, 366, 365, 364, 363, 362,
+ 357, 353, 351, 350, 349, 348, 347, 346, 344, 342,
+ 341, 340, 339, 338, 337, 336, 334, 333, 332, 331,
+ 330, 328, 327, 323, 322, 321, 319, 316, 314, 313,
+ 311, 309, 308, 307, 306, 304, 303, 302, 301, 300,
+ 299, 298, 297, 296, 295, 294, 293, 291, 290, 289,
+
+ 287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
+ 277, 276, 275, 273, 269, 268, 267, 266, 265, 264,
+ 263, 262, 261, 260, 259, 258, 257, 256, 254, 253,
+ 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
+ 239, 238, 237, 236, 235, 233, 232, 231, 213, 208,
+ 207, 206, 205, 204, 203, 202, 201, 200, 199, 198,
+ 196, 195, 194, 192, 191, 190, 188, 187, 186, 184,
+ 183, 182, 181, 179, 178, 171, 168, 155, 153, 138,
+ 136, 127, 126, 125, 120, 118, 116, 115, 114, 111,
+ 110, 105, 100, 77, 74, 72, 70, 69, 55, 53,
+
+ 33, 30, 4, 3, 2, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572,
+ 572, 572, 572, 572
} ;
static yy_state_type yy_last_accepting_state;
@@ -1199,22 +1197,22 @@ static char *yy_last_accepting_cpos;
extern int yy_flex_debug;
int yy_flex_debug = 1;
-static const flex_int16_t yy_rule_linenum[130] =
+static const flex_int16_t yy_rule_linenum[129] =
{ 0,
- 186, 189, 190, 191, 199, 217, 218, 219, 220, 221,
- 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
- 232, 233, 234, 235, 236, 237, 238, 239, 240, 241,
- 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
- 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
- 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
- 274, 276, 280, 281, 282, 284, 291, 295, 302, 307,
- 310, 313, 316, 324, 331, 332, 333, 339, 346, 353,
- 373, 383, 398, 403, 422, 435, 451, 466, 483, 484,
- 495, 506, 507, 519, 527, 537, 556, 568, 582, 583,
-
- 594, 603, 613, 614, 615, 616, 617, 618, 619, 622,
- 624, 632, 650, 655, 656, 662, 663, 674, 680, 686,
- 692, 708, 709, 713, 720, 737, 758, 791, 792
+ 190, 193, 194, 195, 203, 221, 222, 223, 224, 225,
+ 226, 227, 228, 229, 230, 231, 232, 233, 234, 235,
+ 236, 237, 238, 239, 240, 241, 242, 243, 244, 245,
+ 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
+ 256, 257, 258, 259, 260, 261, 262, 263, 267, 271,
+ 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
+ 285, 289, 290, 291, 293, 300, 301, 305, 310, 313,
+ 316, 319, 327, 334, 335, 336, 342, 349, 356, 376,
+ 386, 401, 406, 425, 438, 454, 469, 486, 487, 498,
+ 509, 510, 522, 531, 541, 560, 572, 586, 587, 598,
+
+ 608, 618, 619, 620, 621, 622, 623, 624, 627, 629,
+ 637, 655, 660, 661, 667, 668, 679, 685, 691, 697,
+ 713, 714, 718, 725, 741, 761, 792, 793
} ;
/* The intent behind this definition is that it'll catch
@@ -1228,7 +1226,7 @@ char *yytext;
#line 1 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Bison Grammar Scanner -*- C -*-
- Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -1246,27 +1244,26 @@ char *yytext;
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define YY_NO_INPUT 1
#line 24 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-/* Work around a bug in flex 2.5.31. See Debian bug 333231
- <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
-#undef gram_wrap
-#define gram_wrap() 1
-
-#define FLEX_PREFIX(Id) gram_ ## Id
-#include <src/flex-scanner.h>
+#include <c-ctype.h>
+#include <mbswidth.h>
+#include <quote.h>
+#include <quotearg.h>
#include <src/complain.h>
#include <src/files.h>
#include <src/getargs.h>
#include <src/gram.h>
-#include <quotearg.h>
#include <src/reader.h>
+#include <src/scan-gram.h>
#include <src/uniqstr.h>
-#include <c-ctype.h>
-#include <mbswidth.h>
-#include <quote.h>
+#define FLEX_PREFIX(Id) gram_ ## Id
+#include <src/flex-scanner.h>
-#include <src/scan-gram.h>
+/* Work around a bug in flex 2.5.31. See Debian bug 333231
+ <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
+#undef gram_wrap
+#define gram_wrap() 1
#define YY_DECL GRAM_LEX_DECL
@@ -1278,15 +1275,19 @@ static boundary scanner_cursor;
static size_t no_cr_read (FILE *, char *, size_t);
#define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
-#define RETURN_PERCENT_PARAM(Value) \
- RETURN_VALUE(PERCENT_PARAM, param, param_ ## Value)
+/* Report that yytext is an extension, and evaluate to its token type. */
+#define BISON_DIRECTIVE(Directive) \
+ (bison_directive (loc, yytext), PERCENT_ ## Directive)
+
+#define RETURN_PERCENT_PARAM(Value) \
+ RETURN_VALUE(PERCENT_PARAM, param_ ## Value)
-#define RETURN_PERCENT_FLAG(Value) \
- RETURN_VALUE(PERCENT_FLAG, uniqstr, uniqstr_new (Value))
+#define RETURN_PERCENT_FLAG(Value) \
+ RETURN_VALUE(PERCENT_FLAG, uniqstr_new (Value))
-#define RETURN_VALUE(Token, Field, Value) \
+#define RETURN_VALUE(Token, Value) \
do { \
- val->Field = Value; \
+ val->Token = Value; \
return Token; \
} while (0)
@@ -1298,18 +1299,17 @@ static size_t no_cr_read (FILE *, char *, size_t);
#define DEPRECATED(Msg) \
do { \
- size_t i; \
deprecated_directive (loc, yytext, Msg); \
scanner_cursor.column -= mbsnwidth (Msg, strlen (Msg), 0); \
- for (i = strlen (Msg); i != 0; --i) \
+ for (size_t i = strlen (Msg); i != 0; --i) \
unput (Msg[i - 1]); \
} while (0)
/* A string representing the most recently saved token. */
-static char *last_string;
+static char *last_string = NULL;
/* Bracketed identifier. */
-static uniqstr bracketed_id_str = 0;
+static uniqstr bracketed_id_str = NULL;
static location bracketed_id_loc;
static boundary bracketed_id_start;
static int bracketed_id_context_state = 0;
@@ -1327,7 +1327,7 @@ static void unexpected_eof (boundary, char const *);
static void unexpected_newline (boundary, char const *);
#line 1329 "src/scan-gram.c"
-#line 106 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 108 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* A C-like comment in directives/rules. */
/* Strings and characters in directives/rules. */
@@ -1655,7 +1655,7 @@ YY_DECL
{
/* %% [7.0] user's declarations go here */
-#line 147 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 151 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Nesting level. Either for nested braces, or nested angle brackets
@@ -1722,13 +1722,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 579 )
+ if ( yy_current_state >= 573 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
- while ( yy_current_state != 578 );
+ while ( yy_current_state != 572 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@@ -1747,13 +1747,13 @@ do_action: /* This label is used only to access EOF actions. */
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backing up\n" );
- else if ( yy_act < 130 )
+ else if ( yy_act < 129 )
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
(long)yy_rule_linenum[yy_act], yytext );
- else if ( yy_act == 130 )
+ else if ( yy_act == 129 )
fprintf( stderr, "--accepting default rule (\"%s\")\n",
yytext );
- else if ( yy_act == 131 )
+ else if ( yy_act == 130 )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
@@ -1772,23 +1772,23 @@ do_action: /* This label is used only to access EOF actions. */
/* Comments and white space. */
case 1:
YY_RULE_SETUP
-#line 186 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 190 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, Wother, _("stray ',' treated as white space"));
}
YY_BREAK
case 2:
/* rule 2 can match eol */
-#line 190 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 194 "/Users/akim/src/gnu/bison/src/scan-gram.l"
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
-#line 190 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 194 "/Users/akim/src/gnu/bison/src/scan-gram.l"
continue;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 191 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 195 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
token_start = loc->start;
context_state = YY_START;
@@ -1800,7 +1800,7 @@ YY_RULE_SETUP
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
-#line 199 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 203 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
handle_syncline (yytext + sizeof "#line " - 1, *loc);
}
@@ -1818,367 +1818,360 @@ YY_RULE_SETUP
case 6:
YY_RULE_SETUP
-#line 217 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NONASSOC;
+#line 221 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (NONASSOC);
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 218 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_CODE;
+#line 222 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (CODE);
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 219 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-RETURN_PERCENT_FLAG("parse.trace");
+#line 223 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_PERCENT_FLAG ("parse.trace");
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 220 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_DEFAULT_PREC;
+#line 224 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (DEFAULT_PREC);
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 221 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_DEFINE;
+#line 225 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (DEFINE);
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 222 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_DEFINES;
+#line 226 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (DEFINES);
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 223 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_DESTRUCTOR;
+#line 227 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (DESTRUCTOR);
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 224 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_DPREC;
+#line 228 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (DPREC);
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 225 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_EMPTY;
+#line 229 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (EMPTY);
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 226 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_ERROR_VERBOSE;
+#line 230 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (EXPECT);
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 227 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_EXPECT;
+#line 231 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (EXPECT_RR);
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 228 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_EXPECT_RR;
+#line 232 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_FILE_PREFIX, uniqstr_new (yytext));
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 229 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_FILE_PREFIX;
+#line 233 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_YACC, uniqstr_new (yytext));
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 230 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_YACC;
+#line 234 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (INITIAL_ACTION);
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 231 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_INITIAL_ACTION;
+#line 235 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (GLR_PARSER);
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 232 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_GLR_PARSER;
+#line 236 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (LANGUAGE);
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 233 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_LANGUAGE;
+#line 237 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_LEFT;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 234 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_LEFT;
+#line 238 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_PERCENT_PARAM (lex);
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 235 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-RETURN_PERCENT_PARAM(lex);
+#line 239 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_PERCENT_FLAG ("locations");
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 236 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-RETURN_PERCENT_FLAG("locations");
+#line 240 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (MERGE);
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 237 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_MERGE;
+#line 241 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (NO_DEFAULT_PREC);
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 238 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NAME_PREFIX;
+#line 242 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (NO_LINES);
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 239 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NO_DEFAULT_PREC;
+#line 243 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_NONASSOC;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 240 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NO_LINES;
+#line 244 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (NONDETERMINISTIC_PARSER);
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 241 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NONASSOC;
+#line 245 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (NTERM);
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 242 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NONDETERMINISTIC_PARSER;
+#line 246 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (OUTPUT);
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 243 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_NTERM;
+#line 247 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_PERCENT_PARAM (both);
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 244 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_OUTPUT;
+#line 248 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_PERCENT_PARAM (parse);
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 245 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-RETURN_PERCENT_PARAM(both);
+#line 249 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_PREC;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 246 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-RETURN_PERCENT_PARAM(parse);
+#line 250 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (PRECEDENCE);
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 247 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_PREC;
+#line 251 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (PRINTER);
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 248 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_PRECEDENCE;
+#line 252 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_PERCENT_FLAG ("api.pure");
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 249 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_PRINTER;
+#line 253 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (REQUIRE);
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 250 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-RETURN_PERCENT_FLAG("api.pure");
+#line 254 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_RIGHT;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 251 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_REQUIRE;
+#line 255 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (SKELETON);
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 252 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_RIGHT;
+#line 256 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_START;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 253 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_SKELETON;
+#line 257 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (TOKEN);
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 254 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_START;
+#line 258 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_TOKEN;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 255 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_TOKEN;
+#line 259 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (TOKEN_TABLE);
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 256 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_TOKEN;
+#line 260 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_TYPE;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 257 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_TOKEN_TABLE;
+#line 261 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return PERCENT_UNION;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 258 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_TYPE;
+#line 262 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+return BISON_DIRECTIVE (VERBOSE);
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 259 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_UNION;
+#line 263 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_YACC, uniqstr_new (yytext));
YY_BREAK
+/* Deprecated since Bison 3.0 (2013-07-25), but the warning is
+ issued only since Bison 3.3. */
case 49:
YY_RULE_SETUP
-#line 260 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_VERBOSE;
+#line 267 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_ERROR_VERBOSE, uniqstr_new (yytext));
YY_BREAK
+/* Deprecated since Bison 2.6 (2012-07-19), but the warning is
+ issued only since Bison 3.3. */
case 50:
+/* rule 50 can match eol */
YY_RULE_SETUP
-#line 261 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-return PERCENT_YACC;
+#line 271 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_NAME_PREFIX, uniqstr_new (yytext));
YY_BREAK
-/* deprecated */
+/* Deprecated since Bison 2.7.90, 2012. */
case 51:
YY_RULE_SETUP
-#line 264 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%default-prec");
+#line 274 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%default-prec");
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 265 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%define parse.error verbose");
+#line 275 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_ERROR_VERBOSE, uniqstr_new (yytext));
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 266 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%expect-rr");
+#line 276 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%expect-rr");
YY_BREAK
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
-#line 267 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%file-prefix");
+#line 277 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_FILE_PREFIX, uniqstr_new (yytext));
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 268 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%fixed-output-files");
+#line 278 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (PERCENT_YACC, uniqstr_new (yytext));
YY_BREAK
case 56:
-/* rule 56 can match eol */
YY_RULE_SETUP
-#line 269 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%name-prefix");
+#line 279 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%no-default-prec");
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 270 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%no-default-prec");
+#line 280 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%no-lines");
YY_BREAK
case 58:
+/* rule 58 can match eol */
YY_RULE_SETUP
-#line 271 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%no-lines");
+#line 281 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%output");
YY_BREAK
case 59:
-/* rule 59 can match eol */
YY_RULE_SETUP
-#line 272 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%output");
+#line 282 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%pure-parser");
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 273 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%pure-parser");
+#line 283 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+DEPRECATED ("%token-table");
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 274 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-DEPRECATED("%token-table");
- YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 276 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 285 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, _("invalid directive: %s"), quote (yytext));
}
YY_BREAK
-case 63:
+case 62:
YY_RULE_SETUP
-#line 280 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 289 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return EQUAL;
YY_BREAK
-case 64:
+case 63:
YY_RULE_SETUP
-#line 281 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 290 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PIPE;
YY_BREAK
-case 65:
+case 64:
YY_RULE_SETUP
-#line 282 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 291 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return SEMICOLON;
YY_BREAK
-case 66:
+case 65:
YY_RULE_SETUP
-#line 284 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 293 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
- val->uniqstr = uniqstr_new (yytext);
+ val->ID = uniqstr_new (yytext);
id_loc = *loc;
bracketed_id_str = NULL;
BEGIN SC_AFTER_IDENTIFIER;
}
YY_BREAK
-case 67:
+case 66:
YY_RULE_SETUP
-#line 291 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-{
- val->integer = scan_integer (yytext, 10, *loc);
- return INT;
- }
+#line 300 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (INT, scan_integer (yytext, 10, *loc));
YY_BREAK
-case 68:
+case 67:
YY_RULE_SETUP
-#line 295 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-{
- val->integer = scan_integer (yytext, 16, *loc);
- return INT;
- }
+#line 301 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+RETURN_VALUE (INT, scan_integer (yytext, 16, *loc));
YY_BREAK
/* Identifiers may not start with a digit. Yet, don't silently
accept "1FOO" as "1 FOO". */
-case 69:
+case 68:
YY_RULE_SETUP
-#line 302 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 305 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, _("invalid identifier: %s"), quote (yytext));
}
YY_BREAK
/* Characters. */
-case 70:
+case 69:
YY_RULE_SETUP
-#line 307 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 310 "/Users/akim/src/gnu/bison/src/scan-gram.l"
token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER;
YY_BREAK
/* Strings. */
-case 71:
+case 70:
YY_RULE_SETUP
-#line 310 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 313 "/Users/akim/src/gnu/bison/src/scan-gram.l"
token_start = loc->start; BEGIN SC_ESCAPED_STRING;
YY_BREAK
/* Prologue. */
-case 72:
+case 71:
YY_RULE_SETUP
-#line 313 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 316 "/Users/akim/src/gnu/bison/src/scan-gram.l"
code_start = loc->start; BEGIN SC_PROLOGUE;
YY_BREAK
/* Code in between braces. */
-case 73:
+case 72:
YY_RULE_SETUP
-#line 316 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 319 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
nesting = 0;
@@ -2187,10 +2180,10 @@ YY_RULE_SETUP
}
YY_BREAK
/* Semantic predicate. */
-case 74:
-/* rule 74 can match eol */
+case 73:
+/* rule 73 can match eol */
YY_RULE_SETUP
-#line 324 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 327 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
nesting = 0;
code_start = loc->start;
@@ -2198,28 +2191,28 @@ YY_RULE_SETUP
}
YY_BREAK
/* A type. */
-case 75:
+case 74:
YY_RULE_SETUP
-#line 331 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 334 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return TAG_ANY;
YY_BREAK
-case 76:
+case 75:
YY_RULE_SETUP
-#line 332 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 335 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return TAG_NONE;
YY_BREAK
-case 77:
+case 76:
YY_RULE_SETUP
-#line 333 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 336 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
nesting = 0;
token_start = loc->start;
BEGIN SC_TAG;
}
YY_BREAK
-case 78:
+case 77:
YY_RULE_SETUP
-#line 339 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 342 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
static int percent_percent_count;
if (++percent_percent_count == 2)
@@ -2227,9 +2220,9 @@ YY_RULE_SETUP
return PERCENT_PERCENT;
}
YY_BREAK
-case 79:
+case 78:
YY_RULE_SETUP
-#line 346 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 349 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
bracketed_id_str = NULL;
bracketed_id_start = loc->start;
@@ -2237,9 +2230,9 @@ YY_RULE_SETUP
BEGIN SC_BRACKETED_ID;
}
YY_BREAK
-case 80:
+case 79:
YY_RULE_SETUP
-#line 353 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 356 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, "%s: %s",
ngettext ("invalid character", "invalid characters", yyleng),
@@ -2247,7 +2240,7 @@ YY_RULE_SETUP
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 359 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 362 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
loc->start = loc->end = scanner_cursor;
yyterminate ();
@@ -2260,9 +2253,9 @@ case YY_STATE_EOF(INITIAL):
`--------------------------------------------------------------*/
-case 81:
+case 80:
YY_RULE_SETUP
-#line 373 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 376 "/Users/akim/src/gnu/bison/src/scan-gram.l"
complain (loc, complaint, _("invalid null character"));
YY_BREAK
@@ -2271,9 +2264,9 @@ complain (loc, complaint, _("invalid null character"));
`-----------------------------------------------------------------*/
-case 82:
+case 81:
YY_RULE_SETUP
-#line 383 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 386 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
if (bracketed_id_str)
{
@@ -2290,18 +2283,18 @@ YY_RULE_SETUP
}
}
YY_BREAK
-case 83:
+case 82:
YY_RULE_SETUP
-#line 398 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 401 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
return ID_COLON;
}
YY_BREAK
-case 84:
+case 83:
YY_RULE_SETUP
-#line 403 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 406 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
ROLLBACK_CURRENT_TOKEN;
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
@@ -2310,7 +2303,7 @@ YY_RULE_SETUP
}
YY_BREAK
case YY_STATE_EOF(SC_AFTER_IDENTIFIER):
-#line 409 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 412 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
@@ -2323,9 +2316,9 @@ case YY_STATE_EOF(SC_AFTER_IDENTIFIER):
`--------------------------------*/
-case 85:
+case 84:
YY_RULE_SETUP
-#line 422 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 425 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
if (bracketed_id_str)
{
@@ -2340,16 +2333,16 @@ YY_RULE_SETUP
}
}
YY_BREAK
-case 86:
+case 85:
YY_RULE_SETUP
-#line 435 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 438 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN bracketed_id_context_state;
if (bracketed_id_str)
{
if (INITIAL == bracketed_id_context_state)
{
- val->uniqstr = bracketed_id_str;
+ val->BRACKETED_ID = bracketed_id_str;
bracketed_id_str = 0;
*loc = bracketed_id_loc;
return BRACKETED_ID;
@@ -2359,9 +2352,9 @@ YY_RULE_SETUP
complain (loc, complaint, _("an identifier expected"));
}
YY_BREAK
-case 87:
+case 86:
YY_RULE_SETUP
-#line 451 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 454 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, "%s: %s",
ngettext ("invalid character in bracketed name",
@@ -2370,7 +2363,7 @@ YY_RULE_SETUP
}
YY_BREAK
case YY_STATE_EOF(SC_BRACKETED_ID):
-#line 458 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 461 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN bracketed_id_context_state;
unexpected_eof (bracketed_id_start, "]");
@@ -2379,12 +2372,12 @@ case YY_STATE_EOF(SC_BRACKETED_ID):
-case 88:
+case 87:
YY_RULE_SETUP
-#line 466 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 469 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
ROLLBACK_CURRENT_TOKEN;
- val->uniqstr = bracketed_id_str;
+ val->BRACKETED_ID = bracketed_id_str;
bracketed_id_str = 0;
*loc = bracketed_id_loc;
BEGIN INITIAL;
@@ -2397,19 +2390,19 @@ YY_RULE_SETUP
`---------------------------------------------------------------*/
-case 89:
+case 88:
YY_RULE_SETUP
-#line 483 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 486 "/Users/akim/src/gnu/bison/src/scan-gram.l"
BEGIN context_state;
YY_BREAK
-case 90:
-/* rule 90 can match eol */
+case 89:
+/* rule 89 can match eol */
YY_RULE_SETUP
-#line 484 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 487 "/Users/akim/src/gnu/bison/src/scan-gram.l"
continue;
YY_BREAK
case YY_STATE_EOF(SC_YACC_COMMENT):
-#line 485 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 488 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "*/"); BEGIN context_state;
YY_BREAK
@@ -2418,14 +2411,14 @@ unexpected_eof (token_start, "*/"); BEGIN context_state;
`------------------------------------------------------------*/
-case 91:
-/* rule 91 can match eol */
+case 90:
+/* rule 90 can match eol */
YY_RULE_SETUP
-#line 495 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 498 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case YY_STATE_EOF(SC_COMMENT):
-#line 496 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 499 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "*/"); BEGIN context_state;
YY_BREAK
@@ -2434,20 +2427,20 @@ unexpected_eof (token_start, "*/"); BEGIN context_state;
`--------------------------------------------------------------*/
-case 92:
-/* rule 92 can match eol */
+case 91:
+/* rule 91 can match eol */
YY_RULE_SETUP
-#line 506 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 509 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
-case 93:
-/* rule 93 can match eol */
+case 92:
+/* rule 92 can match eol */
YY_RULE_SETUP
-#line 507 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 510 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case YY_STATE_EOF(SC_LINE_COMMENT):
-#line 508 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 511 "/Users/akim/src/gnu/bison/src/scan-gram.l"
BEGIN context_state;
YY_BREAK
@@ -2457,25 +2450,26 @@ BEGIN context_state;
`------------------------------------------------*/
-case 94:
+case 93:
YY_RULE_SETUP
-#line 519 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 522 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
- loc->start = token_start;
- val->code = last_string;
BEGIN INITIAL;
- return STRING;
+ loc->start = token_start;
+ complain (loc, Wyacc,
+ _("POSIX Yacc does not support string literals"));
+ RETURN_VALUE (STRING, last_string);
}
YY_BREAK
case YY_STATE_EOF(SC_ESCAPED_STRING):
-#line 526 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 530 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "\"");
YY_BREAK
-case 95:
-/* rule 95 can match eol */
+case 94:
+/* rule 94 can match eol */
YY_RULE_SETUP
-#line 527 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 531 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "\"");
YY_BREAK
@@ -2485,20 +2479,20 @@ unexpected_newline (token_start, "\"");
`----------------------------------------------------------*/
-case 96:
+case 95:
YY_RULE_SETUP
-#line 537 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 541 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = token_start;
- val->character = last_string[0];
+ val->CHAR = last_string[0];
/* FIXME: Eventually, make these errors. */
if (last_string[0] == '\0')
{
complain (loc, Wother, _("empty character literal"));
/* '\0' seems dangerous even if we are about to complain. */
- val->character = '\'';
+ val->CHAR = '\'';
}
else if (last_string[1] != '\0')
complain (loc, Wother,
@@ -2508,14 +2502,14 @@ YY_RULE_SETUP
return CHAR;
}
YY_BREAK
-case 97:
-/* rule 97 can match eol */
+case 96:
+/* rule 96 can match eol */
YY_RULE_SETUP
-#line 556 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 560 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "'");
YY_BREAK
case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
-#line 557 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 561 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "'");
YY_BREAK
@@ -2524,16 +2518,16 @@ unexpected_eof (token_start, "'");
`--------------------------------------------------------------*/
-case 98:
+case 97:
YY_RULE_SETUP
-#line 568 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 572 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
--nesting;
if (nesting < 0)
{
STRING_FINISH;
loc->start = token_start;
- val->uniqstr = uniqstr_new (last_string);
+ val->TAG = uniqstr_new (last_string);
STRING_FREE;
BEGIN INITIAL;
return TAG;
@@ -2541,19 +2535,19 @@ YY_RULE_SETUP
STRING_GROW;
}
YY_BREAK
-case 99:
-/* rule 99 can match eol */
+case 98:
+/* rule 98 can match eol */
YY_RULE_SETUP
-#line 582 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 586 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
-case 100:
+case 99:
YY_RULE_SETUP
-#line 583 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 587 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; nesting += yyleng;
YY_BREAK
case YY_STATE_EOF(SC_TAG):
-#line 585 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 589 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, ">");
YY_BREAK
@@ -2562,88 +2556,89 @@ unexpected_eof (token_start, ">");
`----------------------------*/
-case 101:
+case 100:
YY_RULE_SETUP
-#line 594 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 598 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
+ verify (UCHAR_MAX < ULONG_MAX);
unsigned long c = strtoul (yytext + 1, NULL, 8);
if (!c || UCHAR_MAX < c)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
- yytext+1);
+ yytext+1);
else
obstack_1grow (&obstack_for_string, c);
}
YY_BREAK
-case 102:
+case 101:
YY_RULE_SETUP
-#line 603 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 608 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
verify (UCHAR_MAX < ULONG_MAX);
unsigned long c = strtoul (yytext + 2, NULL, 16);
if (!c || UCHAR_MAX < c)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
- yytext+1);
+ yytext+1);
else
obstack_1grow (&obstack_for_string, c);
}
YY_BREAK
-case 103:
+case 102:
YY_RULE_SETUP
-#line 613 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 618 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\a');
YY_BREAK
-case 104:
+case 103:
YY_RULE_SETUP
-#line 614 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 619 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\b');
YY_BREAK
-case 105:
+case 104:
YY_RULE_SETUP
-#line 615 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 620 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\f');
YY_BREAK
-case 106:
+case 105:
YY_RULE_SETUP
-#line 616 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 621 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\n');
YY_BREAK
-case 107:
+case 106:
YY_RULE_SETUP
-#line 617 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 622 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\r');
YY_BREAK
-case 108:
+case 107:
YY_RULE_SETUP
-#line 618 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 623 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\t');
YY_BREAK
-case 109:
+case 108:
YY_RULE_SETUP
-#line 619 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 624 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\v');
YY_BREAK
/* \\[\"\'?\\] would be shorter, but it confuses xgettext. */
-case 110:
+case 109:
YY_RULE_SETUP
-#line 622 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 627 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, yytext[1]);
YY_BREAK
-case 111:
+case 110:
YY_RULE_SETUP
-#line 624 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 629 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
int c = convert_ucn_to_byte (yytext);
if (c <= 0)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
- yytext+1);
+ yytext+1);
else
obstack_1grow (&obstack_for_string, c);
}
YY_BREAK
-case 112:
-/* rule 112 can match eol */
+case 111:
+/* rule 111 can match eol */
YY_RULE_SETUP
-#line 632 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 637 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
char const *p = yytext + 1;
/* Quote only if escaping won't make the character visible. */
@@ -2652,7 +2647,7 @@ YY_RULE_SETUP
else
p = quotearg_style_mem (escape_quoting_style, p, 1);
complain (loc, complaint, _("invalid character after \\-escape: %s"),
- p);
+ p);
}
YY_BREAK
@@ -2661,46 +2656,46 @@ YY_RULE_SETUP
`--------------------------------------------*/
-case 113:
-/* rule 113 can match eol */
+case 112:
+/* rule 112 can match eol */
YY_RULE_SETUP
-#line 650 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 655 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
-case 114:
+case 113:
YY_RULE_SETUP
-#line 655 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 660 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
-case 115:
-/* rule 115 can match eol */
+case 114:
+/* rule 114 can match eol */
YY_RULE_SETUP
-#line 656 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 661 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "'");
YY_BREAK
case YY_STATE_EOF(SC_CHARACTER):
-#line 657 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 662 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "'");
YY_BREAK
-case 116:
+case 115:
YY_RULE_SETUP
-#line 662 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 667 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
-case 117:
-/* rule 117 can match eol */
+case 116:
+/* rule 116 can match eol */
YY_RULE_SETUP
-#line 663 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 668 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "\"");
YY_BREAK
case YY_STATE_EOF(SC_STRING):
-#line 664 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 669 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "\"");
YY_BREAK
@@ -2709,9 +2704,9 @@ unexpected_eof (token_start, "\"");
`---------------------------------------------------*/
-case 118:
+case 117:
YY_RULE_SETUP
-#line 674 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 679 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
@@ -2719,9 +2714,9 @@ YY_RULE_SETUP
BEGIN SC_CHARACTER;
}
YY_BREAK
-case 119:
+case 118:
YY_RULE_SETUP
-#line 680 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 685 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
@@ -2729,10 +2724,10 @@ YY_RULE_SETUP
BEGIN SC_STRING;
}
YY_BREAK
-case 120:
-/* rule 120 can match eol */
+case 119:
+/* rule 119 can match eol */
YY_RULE_SETUP
-#line 686 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 691 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
@@ -2740,10 +2735,10 @@ YY_RULE_SETUP
BEGIN SC_COMMENT;
}
YY_BREAK
-case 121:
-/* rule 121 can match eol */
+case 120:
+/* rule 120 can match eol */
YY_RULE_SETUP
-#line 692 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 697 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
@@ -2757,37 +2752,37 @@ YY_RULE_SETUP
`-----------------------------------------------------------*/
-case 122:
-/* rule 122 can match eol */
+case 121:
+/* rule 121 can match eol */
YY_RULE_SETUP
-#line 708 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 713 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; nesting++;
YY_BREAK
-case 123:
-/* rule 123 can match eol */
+case 122:
+/* rule 122 can match eol */
YY_RULE_SETUP
-#line 709 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 714 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; nesting--;
YY_BREAK
/* Tokenize '<<%' correctly (as '<<' '%') rather than incorrectly
(as '<' '<%'). */
-case 124:
-/* rule 124 can match eol */
+case 123:
+/* rule 123 can match eol */
YY_RULE_SETUP
-#line 713 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 718 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case YY_STATE_EOF(SC_BRACED_CODE):
case YY_STATE_EOF(SC_PREDICATE):
-#line 715 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 720 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (code_start, "}");
YY_BREAK
-case 125:
+case 124:
YY_RULE_SETUP
-#line 720 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 725 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
obstack_1grow (&obstack_for_string, '}');
@@ -2796,27 +2791,25 @@ YY_RULE_SETUP
{
STRING_FINISH;
loc->start = code_start;
- val->code = last_string;
BEGIN INITIAL;
- return BRACED_CODE;
+ RETURN_VALUE (BRACED_CODE, last_string);
}
}
YY_BREAK
-case 126:
+case 125:
YY_RULE_SETUP
-#line 737 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 741 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
--nesting;
if (nesting < 0)
{
STRING_FINISH;
loc->start = code_start;
- val->code = last_string;
BEGIN INITIAL;
- return BRACED_PREDICATE;
+ RETURN_VALUE (BRACED_PREDICATE, last_string);
}
else
obstack_1grow (&obstack_for_string, '}');
@@ -2828,19 +2821,18 @@ YY_RULE_SETUP
`--------------------------------------------------------------*/
-case 127:
+case 126:
YY_RULE_SETUP
-#line 758 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 761 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = code_start;
- val->code = last_string;
BEGIN INITIAL;
- return PROLOGUE;
+ RETURN_VALUE (PROLOGUE, last_string);
}
YY_BREAK
case YY_STATE_EOF(SC_PROLOGUE):
-#line 766 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 768 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (code_start, "%}");
YY_BREAK
@@ -2851,33 +2843,32 @@ unexpected_eof (code_start, "%}");
case YY_STATE_EOF(SC_EPILOGUE):
-#line 777 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 779 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = code_start;
- val->code = last_string;
BEGIN INITIAL;
- return EPILOGUE;
+ RETURN_VALUE (EPILOGUE, last_string);
}
YY_BREAK
/*-----------------------------------------------------.
| By default, grow the string obstack with the input. |
`-----------------------------------------------------*/
+case 127:
+#line 793 "/Users/akim/src/gnu/bison/src/scan-gram.l"
case 128:
-#line 792 "/Users/akim/src/gnu/bison/src/scan-gram.l"
-case 129:
-/* rule 129 can match eol */
+/* rule 128 can match eol */
YY_RULE_SETUP
-#line 792 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 793 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
-case 130:
+case 129:
YY_RULE_SETUP
-#line 794 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 795 "/Users/akim/src/gnu/bison/src/scan-gram.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2880 "src/scan-gram.c"
+#line 2871 "src/scan-gram.c"
case YY_STATE_EOF(SC_RETURN_BRACKETED_ID):
yyterminate();
@@ -3199,7 +3190,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 579 )
+ if ( yy_current_state >= 573 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -3232,11 +3223,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 579 )
+ if ( yy_current_state >= 573 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- yy_is_jam = (yy_current_state == 578);
+ yy_is_jam = (yy_current_state == 572);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -4029,7 +4020,7 @@ void yyfree (void * ptr )
/* %ok-for-header */
-#line 794 "/Users/akim/src/gnu/bison/src/scan-gram.l"
+#line 795 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Read bytes from FP into buffer BUF of size SIZE. Return the
@@ -4088,12 +4079,16 @@ static unsigned long
scan_integer (char const *number, int base, location loc)
{
verify (INT_MAX < ULONG_MAX);
+ if (base == 16)
+ complain (&loc, Wyacc,
+ _("POSIX Yacc does not support hexadecimal literals"));
+
unsigned long num = strtoul (number, NULL, base);
if (INT_MAX < num)
{
complain (&loc, complaint, _("integer out of range: %s"),
- quote (number));
+ quote (number));
num = INT_MAX;
}
@@ -4197,7 +4192,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
loc.end = scanner_cursor;
size_t i = strlen (token_end);
-/* Adjust scanner cursor so that any later message does not count
+ /* Adjust scanner cursor so that any later message does not count
the characters about to be inserted. */
scanner_cursor.column -= i;
@@ -4208,7 +4203,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
/* Instead of '\'', display "'". */
if (STREQ (token_end, "'\\''"))
token_end = "\"'\"";
- complain (&loc, complaint, _(msgid), token_end);
+ complain (&loc, complaint, msgid, token_end);
}
@@ -4221,7 +4216,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
static void
unexpected_eof (boundary start, char const *token_end)
{
- unexpected_end (start, N_("missing %s at end of file"), token_end);
+ unexpected_end (start, _("missing %s at end of file"), token_end);
}
@@ -4232,7 +4227,7 @@ unexpected_eof (boundary start, char const *token_end)
static void
unexpected_newline (boundary start, char const *token_end)
{
- unexpected_end (start, N_("missing %s at end of line"), token_end);
+ unexpected_end (start, _("missing %s at end of line"), token_end);
}
diff --git a/contrib/tools/bison/src/scan-gram.h b/contrib/tools/bison/src/scan-gram.h
index f135959e3c..f25d183f1e 100644
--- a/contrib/tools/bison/src/scan-gram.h
+++ b/contrib/tools/bison/src/scan-gram.h
@@ -1,7 +1,7 @@
/* Bison Grammar Scanner
- Copyright (C) 2006-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2006-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/scan-skel.h b/contrib/tools/bison/src/scan-skel.h
index f76abde10d..20fa09da8e 100644
--- a/contrib/tools/bison/src/scan-skel.h
+++ b/contrib/tools/bison/src/scan-skel.h
@@ -1,7 +1,7 @@
/* Scan Bison Skeletons.
- Copyright (C) 2005-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2005-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/state.c b/contrib/tools/bison/src/state.c
index 7037b358ea..0fc9320601 100644
--- a/contrib/tools/bison/src/state.c
+++ b/contrib/tools/bison/src/state.c
@@ -1,7 +1,7 @@
/* Type definitions for the finite state machine for Bison.
- Copyright (C) 2001-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2001-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -143,7 +143,7 @@ state_new (symbol_number accessing_symbol,
res->reductions = NULL;
res->errs = NULL;
res->state_list = NULL;
- res->consistent = 0;
+ res->consistent = false;
res->solved_conflicts = NULL;
res->solved_conflicts_xml = NULL;
diff --git a/contrib/tools/bison/src/state.h b/contrib/tools/bison/src/state.h
index 9fb968f761..5b37ed6a47 100644
--- a/contrib/tools/bison/src/state.h
+++ b/contrib/tools/bison/src/state.h
@@ -1,6 +1,6 @@
/* Type definitions for the finite state machine for Bison.
- Copyright (C) 1984, 1989, 2000-2004, 2007, 2009-2015, 2018 Free
+ Copyright (C) 1984, 1989, 2000-2004, 2007, 2009-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -81,6 +81,8 @@
#ifndef STATE_H_
# define STATE_H_
+# include <stdbool.h>
+
# include <bitset.h>
# include "gram.h"
@@ -117,7 +119,7 @@ typedef struct
/* What is the symbol labelling the transition to
TRANSITIONS->states[Num]? Can be a token (amongst which the error
- token), or non terminals in case of gotos. */
+ token), or nonterminals in case of gotos. */
# define TRANSITION_SYMBOL(Transitions, Num) \
(Transitions->states[Num]->accessing_symbol)
@@ -208,9 +210,9 @@ struct state
store in this member a reference to the node containing each state. */
struct state_list *state_list;
- /* If non-zero, then no lookahead sets on reduce actions are needed to
- decide what to do in state S. */
- char consistent;
+ /* Whether no lookahead sets on reduce actions are needed to decide
+ what to do in state S. */
+ bool consistent;
/* If some conflicts were solved thanks to precedence/associativity,
a human readable description of the resolution. */
diff --git a/contrib/tools/bison/src/symlist.c b/contrib/tools/bison/src/symlist.c
index 201ddabdba..c5947cc890 100644
--- a/contrib/tools/bison/src/symlist.c
+++ b/contrib/tools/bison/src/symlist.c
@@ -1,6 +1,6 @@
/* Lists of symbols for Bison
- Copyright (C) 2002, 2005-2007, 2009-2015, 2018 Free Software
+ Copyright (C) 2002, 2005-2007, 2009-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -49,6 +49,8 @@ symbol_list_sym_new (symbol *sym, location loc)
res->dprec_location = empty_location;
res->merger = 0;
res->merger_declaration_location = empty_location;
+ res->expected_sr_conflicts = -1;
+ res->expected_rr_conflicts = -1;
res->next = NULL;
@@ -79,6 +81,15 @@ symbol_list_type_new (uniqstr type_name, location loc)
}
+symbol_list *
+symbol_list_type_set (symbol_list *syms, uniqstr type_name, location loc)
+{
+ for (symbol_list *l = syms; l; l = l->next)
+ symbol_type_set (l->content.sym, type_name, loc);
+ return syms;
+}
+
+
/*-----------------------------------------------------------------------.
| Print this list, for which every content_type must be SYMLIST_SYMBOL. |
`-----------------------------------------------------------------------*/
@@ -172,9 +183,8 @@ symbol_list_length (symbol_list const *l)
symbol_list *
symbol_list_n_get (symbol_list *l, int n)
{
- int i;
aver (0 <= n);
- for (i = 0; i < n; ++i)
+ for (int i = 0; i < n; ++i)
{
l = l->next;
aver (l);
diff --git a/contrib/tools/bison/src/symlist.h b/contrib/tools/bison/src/symlist.h
index 3ade17049a..d8ae90c97d 100644
--- a/contrib/tools/bison/src/symlist.h
+++ b/contrib/tools/bison/src/symlist.h
@@ -1,6 +1,6 @@
/* Lists of symbols for Bison
- Copyright (C) 2002, 2005-2007, 2009-2015, 2018 Free Software
+ Copyright (C) 2002, 2005-2007, 2009-2015, 2018-2019 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -87,6 +87,11 @@ typedef struct symbol_list
int merger;
location merger_declaration_location;
+ /* Counts of the number of expected conflicts for this rule, or -1 if none
+ given. */
+ int expected_sr_conflicts;
+ int expected_rr_conflicts;
+
/* The list. */
struct symbol_list *next;
} symbol_list;
@@ -98,6 +103,11 @@ symbol_list *symbol_list_sym_new (symbol *sym, location loc);
/** Create a list containing \c type_name at \c loc. */
symbol_list *symbol_list_type_new (uniqstr type_name, location loc);
+/** Assign the type \c type_name to all the members of \c syms.
+ ** \returns \c syms */
+symbol_list *symbol_list_type_set (symbol_list *syms,
+ uniqstr type_name, location loc);
+
/** Print this list.
\pre For every node \c n in the list, <tt>n->content_type =
diff --git a/contrib/tools/bison/src/symtab.c b/contrib/tools/bison/src/symtab.c
index a91ac3f860..b9a934f726 100644
--- a/contrib/tools/bison/src/symtab.c
+++ b/contrib/tools/bison/src/symtab.c
@@ -1,7 +1,7 @@
/* Symbol table manager for Bison.
- Copyright (C) 1984, 1989, 2000-2002, 2004-2015, 2018 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1989, 2000-2002, 2004-2015, 2018-2019 Free
+ Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -46,17 +46,14 @@ symbol *accept = NULL;
symbol *startsymbol = NULL;
location startsymbol_location;
-/*---------------------------.
-| Precedence relation graph. |
-`---------------------------*/
-
+/* Precedence relation graph. */
static symgraph **prec_nodes;
-/*-----------------------------------.
-| Store which associativity is used. |
-`-----------------------------------*/
+/* Store which associativity is used. */
+static bool *used_assoc = NULL;
+
+bool tag_seen = false;
-bool *used_assoc = NULL;
/*--------------------------.
| Create a new sym_content. |
@@ -213,11 +210,11 @@ semantic_type_new (uniqstr tag, const location *loc)
`-----------------*/
#define SYMBOL_ATTR_PRINT(Attr) \
- if (s->content->Attr) \
+ if (s->content && s->content->Attr) \
fprintf (f, " %s { %s }", #Attr, s->content->Attr)
#define SYMBOL_CODE_PRINT(Attr) \
- if (s->content->props[Attr].code) \
+ if (s->content && s->content->props[Attr].code) \
fprintf (f, " %s { %s }", #Attr, s->content->props[Attr].code)
void
@@ -277,8 +274,8 @@ symbol_id_get (symbol const *sym)
`------------------------------------------------------------------*/
static void
-symbol_redeclaration (symbol *s, const char *what, location first,
- location second)
+complain_symbol_redeclared (symbol *s, const char *what, location first,
+ location second)
{
unsigned i = 0;
locations_sort (&first, &second);
@@ -290,8 +287,8 @@ symbol_redeclaration (symbol *s, const char *what, location first,
}
static void
-semantic_type_redeclaration (semantic_type *s, const char *what, location first,
- location second)
+complain_semantic_type_redeclared (semantic_type *s, const char *what, location first,
+ location second)
{
unsigned i = 0;
locations_sort (&first, &second);
@@ -302,6 +299,19 @@ semantic_type_redeclaration (semantic_type *s, const char *what, location first,
_("previous declaration"));
}
+static void
+complain_class_redeclared (symbol *sym, symbol_class class, location second)
+{
+ unsigned i = 0;
+ complain_indent (&second, complaint, &i,
+ class == token_sym
+ ? _("symbol %s redeclared as a token")
+ : _("symbol %s redeclared as a nonterminal"), sym->tag);
+ i += SUB_INDENT;
+ complain_indent (&sym->location, complaint, &i,
+ _("previous definition"));
+}
+
void
symbol_location_as_lhs_set (symbol *sym, location loc)
@@ -321,8 +331,10 @@ symbol_type_set (symbol *sym, uniqstr type_name, location loc)
{
if (type_name)
{
+ tag_seen = true;
if (sym->content->type_name)
- symbol_redeclaration (sym, "%type", sym->content->type_location, loc);
+ complain_symbol_redeclared (sym, "%type",
+ sym->content->type_location, loc);
else
{
uniqstr_assert (type_name);
@@ -341,9 +353,9 @@ symbol_code_props_set (symbol *sym, code_props_type kind,
code_props const *code)
{
if (sym->content->props[kind].code)
- symbol_redeclaration (sym, code_props_type_string (kind),
- sym->content->props[kind].location,
- code->location);
+ complain_symbol_redeclared (sym, code_props_type_string (kind),
+ sym->content->props[kind].location,
+ code->location);
else
sym->content->props[kind] = *code;
}
@@ -358,9 +370,9 @@ semantic_type_code_props_set (semantic_type *type,
code_props const *code)
{
if (type->props[kind].code)
- semantic_type_redeclaration (type, code_props_type_string (kind),
- type->props[kind].location,
- code->location);
+ complain_semantic_type_redeclared (type, code_props_type_string (kind),
+ type->props[kind].location,
+ code->location);
else
type->props[kind] = *code;
}
@@ -408,8 +420,8 @@ symbol_precedence_set (symbol *sym, int prec, assoc a, location loc)
{
sym_content *s = sym->content;
if (s->prec)
- symbol_redeclaration (sym, assoc_to_string (a),
- s->prec_location, loc);
+ complain_symbol_redeclared (sym, assoc_to_string (a),
+ s->prec_location, loc);
else
{
s->prec = prec;
@@ -430,27 +442,25 @@ symbol_precedence_set (symbol *sym, int prec, assoc a, location loc)
void
symbol_class_set (symbol *sym, symbol_class class, location loc, bool declaring)
{
- bool warned = false;
- if (sym->content->class != unknown_sym && sym->content->class != class)
+ aver (class != unknown_sym);
+ sym_content *s = sym->content;
+ if (s->class != unknown_sym && s->class != class)
+ complain_class_redeclared (sym, class, loc);
+ else
{
- complain (&loc, complaint, _("symbol %s redefined"), sym->tag);
- /* Don't report both "redefined" and "redeclared". */
- warned = true;
- }
+ if (class == nterm_sym && s->class != nterm_sym)
+ s->number = nvars++;
+ else if (class == token_sym && s->number == NUMBER_UNDEFINED)
+ s->number = ntokens++;
+ s->class = class;
- if (class == nterm_sym && sym->content->class != nterm_sym)
- sym->content->number = nvars++;
- else if (class == token_sym && sym->content->number == NUMBER_UNDEFINED)
- sym->content->number = ntokens++;
-
- sym->content->class = class;
-
- if (declaring)
- {
- if (sym->content->status == declared && !warned)
- complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
- else
- sym->content->status = declared;
+ if (declaring)
+ {
+ if (s->status == declared)
+ complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
+ else
+ s->status = declared;
+ }
}
}
@@ -462,24 +472,27 @@ symbol_class_set (symbol *sym, symbol_class class, location loc, bool declaring)
void
symbol_user_token_number_set (symbol *sym, int user_token_number, location loc)
{
- int *user_token_numberp;
-
- user_token_numberp = &sym->content->user_token_number;
- if (*user_token_numberp != USER_NUMBER_UNDEFINED
- && *user_token_numberp != user_token_number)
+ int *user_token_numberp = &sym->content->user_token_number;
+ if (sym->content->class != token_sym)
+ complain (&loc, complaint,
+ _("nonterminals cannot be given an explicit number"));
+ else if (*user_token_numberp != USER_NUMBER_UNDEFINED
+ && *user_token_numberp != user_token_number)
complain (&loc, complaint, _("redefining user token number of %s"),
sym->tag);
-
- *user_token_numberp = user_token_number;
- /* User defined $end token? */
- if (user_token_number == 0)
+ else
{
- endtoken = sym->content->symbol;
- /* It is always mapped to 0, so it was already counted in
- NTOKENS. */
- if (endtoken->content->number != NUMBER_UNDEFINED)
- --ntokens;
- endtoken->content->number = 0;
+ *user_token_numberp = user_token_number;
+ /* User defined $end token? */
+ if (user_token_number == 0)
+ {
+ endtoken = sym->content->symbol;
+ /* It is always mapped to 0, so it was already counted in
+ NTOKENS. */
+ if (endtoken->content->number != NUMBER_UNDEFINED)
+ --ntokens;
+ endtoken->content->number = 0;
+ }
}
}
@@ -596,7 +609,10 @@ symbol_merge_properties (symbol *sym, symbol *str)
void
symbol_make_alias (symbol *sym, symbol *str, location loc)
{
- if (str->alias)
+ if (sym->content->class != token_sym)
+ complain (&loc, complaint,
+ _("nonterminals cannot be given a string alias"));
+ else if (str->alias)
complain (&loc, Wother,
_("symbol %s used more than once as a literal string"), str->tag);
else if (sym->alias)
@@ -638,7 +654,7 @@ symbol_pack_processor (void *this, void *null ATTRIBUTE_UNUSED)
}
static void
-user_token_number_redeclaration (int num, symbol *first, symbol *second)
+complain_user_token_number_redeclared (int num, symbol *first, symbol *second)
{
unsigned i = 0;
symbols_sort (&first, &second);
@@ -658,14 +674,14 @@ user_token_number_redeclaration (int num, symbol *first, symbol *second)
static inline bool
symbol_translation (symbol *this)
{
- /* Non-terminal? */
+ /* Nonterminal? */
if (this->content->class == token_sym
&& !this->is_alias)
{
/* A token which translation has already been set?*/
if (token_translations[this->content->user_token_number]
!= undeftoken->content->number)
- user_token_number_redeclaration
+ complain_user_token_number_redeclared
(this->content->user_token_number,
symbols[token_translations[this->content->user_token_number]], this);
else
diff --git a/contrib/tools/bison/src/symtab.h b/contrib/tools/bison/src/symtab.h
index 71ade8a7cf..c22811265d 100644
--- a/contrib/tools/bison/src/symtab.h
+++ b/contrib/tools/bison/src/symtab.h
@@ -1,6 +1,6 @@
/* Definitions for symtab.c and callers, part of Bison.
- Copyright (C) 1984, 1989, 1992, 2000-2002, 2004-2015, 2018 Free
+ Copyright (C) 1984, 1989, 1992, 2000-2002, 2004-2015, 2018-2019 Free
Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -40,7 +40,7 @@ typedef enum
{
unknown_sym, /**< Undefined. */
token_sym, /**< Terminal. */
- nterm_sym /**< Non-terminal. */
+ nterm_sym /**< Nonterminal. */
} symbol_class;
@@ -137,6 +137,10 @@ struct sym_content
location prec_location;
int prec;
assoc assoc;
+
+ /** The user specified token number.
+
+ E.g., %token FOO 42.*/
int user_token_number;
symbol_class class;
@@ -212,7 +216,10 @@ code_props *symbol_code_props_get (symbol *sym, code_props_type kind);
Do nothing if invoked with \c undef_assoc as \c assoc. */
void symbol_precedence_set (symbol *sym, int prec, assoc a, location loc);
-/** Set the \c class associated with \c sym. */
+/** Set the \c class associated with \c sym.
+
+ Whether \c declaring means whether this class definition comes
+ from %nterm or %token. */
void symbol_class_set (symbol *sym, symbol_class class, location loc,
bool declaring);
@@ -241,6 +248,8 @@ extern symbol *startsymbol;
/** The location of the \c \%start declaration. */
extern location startsymbol_location;
+/** Whether a symbol declared with a type tag. */
+extern bool tag_seen;
/*-------------------.
diff --git a/contrib/tools/bison/src/system.h b/contrib/tools/bison/src/system.h
index fa7a060d38..8a82c788e0 100644
--- a/contrib/tools/bison/src/system.h
+++ b/contrib/tools/bison/src/system.h
@@ -1,7 +1,7 @@
/* System-dependent definitions for Bison.
- Copyright (C) 2000-2007, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2000-2007, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/contrib/tools/bison/src/tables.c b/contrib/tools/bison/src/tables.c
index 3c35b6f10b..30849c33b5 100644
--- a/contrib/tools/bison/src/tables.c
+++ b/contrib/tools/bison/src/tables.c
@@ -1,7 +1,7 @@
/* Output the generated parsing program for Bison.
- Copyright (C) 1984, 1986, 1989, 1992, 2000-2006, 2009-2015, 2018 Free
- Software Foundation, Inc.
+ Copyright (C) 1984, 1986, 1989, 1992, 2000-2006, 2009-2015, 2018-2019
+ Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/tables.h b/contrib/tools/bison/src/tables.h
index 0eb0e5cd23..0504e38c46 100644
--- a/contrib/tools/bison/src/tables.h
+++ b/contrib/tools/bison/src/tables.h
@@ -1,7 +1,7 @@
/* Prepare the LALR and GLR parser tables.
- Copyright (C) 2002, 2004, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2002, 2004, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/uniqstr.c b/contrib/tools/bison/src/uniqstr.c
index b4f6e9463d..f654d55ef1 100644
--- a/contrib/tools/bison/src/uniqstr.c
+++ b/contrib/tools/bison/src/uniqstr.c
@@ -1,7 +1,7 @@
/* Keep a unique copy of strings.
- Copyright (C) 2002-2005, 2009-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2002-2005, 2009-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
diff --git a/contrib/tools/bison/src/uniqstr.h b/contrib/tools/bison/src/uniqstr.h
index 5247242158..1fd731807f 100644
--- a/contrib/tools/bison/src/uniqstr.h
+++ b/contrib/tools/bison/src/uniqstr.h
@@ -1,7 +1,7 @@
/* Keeping a unique copy of strings.
- Copyright (C) 2002-2003, 2008-2015, 2018 Free Software Foundation,
- Inc.
+ Copyright (C) 2002-2003, 2008-2015, 2018-2019 Free Software
+ Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.