mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-08 18:25:13 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcf845a716 | ||
|
|
3158164614 |
+1
-10
@@ -1,16 +1,7 @@
|
||||
*.eps
|
||||
*.log
|
||||
*.o
|
||||
*.pdf
|
||||
*.png
|
||||
*.stamp
|
||||
*.trs
|
||||
*~
|
||||
.deps
|
||||
.dirstamp
|
||||
/*.cache
|
||||
/*.flc
|
||||
/*.prj
|
||||
/*~
|
||||
/.tarball-version
|
||||
/.version
|
||||
/ABOUT-NLS
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3.0.2
|
||||
2.7
|
||||
|
||||
@@ -24,7 +24,7 @@ and nasty bugs.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1998-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+1
-1
@@ -26733,7 +26733,7 @@
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1987-1988, 1991-2015 Free Software Foundation,
|
||||
Copyright (C) 1987-1988, 1991-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Copying and distribution of this file, with or without
|
||||
|
||||
+7
-9
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
# Copyright (C) 2001-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 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
|
||||
@@ -24,18 +24,16 @@ SUBDIRS = po runtime-po .
|
||||
aclocaldir = @aclocaldir@
|
||||
aclocal_DATA = m4/bison-i18n.m4
|
||||
|
||||
EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \
|
||||
ChangeLog-1998 ChangeLog-2012 ChangeLog
|
||||
|
||||
dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO
|
||||
EXTRA_DIST = .prev-version .version \
|
||||
cfg.mk ChangeLog-1998 ChangeLog-2012 PACKAGING
|
||||
|
||||
## Running the bison from this tarball. To generate our own parser,
|
||||
## but also to run the tests. Of course, you ought to keep a sane
|
||||
## version of Bison nearby...
|
||||
BISON = $(top_builddir)/tests/bison
|
||||
BISON_IN = $(top_srcdir)/tests/bison.in
|
||||
YACC = $(BISON) -o y.tab.c
|
||||
AM_YFLAGS = -d -v -Werror -Wall -Wno-yacc --report=all
|
||||
YACC = $(BISON) -y
|
||||
AM_YFLAGS = -d -v --warnings=all,error --report=all
|
||||
|
||||
# Initialization before completion by local.mk's.
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
@@ -80,11 +78,11 @@ dist-hook: gen-ChangeLog
|
||||
|
||||
.PHONY: update-b4-copyright update-package-copyright-year
|
||||
update-b4-copyright:
|
||||
$(AM_V_GEN)find $(srcdir)/data -type f \
|
||||
find $(srcdir)/data -type f \
|
||||
| xargs $(srcdir)/build-aux/$@
|
||||
@echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
|
||||
update-package-copyright-year:
|
||||
$(AM_V_GEN)$(srcdir)/build-aux/$@ $(srcdir)/configure.ac
|
||||
$(srcdir)/build-aux/$@ $(srcdir)/configure.ac
|
||||
|
||||
gen_start_date = 2012-01-16
|
||||
.PHONY: gen-ChangeLog
|
||||
|
||||
@@ -1,120 +1,17 @@
|
||||
GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release 3.0.3 (2015-01-15) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** C++ with Variants (lalr1.cc)
|
||||
|
||||
Problems with %destructor and '%define parse.assert' have been fixed.
|
||||
|
||||
*** Named %union support (yacc.c, glr.c)
|
||||
|
||||
Bison 3.0 introduced a regression on named %union such as
|
||||
|
||||
%union foo { int ival; };
|
||||
|
||||
The possibility to use a name was introduced "for Yacc compatibility".
|
||||
It is however not required by POSIX Yacc, and its usefulness is not clear.
|
||||
|
||||
*** %define api.value.type union with %defines (yacc.c, glr.c)
|
||||
|
||||
The C parsers were broken when %defines was used together with "%define
|
||||
api.value.type union".
|
||||
|
||||
*** Redeclarations are reported in proper order
|
||||
|
||||
On
|
||||
|
||||
%token FOO "foo"
|
||||
%printer {} "foo"
|
||||
%printer {} FOO
|
||||
|
||||
bison used to report:
|
||||
|
||||
/tmp/foo.yy:2.10-11: error: %printer redeclaration for FOO
|
||||
%printer {} "foo"
|
||||
^^
|
||||
/tmp/foo.yy:3.10-11: previous declaration
|
||||
%printer {} FOO
|
||||
^^
|
||||
|
||||
Now, the "previous" declaration is always the first one.
|
||||
|
||||
|
||||
** Documentation
|
||||
|
||||
Bison now installs various files in its docdir (which defaults to
|
||||
'/usr/local/share/doc/bison'), including the three fully blown examples
|
||||
extracted from the documentation:
|
||||
|
||||
- rpcalc
|
||||
Reverse polish calculator, a simple introductory example.
|
||||
- mfcalc
|
||||
Multi-function Calc, a calculator with memory and functions and located
|
||||
error messages.
|
||||
- calc++
|
||||
a calculator in C++ using variant support and token constructors.
|
||||
|
||||
* Noteworthy changes in release 3.0.2 (2013-12-05) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** Generated source files when errors are reported
|
||||
|
||||
When warnings are issued and -Werror is set, bison would still generate
|
||||
the source files (*.c, *.h...). As a consequence, some runs of "make"
|
||||
could fail the first time, but not the second (as the files were generated
|
||||
anyway).
|
||||
|
||||
This is fixed: bison no longer generates this source files, but, of
|
||||
course, still produces the various reports (*.output, *.xml, etc.).
|
||||
|
||||
*** %empty is used in reports
|
||||
|
||||
Empty right-hand sides are denoted by '%empty' in all the reports (text,
|
||||
dot, XML and formats derived from it).
|
||||
|
||||
*** YYERROR and variants
|
||||
|
||||
When C++ variant support is enabled, an error triggered via YYERROR, but
|
||||
not caught via error recovery, resulted in a double deletion.
|
||||
|
||||
* Noteworthy changes in release 3.0.1 (2013-11-12) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** Errors in caret diagnostics
|
||||
|
||||
On some platforms, some errors could result in endless diagnostics.
|
||||
|
||||
*** Fixes of the -Werror option
|
||||
|
||||
Options such as "-Werror -Wno-error=foo" were still turning "foo"
|
||||
diagnostics into errors instead of warnings. This is fixed.
|
||||
|
||||
Actually, for consistency with GCC, "-Wno-error=foo -Werror" now also
|
||||
leaves "foo" diagnostics as warnings. Similarly, with "-Werror=foo
|
||||
-Wno-error", "foo" diagnostics are now errors.
|
||||
|
||||
*** GLR Predicates
|
||||
|
||||
As demonstrated in the documentation, one can now leave spaces between
|
||||
"%?" and its "{".
|
||||
|
||||
*** Installation
|
||||
|
||||
The yacc.1 man page is no longer installed if --disable-yacc was
|
||||
specified.
|
||||
|
||||
*** Fixes in the test suite
|
||||
|
||||
Bugs and portability issues.
|
||||
|
||||
* Noteworthy changes in release 3.0 (2013-07-25) [stable]
|
||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
|
||||
** WARNING: Future backward-incompatibilities!
|
||||
|
||||
Bison will stop adding a semicolon at the end of the actions (as announced
|
||||
in the release 2.5):
|
||||
|
||||
foo.y:2.22: warning: a ';' might be needed at the end of action code
|
||||
exp: "num" { $$ = $1 }
|
||||
^
|
||||
foo.y:2.22: future versions of Bison will not add the ';'
|
||||
|
||||
Like other GNU packages, Bison will start using some of the C99 features
|
||||
for its own code, especially the definition of variables after statements.
|
||||
The generated C parsers still aim at C90.
|
||||
@@ -131,32 +28,9 @@ GNU Bison NEWS
|
||||
Support for YYLEX_PARAM and YYPARSE_PARAM is removed (deprecated in Bison
|
||||
1.875): use %lex-param, %parse-param, or %param.
|
||||
|
||||
Missing semicolons at the end of actions are no longer added (as announced
|
||||
in the release 2.5).
|
||||
|
||||
*** Use of YACC='bison -y'
|
||||
|
||||
TL;DR: With Autoconf <= 2.69, pass -Wno-yacc to (AM_)YFLAGS if you use
|
||||
Bison extensions.
|
||||
|
||||
Traditional Yacc generates 'y.tab.c' whatever the name of the input file.
|
||||
Therefore Makefiles written for Yacc expect 'y.tab.c' (and possibly
|
||||
'y.tab.h' and 'y.outout') to be generated from 'foo.y'.
|
||||
|
||||
To this end, for ages, AC_PROG_YACC, Autoconf's macro to look for an
|
||||
implementation of Yacc, was using Bison as 'bison -y'. While it does
|
||||
ensure compatible output file names, it also enables warnings for
|
||||
incompatibilities with POSIX Yacc. In other words, 'bison -y' triggers
|
||||
warnings for Bison extensions.
|
||||
|
||||
Autoconf 2.70+ fixes this incompatibility by using YACC='bison -o y.tab.c'
|
||||
(which also generates 'y.tab.h' and 'y.output' when needed).
|
||||
Alternatively, disable Yacc warnings by passing '-Wno-yacc' to your Yacc
|
||||
flags (YFLAGS, or AM_YFLAGS with Automake).
|
||||
|
||||
** Bug fixes
|
||||
|
||||
*** The epilogue is no longer affected by internal #defines (glr.c)
|
||||
*** The epilogue is no longer affected by internal #defines
|
||||
|
||||
The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in
|
||||
generated code. These weren't properly undefined before the inclusion of
|
||||
@@ -165,7 +39,7 @@ GNU Bison NEWS
|
||||
|
||||
int yylex (YYSTYPE *yylval);
|
||||
|
||||
This is fixed: yylval, yynerrs, yychar, and yylloc are now valid
|
||||
This is has been fixed: yylval, yynerrs, yychar, and yylloc are now valid
|
||||
identifiers for user-provided variables.
|
||||
|
||||
*** stdio.h is no longer needed when locations are enabled (yacc.c)
|
||||
@@ -173,8 +47,6 @@ GNU Bison NEWS
|
||||
Changes in Bison 2.7 introduced a dependency on FILE and fprintf when
|
||||
locations are enabled. This is fixed.
|
||||
|
||||
*** Warnings about useless %pure-parser/%define api.pure are restored
|
||||
|
||||
** Diagnostics reported by Bison
|
||||
|
||||
Most of these features were contributed by Théophile Ranquet and Victor
|
||||
@@ -186,29 +58,6 @@ GNU Bison NEWS
|
||||
activated by default. The old format can still be used by invoking Bison
|
||||
with -fno-caret (or -fnone).
|
||||
|
||||
Some error messages that reproduced excerpts of the grammar are now using
|
||||
the caret information only. For instance on:
|
||||
|
||||
%%
|
||||
exp: 'a' | 'a';
|
||||
|
||||
Bison 2.7 reports:
|
||||
|
||||
in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
|
||||
in.y:2.12-14: warning: rule useless in parser due to conflicts: exp: 'a' [-Wother]
|
||||
|
||||
Now bison reports:
|
||||
|
||||
in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
|
||||
in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother]
|
||||
exp: 'a' | 'a';
|
||||
^^^
|
||||
|
||||
and "bison -fno-caret" reports:
|
||||
|
||||
in.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
|
||||
in.y:2.12-14: warning: rule useless in parser due to conflicts [-Wother]
|
||||
|
||||
*** Enhancements of the -Werror option
|
||||
|
||||
The -Werror=CATEGORY option is now recognized, and will treat specified
|
||||
@@ -349,10 +198,12 @@ GNU Bison NEWS
|
||||
bar.y: error: shift/reduce conflicts: 1 found, 0 expected
|
||||
bar.y: error: reduce/reduce conflicts: 2 found, 0 expected
|
||||
|
||||
** Incompatibilities with POSIX Yacc
|
||||
*** Useless precedence
|
||||
|
||||
The 'yacc' category is no longer part of '-Wall', enable it explicitly
|
||||
with '-Wyacc'.
|
||||
Bison now warns about symbols with a declared precedence but no declared
|
||||
associativity (i.e. declared with %precedence), and whose precedence is
|
||||
never used. In that case, the symbol can be safely declared with %token
|
||||
instead, without modifying the parsing tables.
|
||||
|
||||
** Additional yylex/yyparse arguments
|
||||
|
||||
@@ -369,271 +220,13 @@ GNU Bison NEWS
|
||||
|
||||
%param {arg1_type *arg1} {arg2_type *arg2}
|
||||
|
||||
** Types of values for %define variables
|
||||
|
||||
Bison used to make no difference between '%define foo bar' and '%define
|
||||
foo "bar"'. The former is now called a 'keyword value', and the latter a
|
||||
'string value'. A third kind was added: 'code values', such as '%define
|
||||
foo {bar}'.
|
||||
|
||||
Keyword variables are used for fixed value sets, e.g.,
|
||||
|
||||
%define lr.type lalr
|
||||
|
||||
Code variables are used for value in the target language, e.g.,
|
||||
|
||||
%define api.value.type {struct semantic_type}
|
||||
|
||||
String variables are used remaining cases, e.g. file names.
|
||||
|
||||
** Variable api.token.prefix
|
||||
|
||||
The variable api.token.prefix changes the way tokens are identified in
|
||||
the generated files. This is especially useful to avoid collisions
|
||||
with identifiers in the target language. For instance
|
||||
|
||||
%token FILE for ERROR
|
||||
%define api.token.prefix {TOK_}
|
||||
%%
|
||||
start: FILE for ERROR;
|
||||
|
||||
will generate the definition of the symbols TOK_FILE, TOK_for, and
|
||||
TOK_ERROR in the generated sources. In particular, the scanner must
|
||||
use these prefixed token names, although the grammar itself still
|
||||
uses the short names (as in the sample rule given above).
|
||||
|
||||
** Variable api.value.type
|
||||
|
||||
This new %define variable supersedes the #define macro YYSTYPE. The use
|
||||
of YYSTYPE is discouraged. In particular, #defining YYSTYPE *and* either
|
||||
using %union or %defining api.value.type results in undefined behavior.
|
||||
|
||||
Either define api.value.type, or use "%union":
|
||||
|
||||
%union
|
||||
{
|
||||
int ival;
|
||||
char *sval;
|
||||
}
|
||||
%token <ival> INT "integer"
|
||||
%token <sval> STRING "string"
|
||||
%printer { fprintf (yyo, "%d", $$); } <ival>
|
||||
%destructor { free ($$); } <sval>
|
||||
|
||||
/* In yylex(). */
|
||||
yylval.ival = 42; return INT;
|
||||
yylval.sval = "42"; return STRING;
|
||||
|
||||
The %define variable api.value.type supports both keyword and code values.
|
||||
|
||||
The keyword value 'union' means that the user provides genuine types, not
|
||||
union member names such as "ival" and "sval" above (WARNING: will fail if
|
||||
-y/--yacc/%yacc is enabled).
|
||||
|
||||
%define api.value.type union
|
||||
%token <int> INT "integer"
|
||||
%token <char *> STRING "string"
|
||||
%printer { fprintf (yyo, "%d", $$); } <int>
|
||||
%destructor { free ($$); } <char *>
|
||||
|
||||
/* In yylex(). */
|
||||
yylval.INT = 42; return INT;
|
||||
yylval.STRING = "42"; return STRING;
|
||||
|
||||
The keyword value variant is somewhat equivalent, but for C++ special
|
||||
provision is made to allow classes to be used (more about this below).
|
||||
|
||||
%define api.value.type variant
|
||||
%token <int> INT "integer"
|
||||
%token <std::string> STRING "string"
|
||||
|
||||
Code values (in braces) denote user defined types. This is where YYSTYPE
|
||||
used to be used.
|
||||
|
||||
%code requires
|
||||
{
|
||||
struct my_value
|
||||
{
|
||||
enum
|
||||
{
|
||||
is_int, is_string
|
||||
} kind;
|
||||
union
|
||||
{
|
||||
int ival;
|
||||
char *sval;
|
||||
} u;
|
||||
};
|
||||
}
|
||||
%define api.value.type {struct my_value}
|
||||
%token <u.ival> INT "integer"
|
||||
%token <u.sval> STRING "string"
|
||||
%printer { fprintf (yyo, "%d", $$); } <u.ival>
|
||||
%destructor { free ($$); } <u.sval>
|
||||
|
||||
/* In yylex(). */
|
||||
yylval.u.ival = 42; return INT;
|
||||
yylval.u.sval = "42"; return STRING;
|
||||
|
||||
** Variable parse.error
|
||||
|
||||
This variable controls the verbosity of error messages. The use of the
|
||||
%error-verbose directive is deprecated in favor of "%define parse.error
|
||||
verbose".
|
||||
|
||||
** Renamed %define variables
|
||||
|
||||
The following variables have been renamed for consistency. Backward
|
||||
compatibility is ensured, but upgrading is recommended.
|
||||
|
||||
lr.default-reductions -> lr.default-reduction
|
||||
lr.keep-unreachable-states -> lr.keep-unreachable-state
|
||||
namespace -> api.namespace
|
||||
stype -> api.value.type
|
||||
|
||||
** Semantic predicates
|
||||
|
||||
Contributed by Paul Hilfinger.
|
||||
|
||||
The new, experimental, semantic-predicate feature allows actions of the
|
||||
form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for
|
||||
YYERROR) if the expression evaluates to 0, and are evaluated immediately
|
||||
in GLR parsers, rather than being deferred. The result is that they allow
|
||||
the programmer to prune possible parses based on the values of run-time
|
||||
expressions.
|
||||
|
||||
** The directive %expect-rr is now an error in non GLR mode
|
||||
|
||||
It used to be an error only if used in non GLR mode, _and_ if there are
|
||||
reduce/reduce conflicts.
|
||||
|
||||
** Tokens are numbered in their order of appearance
|
||||
|
||||
Contributed by Valentin Tolmer.
|
||||
|
||||
With '%token A B', A had a number less than the one of B. However,
|
||||
precedence declarations used to generate a reversed order. This is now
|
||||
fixed, and introducing tokens with any of %token, %left, %right,
|
||||
%precedence, or %nonassoc yields the same result.
|
||||
|
||||
When mixing declarations of tokens with a litteral character (e.g., 'a')
|
||||
or with an identifier (e.g., B) in a precedence declaration, Bison
|
||||
numbered the litteral characters first. For example
|
||||
|
||||
%right A B 'c' 'd'
|
||||
|
||||
would lead to the tokens declared in this order: 'c' 'd' A B. Again, the
|
||||
input order is now preserved.
|
||||
|
||||
These changes were made so that one can remove useless precedence and
|
||||
associativity declarations (i.e., map %nonassoc, %left or %right to
|
||||
%precedence, or to %token) and get exactly the same output.
|
||||
|
||||
** Useless precedence and associativity
|
||||
|
||||
Contributed by Valentin Tolmer.
|
||||
|
||||
When developing and maintaining a grammar, useless associativity and
|
||||
precedence directives are common. They can be a nuisance: new ambiguities
|
||||
arising are sometimes masked because their conflicts are resolved due to
|
||||
the extra precedence or associativity information. Furthermore, it can
|
||||
hinder the comprehension of a new grammar: one will wonder about the role
|
||||
of a precedence, where in fact it is useless. The following changes aim
|
||||
at detecting and reporting these extra directives.
|
||||
|
||||
*** Precedence warning category
|
||||
|
||||
A new category of warning, -Wprecedence, was introduced. It flags the
|
||||
useless precedence and associativity directives.
|
||||
|
||||
*** Useless associativity
|
||||
|
||||
Bison now warns about symbols with a declared associativity that is never
|
||||
used to resolve conflicts. In that case, using %precedence is sufficient;
|
||||
the parsing tables will remain unchanged. Solving these warnings may raise
|
||||
useless precedence warnings, as the symbols no longer have associativity.
|
||||
For example:
|
||||
|
||||
%left '+'
|
||||
%left '*'
|
||||
%%
|
||||
exp:
|
||||
"number"
|
||||
| exp '+' "number"
|
||||
| exp '*' exp
|
||||
;
|
||||
|
||||
will produce a
|
||||
|
||||
warning: useless associativity for '+', use %precedence [-Wprecedence]
|
||||
%left '+'
|
||||
^^^
|
||||
|
||||
*** Useless precedence
|
||||
|
||||
Bison now warns about symbols with a declared precedence and no declared
|
||||
associativity (i.e., declared with %precedence), and whose precedence is
|
||||
never used. In that case, the symbol can be safely declared with %token
|
||||
instead, without modifying the parsing tables. For example:
|
||||
|
||||
%precedence '='
|
||||
%%
|
||||
exp: "var" '=' "number";
|
||||
|
||||
will produce a
|
||||
|
||||
warning: useless precedence for '=' [-Wprecedence]
|
||||
%precedence '='
|
||||
^^^
|
||||
|
||||
*** Useless precedence and associativity
|
||||
|
||||
In case of both useless precedence and associativity, the issue is flagged
|
||||
as follows:
|
||||
|
||||
%nonassoc '='
|
||||
%%
|
||||
exp: "var" '=' "number";
|
||||
|
||||
The warning is:
|
||||
|
||||
warning: useless precedence and associativity for '=' [-Wprecedence]
|
||||
%nonassoc '='
|
||||
^^^
|
||||
|
||||
** Empty rules
|
||||
|
||||
With help from Joel E. Denny and Gabriel Rassoul.
|
||||
|
||||
Empty rules (i.e., with an empty right-hand side) can now be explicitly
|
||||
marked by the new %empty directive. Using %empty on a non-empty rule is
|
||||
an error. The new -Wempty-rule warning reports empty rules without
|
||||
%empty. On the following grammar:
|
||||
|
||||
%%
|
||||
s: a b c;
|
||||
a: ;
|
||||
b: %empty;
|
||||
c: 'a' %empty;
|
||||
|
||||
bison reports:
|
||||
|
||||
3.4-5: warning: empty rule without %empty [-Wempty-rule]
|
||||
a: {}
|
||||
^^
|
||||
5.8-13: error: %empty on non-empty rule
|
||||
c: 'a' %empty {};
|
||||
^^^^^^
|
||||
|
||||
** Java skeleton improvements
|
||||
|
||||
Contributed by Paolo Bonzini.
|
||||
|
||||
The constants for token names were moved to the Lexer interface. Also, it
|
||||
is possible to add code to the parser's constructors using "%code init"
|
||||
and "%define init_throws".
|
||||
Contributed by Paolo Bonzini.
|
||||
|
||||
The Java skeleton now supports push parsing.
|
||||
Contributed by Dennis Heimbigner.
|
||||
|
||||
** C++ skeletons improvements
|
||||
|
||||
@@ -656,66 +249,59 @@ GNU Bison NEWS
|
||||
used by the scanner, or rejecting invalid combinations from a
|
||||
factory invoked by the user actions).
|
||||
|
||||
*** %define api.value.type variant
|
||||
** Renamed %define variables
|
||||
|
||||
This is based on a submission from Michiel De Wilde. With help
|
||||
from Théophile Ranquet.
|
||||
The following variables have been renamed for consistency. Backward
|
||||
compatibility is ensured, but upgrading is recommended.
|
||||
|
||||
In this mode, complex C++ objects can be used as semantic values. For
|
||||
instance:
|
||||
lr.default-reductions -> lr.default-reduction
|
||||
lr.keep-unreachable-states -> lr.keep-unreachable-state
|
||||
namespace -> api.namespace
|
||||
stype -> api.value.type
|
||||
|
||||
%token <::std::string> TEXT;
|
||||
%token <int> NUMBER;
|
||||
%token SEMICOLON ";"
|
||||
%type <::std::string> item;
|
||||
%type <::std::list<std::string>> list;
|
||||
** Variable api.token.prefix
|
||||
|
||||
The variable api.token.prefix changes the way tokens are identified in
|
||||
the generated files. This is especially useful to avoid collisions
|
||||
with identifiers in the target language. For instance
|
||||
|
||||
%token FILE for ERROR
|
||||
%define api.token.prefix "TOK_"
|
||||
%%
|
||||
result:
|
||||
list { std::cout << $1 << std::endl; }
|
||||
;
|
||||
start: FILE for ERROR;
|
||||
|
||||
list:
|
||||
%empty { /* Generates an empty string list. */ }
|
||||
| list item ";" { std::swap ($$, $1); $$.push_back ($2); }
|
||||
;
|
||||
will generate the definition of the symbols TOK_FILE, TOK_for, and
|
||||
TOK_ERROR in the generated sources. In particular, the scanner must
|
||||
use these prefixed token names, although the grammar itself still
|
||||
uses the short names (as in the sample rule given above).
|
||||
|
||||
item:
|
||||
TEXT { std::swap ($$, $1); }
|
||||
| NUMBER { $$ = string_cast ($1); }
|
||||
;
|
||||
** Variable parse.error
|
||||
|
||||
*** %define api.token.constructor
|
||||
This variable controls the verbosity of error messages. The use of the
|
||||
%error-verbose directive is deprecated in favor of "%define parse.error
|
||||
verbose".
|
||||
|
||||
When variants are enabled, Bison can generate functions to build the
|
||||
tokens. This guarantees that the token type (e.g., NUMBER) is consistent
|
||||
with the semantic value (e.g., int):
|
||||
** Semantic predicates
|
||||
|
||||
parser::symbol_type yylex ()
|
||||
{
|
||||
parser::location_type loc = ...;
|
||||
...
|
||||
return parser::make_TEXT ("Hello, world!", loc);
|
||||
...
|
||||
return parser::make_NUMBER (42, loc);
|
||||
...
|
||||
return parser::make_SEMICOLON (loc);
|
||||
...
|
||||
}
|
||||
Contributed by Paul Hilfinger.
|
||||
|
||||
*** C++ locations
|
||||
The new, experimental, semantic-predicate feature allows actions of the
|
||||
form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for
|
||||
YYERROR) if the expression evaluates to 0, and are evaluated immediately
|
||||
in GLR parsers, rather than being deferred. The result is that they allow
|
||||
the programmer to prune possible parses based on the values of run-time
|
||||
expressions.
|
||||
|
||||
There are operator- and operator-= for 'location'. Negative line/column
|
||||
increments can no longer underflow the resulting value.
|
||||
** The directive %expect-rr is now an error in non GLR mode
|
||||
|
||||
* Noteworthy changes in release 2.7.1 (2013-04-15) [stable]
|
||||
It used to be an error only if used in non GLR mode, _and_ if there are
|
||||
reduce/reduce conflicts.
|
||||
|
||||
** Bug fixes
|
||||
** Token numbering has changed to preserve the user-defined order
|
||||
|
||||
*** Fix compiler attribute portability (yacc.c)
|
||||
|
||||
With locations enabled, __attribute__ was used unprotected.
|
||||
|
||||
*** Fix some compiler warnings (lalr1.cc)
|
||||
When declaring %token A B, the numbering for A is inferior to B. Up to now,
|
||||
when declaring associativity at the same time, with %left (or %right,
|
||||
%precedence, %nonassoc), B was inferior to A.
|
||||
|
||||
* Noteworthy changes in release 2.7 (2012-12-12) [stable]
|
||||
|
||||
@@ -767,8 +353,8 @@ GNU Bison NEWS
|
||||
exp: exp '+' exp { $exp = $1 + $3; };
|
||||
^^^
|
||||
|
||||
The default behavior for now is still not to display these unless
|
||||
explicitly asked with -fcaret (or -fall). However, in a later release, it
|
||||
The default behaviour for now is still not to display these unless
|
||||
explictly asked with -fcaret (or -fall). However, in a later release, it
|
||||
will be made the default behavior (but may still be deactivated with
|
||||
-fno-caret).
|
||||
|
||||
@@ -855,7 +441,7 @@ GNU Bison NEWS
|
||||
|
||||
Other issues in the test suite have been addressed.
|
||||
|
||||
Null characters are correctly displayed in error messages.
|
||||
Nul characters are correctly displayed in error messages.
|
||||
|
||||
When possible, yylloc is correctly initialized before calling yylex. It
|
||||
is no longer necessary to initialize it in the %initial-action.
|
||||
@@ -2736,7 +2322,7 @@ Output file does not redefine const for C++.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1995-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
@@ -2771,12 +2357,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
LocalWords: Automake TMPDIR LESSEQ ylwrap endif yydebug YYTOKEN YYLSP ival hh
|
||||
LocalWords: extern YYTOKENTYPE TOKENTYPE yytokentype tokentype STYPE lval pdf
|
||||
LocalWords: lang yyoutput dvi html ps POSIX lvalp llocp Wother nterm arg init
|
||||
LocalWords: TOK calc yyo fval Wconflicts parsers yystackp yyval yynerrs
|
||||
LocalWords: Théophile Ranquet Santet fno fnone stype associativity Tolmer
|
||||
LocalWords: Wprecedence Rassoul Wempty Paolo Bonzini parser's Michiel loc
|
||||
LocalWords: redeclaration sval fcaret reentrant XSLT xsl Wmaybe yyvsp Tedi
|
||||
LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
|
||||
LocalWords: Alexandre MERCHANTABILITY yytype
|
||||
LocalWords: TOK calc yyo fval Wconflicts
|
||||
|
||||
Local Variables:
|
||||
mode: outline
|
||||
|
||||
@@ -36,7 +36,7 @@ to the bison package.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2005, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2005, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ not answer them, please send mail to <[email protected]>.
|
||||
|
||||
* Bug reports
|
||||
Please send bug reports to <[email protected]>. Please include the
|
||||
version number from 'bison --version', and a complete, self-contained
|
||||
version number from `bison --version', and a complete, self-contained
|
||||
test case in each bug report.
|
||||
|
||||
* Copyright statements
|
||||
@@ -44,7 +44,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2015 Free Software
|
||||
Copyright (C) 1992, 1998-1999, 2003-2005, 2008-2013 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ the problems you encounter.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+4
-15
@@ -62,22 +62,13 @@ tools we depend upon, including:
|
||||
- Gettext <http://www.gnu.org/software/gettext/>
|
||||
- Graphviz <http://www.graphviz.org>
|
||||
- Gzip <http://www.gnu.org/software/gzip/>
|
||||
- Help2man <http://www.gnu.org/software/help2man/>
|
||||
- Perl <http://www.cpan.org/>
|
||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||
- Tar <http://www.gnu.org/software/tar/>
|
||||
- Texinfo <http://www.gnu.org/software/texinfo/>
|
||||
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
|
||||
your architecture.
|
||||
|
||||
If you're using a GNU/Linux distribution, the easiest way to install the
|
||||
above packages depends on your system. The following shell command should
|
||||
work for Debian-based systems such as Ubuntu:
|
||||
|
||||
sudo apt-get install \
|
||||
autoconf automake autopoint flex graphviz help2man texinfo valgrind
|
||||
|
||||
Bison is written using Bison grammars, so there are bootstrapping issues.
|
||||
The bootstrap script attempts to discover when the C code generated from the
|
||||
grammars is out of date, and to bootstrap with an out-of-date version of the
|
||||
@@ -103,17 +94,15 @@ to perform the first checkout of the submodules, run
|
||||
|
||||
$ git submodule update --init
|
||||
|
||||
Git submodule support is weak before versions 1.6 and later, upgrade Git if
|
||||
your version is older.
|
||||
Git submodule support is weak before versions 1.6 and later, you
|
||||
should probably upgrade Git if your version is older.
|
||||
|
||||
The next step is to get other files needed to build, which are
|
||||
extracted from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
If it fails with missing symbols (e.g., "error: possibly undefined macro:
|
||||
AC_PROG_GNU_M4"), you are likely to have forgotten the submodule
|
||||
initialization part. Otherwise, there you are! Just
|
||||
And there you are! Just
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
@@ -451,7 +440,7 @@ Push these changes.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2005, 2007-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2005, 2007-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ Bison supports the @N construction, which gives you access to
|
||||
the starting and ending line number and character number associated
|
||||
with any of the symbols in the current rule.
|
||||
|
||||
Also, Bison supports the command '%expect N' which says not to mention
|
||||
Also, Bison supports the command `%expect N' which says not to mention
|
||||
the conflicts if there are N shift/reduce conflicts and no reduce/reduce
|
||||
conflicts.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
Bison was originally written by Robert Corbett. It would not be what
|
||||
it is today without the invaluable help of these people:
|
||||
|
||||
Aaro Koskinen [email protected]
|
||||
Аскар Сафин [email protected]
|
||||
Аскар Сафин [email protected]
|
||||
Airy Andre [email protected]
|
||||
Akim Demaille [email protected]
|
||||
Albert Chin-A-Young [email protected]
|
||||
@@ -12,13 +11,11 @@ Andreas Schwab [email protected]
|
||||
Andrew Suffield [email protected]
|
||||
Angelo Borsotti [email protected]
|
||||
Anthony Heading [email protected]
|
||||
Antonio Silva Correia [email protected]
|
||||
Arnold Robbins [email protected]
|
||||
Art Haas [email protected]
|
||||
Baron Schwartz [email protected]
|
||||
Ben Pfaff [email protected]
|
||||
Benoit Perrot [email protected]
|
||||
Bernd Edlinger [email protected]
|
||||
Bernd Kiefer [email protected]
|
||||
Bert Deknuydt [email protected]
|
||||
Bill Allombert [email protected]
|
||||
@@ -28,13 +25,10 @@ Bruce Lilly [email protected]
|
||||
Bruno Haible [email protected]
|
||||
Charles-Henri de Boysson [email protected]
|
||||
Christian Burger [email protected]
|
||||
Colin Daley [email protected]
|
||||
Cris Bailiff [email protected]
|
||||
Cris van Pelt [email protected]
|
||||
Csaba Raduly [email protected]
|
||||
Dagobert Michelsen [email protected]
|
||||
Daniel Frużyński [email protected]
|
||||
Daniel Galloway [email protected]
|
||||
Daniel Hagerty [email protected]
|
||||
David J. MacKenzie [email protected]
|
||||
David Kastrup [email protected]
|
||||
@@ -43,7 +37,6 @@ Derek M. Jones [email protected]
|
||||
Di-an Jan [email protected]
|
||||
Dick Streefland [email protected]
|
||||
Didier Godefroy [email protected]
|
||||
Efi Fogel [email protected]
|
||||
Enrico Scholz [email protected]
|
||||
Eric Blake [email protected]
|
||||
Evgeny Stambulchik [email protected]
|
||||
@@ -51,7 +44,6 @@ Fabrice Bauzac [email protected]
|
||||
Florian Krohm [email protected]
|
||||
Frank Heckenbach [email protected]
|
||||
Frans Englich [email protected]
|
||||
Gabriel Rassoul [email protected]
|
||||
Georg Sauthoff [email protected]
|
||||
George Neuner [email protected]
|
||||
Gilles Espinasse [email protected]
|
||||
@@ -71,7 +63,6 @@ Jonathan Nieder [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
Keith Browne [email protected]
|
||||
Ken Moffat [email protected]
|
||||
Laurent Mascherpa [email protected]
|
||||
Lie Yan [email protected]
|
||||
Magnus Fromreide [email protected]
|
||||
@@ -83,19 +74,14 @@ Martin Mokrejs [email protected]
|
||||
Martin Nylin [email protected]
|
||||
Matt Kraai [email protected]
|
||||
Matt Rosing [email protected]
|
||||
Michael Catanzaro [email protected]
|
||||
Michael Felt [email protected]
|
||||
Michael Hayes [email protected]
|
||||
Michael Raskin [email protected]
|
||||
Michel d'Hooge [email protected]
|
||||
Michiel De Wilde [email protected]
|
||||
Mickael Labau [email protected]
|
||||
Mike Castle [email protected]
|
||||
Mike Sullivan [email protected]
|
||||
Neil Booth [email protected]
|
||||
Nelson H. F. Beebe [email protected]
|
||||
Nick Bowler [email protected]
|
||||
Nicolas Bedon [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
Nicolas Tisserand [email protected]
|
||||
Noah Friedman [email protected]
|
||||
@@ -103,7 +89,6 @@ Odd Arild Olsen [email protected]
|
||||
Oleg Smolsky [email protected]
|
||||
Oleksii Taran [email protected]
|
||||
Paolo Bonzini [email protected]
|
||||
Paolo Simone Gasparello [email protected]
|
||||
Pascal Bart [email protected]
|
||||
Paul Eggert [email protected]
|
||||
Paul Hilfinger [email protected]
|
||||
@@ -112,17 +97,13 @@ Peter Eisentraut [email protected]
|
||||
Peter Fales [email protected]
|
||||
Peter Hamorsky [email protected]
|
||||
Peter Simons [email protected]
|
||||
Petr Machata [email protected]
|
||||
Piotr Gackiewicz [email protected]
|
||||
Quentin Hocquet [email protected]
|
||||
Quoc Peyrot [email protected]
|
||||
R Blake [email protected]
|
||||
Raja R Harinath [email protected]
|
||||
Ralf Wildenhues [email protected]
|
||||
Rich Wilson [email protected]
|
||||
Richard Stallman [email protected]
|
||||
Rici Lake [email protected]
|
||||
Rob Conde [email protected]
|
||||
Rob Vermaas [email protected]
|
||||
Robert Anisko [email protected]
|
||||
Roland Levillain [email protected]
|
||||
@@ -132,23 +113,19 @@ Sebastien Fricker [email protected]
|
||||
Sergei Steshenko [email protected]
|
||||
Shura [email protected]
|
||||
Stefano Lattarini [email protected]
|
||||
Stephen Cameron [email protected]
|
||||
Steve Murphy [email protected]
|
||||
Sum Wu [email protected]
|
||||
Théophile Ranquet [email protected]
|
||||
Thiru Ramakrishnan [email protected]
|
||||
Thomas Jahns [email protected]
|
||||
Tim Josling [email protected]
|
||||
Tim Landscheidt [email protected]
|
||||
Tim Van Holder [email protected]
|
||||
Tobias Frost [email protected]
|
||||
Tom Lane [email protected]
|
||||
Tom Tromey [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
Troy A. Johnson [email protected]
|
||||
Tys Lefering [email protected]
|
||||
Valentin Tolmer [email protected]
|
||||
Victor Khomenko [email protected]
|
||||
Vin Shelton [email protected]
|
||||
W.C.A. Wijngaards [email protected]
|
||||
Wayne Green [email protected]
|
||||
@@ -157,7 +134,6 @@ Wojciech Polak [email protected]
|
||||
Wolfgang S. Kechel [email protected]
|
||||
Wolfram Wagner [email protected]
|
||||
Wwp [email protected]
|
||||
xolodho [email protected]
|
||||
Zack Weinberg [email protected]
|
||||
|
||||
Many people are not named here because we lost track of them. We
|
||||
@@ -170,7 +146,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Parser Generator.
|
||||
|
||||
|
||||
@@ -1,27 +1,16 @@
|
||||
* Short term
|
||||
** Graphviz display code thoughts
|
||||
The code for the --graph option is over two files: print_graph, and
|
||||
graphviz. This is because Bison used to also produce VCG graphs, but since
|
||||
this is no longer true, maybe we could consider these files for fusion.
|
||||
graphviz. I believe this is because Bison used to also produce VCG graphs,
|
||||
but since this is no longer true, maybe we could consider these files for
|
||||
fusion.
|
||||
|
||||
An other consideration worth noting is that print_graph.c (correct me if I
|
||||
am wrong) should contain generic functions, whereas graphviz.c and other
|
||||
potential files should contain just the specific code for that output
|
||||
format. It will probably prove difficult to tell if the implementation is
|
||||
actually generic whilst only having support for a single format, but it
|
||||
would be nice to keep stuff a bit tidier: right now, the construction of the
|
||||
bitset used to show reductions is in the graphviz-specific code, and on the
|
||||
opposite side we have some use of \l, which is graphviz-specific, in what
|
||||
should be generic code.
|
||||
Little effort factoring seems to have been given to factoring in these files,
|
||||
and their print-xml and print counterpart. We would very much like to re-use
|
||||
the pretty format of states from .output in the .dot
|
||||
|
||||
Little effort seems to have been given to factoring these files and their
|
||||
rint{,-xml} counterpart. We would very much like to re-use the pretty format
|
||||
of states from .output for the graphs, etc.
|
||||
|
||||
Also, the underscore in print_graph.[ch] isn't very fitting considering the
|
||||
dashes in the other filenames.
|
||||
|
||||
Since graphviz dies on medium-to-big grammars, maybe consider an other tool?
|
||||
Also, the underscore in print_graph.[ch] isn't very fitting considering
|
||||
the dashes in the other filenames.
|
||||
|
||||
** push-parser
|
||||
Check it too when checking the different kinds of parsers. And be
|
||||
@@ -176,13 +165,13 @@ part of $default. Should we make the two reductions explicit, or just
|
||||
keep $default? See the following point.
|
||||
|
||||
** Disabled Reductions
|
||||
See 'tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
||||
See `tests/conflicts.at (Defaulted Conflicted Reduction)', and decide
|
||||
what we want to do.
|
||||
|
||||
** Documentation
|
||||
Extend with error productions. The hard part will probably be finding
|
||||
the right rule so that a single state does not exhibit too many yet
|
||||
undocumented ''features''. Maybe an empty action ought to be
|
||||
undocumented ``features''. Maybe an empty action ought to be
|
||||
presented too. Shall we try to make a single grammar with all these
|
||||
features, or should we have several very small grammars?
|
||||
|
||||
@@ -243,9 +232,9 @@ into
|
||||
exp: exp '+' exp | exp '&' exp;
|
||||
|
||||
when there are no actions. This can significantly speed up some
|
||||
grammars. I can't find the papers. In particular the book 'LR
|
||||
grammars. I can't find the papers. In particular the book `LR
|
||||
parsing: Theory and Practice' is impossible to find, but according to
|
||||
'Parsing Techniques: a Practical Guide', it includes information about
|
||||
`Parsing Techniques: a Practical Guide', it includes information about
|
||||
this issue. Does anybody have it?
|
||||
|
||||
|
||||
@@ -369,7 +358,7 @@ End:
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2001-2004, 2006, 2008-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2004, 2006, 2008-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2014-12-08.12; # UTC
|
||||
scriptversion=2012-12-28.10; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2013 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
|
||||
@@ -42,9 +42,6 @@ export LC_ALL
|
||||
|
||||
local_gl_dir=gl
|
||||
|
||||
# Honour $PERL, but work even if there is none
|
||||
PERL="${PERL-perl}"
|
||||
|
||||
me=$0
|
||||
|
||||
usage() {
|
||||
@@ -143,21 +140,20 @@ po_download_command_format2=\
|
||||
"wget --mirror -nd -q -np -A.po -P '%s' \
|
||||
http://translationproject.org/latest/%s/"
|
||||
|
||||
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
||||
# fall back to the package name (1st argument with munging)
|
||||
extract_package_name='
|
||||
/^AC_INIT(\[*/{
|
||||
s///
|
||||
/^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
|
||||
s//\1/
|
||||
s/[],)].*//
|
||||
/^AC_INIT(/{
|
||||
/.*,.*,.*, */{
|
||||
s///
|
||||
s/[][]//g
|
||||
s/)$//
|
||||
p
|
||||
q
|
||||
}
|
||||
s/[],)].*//
|
||||
s/AC_INIT(\[*//
|
||||
s/]*,.*//
|
||||
s/^GNU //
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
|
||||
s/[^A-Za-z0-9_]/-/g
|
||||
p
|
||||
}
|
||||
'
|
||||
@@ -212,26 +208,12 @@ bootstrap_sync=false
|
||||
# Use git to update gnulib sources
|
||||
use_git=true
|
||||
|
||||
check_exists() {
|
||||
if test "$1" = "--verbose"; then
|
||||
($2 --version </dev/null) >/dev/null 2>&1
|
||||
if test $? -ge 126; then
|
||||
# If not found, run with diagnostics as one may be
|
||||
# presented with env variables to set to find the right version
|
||||
($2 --version </dev/null)
|
||||
fi
|
||||
else
|
||||
($1 --version </dev/null) >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
test $? -lt 126
|
||||
}
|
||||
|
||||
# find_tool ENVVAR NAMES...
|
||||
# -------------------------
|
||||
# Search for a required program. Use the value of ENVVAR, if set,
|
||||
# otherwise find the first of the NAMES that can be run.
|
||||
# If found, set ENVVAR to the program name, die otherwise.
|
||||
# otherwise find the first of the NAMES that can be run (i.e.,
|
||||
# supports --version). If found, set ENVVAR to the program name,
|
||||
# die otherwise.
|
||||
#
|
||||
# FIXME: code duplication, see also gnu-web-doc-update.
|
||||
find_tool ()
|
||||
@@ -241,21 +223,27 @@ find_tool ()
|
||||
find_tool_names=$@
|
||||
eval "find_tool_res=\$$find_tool_envvar"
|
||||
if test x"$find_tool_res" = x; then
|
||||
for i; do
|
||||
if check_exists $i; then
|
||||
find_tool_res=$i
|
||||
break
|
||||
for i
|
||||
do
|
||||
if ($i --version </dev/null) >/dev/null 2>&1; then
|
||||
find_tool_res=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
find_tool_error_prefix="\$$find_tool_envvar: "
|
||||
fi
|
||||
if test x"$find_tool_res" = x; then
|
||||
warn_ "one of these is required: $find_tool_names;"
|
||||
die "alternatively set $find_tool_envvar to a compatible tool"
|
||||
fi
|
||||
test x"$find_tool_res" != x \
|
||||
|| die "one of these is required: $find_tool_names"
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 \
|
||||
|| die "${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
eval "$find_tool_envvar=\$find_tool_res"
|
||||
eval "export $find_tool_envvar"
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
|
||||
find_tool SHA1SUM sha1sum gsha1sum shasum
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
# Make sure that bootstrap.conf is sourced from the current directory
|
||||
# if we were invoked as "sh bootstrap".
|
||||
@@ -267,12 +255,12 @@ esac
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
test -z "${gnulib_extra_files}" && \
|
||||
gnulib_extra_files="
|
||||
build-aux/install-sh
|
||||
build-aux/mdate-sh
|
||||
build-aux/texinfo.tex
|
||||
build-aux/depcomp
|
||||
build-aux/config.guess
|
||||
build-aux/config.sub
|
||||
$build_aux/install-sh
|
||||
$build_aux/mdate-sh
|
||||
$build_aux/texinfo.tex
|
||||
$build_aux/depcomp
|
||||
$build_aux/config.guess
|
||||
$build_aux/config.sub
|
||||
doc/INSTALL
|
||||
"
|
||||
|
||||
@@ -318,34 +306,34 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||
die "Bootstrapping from a non-checked-out distribution is risky."
|
||||
fi
|
||||
|
||||
# Strip blank and comment lines to leave significant entries.
|
||||
gitignore_entries() {
|
||||
sed '/^#/d; /^$/d' "$@"
|
||||
# Ensure that lines starting with ! sort last, per gitignore conventions
|
||||
# for whitelisting exceptions after a more generic blacklist pattern.
|
||||
sort_patterns() {
|
||||
sort -u "$@" | sed '/^!/ {
|
||||
H
|
||||
d
|
||||
}
|
||||
$ {
|
||||
P
|
||||
x
|
||||
s/^\n//
|
||||
}' | sed '/^$/d'
|
||||
}
|
||||
|
||||
# If $STR is not already on a line by itself in $FILE, insert it at the start.
|
||||
# Entries are inserted at the start of the ignore list to ensure existing
|
||||
# entries starting with ! are not overridden. Such entries support
|
||||
# whitelisting exceptions after a more generic blacklist pattern.
|
||||
insert_if_absent() {
|
||||
# If $STR is not already on a line by itself in $FILE, insert it,
|
||||
# sorting the new contents of the file and replacing $FILE with the result.
|
||||
insert_sorted_if_absent() {
|
||||
file=$1
|
||||
str=$2
|
||||
test -f $file || touch $file
|
||||
test -r $file || die "Error: failed to read ignore file: $file"
|
||||
duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
|
||||
if [ "$duplicate_entries" ] ; then
|
||||
die "Error: Duplicate entries in $file: " $duplicate_entries
|
||||
fi
|
||||
linesold=$(gitignore_entries $file | wc -l)
|
||||
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
||||
if [ $linesold != $linesnew ] ; then
|
||||
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
||||
|| die "insert_if_absent $file $str: failed"
|
||||
fi
|
||||
echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
|
||||
|| { echo "$str" | sort_patterns - $file > $file.bak \
|
||||
&& mv $file.bak $file; } \
|
||||
|| die "insert_sorted_if_absent $file $str: failed"
|
||||
}
|
||||
|
||||
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
||||
# insert_if_absent.
|
||||
# insert_sorted_if_absent.
|
||||
insert_vc_ignore() {
|
||||
vc_ignore_file="$1"
|
||||
pattern="$2"
|
||||
@@ -356,7 +344,7 @@ insert_vc_ignore() {
|
||||
# .gitignore entry.
|
||||
pattern=$(echo "$pattern" | sed s,^,/,);;
|
||||
esac
|
||||
insert_if_absent "$vc_ignore_file" "$pattern"
|
||||
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
||||
}
|
||||
|
||||
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||
@@ -421,7 +409,7 @@ sort_ver() { # sort -V is not generally available
|
||||
get_version() {
|
||||
app=$1
|
||||
|
||||
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
||||
$app --version >/dev/null 2>&1 || return 1
|
||||
|
||||
$app --version 2>&1 |
|
||||
sed -n '# Move version to start of line.
|
||||
@@ -459,7 +447,6 @@ check_versions() {
|
||||
test "$appvar" = TAR && appvar=AMTAR
|
||||
case $appvar in
|
||||
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||
PERL::*) ;; # Keep perl modules as-is
|
||||
*) eval "app=\${$appvar-$app}" ;;
|
||||
esac
|
||||
|
||||
@@ -477,22 +464,12 @@ check_versions() {
|
||||
ret=1
|
||||
continue
|
||||
} ;;
|
||||
# Another check is for perl modules. These can be written as
|
||||
# e.g. perl::XML::XPath in case of XML::XPath module, etc.
|
||||
perl::*)
|
||||
# Extract module name
|
||||
app="${app#perl::}"
|
||||
if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
|
||||
warn_ "Error: perl module '$app' not found"
|
||||
ret=1
|
||||
fi
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
if [ "$req_ver" = "-" ]; then
|
||||
# Merely require app to exist; not all prereq apps are well-behaved
|
||||
# so we have to rely on $? rather than get_version.
|
||||
if ! check_exists --verbose $app; then
|
||||
$app --version >/dev/null 2>&1
|
||||
if [ 126 -le $? ]; then
|
||||
warn_ "Error: '$app' not found"
|
||||
ret=1
|
||||
fi
|
||||
@@ -525,12 +502,6 @@ print_versions() {
|
||||
# can't depend on column -t
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
|
||||
# Also find the compatible sha1 utility on the BSDs
|
||||
if test x"$SKIP_PO" = x; then
|
||||
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
|
||||
fi
|
||||
|
||||
use_libtool=0
|
||||
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||
@@ -576,21 +547,13 @@ if ! printf "$buildreq" | check_versions; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Warn the user if autom4te appears to be broken; this causes known
|
||||
# issues with at least gettext 0.18.3.
|
||||
probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
|
||||
if test "x$probe" != xhi; then
|
||||
warn_ "WARNING: your autom4te wrapper eats stdin;"
|
||||
warn_ "if bootstrap fails, consider upgrading your autotools"
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
|
||||
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||
if $use_git && test -d .git && check_exists git; then
|
||||
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
|
||||
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||
:
|
||||
elif check_exists git-merge-changelog; then
|
||||
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
|
||||
echo "$0: initializing git-merge-changelog driver"
|
||||
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||
@@ -610,21 +573,17 @@ git_modules_config () {
|
||||
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||
}
|
||||
|
||||
if $use_git; then
|
||||
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||
fi
|
||||
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||
|
||||
# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
|
||||
# submodule, for use in the rest of the script.
|
||||
# Get gnulib files.
|
||||
|
||||
case ${GNULIB_SRCDIR--} in
|
||||
-)
|
||||
# Note that $use_git is necessarily true in this case.
|
||||
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule init -- "$gnulib_path" || exit $?
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
git submodule init || exit $?
|
||||
git submodule update || exit $?
|
||||
|
||||
elif [ ! -d "$gnulib_path" ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
@@ -641,8 +600,8 @@ case ${GNULIB_SRCDIR--} in
|
||||
GNULIB_SRCDIR=$gnulib_path
|
||||
;;
|
||||
*)
|
||||
# Use GNULIB_SRCDIR directly or as a reference.
|
||||
if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
|
||||
# Use GNULIB_SRCDIR as a reference.
|
||||
if test -d "$GNULIB_SRCDIR"/.git && \
|
||||
git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
if git submodule -h|grep -- --reference > /dev/null; then
|
||||
@@ -653,14 +612,13 @@ case ${GNULIB_SRCDIR--} in
|
||||
# This fallback allows at least git 1.5.5.
|
||||
if test -f "$gnulib_path"/gnulib-tool; then
|
||||
# Since file already exists, assume submodule init already complete.
|
||||
git submodule update -- "$gnulib_path" || exit $?
|
||||
git submodule update || exit $?
|
||||
else
|
||||
# Older git can't clone into an empty directory.
|
||||
rmdir "$gnulib_path" 2>/dev/null
|
||||
git clone --reference "$GNULIB_SRCDIR" \
|
||||
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||
&& git submodule init -- "$gnulib_path" \
|
||||
&& git submodule update -- "$gnulib_path" \
|
||||
&& git submodule init && git submodule update \
|
||||
|| exit $?
|
||||
fi
|
||||
fi
|
||||
@@ -669,19 +627,12 @@ case ${GNULIB_SRCDIR--} in
|
||||
;;
|
||||
esac
|
||||
|
||||
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
||||
# we no longer need to use git or $gnulib_path below here.
|
||||
|
||||
if $bootstrap_sync; then
|
||||
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
|
||||
echo "$0: updating bootstrap and restarting..."
|
||||
case $(sh -c 'echo "$1"' -- a) in
|
||||
a) ignored=--;;
|
||||
*) ignored=ignored;;
|
||||
esac
|
||||
exec sh -c \
|
||||
'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||
$ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
||||
-- "$GNULIB_SRCDIR/build-aux/bootstrap" \
|
||||
"$0" "$@" --no-bootstrap-sync
|
||||
}
|
||||
fi
|
||||
@@ -729,10 +680,11 @@ update_po_files() {
|
||||
cksum_file="$ref_po_dir/$po.s1"
|
||||
if ! test -f "$cksum_file" ||
|
||||
! test -f "$po_dir/$po.po" ||
|
||||
! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
|
||||
! $SHA1SUM -c --status "$cksum_file" \
|
||||
< "$new_po" > /dev/null; then
|
||||
echo "$me: updated $po_dir/$po.po..."
|
||||
cp "$new_po" "$po_dir/$po.po" \
|
||||
&& $SHA1SUM < "$new_po" > "$cksum_file" || return
|
||||
&& $SHA1SUM < "$new_po" > "$cksum_file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2013 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
|
||||
@@ -34,8 +34,7 @@ gnulib_modules='
|
||||
readme-release
|
||||
realloc-posix
|
||||
spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
|
||||
unistd unistd-safer unlink unlocked-io
|
||||
update-copyright unsetenv verify
|
||||
unistd unistd-safer unlocked-io update-copyright unsetenv verify
|
||||
warnings
|
||||
xalloc
|
||||
xalloc-die
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2012-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2013 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
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
# option. It specifies what changes to make to each given SHA1's commit
|
||||
# log and metadata, using Perl-eval'able expressions.
|
||||
|
||||
975bb564319aa4f4204c48aba265757ba207a80f
|
||||
s/Edligner/Edlinger/;
|
||||
|
||||
0db2648930e3b6c376a539aabe368aade83ee29a
|
||||
s/--flags/--feature/;
|
||||
s/flag_flag/feature_flag/;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Linux seattle 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012
|
||||
# x86_64 GNU/Linux
|
||||
{
|
||||
index
|
||||
Memcheck:Cond
|
||||
fun:index
|
||||
fun:expand_dynamic_string_token
|
||||
fun:_dl_map_object
|
||||
fun:map_doit
|
||||
fun:_dl_catch_error
|
||||
fun:do_preload
|
||||
fun:dl_main
|
||||
fun:_dl_sysdep_start
|
||||
fun:_dl_start
|
||||
obj:/lib/ld-2.11.3.so
|
||||
}
|
||||
+3
-2
@@ -1,4 +1,6 @@
|
||||
# Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
||||
## Makefile for Bison testsuite.
|
||||
|
||||
# Copyright (C) 2000-2013 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
|
||||
@@ -16,7 +18,6 @@
|
||||
EXTRA_DIST += \
|
||||
build-aux/cross-options.pl \
|
||||
build-aux/darwin11.4.0.valgrind \
|
||||
build-aux/linux-gnu.valgrind \
|
||||
build-aux/move-if-change \
|
||||
build-aux/prev-version.txt \
|
||||
build-aux/update-b4-copyright
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Update b4_copyright invocations or b4_copyright_years definitions to
|
||||
# include the current year.
|
||||
|
||||
# Copyright (C) 2009-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2013 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# In configure.ac, update PACKAGE_COPYRIGHT_YEAR to the current year.
|
||||
|
||||
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2010-2013 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Customize maint.mk -*- makefile -*-
|
||||
# Copyright (C) 2008-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2008-2013 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
|
||||
@@ -135,7 +135,7 @@ _sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments))
|
||||
|
||||
_space_before_paren_exempt =? \\n\\$$
|
||||
_space_before_paren_exempt = \
|
||||
(^ *\#|(LA)?LR\([01]\)|percent_(code|define)|b4_syncline|m4_(define|init)|symbol)
|
||||
(^ *\#|\\n\\$$|%s\(to %s|(date|group|character)\(s\))
|
||||
# Ensure that there is a space before each open parenthesis in C code.
|
||||
sc_space_before_open_paren:
|
||||
@if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then \
|
||||
@@ -175,6 +175,5 @@ $(call exclude, \
|
||||
prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \
|
||||
prohibit_tab_based_indentation=\.(am|mk)$$|^djgpp/|^\.git \
|
||||
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
|
||||
space_before_open_paren=^(data/|djgpp/) \
|
||||
unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \
|
||||
)
|
||||
|
||||
+29
-35
@@ -1,6 +1,6 @@
|
||||
# Configure template for GNU Bison. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2001-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 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
|
||||
@@ -18,7 +18,7 @@
|
||||
# In order for some versions of Sun Studio to compile our C++ test cases
|
||||
# correctly, we need Autoconf 2.64 or better to handle the restrict
|
||||
# keyword in at least string.h from gnulib. We need Autoconf 2.68 or
|
||||
# better to avoid a typo in the 'configure --help' entry for the YACC
|
||||
# better to avoid a typo in the `configure --help' entry for the YACC
|
||||
# environment variable.
|
||||
AC_PREREQ([2.68])
|
||||
m4_pattern_forbid([^gl_[A-Z]])
|
||||
@@ -26,14 +26,18 @@ m4_pattern_forbid([^gl_[A-Z]])
|
||||
AC_INIT([GNU Bison],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[[email protected]])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2015])
|
||||
AC_SUBST([PACKAGE_COPYRIGHT_YEAR], [2013])
|
||||
AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR],
|
||||
[The copyright year for this package])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# We use Automake 1.14's %D% and %C%.
|
||||
# Automake 1.10.3 and 1.11.1 fix a security flaw discussed here:
|
||||
#
|
||||
# http://thread.gmane.org/gmane.comp.sysutils.autotools.announce/131
|
||||
#
|
||||
# To avoid 1.11, we make 1.11.1 the minimum version.
|
||||
#
|
||||
# We want gnits strictness only when rolling a stable release. For
|
||||
# release candidates, we use version strings like 2.4.3_rc1, but gnits
|
||||
@@ -41,7 +45,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
# releases, we want to be able run make dist without being required to
|
||||
# add a bogus NEWS entry. In that case, the version string
|
||||
# automatically contains a dash, which we also let disable gnits.
|
||||
AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc
|
||||
AM_INIT_AUTOMAKE([1.11.1 dist-xz nostdinc
|
||||
color-tests parallel-tests
|
||||
silent-rules]
|
||||
m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]],
|
||||
@@ -71,17 +75,14 @@ AC_CACHE_CHECK([whether pragma GCC diagnostic push works],
|
||||
CFLAGS=$save_CFLAGS])
|
||||
|
||||
AC_ARG_ENABLE([gcc-warnings],
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended).
|
||||
Also, issue synclines from the examples/ to
|
||||
the corresponding source in the Texinfo doc.],
|
||||
[ --enable-gcc-warnings turn on lots of GCC warnings (not recommended)],
|
||||
[case $enable_gcc_warnings in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([invalid value for --gcc-warnings: $enable_gcc_warnings]);;
|
||||
esac],
|
||||
[enable_gcc_warnings=no])
|
||||
AM_CONDITIONAL([ENABLE_GCC_WARNINGS], [test "$enable_gcc_warnings" = yes])
|
||||
if test "$enable_gcc_warnings" = yes; then
|
||||
warn_common='-Wall-Wextra -Wno-sign-compare -Wcast-align -Wdocumentation
|
||||
warn_common='-Wall -Wextra -Wno-sign-compare -Wcast-align
|
||||
-Wformat -Wpointer-arith -Wwrite-strings'
|
||||
warn_c='-Wbad-function-cast -Wshadow -Wstrict-prototypes'
|
||||
warn_cxx='-Wnoexcept'
|
||||
@@ -90,7 +91,7 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
# -fno-color-diagnostics: Clang's use of colors in the error
|
||||
# messages is confusing the tests looking at the compiler's output
|
||||
# (e.g., synclines.at).
|
||||
warn_tests='-Wundef -pedantic -Wsign-compare -fno-color-diagnostics'
|
||||
warn_tests='-Wundef -pedantic -fno-color-diagnostics'
|
||||
|
||||
AC_LANG_PUSH([C])
|
||||
# Clang supports many of GCC's -W options, but only issues warnings
|
||||
@@ -142,11 +143,9 @@ if test "$enable_gcc_warnings" = yes; then
|
||||
gl_WARN_ADD([$i], [WARN_CXXFLAGS_TEST])
|
||||
done
|
||||
# Clang++ 3.2+ reject C code generated by Flex.
|
||||
gl_WARN_ADD([-Wno-null-conversion], [FLEX_SCANNER_CXXFLAGS])
|
||||
# So does G++ 4.8...
|
||||
gl_WARN_ADD([-Wno-sign-compare], [FLEX_SCANNER_CXXFLAGS])
|
||||
# ... possiby in std=c++11 mode.
|
||||
gl_WARN_ADD([-Wno-zero-as-null-pointer-constant], [FLEX_SCANNER_CXXFLAGS])
|
||||
gl_WARN_ADD([-Wno-null-conversion], [WARN_NO_NULL_CONVERSION_CXXFLAGS])
|
||||
# Variants break strict aliasing analysis.
|
||||
gl_WARN_ADD([-fno-strict-aliasing], [NO_STRICT_ALIAS_CXXFLAGS])
|
||||
CXXFLAGS=$save_CXXFLAGS
|
||||
AC_LANG_POP([C++])
|
||||
fi
|
||||
@@ -160,17 +159,21 @@ AC_ARG_ENABLE([yacc],
|
||||
[AC_HELP_STRING([--disable-yacc],
|
||||
[do not build a yacc command or an -ly library])],
|
||||
, [enable_yacc=yes])
|
||||
AM_CONDITIONAL([ENABLE_YACC], [test "$enable_yacc" = yes])
|
||||
case $enable_yacc in
|
||||
yes)
|
||||
YACC_SCRIPT=src/yacc
|
||||
YACC_LIBRARY=lib/liby.a;;
|
||||
*)
|
||||
YACC_SCRIPT=
|
||||
YACC_LIBRARY=;;
|
||||
esac
|
||||
AC_SUBST([YACC_SCRIPT])
|
||||
AC_SUBST([YACC_LIBRARY])
|
||||
|
||||
# Checks for programs.
|
||||
AM_MISSING_PROG([DOT], [dot])
|
||||
AC_PROG_LEX
|
||||
$LEX_IS_FLEX || test "X$LEX" = X: || {
|
||||
AC_MSG_WARN([bypassing lex because flex is required])
|
||||
LEX=:
|
||||
}
|
||||
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
||||
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
||||
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
|
||||
AC_PROG_YACC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_GNU_M4
|
||||
@@ -217,7 +220,7 @@ AC_SUBST([aclocaldir])
|
||||
AC_CONFIG_FILES([etc/bench.pl], [chmod +x etc/bench.pl])
|
||||
|
||||
# Initialize the test suite.
|
||||
AC_CONFIG_TESTDIR(tests)
|
||||
AC_CONFIG_TESTDIR([tests], [$ac_abs_top_builddir/tests])
|
||||
AC_CONFIG_FILES([tests/atlocal])
|
||||
AC_CONFIG_FILES([tests/bison], [chmod +x tests/bison])
|
||||
AC_CHECK_PROGS([VALGRIND], [valgrind])
|
||||
@@ -225,21 +228,12 @@ case $VALGRIND:$host_os in
|
||||
'':*) ;;
|
||||
*:darwin*)
|
||||
# See README-hacking.
|
||||
# VALGRIND+='-q --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind'
|
||||
# VALGRIND+=' --suppressions=$(abs_top_srcdir)/build-aux/darwin11.4.0.valgrind'
|
||||
VALGRIND=;;
|
||||
*:*)
|
||||
suppfile=build-aux/$host_os.valgrind
|
||||
if test -f "$srcdir/$suppfile"; then
|
||||
VALGRIND="$VALGRIND --gen-suppressions=all"
|
||||
VALGRIND="$VALGRIND --suppressions=\$(abs_top_srcdir)/$suppfile"
|
||||
fi
|
||||
AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"])
|
||||
;;
|
||||
AC_SUBST([VALGRIND_PREBISON], ["$VALGRIND -q"]);;
|
||||
esac
|
||||
|
||||
# Whether we cannot run the compiled bison.
|
||||
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
||||
|
||||
AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
||||
# Needed by tests/atlocal.in.
|
||||
AC_SUBST([GCC])
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ Currently, the supported skeletons are:
|
||||
These skeletons are the only ones supported by the Bison team.
|
||||
Because the interface between skeletons and the bison program is not
|
||||
finished, *we are not bound to it*. In particular, Bison is not
|
||||
mature enough for us to consider that "foreign skeletons" are
|
||||
mature enough for us to consider that ``foreign skeletons'' are
|
||||
supported.
|
||||
|
||||
* m4sugar
|
||||
@@ -52,7 +52,7 @@ into various formats.
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2008-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2008-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bison.
|
||||
|
||||
|
||||
+29
-145
@@ -2,7 +2,7 @@
|
||||
|
||||
# Language-independent M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004-2013 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
|
||||
@@ -85,20 +85,6 @@ m4_changecom([#])
|
||||
])
|
||||
|
||||
|
||||
# b4_divert_kill(CODE)
|
||||
# --------------------
|
||||
# Expand CODE for its side effects, discard its output.
|
||||
m4_define([b4_divert_kill],
|
||||
[m4_divert_text([KILL], [$1])])
|
||||
|
||||
|
||||
# b4_define_silent(MACRO, CODE)
|
||||
# -----------------------------
|
||||
# Same as m4_define, but throw away the expansion of CODE.
|
||||
m4_define([b4_define_silent],
|
||||
[m4_define([$1], [b4_divert_kill([$2])])])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Error handling. ##
|
||||
## ---------------- ##
|
||||
@@ -327,7 +313,7 @@ m4_define([b4_define_flag_if],
|
||||
# _b4_define_flag_if($1, $2, FLAG)
|
||||
# --------------------------------
|
||||
# Work around the impossibility to define macros inside macros,
|
||||
# because issuing '[$1]' is not possible in M4. GNU M4 should provide
|
||||
# because issuing `[$1]' is not possible in M4. GNU M4 should provide
|
||||
# $$1 a la M5/TeX.
|
||||
m4_define([_b4_define_flag_if],
|
||||
[m4_if([$1$2], $[1]$[2], [],
|
||||
@@ -361,7 +347,6 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
# Whether the symbol has an id.
|
||||
# - id: string
|
||||
# If has_id, the id. Guaranteed to be usable as a C identifier.
|
||||
# Prefixed by api.token.prefix if defined.
|
||||
# - tag: string.
|
||||
# A representat of the symbol. Can be 'foo', 'foo.id', '"foo"' etc.
|
||||
# - user_number: integer
|
||||
@@ -372,13 +357,9 @@ b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
# The internalized number (used after yytranslate).
|
||||
# - has_type: 0, 1
|
||||
# Whether has a semantic value.
|
||||
# - type_tag: string
|
||||
# When api.value.type=union, the generated name for the union member.
|
||||
# yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc.
|
||||
# - type
|
||||
# If it has a semantic value, its type tag, or, if variant are used,
|
||||
# its type.
|
||||
# In the case of api.value.type=union, type is the real type (e.g. int).
|
||||
# - has_printer: 0, 1
|
||||
# - printer: string
|
||||
# - printer_file: string
|
||||
@@ -461,24 +442,6 @@ m4_define([b4_symbol_destructor], [b4_symbol_action([$1], [destructor])])
|
||||
m4_define([b4_symbol_printer], [b4_symbol_action([$1], [printer])])
|
||||
|
||||
|
||||
# b4_symbol_actions(KIND, [TYPE = yytype])
|
||||
# ----------------------------------------
|
||||
# Emit the symbol actions for KIND ("printer" or "destructor").
|
||||
# Dispatch on TYPE.
|
||||
m4_define([b4_symbol_actions],
|
||||
[m4_pushdef([b4_actions_], m4_expand([b4_symbol_foreach([b4_symbol_$1])]))dnl
|
||||
m4_ifval(m4_defn([b4_actions_]),
|
||||
[switch (m4_default([$2], [yytype]))
|
||||
{
|
||||
m4_defn([b4_actions_])
|
||||
default:
|
||||
break;
|
||||
}dnl
|
||||
],
|
||||
[YYUSE (m4_default([$2], [yytype]));])dnl
|
||||
m4_popdef([b4_actions_])dnl
|
||||
])
|
||||
|
||||
# b4_symbol_case_(SYMBOL-NUM)
|
||||
# ---------------------------
|
||||
# Issue a "case NUM" for SYMBOL-NUM.
|
||||
@@ -614,14 +577,14 @@ m4_define([b4_define_user_code],
|
||||
# b4_user_initial_action
|
||||
# b4_user_post_prologue
|
||||
# b4_user_pre_prologue
|
||||
# b4_user_union_members
|
||||
# b4_user_stype
|
||||
# ----------------------
|
||||
# Macros that issue user code, ending with synclines.
|
||||
b4_define_user_code([actions])
|
||||
b4_define_user_code([initial_action])
|
||||
b4_define_user_code([post_prologue])
|
||||
b4_define_user_code([pre_prologue])
|
||||
b4_define_user_code([union_members])
|
||||
b4_define_user_code([stype])
|
||||
|
||||
|
||||
# b4_check_user_names(WHAT, USER-LIST, BISON-NAMESPACE)
|
||||
@@ -702,9 +665,9 @@ m4_define([b4_percent_define_use],
|
||||
# b4_percent_define_get([[foo]])
|
||||
m4_define([b4_percent_define_get],
|
||||
[b4_percent_define_use([$1])dnl
|
||||
b4_percent_define_ifdef_([$1],
|
||||
[m4_indir([b4_percent_define(]$1[)])],
|
||||
[$2])])
|
||||
m4_ifdef([b4_percent_define(]$1[)],
|
||||
[m4_indir([b4_percent_define(]$1[)])],
|
||||
[$2])])
|
||||
|
||||
# b4_percent_define_get_loc(VARIABLE)
|
||||
# -----------------------------------
|
||||
@@ -723,21 +686,7 @@ m4_define([b4_percent_define_get_loc],
|
||||
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
|
||||
b4_loc[]dnl
|
||||
m4_popdef([b4_loc])],
|
||||
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||
|
||||
# b4_percent_define_get_kind(VARIABLE)
|
||||
# ------------------------------------
|
||||
# Get the kind (code, keyword, string) of VARIABLE, i.e., how its
|
||||
# value was defined (braces, not delimiters, quotes).
|
||||
#
|
||||
# If the %define variable VARIABLE is undefined, complain fatally
|
||||
# since that's a Bison or skeleton error. Don't record this as a
|
||||
# Bison usage of VARIABLE as there's no reason to suspect that the
|
||||
# user-supplied value has yet influenced the output.
|
||||
m4_define([b4_percent_define_get_kind],
|
||||
[m4_ifdef([b4_percent_define_kind(]$1[)],
|
||||
[m4_indir([b4_percent_define_kind(]$1[)])],
|
||||
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||
[b4_fatal([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$1])])])
|
||||
|
||||
# b4_percent_define_get_syncline(VARIABLE)
|
||||
# ----------------------------------------
|
||||
@@ -754,20 +703,7 @@ m4_define([b4_percent_define_get_kind],
|
||||
m4_define([b4_percent_define_get_syncline],
|
||||
[m4_ifdef([b4_percent_define_syncline(]$1[)],
|
||||
[m4_indir([b4_percent_define_syncline(]$1[)])],
|
||||
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||
|
||||
# b4_percent_define_ifdef_(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||
# ------------------------------------------------------
|
||||
# If the %define variable VARIABLE is defined, expand IF-TRUE, else expand
|
||||
# IF-FALSE. Don't record usage of VARIABLE.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# b4_percent_define_ifdef_([[foo]], [[it's defined]], [[it's undefined]])
|
||||
m4_define([b4_percent_define_ifdef_],
|
||||
[m4_ifdef([b4_percent_define(]$1[)],
|
||||
[$2],
|
||||
[$3])])
|
||||
[b4_fatal([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$1])])])
|
||||
|
||||
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
|
||||
# ------------------------------------------------------
|
||||
@@ -780,9 +716,9 @@ m4_define([b4_percent_define_ifdef_],
|
||||
#
|
||||
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
|
||||
m4_define([b4_percent_define_ifdef],
|
||||
[b4_percent_define_ifdef_([$1],
|
||||
[b4_percent_define_use([$1])$2],
|
||||
[$3])])
|
||||
[m4_ifdef([b4_percent_define(]$1[)],
|
||||
[b4_percent_define_use([$1])$2],
|
||||
[$3])])
|
||||
|
||||
|
||||
## --------- ##
|
||||
@@ -811,11 +747,11 @@ m4_define([b4_percent_define_flag_if],
|
||||
[[invalid value for %%define Boolean variable '%s']],
|
||||
[$1])],
|
||||
[[b4_percent_define_flag_if($1)]])])],
|
||||
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||
[b4_fatal([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$1])])])
|
||||
|
||||
|
||||
# b4_percent_define_default(VARIABLE, DEFAULT, [KIND = keyword])
|
||||
# --------------------------------------------------------------
|
||||
# b4_percent_define_default(VARIABLE, DEFAULT)
|
||||
# --------------------------------------------
|
||||
# Mimic muscle_percent_define_default in ../src/muscle-tab.h exactly. That is,
|
||||
# if the %define variable VARIABLE is undefined, set its value to DEFAULT.
|
||||
# Don't record this as a Bison usage of VARIABLE as there's no reason to
|
||||
@@ -825,10 +761,8 @@ m4_define([b4_percent_define_flag_if],
|
||||
#
|
||||
# b4_percent_define_default([[foo]], [[default value]])
|
||||
m4_define([b4_percent_define_default],
|
||||
[b4_percent_define_ifdef_([$1], [],
|
||||
[m4_ifndef([b4_percent_define(]$1[)],
|
||||
[m4_define([b4_percent_define(]$1[)], [$2])dnl
|
||||
m4_define([b4_percent_define_kind(]$1[)],
|
||||
[m4_default([$3], [keyword])])dnl
|
||||
m4_define([b4_percent_define_loc(]$1[)],
|
||||
[[[[<skeleton default value>:-1.-1]],
|
||||
[[<skeleton default value>:-1.-1]]]])dnl
|
||||
@@ -838,8 +772,8 @@ m4_define([b4_percent_define_default],
|
||||
# b4_percent_define_if_define(NAME, [VARIABLE = NAME])
|
||||
# ----------------------------------------------------
|
||||
# Define b4_NAME_if that executes its $1 or $2 depending whether
|
||||
# VARIABLE was %defined. The characters '.' and `-' in VARIABLE are mapped
|
||||
# to '_'.
|
||||
# VARIABLE was %defined. The characters `.' and `-' in VARIABLE are mapped
|
||||
# to `_'.
|
||||
m4_define([b4_percent_define_if_define_],
|
||||
[m4_define(m4_bpatsubst([b4_$1_if], [[-.]], [_]),
|
||||
[b4_percent_define_flag_if(m4_default([$2], [$1]),
|
||||
@@ -849,21 +783,6 @@ m4_define([b4_percent_define_if_define],
|
||||
b4_percent_define_if_define_([$1], [$2], $[1], $[2])])
|
||||
|
||||
|
||||
# b4_percent_define_check_kind(VARIABLE, KIND, [DIAGNOSTIC = complain])
|
||||
# ---------------------------------------------------------------------
|
||||
m4_define([b4_percent_define_check_kind],
|
||||
[b4_percent_define_ifdef_([$1],
|
||||
[m4_if(b4_percent_define_get_kind([$1]), [$2], [],
|
||||
[b4_error([m4_default([$3], [complain])],
|
||||
b4_percent_define_get_loc([$1]),
|
||||
[m4_case([$2],
|
||||
[code], [[%%define variable '%s' requires '{...}' values]],
|
||||
[keyword], [[%%define variable '%s' requires keyword values]],
|
||||
[string], [[%%define variable '%s' requires '"..."' values]])],
|
||||
[$1])])])dnl
|
||||
])
|
||||
|
||||
|
||||
# b4_percent_define_check_values(VALUES)
|
||||
# --------------------------------------
|
||||
# Mimic muscle_percent_define_check_values in ../src/muscle-tab.h exactly
|
||||
@@ -885,9 +804,8 @@ m4_define([b4_percent_define_check_values],
|
||||
[_b4_percent_define_check_values(b4_sublist)])])
|
||||
|
||||
m4_define([_b4_percent_define_check_values],
|
||||
[b4_percent_define_ifdef_([$1],
|
||||
[b4_percent_define_check_kind(]$1[, [keyword], [deprecated])dnl
|
||||
m4_pushdef([b4_good_value], [0])dnl
|
||||
[m4_ifdef([b4_percent_define(]$1[)],
|
||||
[m4_pushdef([b4_good_value], [0])dnl
|
||||
m4_if($#, 1, [],
|
||||
[m4_foreach([b4_value], m4_dquote(m4_shift($@)),
|
||||
[m4_if(m4_indir([b4_percent_define(]$1[)]), b4_value,
|
||||
@@ -902,7 +820,7 @@ m4_define([_b4_percent_define_check_values],
|
||||
[[accepted value: '%s']],
|
||||
m4_dquote(b4_value))])])dnl
|
||||
m4_popdef([b4_good_value])],
|
||||
[b4_fatal([[$0: undefined %%define variable '%s']], [$1])])])
|
||||
[b4_fatal([[b4_percent_define_check_values: undefined %%define variable '%s']], [$1])])])
|
||||
|
||||
# b4_percent_code_get([QUALIFIER])
|
||||
# --------------------------------
|
||||
@@ -943,6 +861,10 @@ m4_define([b4_percent_code_ifdef],
|
||||
## Common variables. ##
|
||||
## ------------------ ##
|
||||
|
||||
# Default values for %define.
|
||||
# ---------------------------
|
||||
# If the api.token.prefix, it is empty.
|
||||
m4_percent_define_default([[api.token.prefix]], [[]])
|
||||
|
||||
# b4_parse_assert_if([IF-ASSERTIONS-ARE-USED], [IF-NOT])
|
||||
# b4_parse_trace_if([IF-DEBUG-TRACES-ARE-ENABLED], [IF-NOT])
|
||||
@@ -982,11 +904,9 @@ b4_error_verbose_if([m4_define([b4_token_table_flag], [1])])
|
||||
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
|
||||
# ----------------------------------------------
|
||||
b4_percent_define_if_define([variant])
|
||||
m4_define([b4_variant_flag], [[0]])
|
||||
b4_percent_define_ifdef([[api.value.type]],
|
||||
[m4_case(b4_percent_define_get_kind([[api.value.type]]), [keyword],
|
||||
[m4_case(b4_percent_define_get([[api.value.type]]), [variant],
|
||||
[m4_define([b4_variant_flag], [[1]])])])])
|
||||
m4_case(b4_percent_define_get([[api.value.type]]),
|
||||
[variant], [m4_define([b4_variant_flag], [[1]])],
|
||||
[m4_define([b4_variant_flag], [[0]])])
|
||||
b4_define_flag_if([variant])
|
||||
|
||||
|
||||
@@ -1021,46 +941,10 @@ m4_define_default([b4_parse_param], [])
|
||||
m4_define_default([b4_location_initial_column], [1])
|
||||
m4_define_default([b4_location_initial_line], [1])
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Sanity checks. ##
|
||||
## --------------- ##
|
||||
|
||||
# api.location.prefix={...} (Java and C++).
|
||||
b4_percent_define_check_kind([api.location.type], [code], [deprecated])
|
||||
|
||||
# api.position.prefix={...} (Java).
|
||||
b4_percent_define_check_kind([api.position.type], [code], [deprecated])
|
||||
|
||||
# api.prefix >< %name-prefix.
|
||||
b4_percent_define_check_kind([api.prefix], [code], [deprecated])
|
||||
# Sanity checks.
|
||||
b4_percent_define_ifdef([api.prefix],
|
||||
[m4_ifdef([b4_prefix],
|
||||
[b4_complain_at(b4_percent_define_get_loc([api.prefix]),
|
||||
[['%s' and '%s' cannot be used together]],
|
||||
[%name-prefix],
|
||||
[%define api.prefix])])])
|
||||
|
||||
# api.token.prefix={...}
|
||||
# Make it a warning for those who used betas of Bison 3.0.
|
||||
b4_percent_define_check_kind([api.token.prefix], [code], [deprecated])
|
||||
|
||||
# api.value.type >< %union.
|
||||
b4_percent_define_ifdef([api.value.type],
|
||||
[m4_ifdef([b4_union_members],
|
||||
[b4_complain_at(b4_percent_define_get_loc([api.value.type]),
|
||||
[['%s' and '%s' cannot be used together]],
|
||||
[%union],
|
||||
[%define api.value.type])])])
|
||||
|
||||
# api.value.type=union >< %yacc.
|
||||
b4_percent_define_ifdef([api.value.type],
|
||||
[m4_if(b4_percent_define_get([api.value.type]), [union],
|
||||
[b4_yacc_if(dnl
|
||||
[b4_complain_at(b4_percent_define_get_loc([api.value.type]),
|
||||
[['%s' and '%s' cannot be used together]],
|
||||
[%yacc],
|
||||
[%define api.value.type "union"])])])])
|
||||
|
||||
# api.value.union.name.
|
||||
b4_percent_define_check_kind([api.value.union.name], [keyword])
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2007, 2009-2013 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
|
||||
|
||||
+22
-86
@@ -2,7 +2,7 @@
|
||||
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -17,11 +17,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Sanity checks, before defaults installed by c.m4.
|
||||
b4_percent_define_ifdef([[api.value.union.name]],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[api.value.union.name]]),
|
||||
[named %union is invalid in C++])])
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
# b4_comment(TEXT, [PREFIX])
|
||||
@@ -30,12 +25,6 @@ m4_include(b4_pkgdatadir/[c.m4])
|
||||
m4_define([b4_comment],
|
||||
[b4_comment_([$1], [$2// ], [$2// ])])
|
||||
|
||||
## -------- ##
|
||||
## Checks. ##
|
||||
## -------- ##
|
||||
|
||||
b4_percent_define_check_kind([api.namespace], [code], [deprecated])
|
||||
b4_percent_define_check_kind([parser_class_name], [code], [deprecated])
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
@@ -49,7 +38,6 @@ b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||
# b4_percent_define_default([[api.location.type]], [[location]])
|
||||
|
||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||
# Make it a warning for those who used betas of Bison 3.0.
|
||||
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
||||
|
||||
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])
|
||||
@@ -66,8 +54,8 @@ b4_percent_define_default([[define_location_comparison]],
|
||||
m4_define([b4_namespace_ref], [b4_percent_define_get([[api.namespace]])])
|
||||
|
||||
|
||||
# Don't permit an empty b4_namespace_ref. Any '::parser::foo' appended to it
|
||||
# would compile as an absolute reference with 'parser' in the global namespace.
|
||||
# Don't permit an empty b4_namespace_ref. Any `::parser::foo' appended to it
|
||||
# would compile as an absolute reference with `parser' in the global namespace.
|
||||
# b4_namespace_open would open an anonymous namespace and thus establish
|
||||
# internal linkage. This would compile. However, it's cryptic, and internal
|
||||
# linkage for the parser would be specified in all translation units that
|
||||
@@ -124,24 +112,19 @@ m4_define([b4_token_enums],
|
||||
## Semantic Values. ##
|
||||
## ----------------- ##
|
||||
|
||||
|
||||
|
||||
# b4_value_type_declare
|
||||
# ---------------------
|
||||
# b4_semantic_type_declare
|
||||
# ------------------------
|
||||
# Declare semantic_type.
|
||||
m4_define([b4_value_type_declare],
|
||||
[b4_value_type_setup[]dnl
|
||||
m4_define([b4_semantic_type_declare],
|
||||
[ /// Symbol semantic values.
|
||||
]m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||
[code],
|
||||
[[ typedef ]b4_percent_define_get([[api.value.type]])[ semantic_type;]],
|
||||
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
||||
[union\|union-directive],
|
||||
[[ union semantic_type
|
||||
m4_ifdef([b4_stype],
|
||||
[ union semantic_type
|
||||
{
|
||||
]b4_user_union_members[
|
||||
};]])])dnl
|
||||
])
|
||||
b4_user_stype
|
||||
};],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[ typedef int semantic_type;]],
|
||||
[[ typedef ]b4_api_PREFIX[STYPE semantic_type;]])])])
|
||||
|
||||
|
||||
# b4_public_types_declare
|
||||
@@ -150,7 +133,7 @@ m4_define([b4_value_type_declare],
|
||||
# Depending on %define token_lex, may be output in the header or source file.
|
||||
m4_define([b4_public_types_declare],
|
||||
[[#ifndef ]b4_api_PREFIX[STYPE
|
||||
]b4_value_type_declare[
|
||||
]b4_semantic_type_declare[
|
||||
#else
|
||||
typedef ]b4_api_PREFIX[STYPE semantic_type;
|
||||
#endif]b4_locations_if([
|
||||
@@ -174,12 +157,9 @@ m4_define([b4_public_types_declare],
|
||||
/// (External) token type, as returned by yylex.
|
||||
typedef token::yytokentype token_type;
|
||||
|
||||
/// Symbol type: an internal symbol number.
|
||||
/// Internal symbol number.
|
||||
typedef int symbol_number_type;
|
||||
|
||||
/// The symbol type number to denote an empty symbol.
|
||||
enum { empty_symbol = -2 };
|
||||
|
||||
/// Internal symbol number for tokens (subsumed by symbol_number_type).
|
||||
typedef ]b4_int_type_for([b4_translate])[ token_number_type;
|
||||
|
||||
@@ -212,15 +192,8 @@ m4_define([b4_public_types_declare],
|
||||
const semantic_type& v]b4_locations_if([,
|
||||
const location_type& l])[);
|
||||
|
||||
/// Destroy the symbol.
|
||||
~basic_symbol ();
|
||||
|
||||
/// Destroy contents, and record that is empty.
|
||||
void clear ();
|
||||
|
||||
/// Whether empty.
|
||||
bool empty () const;
|
||||
|
||||
/// Destructive move, \a s is emptied into this.
|
||||
void move (basic_symbol& s);
|
||||
|
||||
@@ -250,23 +223,21 @@ m4_define([b4_public_types_declare],
|
||||
/// Constructor from (external) token numbers.
|
||||
by_type (kind_type t);
|
||||
|
||||
/// Record that this symbol is empty.
|
||||
void clear ();
|
||||
|
||||
/// Steal the symbol type from \a that.
|
||||
void move (by_type& that);
|
||||
|
||||
/// The (internal) type number (corresponding to \a type).
|
||||
/// \a empty when empty.
|
||||
/// -1 when this symbol is empty.
|
||||
symbol_number_type type_get () const;
|
||||
|
||||
/// The token.
|
||||
token_type token () const;
|
||||
|
||||
enum { empty = 0 };
|
||||
|
||||
/// The symbol type.
|
||||
/// \a empty_symbol when empty.
|
||||
/// An int, not token_number_type, to be able to store empty_symbol.
|
||||
int type;
|
||||
/// -1 when this symbol is empty.
|
||||
token_number_type type;
|
||||
};
|
||||
|
||||
/// "External" symbols: returned by the scanner.
|
||||
@@ -335,18 +306,9 @@ m4_define([b4_public_types_define],
|
||||
template <typename Base>
|
||||
inline
|
||||
]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
|
||||
{
|
||||
clear ();
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::basic_symbol<Base>::clear ()
|
||||
{]b4_variant_if([[
|
||||
// User destructor.
|
||||
symbol_number_type yytype = this->type_get ();
|
||||
basic_symbol<Base>& yysym = *this;
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
@@ -356,15 +318,6 @@ m4_define([b4_public_types_define],
|
||||
|
||||
// Type destructor.
|
||||
]b4_symbol_variant([[yytype]], [[value]], [[template destroy]])])[
|
||||
Base::clear ();
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
inline
|
||||
bool
|
||||
]b4_parser_class_name[::basic_symbol<Base>::empty () const
|
||||
{
|
||||
return Base::type_get () == empty_symbol;
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
@@ -382,7 +335,7 @@ m4_define([b4_public_types_define],
|
||||
// by_type.
|
||||
inline
|
||||
]b4_parser_class_name[::by_type::by_type ()
|
||||
: type (empty_symbol)
|
||||
: type (empty)
|
||||
{}
|
||||
|
||||
inline
|
||||
@@ -395,19 +348,12 @@ m4_define([b4_public_types_define],
|
||||
: type (yytranslate_ (t))
|
||||
{}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_type::clear ()
|
||||
{
|
||||
type = empty_symbol;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_type::move (by_type& that)
|
||||
{
|
||||
type = that.type;
|
||||
that.clear ();
|
||||
that.type = empty;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -574,13 +520,3 @@ m4_define([b4_yylloc_default_define],
|
||||
while (/*CONSTCOND*/ false)
|
||||
# endif
|
||||
]])
|
||||
|
||||
## -------- ##
|
||||
## Checks. ##
|
||||
## -------- ##
|
||||
|
||||
b4_token_ctor_if([b4_variant_if([],
|
||||
[b4_fatal_at(b4_percent_define_get_loc(api.token.constructor),
|
||||
[cannot use '%s' without '%s'],
|
||||
[%define api.token.constructor],
|
||||
[%define api.value.type variant]))])])
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Common code for C-like languages (C, C++, Java, etc.)
|
||||
|
||||
# Copyright (C) 2012-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2013 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
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# C skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2007, 2009-2013 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# C M4 Macros for Bison.
|
||||
|
||||
# Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002, 2004-2013 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
|
||||
@@ -97,8 +97,7 @@ m4_define([b4_api_PREFIX],
|
||||
m4_define_default([b4_prefix], [b4_api_prefix])
|
||||
|
||||
# If the %union is not named, its name is YYSTYPE.
|
||||
b4_percent_define_default([[api.value.union.name]],
|
||||
[b4_api_PREFIX[][STYPE]])
|
||||
m4_define_default([b4_union_name], [b4_api_PREFIX[]STYPE])
|
||||
|
||||
|
||||
## ------------------------ ##
|
||||
@@ -151,7 +150,7 @@ m4_popdef([$1])dnl
|
||||
|
||||
# b4_parse_param_use([VAL], [LOC])
|
||||
# --------------------------------
|
||||
# 'YYUSE' VAL, LOC if locations are enabled, and all the parse-params.
|
||||
# `YYUSE' VAL, LOC if locations are enabled, and all the parse-params.
|
||||
m4_define([b4_parse_param_use],
|
||||
[m4_ifvaln([$1], [ YYUSE ([$1]);])dnl
|
||||
b4_locations_if([m4_ifvaln([$2], [ YYUSE ([$2]);])])dnl
|
||||
@@ -183,7 +182,7 @@ m4_define([b4_int_type],
|
||||
# b4_int_type_for(NAME)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# 'NAME_min' to 'NAME_max' (included).
|
||||
# `NAME_min' to `NAME_max' (included).
|
||||
m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
@@ -200,69 +199,6 @@ m4_define([b4_table_value_equals],
|
||||
[(!!(($2) == ($3)))])])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Compiler issues. ##
|
||||
## ----------------- ##
|
||||
|
||||
# b4_attribute_define
|
||||
# -------------------
|
||||
# Provide portable compiler "attributes".
|
||||
m4_define([b4_attribute_define],
|
||||
[#ifndef YY_ATTRIBUTE
|
||||
# if (defined __GNUC__ \
|
||||
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|
||||
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
|
||||
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
|
||||
# else
|
||||
# define YY_ATTRIBUTE(Spec) /* empty */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef YY_ATTRIBUTE_PURE
|
||||
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
|
||||
#endif
|
||||
|
||||
#ifndef YY_ATTRIBUTE_UNUSED
|
||||
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
||||
#endif
|
||||
|
||||
#if !defined _Noreturn \
|
||||
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
|
||||
# if defined _MSC_VER && 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#if ! defined lint || defined __GNUC__
|
||||
# define YYUSE(E) ((void) (E))
|
||||
#else
|
||||
# define YYUSE(E) /* empty */
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
# define YY_INITIAL_VALUE(Value) Value
|
||||
#endif
|
||||
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
#endif
|
||||
#ifndef YY_INITIAL_VALUE
|
||||
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
||||
#endif
|
||||
])
|
||||
|
||||
|
||||
## ---------##
|
||||
## Values. ##
|
||||
## ---------##
|
||||
@@ -270,14 +206,14 @@ m4_define([b4_attribute_define],
|
||||
|
||||
# b4_null_define
|
||||
# --------------
|
||||
# Portability issues: define a YY_NULLPTR appropriate for the current
|
||||
# Portability issues: define a YY_NULL appropriate for the current
|
||||
# language (C, C++98, or C++11).
|
||||
m4_define([b4_null_define],
|
||||
[# ifndef YY_NULLPTR
|
||||
[# ifndef YY_NULL
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULLPTR nullptr
|
||||
# define YY_NULL nullptr
|
||||
# else
|
||||
# define YY_NULLPTR 0
|
||||
# define YY_NULL 0
|
||||
# endif
|
||||
# endif[]dnl
|
||||
])
|
||||
@@ -286,7 +222,7 @@ m4_define([b4_null_define],
|
||||
# b4_null
|
||||
# -------
|
||||
# Return a null pointer constant.
|
||||
m4_define([b4_null], [YY_NULLPTR])
|
||||
m4_define([b4_null], [YY_NULL])
|
||||
|
||||
# b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
|
||||
# -------------------------------------------------------------
|
||||
@@ -485,9 +421,12 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||
yymsg = "Deleting";
|
||||
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
||||
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
]b4_symbol_actions([destructor])[
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
[ default:
|
||||
break;
|
||||
}
|
||||
}]dnl
|
||||
])
|
||||
|
||||
@@ -497,9 +436,9 @@ m4_ifset([b4_parse_param], [, b4_parse_param]))[
|
||||
# Define the "yy_symbol_print" function.
|
||||
m4_define_default([b4_yy_symbol_print_define],
|
||||
[[
|
||||
/*----------------------------------------.
|
||||
| Print this symbol's value on YYOUTPUT. |
|
||||
`----------------------------------------*/
|
||||
/*--------------------------------.
|
||||
| Print this symbol on YYOUTPUT. |
|
||||
`--------------------------------*/
|
||||
|
||||
]b4_function_define([yy_symbol_value_print],
|
||||
[static void],
|
||||
@@ -520,7 +459,12 @@ m4_if(b4_skeleton, ["yacc.c"],
|
||||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
||||
# endif
|
||||
]])dnl
|
||||
b4_symbol_actions([printer])[
|
||||
[ switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_printer])dnl
|
||||
[ default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -548,155 +492,28 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
|
||||
}]dnl
|
||||
])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## api.value.type. ##
|
||||
## ---------------- ##
|
||||
|
||||
|
||||
# ---------------------- #
|
||||
# api.value.type=union. #
|
||||
# ---------------------- #
|
||||
|
||||
# b4_symbol_type_register(SYMBOL-NUM)
|
||||
# -----------------------------------
|
||||
# Symbol SYMBOL-NUM has a type (for variant) instead of a type-tag.
|
||||
# Extend the definition of %union's body (b4_union_members) with a
|
||||
# field of that type, and extend the symbol's "type" field to point to
|
||||
# the field name, instead of the type name.
|
||||
m4_define([b4_symbol_type_register],
|
||||
[m4_define([b4_symbol($1, type_tag)],
|
||||
[b4_symbol_if([$1], [has_id],
|
||||
[b4_symbol([$1], [id])],
|
||||
[yytype_[]b4_symbol([$1], [number])])])dnl
|
||||
m4_append([b4_union_members],
|
||||
m4_expand([
|
||||
b4_symbol_tag_comment([$1])dnl
|
||||
b4_symbol([$1], [type]) b4_symbol([$1], [type_tag]);]))
|
||||
])
|
||||
|
||||
|
||||
# b4_type_define_tag(SYMBOL1-NUM, ...)
|
||||
# ------------------------------------
|
||||
# For the batch of symbols SYMBOL1-NUM... (which all have the same
|
||||
# type), enhance the %union definition for each of them, and set
|
||||
# there "type" field to the field tag name, instead of the type name.
|
||||
m4_define([b4_type_define_tag],
|
||||
[b4_symbol_if([$1], [has_type],
|
||||
[m4_map([b4_symbol_type_register], [$@])])
|
||||
])
|
||||
|
||||
|
||||
# b4_symbol_value_union(VAL, [TYPE])
|
||||
# ----------------------------------
|
||||
# Same of b4_symbol_value, but when api.value.type=union.
|
||||
m4_define([b4_symbol_value_union],
|
||||
[m4_ifval([$2],
|
||||
[(*($2*)(&$1))],
|
||||
[$1])])
|
||||
])
|
||||
|
||||
|
||||
# b4_value_type_setup_union
|
||||
# -------------------------
|
||||
# Setup support for api.value.type=union. Symbols are defined with a
|
||||
# type instead of a union member name: build the corresponding union,
|
||||
# and give the symbols their tag.
|
||||
m4_define([b4_value_type_setup_union],
|
||||
[m4_define([b4_union_members])
|
||||
b4_type_foreach([b4_type_define_tag])
|
||||
m4_copy_force([b4_symbol_value_union], [b4_symbol_value])
|
||||
])
|
||||
|
||||
|
||||
# -------------------------- #
|
||||
# api.value.type = variant. #
|
||||
# -------------------------- #
|
||||
|
||||
# b4_value_type_setup_variant
|
||||
# ---------------------------
|
||||
# Setup support for api.value.type=variant. By default, fail, specialized
|
||||
# by other skeletons.
|
||||
m4_define([b4_value_type_setup_variant],
|
||||
[b4_complain_at(b4_percent_define_get_loc([[api.value.type]]),
|
||||
[['%s' does not support '%s']],
|
||||
[b4_skeleton],
|
||||
[%define api.value.type variant])])
|
||||
|
||||
|
||||
# _b4_value_type_setup_keyword
|
||||
# ----------------------------
|
||||
# api.value.type is defined with a keyword/string syntax. Check if
|
||||
# that is properly defined, and prepare its use.
|
||||
m4_define([_b4_value_type_setup_keyword],
|
||||
[b4_percent_define_check_values([[[[api.value.type]],
|
||||
[[none]],
|
||||
[[union]],
|
||||
[[union-directive]],
|
||||
[[variant]],
|
||||
[[yystype]]]])dnl
|
||||
m4_case(b4_percent_define_get([[api.value.type]]),
|
||||
[union], [b4_value_type_setup_union],
|
||||
[variant], [b4_value_type_setup_variant])])
|
||||
|
||||
|
||||
# b4_value_type_setup
|
||||
# -------------------
|
||||
# Check if api.value.type is properly defined, and possibly prepare
|
||||
# its use.
|
||||
b4_define_silent([b4_value_type_setup],
|
||||
[# Define default value.
|
||||
b4_percent_define_ifdef([[api.value.type]], [],
|
||||
[# %union => api.value.type=union-directive
|
||||
m4_ifdef([b4_union_members],
|
||||
[m4_define([b4_percent_define_kind(api.value.type)], [keyword])
|
||||
m4_define([b4_percent_define(api.value.type)], [union-directive])],
|
||||
[# no tag seen => api.value.type={int}
|
||||
m4_if(b4_tag_seen_flag, 0,
|
||||
[m4_define([b4_percent_define_kind(api.value.type)], [code])
|
||||
m4_define([b4_percent_define(api.value.type)], [int])],
|
||||
[# otherwise api.value.type=yystype
|
||||
m4_define([b4_percent_define_kind(api.value.type)], [keyword])
|
||||
m4_define([b4_percent_define(api.value.type)], [yystype])])])])
|
||||
|
||||
# Set up.
|
||||
m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||
[keyword\|string], [_b4_value_type_setup_keyword])
|
||||
])
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Declarations. ##
|
||||
## -------------- ##
|
||||
|
||||
|
||||
# b4_value_type_define
|
||||
# --------------------
|
||||
m4_define([b4_value_type_define],
|
||||
[b4_value_type_setup[]dnl
|
||||
/* Value type. */
|
||||
m4_bmatch(b4_percent_define_get_kind([[api.value.type]]),
|
||||
[code],
|
||||
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||
typedef ]b4_percent_define_get([[api.value.type]])[ ]b4_api_PREFIX[STYPE;
|
||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
|
||||
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
||||
#endif
|
||||
]],
|
||||
[m4_bmatch(b4_percent_define_get([[api.value.type]]),
|
||||
[union\|union-directive],
|
||||
[[#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||
]b4_percent_define_get_syncline([[api.value.union.name]])[
|
||||
union ]b4_percent_define_get([[api.value.union.name]])[
|
||||
[[/* Value type. */
|
||||
#if ! defined ]b4_api_PREFIX[STYPE && ! defined ]b4_api_PREFIX[STYPE_IS_DECLARED
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[ ]b4_api_PREFIX[STYPE;
|
||||
union ]b4_union_name[
|
||||
{
|
||||
]b4_user_union_members[
|
||||
]b4_user_stype[
|
||||
};
|
||||
]b4_percent_define_get_syncline([[api.value.union.name]])[
|
||||
typedef union ]b4_percent_define_get([[api.value.union.name]])[ ]b4_api_PREFIX[STYPE;
|
||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1
|
||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int ]b4_api_PREFIX[STYPE;
|
||||
# define ]b4_api_PREFIX[STYPE_IS_TRIVIAL 1]])])[
|
||||
# define ]b4_api_PREFIX[STYPE_IS_DECLARED 1
|
||||
#endif
|
||||
]])])])
|
||||
]])
|
||||
|
||||
|
||||
# b4_location_type_define
|
||||
@@ -732,7 +549,7 @@ b4_pure_if([], [[extern ]b4_api_PREFIX[STYPE ]b4_prefix[lval;
|
||||
|
||||
|
||||
# b4_YYDEBUG_define
|
||||
# -----------------
|
||||
# ------------------
|
||||
m4_define([b4_YYDEBUG_define],
|
||||
[[/* Debug traces. */
|
||||
]m4_if(b4_api_prefix, [yy],
|
||||
@@ -804,7 +621,7 @@ m4_define([b4_yy_location_print_define],
|
||||
|
||||
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
||||
|
||||
YY_ATTRIBUTE_UNUSED
|
||||
__attribute__((__unused__))
|
||||
]b4_function_define([yy_location_print_],
|
||||
[static unsigned],
|
||||
[[FILE *yyo], [yyo]],
|
||||
|
||||
+112
-117
@@ -2,7 +2,7 @@
|
||||
|
||||
# GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -178,42 +178,9 @@ m4_if(b4_skeleton, ["glr.c"],
|
||||
## Output files. ##
|
||||
## -------------- ##
|
||||
|
||||
# Unfortunately the order of generation between the header and the
|
||||
# implementation file matters (for glr.c) because of the current
|
||||
# implementation of api.value.type=union. In that case we still use a
|
||||
# union for YYSTYPE, but we generate the contents of this union when
|
||||
# setting up YYSTYPE. This is needed for other aspects, such as
|
||||
# defining yy_symbol_value_print, since we need to now the name of the
|
||||
# members of this union.
|
||||
#
|
||||
# To avoid this issue, just generate the header before the
|
||||
# implementation file. But we should also make them more independant.
|
||||
|
||||
# ----------------- #
|
||||
# The header file. #
|
||||
# ----------------- #
|
||||
|
||||
# glr.cc produces its own header.
|
||||
m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[b4_output_begin([b4_spec_defines_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2015])[
|
||||
|
||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||
]b4_output_end()
|
||||
])])
|
||||
|
||||
|
||||
# ------------------------- #
|
||||
# The implementation file. #
|
||||
# ------------------------- #
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
||||
[2002-2015])[
|
||||
[2002-2013])[
|
||||
|
||||
/* C GLR parser skeleton written by Paul Hilfinger. */
|
||||
|
||||
@@ -279,6 +246,13 @@ b4_percent_code_get[]dnl
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#ifdef __GNUC__
|
||||
# define YYUSE(E) ((void) (E))
|
||||
#else
|
||||
# define YYUSE(E) /* empty */
|
||||
#endif
|
||||
|
||||
#ifndef YYFREE
|
||||
# define YYFREE free
|
||||
#endif
|
||||
@@ -307,7 +281,17 @@ b4_percent_code_get[]dnl
|
||||
# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
|
||||
#endif
|
||||
|
||||
]b4_attribute_define[
|
||||
/*-----------------.
|
||||
| GCC extensions. |
|
||||
`-----------------*/
|
||||
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if (! defined __GNUC__ || __GNUC__ < 2 \
|
||||
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef YYASSERT
|
||||
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
|
||||
@@ -478,9 +462,9 @@ int yydebug;
|
||||
|
||||
struct yyGLRStack;
|
||||
static void yypstack (struct yyGLRStack* yystackp, size_t yyk)
|
||||
YY_ATTRIBUTE_UNUSED;
|
||||
__attribute__ ((__unused__));
|
||||
static void yypdumpstack (struct yyGLRStack* yystackp)
|
||||
YY_ATTRIBUTE_UNUSED;
|
||||
__attribute__ ((__unused__));
|
||||
|
||||
#else /* !]b4_api_PREFIX[DEBUG */
|
||||
|
||||
@@ -702,15 +686,19 @@ struct yyGLRStack {
|
||||
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
||||
#endif
|
||||
|
||||
static _Noreturn void
|
||||
static void yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||
__attribute__ ((__noreturn__));
|
||||
static void
|
||||
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||
{
|
||||
if (yymsg != YY_NULLPTR)
|
||||
if (yymsg != YY_NULL)
|
||||
yyerror (]b4_yyerror_args[yymsg);
|
||||
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
||||
}
|
||||
|
||||
static _Noreturn void
|
||||
static void yyMemoryExhausted (yyGLRStack* yystackp)
|
||||
__attribute__ ((__noreturn__));
|
||||
static void
|
||||
yyMemoryExhausted (yyGLRStack* yystackp)
|
||||
{
|
||||
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
||||
@@ -731,7 +719,7 @@ yytokenName (yySymbol yytoken)
|
||||
/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
|
||||
* at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
|
||||
* containing the pointer to the next state in the chain. */
|
||||
static void yyfillin (yyGLRStackItem *, int, int) YY_ATTRIBUTE_UNUSED;
|
||||
static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__));
|
||||
static void
|
||||
yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||
{
|
||||
@@ -748,7 +736,7 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||
else
|
||||
/* The effect of using yysval or yyloc (in an immediate rule) is
|
||||
* undefined. */
|
||||
yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULLPTR;]b4_locations_if([[
|
||||
yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULL;]b4_locations_if([[
|
||||
yyvsp[i].yystate.yyloc = s->yyloc;]])[
|
||||
s = yyvsp[i].yystate.yypred = s->yypred;
|
||||
}
|
||||
@@ -758,7 +746,7 @@ yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
||||
* YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
|
||||
* For convenience, always return YYLOW1. */
|
||||
static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
|
||||
YY_ATTRIBUTE_UNUSED;
|
||||
__attribute__ ((__unused__));
|
||||
static inline int
|
||||
yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
|
||||
{
|
||||
@@ -780,7 +768,8 @@ yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
|
||||
yyGLRStack* yystackp,
|
||||
YYSTYPE* yyvalp]b4_locuser_formals[)
|
||||
{
|
||||
yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR);
|
||||
yybool yynormal __attribute__ ((__unused__)) =
|
||||
(yystackp->yysplitPoint == YY_NULL);
|
||||
int yylow;
|
||||
]b4_parse_param_use([yyvalp], [yylocp])dnl
|
||||
[ YYUSE (yyrhslen);
|
||||
@@ -864,10 +853,12 @@ yydestroyGLRState (char const *yymsg, yyGLRState *yys]b4_user_formals[)
|
||||
if (yydebug)
|
||||
{
|
||||
if (yys->yysemantics.yyfirstVal)
|
||||
YYFPRINTF (stderr, "%s unresolved", yymsg);
|
||||
YYFPRINTF (stderr, "%s unresolved ", yymsg);
|
||||
else
|
||||
YYFPRINTF (stderr, "%s incomplete", yymsg);
|
||||
YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
|
||||
YYFPRINTF (stderr, "%s incomplete ", yymsg);
|
||||
yy_symbol_print (stderr, yystos[yys->yylrState],
|
||||
YY_NULL]b4_locuser_args([&yys->yyloc])[);
|
||||
YYFPRINTF (stderr, "\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -943,18 +934,14 @@ yygetLRActions (yyStateNum yystate, int yytoken,
|
||||
}
|
||||
}
|
||||
|
||||
/** Compute post-reduction state.
|
||||
* \param yystate the current state
|
||||
* \param yysym the nonterminal to push on the stack
|
||||
*/
|
||||
static inline yyStateNum
|
||||
yyLRgotoState (yyStateNum yystate, yySymbol yysym)
|
||||
yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
|
||||
{
|
||||
int yyr = yypgoto[yysym - YYNTOKENS] + yystate;
|
||||
int yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
|
||||
if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
|
||||
return yytable[yyr];
|
||||
else
|
||||
return yydefgoto[yysym - YYNTOKENS];
|
||||
return yydefgoto[yylhs - YYNTOKENS];
|
||||
}
|
||||
|
||||
static inline yybool
|
||||
@@ -996,7 +983,6 @@ yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
|
||||
{
|
||||
yySemanticOption* yynewOption =
|
||||
&yynewGLRStackItem (yystackp, yyfalse)->yyoption;
|
||||
YYASSERT (!yynewOption->yyisState);
|
||||
yynewOption->yystate = yyrhs;
|
||||
yynewOption->yyrule = yyrule;
|
||||
if (yystackp->yytops.yylookaheadNeeds[yyk])
|
||||
@@ -1024,7 +1010,7 @@ yyinitStateSet (yyGLRStateSet* yyset)
|
||||
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
|
||||
if (! yyset->yystates)
|
||||
return yyfalse;
|
||||
yyset->yystates[0] = YY_NULLPTR;
|
||||
yyset->yystates[0] = YY_NULL;
|
||||
yyset->yylookaheadNeeds =
|
||||
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
|
||||
if (! yyset->yylookaheadNeeds)
|
||||
@@ -1054,8 +1040,8 @@ yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
|
||||
if (!yystackp->yyitems)
|
||||
return yyfalse;
|
||||
yystackp->yynextFree = yystackp->yyitems;
|
||||
yystackp->yysplitPoint = YY_NULLPTR;
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
yystackp->yysplitPoint = YY_NULL;
|
||||
yystackp->yylastDeleted = YY_NULL;
|
||||
return yyinitStateSet (&yystackp->yytops);
|
||||
}
|
||||
|
||||
@@ -1094,10 +1080,10 @@ yyexpandGLRStack (yyGLRStack* yystackp)
|
||||
{
|
||||
yyGLRState* yys0 = &yyp0->yystate;
|
||||
yyGLRState* yys1 = &yyp1->yystate;
|
||||
if (yys0->yypred != YY_NULLPTR)
|
||||
if (yys0->yypred != YY_NULL)
|
||||
yys1->yypred =
|
||||
YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
|
||||
if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULLPTR)
|
||||
if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULL)
|
||||
yys1->yysemantics.yyfirstVal =
|
||||
YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
|
||||
}
|
||||
@@ -1105,18 +1091,18 @@ yyexpandGLRStack (yyGLRStack* yystackp)
|
||||
{
|
||||
yySemanticOption* yyv0 = &yyp0->yyoption;
|
||||
yySemanticOption* yyv1 = &yyp1->yyoption;
|
||||
if (yyv0->yystate != YY_NULLPTR)
|
||||
if (yyv0->yystate != YY_NULL)
|
||||
yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
|
||||
if (yyv0->yynext != YY_NULLPTR)
|
||||
if (yyv0->yynext != YY_NULL)
|
||||
yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
|
||||
}
|
||||
}
|
||||
if (yystackp->yysplitPoint != YY_NULLPTR)
|
||||
if (yystackp->yysplitPoint != YY_NULL)
|
||||
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
|
||||
yystackp->yysplitPoint, yystate);
|
||||
yystackp->yysplitPoint, yystate);
|
||||
|
||||
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
|
||||
if (yystackp->yytops.yystates[yyn] != YY_NULLPTR)
|
||||
if (yystackp->yytops.yystates[yyn] != YY_NULL)
|
||||
yystackp->yytops.yystates[yyn] =
|
||||
YYRELOC (yystackp->yyitems, yynewItems,
|
||||
yystackp->yytops.yystates[yyn], yystate);
|
||||
@@ -1140,7 +1126,7 @@ yyfreeGLRStack (yyGLRStack* yystackp)
|
||||
static inline void
|
||||
yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
|
||||
{
|
||||
if (yystackp->yysplitPoint != YY_NULLPTR && yystackp->yysplitPoint > yys)
|
||||
if (yystackp->yysplitPoint != YY_NULL && yystackp->yysplitPoint > yys)
|
||||
yystackp->yysplitPoint = yys;
|
||||
}
|
||||
|
||||
@@ -1148,9 +1134,9 @@ yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
|
||||
static inline void
|
||||
yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
|
||||
{
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULL)
|
||||
yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
|
||||
yystackp->yytops.yystates[yyk] = YY_NULLPTR;
|
||||
yystackp->yytops.yystates[yyk] = YY_NULL;
|
||||
}
|
||||
|
||||
/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can
|
||||
@@ -1159,12 +1145,12 @@ yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
|
||||
static void
|
||||
yyundeleteLastStack (yyGLRStack* yystackp)
|
||||
{
|
||||
if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0)
|
||||
if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0)
|
||||
return;
|
||||
yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
|
||||
yystackp->yytops.yysize = 1;
|
||||
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
yystackp->yylastDeleted = YY_NULL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -1174,7 +1160,7 @@ yyremoveDeletes (yyGLRStack* yystackp)
|
||||
yyi = yyj = 0;
|
||||
while (yyj < yystackp->yytops.yysize)
|
||||
{
|
||||
if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
|
||||
if (yystackp->yytops.yystates[yyi] == YY_NULL)
|
||||
{
|
||||
if (yyi == yyj)
|
||||
{
|
||||
@@ -1232,13 +1218,12 @@ yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
|
||||
size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
|
||||
{
|
||||
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
|
||||
YYASSERT (yynewState->yyisState);
|
||||
|
||||
yynewState->yylrState = yylrState;
|
||||
yynewState->yyposn = yyposn;
|
||||
yynewState->yyresolved = yyfalse;
|
||||
yynewState->yypred = yystackp->yytops.yystates[yyk];
|
||||
yynewState->yysemantics.yyfirstVal = YY_NULLPTR;
|
||||
yynewState->yysemantics.yyfirstVal = YY_NULL;
|
||||
yystackp->yytops.yystates[yyk] = yynewState;
|
||||
|
||||
/* Invokes YY_RESERVE_GLRSTACK. */
|
||||
@@ -1298,7 +1283,7 @@ yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
{
|
||||
int yynrhs = yyrhsLength (yyrule);
|
||||
|
||||
if (yystackp->yysplitPoint == YY_NULLPTR)
|
||||
if (yystackp->yysplitPoint == YY_NULL)
|
||||
{
|
||||
/* Standard special case: single stack. */
|
||||
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
|
||||
@@ -1350,13 +1335,14 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
{
|
||||
size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
|
||||
|
||||
if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR)
|
||||
if (yyforceEval || yystackp->yysplitPoint == YY_NULL)
|
||||
{
|
||||
YYSTYPE yysval;]b4_locations_if([[
|
||||
YYLTYPE yyloc;]])[
|
||||
YYRESULTTAG yyflag;
|
||||
YYSTYPE yysval;]b4_locations_if([
|
||||
YYLTYPE yyloc;])[
|
||||
|
||||
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
|
||||
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
|
||||
yyflag = yydoAction (yystackp, yyk, yyrule, &yysval]b4_locuser_args([&yyloc])[);
|
||||
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULL)
|
||||
{
|
||||
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
|
||||
(unsigned long int) yyk, yyrule - 1));
|
||||
@@ -1389,7 +1375,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
"Now in state %d.\n",
|
||||
(unsigned long int) yyk, yyrule - 1, yynewLRState));
|
||||
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
||||
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
|
||||
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULL)
|
||||
{
|
||||
yyGLRState *yysplit = yystackp->yysplitPoint;
|
||||
yyGLRState *yyp = yystackp->yytops.yystates[yyi];
|
||||
@@ -1416,7 +1402,7 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
||||
static size_t
|
||||
yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
{
|
||||
if (yystackp->yysplitPoint == YY_NULLPTR)
|
||||
if (yystackp->yysplitPoint == YY_NULL)
|
||||
{
|
||||
YYASSERT (yyk == 0);
|
||||
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
|
||||
@@ -1426,7 +1412,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
yyGLRState** yynewStates;
|
||||
yybool* yynewLookaheadNeeds;
|
||||
|
||||
yynewStates = YY_NULLPTR;
|
||||
yynewStates = YY_NULL;
|
||||
|
||||
if (yystackp->yytops.yycapacity
|
||||
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
|
||||
@@ -1437,7 +1423,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
|
||||
(yystackp->yytops.yycapacity
|
||||
* sizeof yynewStates[0]));
|
||||
if (yynewStates == YY_NULLPTR)
|
||||
if (yynewStates == YY_NULL)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yystates = yynewStates;
|
||||
|
||||
@@ -1445,7 +1431,7 @@ yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
||||
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
|
||||
(yystackp->yytops.yycapacity
|
||||
* sizeof yynewLookaheadNeeds[0]));
|
||||
if (yynewLookaheadNeeds == YY_NULLPTR)
|
||||
if (yynewLookaheadNeeds == YY_NULL)
|
||||
yyMemoryExhausted (yystackp);
|
||||
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
|
||||
}
|
||||
@@ -1509,9 +1495,9 @@ yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
|
||||
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
|
||||
while (yytrue)
|
||||
{
|
||||
if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR)
|
||||
if (yyz1 == *yyz0p || yyz1 == YY_NULL)
|
||||
break;
|
||||
else if (*yyz0p == YY_NULLPTR)
|
||||
else if (*yyz0p == YY_NULL)
|
||||
{
|
||||
*yyz0p = yyz1;
|
||||
break;
|
||||
@@ -1632,7 +1618,7 @@ yyreportTree (yySemanticOption* yyx, int yyindent)
|
||||
|
||||
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
|
||||
yystates[yyi] = yys;
|
||||
if (yys == YY_NULLPTR)
|
||||
if (yys == YY_NULL)
|
||||
{
|
||||
yyleftmost_state.yyposn = 0;
|
||||
yystates[0] = &yyleftmost_state;
|
||||
@@ -1703,7 +1689,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1,
|
||||
yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
|
||||
int yynrhs;
|
||||
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
|
||||
YYASSERT (yyoption != YY_NULLPTR);
|
||||
YYASSERT (yyoption != YY_NULL);
|
||||
yynrhs = yyrhsLength (yyoption->yyrule);
|
||||
if (yynrhs > 0)
|
||||
{
|
||||
@@ -1762,7 +1748,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
YYRESULTTAG yyflag;]b4_locations_if([
|
||||
YYLTYPE *yylocp = &yys->yyloc;])[
|
||||
|
||||
for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; )
|
||||
for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; )
|
||||
{
|
||||
yySemanticOption* yyp = *yypp;
|
||||
|
||||
@@ -1804,7 +1790,7 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
int yyprec = yydprec[yybest->yyrule];
|
||||
yyflag = yyresolveAction (yybest, yystackp, &yysval]b4_locuser_args[);
|
||||
if (yyflag == yyok)
|
||||
for (yyp = yybest->yynext; yyp != YY_NULLPTR; yyp = yyp->yynext)
|
||||
for (yyp = yybest->yynext; yyp != YY_NULL; yyp = yyp->yynext)
|
||||
{
|
||||
if (yyprec == yydprec[yyp->yyrule])
|
||||
{
|
||||
@@ -1831,14 +1817,14 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[)
|
||||
yys->yysemantics.yysval = yysval;
|
||||
}
|
||||
else
|
||||
yys->yysemantics.yyfirstVal = YY_NULLPTR;
|
||||
yys->yysemantics.yyfirstVal = YY_NULL;
|
||||
return yyflag;
|
||||
}
|
||||
|
||||
static YYRESULTTAG
|
||||
yyresolveStack (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
if (yystackp->yysplitPoint != YY_NULLPTR)
|
||||
if (yystackp->yysplitPoint != YY_NULL)
|
||||
{
|
||||
yyGLRState* yys;
|
||||
int yyn;
|
||||
@@ -1858,10 +1844,10 @@ yycompressStack (yyGLRStack* yystackp)
|
||||
{
|
||||
yyGLRState* yyp, *yyq, *yyr;
|
||||
|
||||
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR)
|
||||
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULL)
|
||||
return;
|
||||
|
||||
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR;
|
||||
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULL;
|
||||
yyp != yystackp->yysplitPoint;
|
||||
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
|
||||
yyp->yypred = yyr;
|
||||
@@ -1869,10 +1855,10 @@ yycompressStack (yyGLRStack* yystackp)
|
||||
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
|
||||
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
|
||||
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
|
||||
yystackp->yysplitPoint = YY_NULLPTR;
|
||||
yystackp->yylastDeleted = YY_NULLPTR;
|
||||
yystackp->yysplitPoint = YY_NULL;
|
||||
yystackp->yylastDeleted = YY_NULL;
|
||||
|
||||
while (yyr != YY_NULLPTR)
|
||||
while (yyr != YY_NULL)
|
||||
{
|
||||
yystackp->yynextFree->yystate = *yyr;
|
||||
yyr = yyr->yypred;
|
||||
@@ -1887,7 +1873,7 @@ static YYRESULTTAG
|
||||
yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
size_t yyposn]b4_pure_formals[)
|
||||
{
|
||||
while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
while (yystackp->yytops.yystates[yyk] != YY_NULL)
|
||||
{
|
||||
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
|
||||
YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
|
||||
@@ -2009,13 +1995,13 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
#else
|
||||
{
|
||||
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
||||
size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
|
||||
size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
|
||||
size_t yysize = yysize0;
|
||||
yybool yysize_overflow = yyfalse;
|
||||
char* yymsg = YY_NULLPTR;
|
||||
char* yymsg = YY_NULL;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULLPTR;
|
||||
const char *yyformat = YY_NULL;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
@@ -2071,7 +2057,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
yyarg[yycount++] = yytokenName (yyx);
|
||||
{
|
||||
size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx));
|
||||
size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
|
||||
yysize_overflow |= yysz < yysize;
|
||||
yysize = yysz;
|
||||
}
|
||||
@@ -2149,7 +2135,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
yySymbol yytoken;
|
||||
if (yychar == YYEOF)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULL);
|
||||
if (yychar != YYEMPTY)
|
||||
{]b4_locations_if([[
|
||||
/* We throw away the lookahead, but the error range
|
||||
@@ -2190,10 +2176,10 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
|
||||
/* Reduce to one stack. */
|
||||
for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
||||
if (yystackp->yytops.yystates[yyk] != YY_NULL)
|
||||
break;
|
||||
if (yyk >= yystackp->yytops.yysize)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULL);
|
||||
for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
|
||||
yymarkStackDeleted (yystackp, yyk);
|
||||
yyremoveDeletes (yystackp);
|
||||
@@ -2201,7 +2187,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
|
||||
/* Now pop stack until we find a state that shifts the error token. */
|
||||
yystackp->yyerrState = 3;
|
||||
while (yystackp->yytops.yystates[0] != YY_NULLPTR)
|
||||
while (yystackp->yytops.yystates[0] != YY_NULL)
|
||||
{
|
||||
yyGLRState *yys = yystackp->yytops.yystates[0];
|
||||
yyj = yypact[yys->yylrState];
|
||||
@@ -2225,14 +2211,14 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
}
|
||||
}]b4_locations_if([[
|
||||
yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;]])[
|
||||
if (yys->yypred != YY_NULLPTR)
|
||||
if (yys->yypred != YY_NULL)
|
||||
yydestroyGLRState ("Error: popping", yys]b4_user_args[);
|
||||
yystackp->yytops.yystates[0] = yys->yypred;
|
||||
yystackp->yynextFree -= 1;
|
||||
yystackp->yyspaceLeft += 1;
|
||||
}
|
||||
if (yystackp->yytops.yystates[0] == YY_NULLPTR)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULLPTR);
|
||||
if (yystackp->yytops.yystates[0] == YY_NULL)
|
||||
yyFail (yystackp][]b4_lpure_args[, YY_NULL);
|
||||
}
|
||||
|
||||
#define YYCHK1(YYE) \
|
||||
@@ -2475,7 +2461,7 @@ b4_dollar_popdef])[]dnl
|
||||
{
|
||||
yyGLRState *yys = yystates[yyk];
|
||||
]b4_locations_if([[ yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;]]
|
||||
)[ if (yys->yypred != YY_NULLPTR)
|
||||
)[ if (yys->yypred != YY_NULL)
|
||||
yydestroyGLRState ("Cleanup: popping", yys]b4_user_args[);
|
||||
yystates[yyk] = yys->yypred;
|
||||
yystack.yynextFree -= 1;
|
||||
@@ -2507,7 +2493,7 @@ yy_yypstack (yyGLRState* yys)
|
||||
static void
|
||||
yypstates (yyGLRState* yyst)
|
||||
{
|
||||
if (yyst == YY_NULLPTR)
|
||||
if (yyst == YY_NULL)
|
||||
YYFPRINTF (stderr, "<null>");
|
||||
else
|
||||
yy_yypstack (yyst);
|
||||
@@ -2521,7 +2507,7 @@ yypstack (yyGLRStack* yystackp, size_t yyk)
|
||||
}
|
||||
|
||||
#define YYINDEX(YYX) \
|
||||
((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
|
||||
((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
|
||||
|
||||
|
||||
static void
|
||||
@@ -2535,8 +2521,6 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
(unsigned long int) (yyp - yystackp->yyitems));
|
||||
if (*(yybool *) yyp)
|
||||
{
|
||||
YYASSERT (yyp->yystate.yyisState);
|
||||
YYASSERT (yyp->yyoption.yyisState);
|
||||
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
||||
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
||||
(unsigned long int) yyp->yystate.yyposn,
|
||||
@@ -2548,8 +2532,6 @@ yypdumpstack (yyGLRStack* yystackp)
|
||||
}
|
||||
else
|
||||
{
|
||||
YYASSERT (!yyp->yystate.yyisState);
|
||||
YYASSERT (!yyp->yyoption.yyisState);
|
||||
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
||||
yyp->yyoption.yyrule - 1,
|
||||
(long int) YYINDEX (yyp->yyoption.yystate),
|
||||
@@ -2583,3 +2565,16 @@ m4_if(b4_prefix, [yy], [],
|
||||
|
||||
]b4_epilogue[]dnl
|
||||
b4_output_end()
|
||||
|
||||
# glr.cc produces its own header.
|
||||
m4_if(b4_skeleton, ["glr.c"],
|
||||
[b4_defines_if(
|
||||
[b4_output_begin([b4_spec_defines_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C],
|
||||
[2002-2013])[
|
||||
|
||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||
]b4_shared_declarations[
|
||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||
]b4_output_end()
|
||||
])])
|
||||
|
||||
+14
-3
@@ -1,6 +1,6 @@
|
||||
# C++ GLR skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -43,6 +43,12 @@
|
||||
# user must initialize the first positions (in particular the
|
||||
# filename member).
|
||||
|
||||
b4_token_ctor_if([b4_variant_if([],
|
||||
[b4_fatal_at(b4_percent_define_get_loc(api.token.constructor),
|
||||
[cannot use '%s' without '%s'],
|
||||
[%define api.token.constructor],
|
||||
[%define api.value.type variant]))])])
|
||||
|
||||
# We require a pure interface.
|
||||
m4_define([b4_pure_flag], [1])
|
||||
|
||||
@@ -187,7 +193,12 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
std::ostream& yyoutput = debug_stream ();
|
||||
std::ostream& yyo = yyoutput;
|
||||
YYUSE (yyo);
|
||||
]b4_symbol_actions([printer])[
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_printer])dnl
|
||||
[ default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -329,7 +340,7 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
||||
b4_defines_if(
|
||||
[b4_output_begin([b4_spec_defines_file])
|
||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
[2002-2015])[
|
||||
[2002-2013])[
|
||||
|
||||
// C++ GLR parser skeleton written by Akim Demaille.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Java skeleton dispatching for Bison.
|
||||
|
||||
# Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007, 2009-2013 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
|
||||
|
||||
+2
-18
@@ -2,7 +2,7 @@
|
||||
|
||||
# Java language support for Bison
|
||||
|
||||
# Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2013 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
|
||||
@@ -103,7 +103,7 @@ m4_define([b4_int_type],
|
||||
# b4_int_type_for(NAME)
|
||||
# ---------------------
|
||||
# Return the smallest int type able to handle numbers ranging from
|
||||
# 'NAME_min' to 'NAME_max' (included).
|
||||
# `NAME_min' to `NAME_max' (included).
|
||||
m4_define([b4_int_type_for],
|
||||
[b4_int_type($1_min, $1_max)])
|
||||
|
||||
@@ -169,22 +169,6 @@ m4_define([b4_predicate_case], [ case $1:
|
||||
])
|
||||
|
||||
|
||||
## -------- ##
|
||||
## Checks. ##
|
||||
## -------- ##
|
||||
|
||||
b4_percent_define_check_kind([[api.value.type]], [code], [deprecated])
|
||||
|
||||
b4_percent_define_check_kind([[annotations]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[extends]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[implements]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[init_throws]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[lex_throws]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[parser_class_name]], [code], [deprecated])
|
||||
b4_percent_define_check_kind([[throws]], [code], [deprecated])
|
||||
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
+112
-111
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
m4_include(b4_pkgdatadir/[c++.m4])
|
||||
|
||||
# api.value.type=variant is valid.
|
||||
m4_define([b4_value_type_setup_variant])
|
||||
|
||||
# b4_integral_parser_table_declare(TABLE-NAME, CONTENT, COMMENT)
|
||||
# --------------------------------------------------------------
|
||||
@@ -40,14 +38,13 @@ m4_define([b4_integral_parser_table_define],
|
||||
};dnl
|
||||
])
|
||||
|
||||
|
||||
# b4_symbol_value_template(VAL, [TYPE])
|
||||
# -------------------------------------
|
||||
# Same as b4_symbol_value, but used in a template method. It makes
|
||||
# a difference when using variants. Note that b4_value_type_setup_union
|
||||
# overrides b4_symbol_value, so we must override it again.
|
||||
# a difference when using variants.
|
||||
m4_copy([b4_symbol_value], [b4_symbol_value_template])
|
||||
m4_append([b4_value_type_setup_union],
|
||||
[m4_copy_force([b4_symbol_value_union], [b4_symbol_value_template])])
|
||||
|
||||
|
||||
# b4_lhs_value([TYPE])
|
||||
# --------------------
|
||||
@@ -131,7 +128,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))])])
|
||||
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015])
|
||||
[2002-2013])
|
||||
|
||||
m4_define([b4_parser_class_name],
|
||||
[b4_percent_define_get([[parser_class_name]])])
|
||||
@@ -157,7 +154,6 @@ m4_define([b4_shared_declarations],
|
||||
]b4_bison_locations_if([[# include "location.hh"]])])[
|
||||
]b4_variant_if([b4_variant_includes])[
|
||||
|
||||
]b4_attribute_define[
|
||||
]b4_YYDEBUG_define[
|
||||
|
||||
]b4_namespace_open[
|
||||
@@ -184,14 +180,14 @@ b4_location_define])])[
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
/// The current debugging stream.
|
||||
std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
|
||||
std::ostream& debug_stream () const;
|
||||
/// Set the current debugging stream.
|
||||
void set_debug_stream (std::ostream &);
|
||||
|
||||
/// Type for debugging levels.
|
||||
typedef int debug_level_type;
|
||||
/// The current debugging level.
|
||||
debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
|
||||
debug_level_type debug_level () const;
|
||||
/// Set the current debugging level.
|
||||
void set_debug_level (debug_level_type l);
|
||||
#endif
|
||||
@@ -205,23 +201,19 @@ b4_location_define])])[
|
||||
void error (const syntax_error& err);
|
||||
|
||||
private:
|
||||
/// This class is not copyable.
|
||||
]b4_parser_class_name[ (const ]b4_parser_class_name[&);
|
||||
]b4_parser_class_name[& operator= (const ]b4_parser_class_name[&);
|
||||
|
||||
/// State numbers.
|
||||
typedef int state_type;
|
||||
|
||||
/// Generate an error message.
|
||||
/// \param yystate the state where the error occurred.
|
||||
/// \param yyla the lookahead token.
|
||||
/// \param yytoken the lookahead token type, or yyempty_.
|
||||
virtual std::string yysyntax_error_ (state_type yystate,
|
||||
const symbol_type& yyla) const;
|
||||
symbol_number_type yytoken) const;
|
||||
|
||||
/// Compute post-reduction state.
|
||||
/// \param yystate the current state
|
||||
/// \param yysym the nonterminal to push on the stack
|
||||
state_type yy_lr_goto_state_ (state_type yystate, int yysym);
|
||||
/// \param yylhs the nonterminal to push on the stack
|
||||
state_type yy_lr_goto_state_ (state_type yystate, int yylhs);
|
||||
|
||||
/// Whether the given \c yypact_ value indicates a defaulted state.
|
||||
/// \param yyvalue the value to check
|
||||
@@ -268,7 +260,7 @@ b4_location_define])])[
|
||||
/// \brief Reclaim the memory associated to a symbol.
|
||||
/// \param yymsg Why this token is reclaimed.
|
||||
/// If null, print nothing.
|
||||
/// \param yysym The symbol.
|
||||
/// \param s The symbol.
|
||||
template <typename Base>
|
||||
void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
|
||||
|
||||
@@ -288,21 +280,16 @@ b4_location_define])])[
|
||||
/// Copy constructor.
|
||||
by_state (const by_state& other);
|
||||
|
||||
/// Record that this symbol is empty.
|
||||
void clear ();
|
||||
|
||||
/// Steal the symbol type from \a that.
|
||||
void move (by_state& that);
|
||||
|
||||
/// The (internal) type number (corresponding to \a state).
|
||||
/// \a empty_symbol when empty.
|
||||
/// "empty" when empty.
|
||||
symbol_number_type type_get () const;
|
||||
|
||||
/// The state number used to denote an empty symbol.
|
||||
enum { empty_state = -1 };
|
||||
enum { empty = 0 };
|
||||
|
||||
/// The state.
|
||||
/// \a empty when empty.
|
||||
state_type state;
|
||||
};
|
||||
|
||||
@@ -343,16 +330,17 @@ b4_location_define])])[
|
||||
/// Pop \a n symbols the three stacks.
|
||||
void yypop_ (unsigned int n = 1);
|
||||
|
||||
/// Constants.
|
||||
// Constants.
|
||||
enum
|
||||
{
|
||||
yyeof_ = 0,
|
||||
yylast_ = ]b4_last[, ///< Last index in yytable_.
|
||||
yynnts_ = ]b4_nterms_number[, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = ]b4_final_state_number[, ///< Termination state number.
|
||||
yylast_ = ]b4_last[, //< Last index in yytable_.
|
||||
yynnts_ = ]b4_nterms_number[, //< Number of nonterminal symbols.
|
||||
yyempty_ = -2,
|
||||
yyfinal_ = ]b4_final_state_number[, //< Termination state number.
|
||||
yyterror_ = 1,
|
||||
yyerrcode_ = 256,
|
||||
yyntokens_ = ]b4_tokens_number[ ///< Number of tokens.
|
||||
yyntokens_ = ]b4_tokens_number[ //< Number of tokens.
|
||||
};
|
||||
|
||||
]b4_parse_param_vars[
|
||||
@@ -468,7 +456,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
#endif // !]b4_api_PREFIX[DEBUG
|
||||
|
||||
#define yyerrok (yyerrstatus_ = 0)
|
||||
#define yyclearin (yyla.clear ())
|
||||
#define yyclearin (yyempty = true)
|
||||
|
||||
#define YYACCEPT goto yyacceptlab
|
||||
#define YYABORT goto yyabortlab
|
||||
@@ -537,7 +525,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
// by_state.
|
||||
inline
|
||||
]b4_parser_class_name[::by_state::by_state ()
|
||||
: state (empty_state)
|
||||
: state (empty)
|
||||
{}
|
||||
|
||||
inline
|
||||
@@ -545,19 +533,12 @@ m4_if(b4_prefix, [yy], [],
|
||||
: state (other.state)
|
||||
{}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_state::clear ()
|
||||
{
|
||||
state = empty_state;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
]b4_parser_class_name[::by_state::move (by_state& that)
|
||||
{
|
||||
state = that.state;
|
||||
that.clear ();
|
||||
that.state = empty;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -569,7 +550,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
]b4_parser_class_name[::symbol_number_type
|
||||
]b4_parser_class_name[::by_state::type_get () const
|
||||
{
|
||||
return state == empty_state ? empty_symbol : yystos_[state];
|
||||
return state == empty ? 0 : yystos_[state];
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -585,7 +566,7 @@ m4_if(b4_prefix, [yy], [],
|
||||
[value], [move], [that.value])],
|
||||
[[value = that.value;]])[
|
||||
// that is emptied.
|
||||
that.type = empty_symbol;
|
||||
that.type = empty;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -610,7 +591,13 @@ m4_if(b4_prefix, [yy], [],
|
||||
YY_SYMBOL_PRINT (yymsg, yysym);]b4_variant_if([], [
|
||||
|
||||
// User destructor.
|
||||
b4_symbol_actions([destructor], [yysym.type_get ()])])[
|
||||
symbol_number_type yytype = yysym.type_get ();
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
[ default:
|
||||
break;
|
||||
}])[
|
||||
}
|
||||
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
@@ -625,7 +612,12 @@ m4_if(b4_prefix, [yy], [],
|
||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||
<< yysym.location << ": "])[;
|
||||
]b4_symbol_actions([printer])[
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_printer])dnl
|
||||
[ default:
|
||||
break;
|
||||
}
|
||||
yyo << ')';
|
||||
}
|
||||
#endif
|
||||
@@ -682,13 +674,13 @@ m4_if(b4_prefix, [yy], [],
|
||||
#endif // ]b4_api_PREFIX[DEBUG
|
||||
|
||||
inline ]b4_parser_class_name[::state_type
|
||||
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yysym)
|
||||
]b4_parser_class_name[::yy_lr_goto_state_ (state_type yystate, int yylhs)
|
||||
{
|
||||
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||
int yyr = yypgoto_[yylhs - yyntokens_] + yystate;
|
||||
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||
return yytable_[yyr];
|
||||
else
|
||||
return yydefgoto_[yysym - yyntokens_];
|
||||
return yydefgoto_[yylhs - yyntokens_];
|
||||
}
|
||||
|
||||
inline bool
|
||||
@@ -706,9 +698,11 @@ m4_if(b4_prefix, [yy], [],
|
||||
int
|
||||
]b4_parser_class_name[::parse ()
|
||||
{
|
||||
/// Whether yyla contains a lookahead.
|
||||
bool yyempty = true;
|
||||
|
||||
// State.
|
||||
int yyn;
|
||||
/// Length of the RHS of the rule being reduced.
|
||||
int yylen = 0;
|
||||
|
||||
// Error handling.
|
||||
@@ -721,6 +715,9 @@ m4_if(b4_prefix, [yy], [],
|
||||
/// The locations where the error started and ended.
|
||||
stack_symbol_type yyerror_range[3];]])[
|
||||
|
||||
/// $$ and @@$.
|
||||
stack_symbol_type yylhs;
|
||||
|
||||
/// The return value of parse ().
|
||||
int yyresult;
|
||||
|
||||
@@ -740,8 +737,8 @@ b4_dollar_popdef])[]dnl
|
||||
yynewstate, since the latter expects the semantical and the
|
||||
location values to have been already stored, initialize these
|
||||
stacks with a primary value. */
|
||||
yystack_.clear ();
|
||||
yypush_ (YY_NULLPTR, 0, yyla);
|
||||
yystack_ = stack_type (0);
|
||||
yypush_ (YY_NULL, 0, yyla);
|
||||
|
||||
// A new symbol was pushed on the stack.
|
||||
yynewstate:
|
||||
@@ -762,7 +759,7 @@ b4_dollar_popdef])[]dnl
|
||||
goto yydefault;
|
||||
|
||||
// Read a lookahead token.
|
||||
if (yyla.empty ())
|
||||
if (yyempty)
|
||||
{
|
||||
YYCDEBUG << "Reading a token: ";
|
||||
try
|
||||
@@ -776,6 +773,7 @@ b4_dollar_popdef])[]dnl
|
||||
error (yyexc);
|
||||
goto yyerrlab1;
|
||||
}
|
||||
yyempty = false;
|
||||
}
|
||||
YY_SYMBOL_PRINT ("Next token is", yyla);
|
||||
|
||||
@@ -795,6 +793,9 @@ b4_dollar_popdef])[]dnl
|
||||
goto yyreduce;
|
||||
}
|
||||
|
||||
// Discard the token being shifted.
|
||||
yyempty = true;
|
||||
|
||||
// Count tokens shifted since error; after three, turn off error status.
|
||||
if (yyerrstatus_)
|
||||
--yyerrstatus_;
|
||||
@@ -817,55 +818,52 @@ b4_dollar_popdef])[]dnl
|
||||
`-----------------------------*/
|
||||
yyreduce:
|
||||
yylen = yyr2_[yyn];
|
||||
{
|
||||
stack_symbol_type yylhs;
|
||||
yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([
|
||||
/* Variants are always initialized to an empty instance of the
|
||||
correct type. The default '$$ = $1' action is NOT applied
|
||||
when using variants. */
|
||||
b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])], [
|
||||
/* If YYLEN is nonzero, implement the default value of the
|
||||
action: '$$ = $1'. Otherwise, use the top of the stack.
|
||||
yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);]b4_variant_if([
|
||||
/* Variants are always initialized to an empty instance of the
|
||||
correct type. The default $$=$1 action is NOT applied when using
|
||||
variants. */
|
||||
b4_symbol_variant([[yyr1_@{yyn@}]], [yylhs.value], [build])],[
|
||||
/* If YYLEN is nonzero, implement the default value of the action:
|
||||
`$$ = $1'. Otherwise, use the top of the stack.
|
||||
|
||||
Otherwise, the following line sets YYLHS.VALUE to garbage.
|
||||
This behavior is undocumented and Bison users should not rely
|
||||
upon it. */
|
||||
if (yylen)
|
||||
yylhs.value = yystack_@{yylen - 1@}.value;
|
||||
else
|
||||
yylhs.value = yystack_@{0@}.value;])[
|
||||
Otherwise, the following line sets YYLHS.VALUE to garbage.
|
||||
This behavior is undocumented and Bison
|
||||
users should not rely upon it. */
|
||||
if (yylen)
|
||||
yylhs.value = yystack_@{yylen - 1@}.value;
|
||||
else
|
||||
yylhs.value = yystack_@{0@}.value;])[
|
||||
]b4_locations_if([dnl
|
||||
[
|
||||
// Compute the default @@$.
|
||||
// Compute the default @@$.
|
||||
{
|
||||
slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
|
||||
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
|
||||
}]])[
|
||||
|
||||
// Perform the reduction.
|
||||
YY_REDUCE_PRINT (yyn);
|
||||
try
|
||||
{
|
||||
slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
|
||||
YYLLOC_DEFAULT (yylhs.location, slice, yylen);
|
||||
}]])[
|
||||
|
||||
// Perform the reduction.
|
||||
YY_REDUCE_PRINT (yyn);
|
||||
try
|
||||
{
|
||||
switch (yyn)
|
||||
{
|
||||
switch (yyn)
|
||||
{
|
||||
]b4_user_actions[
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
error (yyexc);
|
||||
YYERROR;
|
||||
}
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
|
||||
yypop_ (yylen);
|
||||
yylen = 0;
|
||||
YY_STACK_PRINT ();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (const syntax_error& yyexc)
|
||||
{
|
||||
error (yyexc);
|
||||
YYERROR;
|
||||
}
|
||||
YY_SYMBOL_PRINT ("-> $$ =", yylhs);
|
||||
yypop_ (yylen);
|
||||
yylen = 0;
|
||||
YY_STACK_PRINT ();
|
||||
|
||||
// Shift the result of the reduction.
|
||||
yypush_ (YY_NULLPTR, yylhs);
|
||||
}
|
||||
// Shift the result of the reduction.
|
||||
yypush_ (YY_NULL, yylhs);
|
||||
goto yynewstate;
|
||||
|
||||
/*--------------------------------------.
|
||||
@@ -877,7 +875,8 @@ b4_dollar_popdef])[]dnl
|
||||
{
|
||||
++yynerrs_;
|
||||
error (]b4_join(b4_locations_if([yyla.location]),
|
||||
[[yysyntax_error_ (yystack_[0].state, yyla)]])[);
|
||||
[[yysyntax_error_ (yystack_[0].state,
|
||||
yyempty ? yyempty_ : yyla.type_get ())]])[);
|
||||
}
|
||||
|
||||
]b4_locations_if([[
|
||||
@@ -890,10 +889,10 @@ b4_dollar_popdef])[]dnl
|
||||
// Return failure if at end of input.
|
||||
if (yyla.type_get () == yyeof_)
|
||||
YYABORT;
|
||||
else if (!yyla.empty ())
|
||||
else if (!yyempty)
|
||||
{
|
||||
yy_destroy_ ("Error: discarding", yyla);
|
||||
yyla.clear ();
|
||||
yyempty = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -911,7 +910,10 @@ b4_dollar_popdef])[]dnl
|
||||
code. */
|
||||
if (false)
|
||||
goto yyerrorlab;]b4_locations_if([[
|
||||
yyerror_range[1].location = yystack_[yylen - 1].location;]])[
|
||||
yyerror_range[1].location = yystack_[yylen - 1].location;]])b4_variant_if([[
|
||||
/* $$ was initialized before running the user action. */
|
||||
YY_SYMBOL_PRINT ("Error: discarding", yylhs);
|
||||
yylhs.~stack_symbol_type();]])[
|
||||
/* Do not reclaim the symbols of the rule whose action triggered
|
||||
this YYERROR. */
|
||||
yypop_ (yylen);
|
||||
@@ -969,7 +971,7 @@ b4_dollar_popdef])[]dnl
|
||||
goto yyreturn;
|
||||
|
||||
yyreturn:
|
||||
if (!yyla.empty ())
|
||||
if (!yyempty)
|
||||
yy_destroy_ ("Cleanup: discarding lookahead", yyla);
|
||||
|
||||
/* Do not reclaim the symbols of the rule whose action triggered
|
||||
@@ -989,12 +991,12 @@ b4_dollar_popdef])[]dnl
|
||||
<< std::endl;
|
||||
// Do not try to display the values of the reclaimed symbols,
|
||||
// as their printer might throw an exception.
|
||||
if (!yyla.empty ())
|
||||
yy_destroy_ (YY_NULLPTR, yyla);
|
||||
if (!yyempty)
|
||||
yy_destroy_ (YY_NULL, yyla);
|
||||
|
||||
while (1 < yystack_.size ())
|
||||
{
|
||||
yy_destroy_ (YY_NULLPTR, yystack_[0]);
|
||||
yy_destroy_ (YY_NULL, yystack_[0]);
|
||||
yypop_ ();
|
||||
}
|
||||
throw;
|
||||
@@ -1011,9 +1013,10 @@ b4_dollar_popdef])[]dnl
|
||||
// Generate an error message.
|
||||
std::string
|
||||
]b4_parser_class_name[::yysyntax_error_ (]dnl
|
||||
b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
[state_type, const symbol_type&])[) const
|
||||
b4_error_verbose_if([state_type yystate, symbol_number_type yytoken],
|
||||
[state_type, symbol_number_type])[) const
|
||||
{]b4_error_verbose_if([[
|
||||
std::string yyres;
|
||||
// Number of reported tokens (one for the "unexpected", one per
|
||||
// "expected").
|
||||
size_t yycount = 0;
|
||||
@@ -1027,7 +1030,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
the only way this function was invoked is if the default action
|
||||
is an error action. In that case, don't check for expected
|
||||
tokens because there are none.
|
||||
- The only way there can be no lookahead present (in yyla) is
|
||||
- The only way there can be no lookahead present (in yytoken) is
|
||||
if this state is a consistent state with a default action.
|
||||
Thus, detecting the absence of a lookahead is sufficient to
|
||||
determine that there is no unexpected or expected token to
|
||||
@@ -1047,9 +1050,8 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
token that will not be accepted due to an error action in a
|
||||
later state.
|
||||
*/
|
||||
if (!yyla.empty ())
|
||||
if (yytoken != yyempty_)
|
||||
{
|
||||
int yytoken = yyla.type_get ();
|
||||
yyarg[yycount++] = yytname_[yytoken];
|
||||
int yyn = yypact_[yystate];
|
||||
if (!yy_pact_value_is_default_ (yyn))
|
||||
@@ -1076,7 +1078,7 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
}
|
||||
}
|
||||
|
||||
char const* yyformat = YY_NULLPTR;
|
||||
char const* yyformat = YY_NULL;
|
||||
switch (yycount)
|
||||
{
|
||||
#define YYCASE_(N, S) \
|
||||
@@ -1092,7 +1094,6 @@ b4_error_verbose_if([state_type yystate, const symbol_type& yyla],
|
||||
#undef YYCASE_
|
||||
}
|
||||
|
||||
std::string yyres;
|
||||
// Argument number.
|
||||
size_t yyi = 0;
|
||||
for (char const* yyp = yyformat; *yyp; ++yyp)
|
||||
|
||||
+81
-276
@@ -1,6 +1,6 @@
|
||||
# Java skeleton for Bison -*- autoconf -*-
|
||||
|
||||
# Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2013 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
|
||||
@@ -20,8 +20,7 @@ m4_include(b4_pkgdatadir/[java.m4])
|
||||
b4_defines_if([b4_fatal([%s: %%defines does not make sense in Java],
|
||||
[b4_skeleton])])
|
||||
|
||||
# We do not depend on %debug in Java, but pacify warnings about
|
||||
# non-used flags.
|
||||
# We don't depend on %debug in Java, but pacify warnings about non-used flags.
|
||||
b4_parse_trace_if([0], [0])
|
||||
|
||||
m4_define([b4_symbol_no_destructor_assert],
|
||||
@@ -31,60 +30,9 @@ m4_define([b4_symbol_no_destructor_assert],
|
||||
[b4_symbol_action_location([$1], [destructor])])])])
|
||||
b4_symbol_foreach([b4_symbol_no_destructor_assert])
|
||||
|
||||
# Setup some macros for api.push-pull.
|
||||
b4_percent_define_default([[api.push-pull]], [[pull]])
|
||||
b4_percent_define_check_values([[[[api.push-pull]],
|
||||
[[pull]], [[push]], [[both]]]])
|
||||
|
||||
# Define m4 conditional macros that encode the value
|
||||
# of the api.push-pull flag.
|
||||
b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])
|
||||
b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])
|
||||
m4_case(b4_percent_define_get([[api.push-pull]]),
|
||||
[pull], [m4_define([b4_push_flag], [[0]])],
|
||||
[push], [m4_define([b4_pull_flag], [[0]])])
|
||||
|
||||
# Define a macro to be true when api.push-pull has the value "both".
|
||||
m4_define([b4_both_if],[b4_push_if([b4_pull_if([$1],[$2])],[$2])])
|
||||
|
||||
# Handle BISON_USE_PUSH_FOR_PULL for the test suite. So that push parsing
|
||||
# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the
|
||||
# behavior of Bison at all when push parsing is already requested.
|
||||
b4_define_flag_if([use_push_for_pull])
|
||||
b4_use_push_for_pull_if([
|
||||
b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
|
||||
[m4_define([b4_push_flag], [[1]])])])
|
||||
|
||||
# Define a macro to encapsulate the parse state variables.
|
||||
# This allows them to be defined either in parse() when doing
|
||||
# pull parsing, or as class instance variable when doing push parsing.
|
||||
m4_define([b4_define_state],[[
|
||||
/* Lookahead and lookahead in internal form. */
|
||||
int yychar = yyempty_;
|
||||
int yytoken = 0;
|
||||
|
||||
/* State. */
|
||||
int yyn = 0;
|
||||
int yylen = 0;
|
||||
int yystate = 0;
|
||||
YYStack yystack = new YYStack ();
|
||||
int label = YYNEWSTATE;
|
||||
|
||||
/* Error handling. */
|
||||
int yynerrs_ = 0;
|
||||
]b4_locations_if([/* The location where the error started. */
|
||||
b4_location_type yyerrloc = null;
|
||||
|
||||
/* Location. */
|
||||
b4_location_type yylloc = new b4_location_type (null, null);])[
|
||||
|
||||
/* Semantic value of the lookahead. */
|
||||
]b4_yystype[ yylval = null;
|
||||
]])
|
||||
|
||||
b4_output_begin([b4_parser_file_name])
|
||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
|
||||
[2007-2015])
|
||||
[2007-2013])
|
||||
|
||||
b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
|
||||
])[/* First part of user declarations. */
|
||||
@@ -107,9 +55,7 @@ b4_percent_define_get3([implements], [ implements ])[
|
||||
{
|
||||
]b4_identification[
|
||||
]b4_error_verbose_if([[
|
||||
/**
|
||||
* True if verbose error messages are enabled.
|
||||
*/
|
||||
/** True if verbose error messages are enabled. */
|
||||
private boolean yyErrorVerbose = true;
|
||||
|
||||
/**
|
||||
@@ -130,24 +76,18 @@ b4_locations_if([[
|
||||
* A class defining a pair of positions. Positions, defined by the
|
||||
* <code>]b4_position_type[</code> class, denote a point in the input.
|
||||
* Locations represent a part of the input through the beginning
|
||||
* and ending positions.
|
||||
*/
|
||||
* and ending positions. */
|
||||
public class ]b4_location_type[ {
|
||||
/**
|
||||
* The first, inclusive, position in the range.
|
||||
*/
|
||||
/** The first, inclusive, position in the range. */
|
||||
public ]b4_position_type[ begin;
|
||||
|
||||
/**
|
||||
* The first position beyond the range.
|
||||
*/
|
||||
/** The first position beyond the range. */
|
||||
public ]b4_position_type[ end;
|
||||
|
||||
/**
|
||||
* Create a <code>]b4_location_type[</code> denoting an empty range located at
|
||||
* a given point.
|
||||
* @@param loc The position at which the range is anchored.
|
||||
*/
|
||||
* @@param loc The position at which the range is anchored. */
|
||||
public ]b4_location_type[ (]b4_position_type[ loc) {
|
||||
this.begin = this.end = loc;
|
||||
}
|
||||
@@ -155,8 +95,7 @@ b4_locations_if([[
|
||||
/**
|
||||
* Create a <code>]b4_location_type[</code> from the endpoints of the range.
|
||||
* @@param begin The first position included in the range.
|
||||
* @@param end The first position beyond the range.
|
||||
*/
|
||||
* @@param end The first position beyond the range. */
|
||||
public ]b4_location_type[ (]b4_position_type[ begin, ]b4_position_type[ end) {
|
||||
this.begin = begin;
|
||||
this.end = end;
|
||||
@@ -165,8 +104,7 @@ b4_locations_if([[
|
||||
/**
|
||||
* Print a representation of the location. For this to be correct,
|
||||
* <code>]b4_position_type[</code> should override the <code>equals</code>
|
||||
* method.
|
||||
*/
|
||||
* method. */
|
||||
public String toString () {
|
||||
if (begin.equals (end))
|
||||
return begin.toString ();
|
||||
@@ -198,28 +136,24 @@ b4_locations_if([[
|
||||
|
||||
]b4_locations_if([[/**
|
||||
* Method to retrieve the beginning position of the last scanned token.
|
||||
* @@return the position at which the last scanned token starts.
|
||||
*/
|
||||
* @@return the position at which the last scanned token starts. */
|
||||
]b4_position_type[ getStartPos ();
|
||||
|
||||
/**
|
||||
* Method to retrieve the ending position of the last scanned token.
|
||||
* @@return the first position beyond the last scanned token.
|
||||
*/
|
||||
* @@return the first position beyond the last scanned token. */
|
||||
]b4_position_type[ getEndPos ();]])[
|
||||
|
||||
/**
|
||||
* Method to retrieve the semantic value of the last scanned token.
|
||||
* @@return the semantic value of the last scanned token.
|
||||
*/
|
||||
* @@return the semantic value of the last scanned token. */
|
||||
]b4_yystype[ getLVal ();
|
||||
|
||||
/**
|
||||
* Entry point for the scanner. Returns the token identifier corresponding
|
||||
* to the next token and prepares to return the semantic value
|
||||
* ]b4_locations_if([and beginning/ending positions ])[of the token.
|
||||
* @@return the token identifier corresponding to the next token.
|
||||
*/
|
||||
* @@return the token identifier corresponding to the next token. */
|
||||
int yylex () ]b4_maybe_throws([b4_lex_throws])[;
|
||||
|
||||
/**
|
||||
@@ -228,8 +162,7 @@ b4_locations_if([[
|
||||
*
|
||||
* ]b4_locations_if([[@@param loc The location of the element to which the
|
||||
* error message is related]])[
|
||||
* @@param msg The string for the error message.
|
||||
*/
|
||||
* @@param msg The string for the error message. */
|
||||
void yyerror (]b4_locations_if([b4_location_type[ loc, ]])[String msg);]
|
||||
}
|
||||
|
||||
@@ -237,9 +170,7 @@ b4_locations_if([[
|
||||
]b4_percent_code_get([[lexer]])[
|
||||
}
|
||||
|
||||
]])[/**
|
||||
* The object doing lexical analysis for us.
|
||||
*/
|
||||
]])[/** The object doing lexical analysis for us. */
|
||||
private Lexer yylexer;
|
||||
]
|
||||
b4_parse_param_vars
|
||||
@@ -405,74 +336,46 @@ b4_lexer_if([[
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to stop the parsing process and
|
||||
* return success (<tt>true</tt>).
|
||||
*/
|
||||
* return success (<tt>true</tt>). */
|
||||
public static final int YYACCEPT = 0;
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to stop the parsing process and
|
||||
* return failure (<tt>false</tt>).
|
||||
*/
|
||||
* return failure (<tt>false</tt>). */
|
||||
public static final int YYABORT = 1;
|
||||
|
||||
]b4_push_if([
|
||||
/**
|
||||
* Returned by a Bison action in order to request a new token.
|
||||
*/
|
||||
public static final int YYPUSH_MORE = 4;])[
|
||||
|
||||
/**
|
||||
* Returned by a Bison action in order to start error recovery without
|
||||
* printing an error message.
|
||||
*/
|
||||
* printing an error message. */
|
||||
public static final int YYERROR = 2;
|
||||
|
||||
/**
|
||||
* Internal return codes that are not supported for user semantic
|
||||
* actions.
|
||||
*/
|
||||
// Internal return codes that are not supported for user semantic
|
||||
// actions.
|
||||
private static final int YYERRLAB = 3;
|
||||
private static final int YYNEWSTATE = 4;
|
||||
private static final int YYDEFAULT = 5;
|
||||
private static final int YYREDUCE = 6;
|
||||
private static final int YYERRLAB1 = 7;
|
||||
private static final int YYRETURN = 8;
|
||||
]b4_push_if([[ private static final int YYGETTOKEN = 9; /* Signify that a new token is expected when doing push-parsing. */]])[
|
||||
|
||||
private int yyerrstatus_ = 0;
|
||||
|
||||
]b4_push_if([dnl
|
||||
b4_define_state])[
|
||||
/**
|
||||
* Return whether error recovery is being done. In this state, the parser
|
||||
* reads token until it reaches a known state, and then restarts normal
|
||||
* operation.
|
||||
*/
|
||||
* operation. */
|
||||
public final boolean recovering ()
|
||||
{
|
||||
return yyerrstatus_ == 0;
|
||||
}
|
||||
|
||||
/** Compute post-reduction state.
|
||||
* @@param yystate the current state
|
||||
* @@param yysym the nonterminal to push on the stack
|
||||
*/
|
||||
private int yy_lr_goto_state_ (int yystate, int yysym)
|
||||
{
|
||||
int yyr = yypgoto_[yysym - yyntokens_] + yystate;
|
||||
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
|
||||
return yytable_[yyr];
|
||||
else
|
||||
return yydefgoto_[yysym - yyntokens_];
|
||||
}
|
||||
|
||||
private int yyaction (int yyn, YYStack yystack, int yylen) ]b4_maybe_throws([b4_throws])[
|
||||
{
|
||||
]b4_yystype[ yyval;
|
||||
]b4_locations_if([b4_location_type[ yyloc = yylloc (yystack, yylen);]])[
|
||||
|
||||
/* If YYLEN is nonzero, implement the default value of the action:
|
||||
'$$ = $1'. Otherwise, use the top of the stack.
|
||||
`$$ = $1'. Otherwise, use the top of the stack.
|
||||
|
||||
Otherwise, the following line sets YYVAL to garbage.
|
||||
This behavior is undocumented and Bison
|
||||
@@ -496,7 +399,14 @@ b4_define_state])[
|
||||
yylen = 0;
|
||||
|
||||
/* Shift the result of the reduction. */
|
||||
int yystate = yy_lr_goto_state_ (yystack.stateAt (0), yyr1_[yyn]);
|
||||
yyn = yyr1_[yyn];
|
||||
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
||||
if (0 <= yystate && yystate <= yylast_
|
||||
&& yycheck_[yystate] == yystack.stateAt (0))
|
||||
yystate = yytable_[yystate];
|
||||
else
|
||||
yystate = yydefgoto_[yyn - yyntokens_];
|
||||
|
||||
yystack.push (yystate, yyval]b4_locations_if([, yyloc])[);
|
||||
return YYNEWSTATE;
|
||||
}
|
||||
@@ -553,7 +463,6 @@ b4_define_state])[
|
||||
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
||||
}
|
||||
|
||||
]b4_push_if([],[[
|
||||
/**
|
||||
* Parse input from the scanner that was specified at object construction
|
||||
* time. Return whether the end of the input was reached successfully.
|
||||
@@ -561,53 +470,46 @@ b4_define_state])[
|
||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||
* imply that there were no syntax errors.
|
||||
*/
|
||||
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[]])[
|
||||
]b4_push_if([
|
||||
/**
|
||||
* Push Parse input from external lexer
|
||||
*
|
||||
* @@param yylextoken current token
|
||||
* @@param yylexval current lval
|
||||
]b4_locations_if([ * @@param yylexloc current position])[
|
||||
*
|
||||
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
|
||||
*/
|
||||
public int push_parse (int yylextoken, b4_yystype yylexval[]b4_locations_if([, b4_location_type yylexloc]))
|
||||
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[
|
||||
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
||||
{
|
||||
]b4_locations_if([/* @@$. */
|
||||
b4_location_type yyloc;])[
|
||||
]b4_push_if([],[[
|
||||
]b4_define_state[
|
||||
/// Lookahead and lookahead in internal form.
|
||||
int yychar = yyempty_;
|
||||
int yytoken = 0;
|
||||
|
||||
/* State. */
|
||||
int yyn = 0;
|
||||
int yylen = 0;
|
||||
int yystate = 0;
|
||||
|
||||
YYStack yystack = new YYStack ();
|
||||
|
||||
/* Error handling. */
|
||||
int yynerrs_ = 0;
|
||||
]b4_locations_if([/// The location where the error started.
|
||||
]b4_location_type[ yyerrloc = null;
|
||||
|
||||
/// ]b4_location_type[ of the lookahead.
|
||||
]b4_location_type[ yylloc = new ]b4_location_type[ (null, null);
|
||||
|
||||
/// @@$.
|
||||
]b4_location_type[ yyloc;])
|
||||
|
||||
/// Semantic value of the lookahead.
|
||||
b4_yystype[ yylval = null;
|
||||
|
||||
yycdebug ("Starting parse\n");
|
||||
yyerrstatus_ = 0;
|
||||
|
||||
/* Initialize the stack. */
|
||||
yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[);
|
||||
]m4_ifdef([b4_initial_action], [
|
||||
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
||||
/* User initialization code. */
|
||||
b4_user_initial_action
|
||||
b4_dollar_popdef[]dnl
|
||||
])[
|
||||
]])[
|
||||
]b4_push_if([[
|
||||
if (!this.push_parse_initialized)
|
||||
{
|
||||
push_parse_initialize ();
|
||||
]m4_ifdef([b4_initial_action], [
|
||||
b4_dollar_pushdef([yylval], [], [yylloc])dnl
|
||||
/* User initialization code. */
|
||||
b4_user_initial_action
|
||||
b4_dollar_popdef[]dnl
|
||||
])[
|
||||
yycdebug ("Starting parse\n");
|
||||
yyerrstatus_ = 0;
|
||||
} else
|
||||
label = YYGETTOKEN;
|
||||
b4_dollar_popdef])[]dnl
|
||||
|
||||
boolean push_token_consumed = true;
|
||||
]])[
|
||||
[ /* Initialize the stack. */
|
||||
yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
|
||||
|
||||
int label = YYNEWSTATE;
|
||||
for (;;)
|
||||
switch (label)
|
||||
{
|
||||
@@ -620,8 +522,7 @@ b4_dollar_popdef[]dnl
|
||||
|
||||
/* Accept? */
|
||||
if (yystate == yyfinal_)
|
||||
]b4_push_if([{label = YYACCEPT; break;}],
|
||||
[return true;])[
|
||||
return true;
|
||||
|
||||
/* Take a decision. First try without lookahead. */
|
||||
yyn = yypact_[yystate];
|
||||
@@ -630,27 +531,16 @@ b4_dollar_popdef[]dnl
|
||||
label = YYDEFAULT;
|
||||
break;
|
||||
}
|
||||
]b4_push_if([ /* Fall Through */
|
||||
|
||||
case YYGETTOKEN:])[
|
||||
/* Read a lookahead token. */
|
||||
if (yychar == yyempty_)
|
||||
{
|
||||
]b4_push_if([[
|
||||
if (!push_token_consumed)
|
||||
return YYPUSH_MORE;
|
||||
yycdebug ("Reading a token: ");
|
||||
yychar = yylextoken;
|
||||
yylval = yylexval;]b4_locations_if([
|
||||
yylloc = yylexloc;])[
|
||||
push_token_consumed = false;]])[
|
||||
]b4_push_if([],[[
|
||||
yycdebug ("Reading a token: ");
|
||||
yychar = yylexer.yylex ();
|
||||
yylval = yylexer.getLVal ();]b4_locations_if([
|
||||
yylloc = new b4_location_type (yylexer.getStartPos (),
|
||||
yylexer.getEndPos ());])[
|
||||
]])[
|
||||
yychar = yylexer.yylex ();]
|
||||
b4_locations_if([[
|
||||
yylloc = new ]b4_location_type[(yylexer.getStartPos (),
|
||||
yylexer.getEndPos ());]])
|
||||
yylval = yylexer.getLVal ();[
|
||||
}
|
||||
|
||||
/* Convert token to internal form. */
|
||||
@@ -747,10 +637,10 @@ b4_dollar_popdef[]dnl
|
||||
{
|
||||
/* Return failure if at end of input. */
|
||||
if (yychar == Lexer.EOF)
|
||||
]b4_push_if([{label = YYABORT; break;}],[return false;])[
|
||||
return false;
|
||||
}
|
||||
else
|
||||
yychar = yyempty_;
|
||||
yychar = yyempty_;
|
||||
}
|
||||
|
||||
/* Else will try to reuse lookahead token after shifting the error
|
||||
@@ -758,9 +648,9 @@ b4_dollar_popdef[]dnl
|
||||
label = YYERRLAB1;
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------.
|
||||
/*---------------------------------------------------.
|
||||
| errorlab -- error raised explicitly by YYERROR. |
|
||||
`-------------------------------------------------*/
|
||||
`---------------------------------------------------*/
|
||||
case YYERROR:
|
||||
|
||||
]b4_locations_if([yyerrloc = yystack.locationAt (yylen - 1);])[
|
||||
@@ -792,10 +682,9 @@ b4_dollar_popdef[]dnl
|
||||
}
|
||||
}
|
||||
|
||||
/* Pop the current state because it cannot handle the
|
||||
* error token. */
|
||||
/* Pop the current state because it cannot handle the error token. */
|
||||
if (yystack.height == 0)
|
||||
]b4_push_if([{label = YYABORT; break;}],[return false;])[
|
||||
return false;
|
||||
|
||||
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
||||
yystack.pop ();
|
||||
@@ -804,11 +693,7 @@ b4_dollar_popdef[]dnl
|
||||
yystack.print (yyDebugStream);
|
||||
}
|
||||
|
||||
if (label == YYABORT)
|
||||
/* Leave the switch. */
|
||||
break;
|
||||
|
||||
]b4_locations_if([
|
||||
]b4_locations_if([
|
||||
/* Muck with the stack to setup for yylloc. */
|
||||
yystack.push (0, null, yylloc);
|
||||
yystack.push (0, null, yyerrloc);
|
||||
@@ -826,91 +711,13 @@ b4_dollar_popdef[]dnl
|
||||
|
||||
/* Accept. */
|
||||
case YYACCEPT:
|
||||
]b4_push_if([this.push_parse_initialized = false; return YYACCEPT;],
|
||||
[return true;])[
|
||||
return true;
|
||||
|
||||
/* Abort. */
|
||||
case YYABORT:
|
||||
]b4_push_if([this.push_parse_initialized = false; return YYABORT;],
|
||||
[return false;])[
|
||||
return false;
|
||||
}
|
||||
}
|
||||
]b4_push_if([[
|
||||
boolean push_parse_initialized = false;
|
||||
|
||||
/**
|
||||
* (Re-)Initialize the state of the push parser.
|
||||
*/
|
||||
public void push_parse_initialize()
|
||||
{
|
||||
/* Lookahead and lookahead in internal form. */
|
||||
this.yychar = yyempty_;
|
||||
this.yytoken = 0;
|
||||
|
||||
/* State. */
|
||||
this.yyn = 0;
|
||||
this.yylen = 0;
|
||||
this.yystate = 0;
|
||||
this.yystack = new YYStack ();
|
||||
this.label = YYNEWSTATE;
|
||||
|
||||
/* Error handling. */
|
||||
this.yynerrs_ = 0;
|
||||
]b4_locations_if([/* The location where the error started. */
|
||||
this.yyerrloc = null;
|
||||
this.yylloc = new b4_location_type (null, null);])[
|
||||
|
||||
/* Semantic value of the lookahead. */
|
||||
this.yylval = null;
|
||||
|
||||
yystack.push (this.yystate, this.yylval]b4_locations_if([, this.yylloc])[);
|
||||
|
||||
this.push_parse_initialized = true;
|
||||
|
||||
}
|
||||
]b4_locations_if([
|
||||
/**
|
||||
* Push parse given input from an external lexer.
|
||||
*
|
||||
* @@param yylextoken current token
|
||||
* @@param yylexval current lval
|
||||
* @@param yyylexpos current position
|
||||
*
|
||||
* @@return <tt>YYACCEPT, YYABORT, YYPUSH_MORE</tt>
|
||||
*/
|
||||
public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type yylexpos)
|
||||
b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
|
||||
{
|
||||
return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos));
|
||||
}
|
||||
])[]])
|
||||
|
||||
b4_both_if([[
|
||||
/**
|
||||
* Parse input from the scanner that was specified at object construction
|
||||
* time. Return whether the end of the input was reached successfully.
|
||||
* This version of parse () is defined only when api.push-push=both.
|
||||
*
|
||||
* @@return <tt>true</tt> if the parsing succeeds. Note that this does not
|
||||
* imply that there were no syntax errors.
|
||||
*/
|
||||
public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])[
|
||||
{
|
||||
if (yylexer == null)
|
||||
throw new NullPointerException("Null Lexer");
|
||||
int status;
|
||||
do {
|
||||
int token = yylexer.yylex();
|
||||
]b4_yystype[ lval = yylexer.getLVal();
|
||||
]b4_locations_if([dnl
|
||||
b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (),
|
||||
yylexer.getEndPos ());])[
|
||||
]b4_locations_if([status = push_parse(token,lval,yyloc);],[
|
||||
status = push_parse(token,lval);])[
|
||||
} while (status == YYPUSH_MORE);
|
||||
return (status == YYACCEPT);
|
||||
}
|
||||
]])[
|
||||
|
||||
// Generate an error message.
|
||||
private String yysyntax_error (int yystate, int tok)
|
||||
@@ -945,8 +752,8 @@ b4_both_if([[
|
||||
*/
|
||||
if (tok != yyempty_)
|
||||
{
|
||||
/* FIXME: This method of building the message is not compatible
|
||||
with internationalization. */
|
||||
// FIXME: This method of building the message is not compatible
|
||||
// with internationalization.
|
||||
StringBuffer res =
|
||||
new StringBuffer ("syntax error, unexpected ");
|
||||
res.append (yytnamerr_ (yytname_[tok]));
|
||||
@@ -995,9 +802,8 @@ b4_both_if([[
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the given <code>yytable_</code>
|
||||
* value indicates a syntax error.
|
||||
* @@param yyvalue the value to check
|
||||
* Whether the given <code>yytable_</code> value indicates a syntax error.
|
||||
* @@param yyvalue the value to check
|
||||
*/
|
||||
private static boolean yy_table_value_is_error_ (int yyvalue)
|
||||
{
|
||||
@@ -1019,7 +825,6 @@ b4_both_if([[
|
||||
]b4_integral_parser_table_define([rline], [b4_rline],
|
||||
[[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[
|
||||
|
||||
|
||||
// Report on the debug stream that the rule yyrule is going to be reduced.
|
||||
private void yy_reduce_print (int yyrule, YYStack yystack)
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002, 2005-2015 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 2005-2013 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
|
||||
|
||||
+36
-60
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015])
|
||||
[2002-2013])
|
||||
|
||||
# b4_position_define
|
||||
# ------------------
|
||||
@@ -25,9 +25,10 @@ m4_define([b4_position_define],
|
||||
[[ /// Abstract a position.
|
||||
class position
|
||||
{
|
||||
public:]m4_ifdef([b4_location_constructors], [[
|
||||
public:
|
||||
]m4_ifdef([b4_location_constructors], [[
|
||||
/// Construct a position.
|
||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
||||
explicit position (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
||||
unsigned int l = ]b4_location_initial_line[u,
|
||||
unsigned int c = ]b4_location_initial_column[u)
|
||||
: filename (f)
|
||||
@@ -38,7 +39,7 @@ m4_define([b4_position_define],
|
||||
|
||||
]])[
|
||||
/// Initialization.
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULLPTR,
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* fn = YY_NULL,
|
||||
unsigned int l = ]b4_location_initial_line[u,
|
||||
unsigned int c = ]b4_location_initial_column[u)
|
||||
{
|
||||
@@ -52,17 +53,14 @@ m4_define([b4_position_define],
|
||||
/// (line related) Advance to the COUNT next lines.
|
||||
void lines (int count = 1)
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
column = ]b4_location_initial_column[u;
|
||||
line = add_ (line, count, ]b4_location_initial_line[);
|
||||
}
|
||||
column = ]b4_location_initial_column[u;
|
||||
line += count;
|
||||
}
|
||||
|
||||
/// (column related) Advance to the COUNT next columns.
|
||||
void columns (int count = 1)
|
||||
{
|
||||
column = add_ (column, count, ]b4_location_initial_column[);
|
||||
column = std::max (]b4_location_initial_column[u, column + count);
|
||||
}
|
||||
/** \} */
|
||||
|
||||
@@ -72,44 +70,36 @@ m4_define([b4_position_define],
|
||||
unsigned int line;
|
||||
/// Current column number.
|
||||
unsigned int column;
|
||||
|
||||
private:
|
||||
/// Compute max(min, lhs+rhs) (provided min <= lhs).
|
||||
static unsigned int add_ (unsigned int lhs, int rhs, unsigned int min)
|
||||
{
|
||||
return (0 < rhs || -static_cast<unsigned int>(rhs) < lhs
|
||||
? rhs + lhs
|
||||
: min);
|
||||
}
|
||||
};
|
||||
|
||||
/// Add \a width columns, in place.
|
||||
/// Add and assign a position.
|
||||
inline position&
|
||||
operator+= (position& res, int width)
|
||||
operator+= (position& res, const int width)
|
||||
{
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns.
|
||||
inline position
|
||||
operator+ (position res, int width)
|
||||
/// Add two position objects.
|
||||
inline const position
|
||||
operator+ (const position& begin, const int width)
|
||||
{
|
||||
position res = begin;
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns, in place.
|
||||
/// Add and assign a position.
|
||||
inline position&
|
||||
operator-= (position& res, int width)
|
||||
operator-= (position& res, const int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns.
|
||||
inline position
|
||||
operator- (position res, int width)
|
||||
/// Add two position objects.
|
||||
inline const position
|
||||
operator- (const position& begin, const int width)
|
||||
{
|
||||
return res -= width;
|
||||
return begin + -width;
|
||||
}
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two position objects.
|
||||
@@ -178,7 +168,7 @@ m4_define([b4_location_define],
|
||||
|
||||
])[
|
||||
/// Initialization.
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULLPTR,
|
||||
void initialize (]b4_percent_define_get([[filename_type]])[* f = YY_NULL,
|
||||
unsigned int l = ]b4_location_initial_line[u,
|
||||
unsigned int c = ]b4_location_initial_column[u)
|
||||
{
|
||||
@@ -196,13 +186,13 @@ m4_define([b4_location_define],
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next columns.
|
||||
void columns (int count = 1)
|
||||
void columns (unsigned int count = 1)
|
||||
{
|
||||
end += count;
|
||||
}
|
||||
|
||||
/// Extend the current location to the COUNT next lines.
|
||||
void lines (int count = 1)
|
||||
void lines (unsigned int count = 1)
|
||||
{
|
||||
end.lines (count);
|
||||
}
|
||||
@@ -216,42 +206,27 @@ m4_define([b4_location_define],
|
||||
position end;
|
||||
};
|
||||
|
||||
/// Join two locations, in place.
|
||||
inline location& operator+= (location& res, const location& end)
|
||||
/// Join two location objects to create a location.
|
||||
inline const location operator+ (const location& begin, const location& end)
|
||||
{
|
||||
location res = begin;
|
||||
res.end = end.end;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Join two locations.
|
||||
inline location operator+ (location res, const location& end)
|
||||
{
|
||||
return res += end;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position, in place.
|
||||
inline location& operator+= (location& res, int width)
|
||||
/// Add two location objects.
|
||||
inline const location operator+ (const location& begin, unsigned int width)
|
||||
{
|
||||
location res = begin;
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Add \a width columns to the end position.
|
||||
inline location operator+ (location res, int width)
|
||||
/// Add and assign a location.
|
||||
inline location& operator+= (location& res, unsigned int width)
|
||||
{
|
||||
return res += width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position, in place.
|
||||
inline location& operator-= (location& res, int width)
|
||||
{
|
||||
return res += -width;
|
||||
}
|
||||
|
||||
/// Subtract \a width columns to the end position.
|
||||
inline location operator- (location res, int width)
|
||||
{
|
||||
return res -= width;
|
||||
res.columns (width);
|
||||
return res;
|
||||
}
|
||||
]b4_percent_define_flag_if([[define_location_comparison]], [[
|
||||
/// Compare two location objects.
|
||||
@@ -279,7 +254,8 @@ m4_define([b4_location_define],
|
||||
operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
|
||||
{
|
||||
unsigned int end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
|
||||
ostr << loc.begin;
|
||||
ostr << loc.begin// << "(" << loc.end << ") "
|
||||
;
|
||||
if (loc.end.filename
|
||||
&& (!loc.begin.filename
|
||||
|| *loc.begin.filename != *loc.end.filename))
|
||||
|
||||
+2
-10
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[2002-2015])
|
||||
[2002-2013])
|
||||
|
||||
# b4_stack_define
|
||||
# ---------------
|
||||
@@ -72,12 +72,6 @@ m4_define([b4_stack_define],
|
||||
seq_.pop_back ();
|
||||
}
|
||||
|
||||
void
|
||||
clear ()
|
||||
{
|
||||
seq_.clear ();
|
||||
}
|
||||
|
||||
inline
|
||||
typename S::size_type
|
||||
size () const
|
||||
@@ -100,8 +94,6 @@ m4_define([b4_stack_define],
|
||||
}
|
||||
|
||||
private:
|
||||
stack (const stack&);
|
||||
stack& operator= (const stack&);
|
||||
/// The wrapped container.
|
||||
S seq_;
|
||||
};
|
||||
|
||||
+42
-57
@@ -1,6 +1,6 @@
|
||||
# C++ skeleton for Bison
|
||||
|
||||
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 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
|
||||
@@ -26,7 +26,7 @@
|
||||
# YYTYPE.
|
||||
m4_define([b4_symbol_variant],
|
||||
[m4_pushdef([b4_dollar_dollar],
|
||||
[$2.$3< $][3 > (m4_shift3($@))])dnl
|
||||
[$2.$3< $][3 >(m4_shift3($@))])dnl
|
||||
switch ($1)
|
||||
{
|
||||
b4_type_foreach([b4_type_action_])[]dnl
|
||||
@@ -63,7 +63,7 @@ m4_define([b4_char_sizeof],
|
||||
[b4_symbol_if([$1], [has_type],
|
||||
[
|
||||
m4_map([ b4_symbol_tag_comment], [$@])dnl
|
||||
char _b4_char_sizeof_dummy@{sizeof(b4_symbol([$1], [type]))@};
|
||||
char _b4_char_sizeof_dummy@{sizeof([b4_symbol([$1], [type])])@};
|
||||
])])
|
||||
|
||||
|
||||
@@ -95,22 +95,22 @@ m4_define([b4_variant_define],
|
||||
|
||||
/// Empty construction.
|
||||
variant ()]b4_parse_assert_if([
|
||||
: yytypeid_ (YY_NULLPTR)])[
|
||||
: tname (YY_NULL)])[
|
||||
{}
|
||||
|
||||
/// Construct and fill.
|
||||
template <typename T>
|
||||
variant (const T& t)]b4_parse_assert_if([
|
||||
: yytypeid_ (&typeid (T))])[
|
||||
: tname (typeid (T).name ())])[
|
||||
{
|
||||
YYASSERT (sizeof (T) <= S);
|
||||
new (yyas_<T> ()) T (t);
|
||||
new (buffer.raw) T (t);
|
||||
}
|
||||
|
||||
/// Destruction, allowed only if empty.
|
||||
~variant ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (!tname);
|
||||
])[}
|
||||
|
||||
/// Instantiate an empty \a T in here.
|
||||
@@ -118,10 +118,10 @@ m4_define([b4_variant_define],
|
||||
T&
|
||||
build ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (!tname);
|
||||
YYASSERT (sizeof (T) <= S);
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T;
|
||||
tname = typeid (T).name ();])[
|
||||
return *new (buffer.raw) T;
|
||||
}
|
||||
|
||||
/// Instantiate a \a T in here from \a t.
|
||||
@@ -129,10 +129,10 @@ m4_define([b4_variant_define],
|
||||
T&
|
||||
build (const T& t)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!yytypeid_);
|
||||
YYASSERT (!tname);
|
||||
YYASSERT (sizeof (T) <= S);
|
||||
yytypeid_ = & typeid (T);])[
|
||||
return *new (yyas_<T> ()) T (t);
|
||||
tname = typeid (T).name ();])[
|
||||
return *new (buffer.raw) T (t);
|
||||
}
|
||||
|
||||
/// Accessor to a built \a T.
|
||||
@@ -140,9 +140,9 @@ m4_define([b4_variant_define],
|
||||
T&
|
||||
as ()
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (*yytypeid_ == typeid (T));
|
||||
YYASSERT (tname == typeid (T).name ());
|
||||
YYASSERT (sizeof (T) <= S);])[
|
||||
return *yyas_<T> ();
|
||||
return reinterpret_cast<T&> (buffer.raw);
|
||||
}
|
||||
|
||||
/// Const accessor to a built \a T (for %printer).
|
||||
@@ -150,9 +150,9 @@ m4_define([b4_variant_define],
|
||||
const T&
|
||||
as () const
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (*yytypeid_ == typeid (T));
|
||||
YYASSERT (tname == typeid (T).name ());
|
||||
YYASSERT (sizeof (T) <= S);])[
|
||||
return *yyas_<T> ();
|
||||
return reinterpret_cast<const T&> (buffer.raw);
|
||||
}
|
||||
|
||||
/// Swap the content with \a other, of same type.
|
||||
@@ -167,9 +167,9 @@ m4_define([b4_variant_define],
|
||||
void
|
||||
swap (self_type& other)
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (yytypeid_);
|
||||
YYASSERT (*yytypeid_ == *other.yytypeid_);])[
|
||||
std::swap (as<T> (), other.as<T> ());
|
||||
YYASSERT (tname);
|
||||
YYASSERT (tname == other.tname);])[
|
||||
std::swap (as<T>(), other.as<T>());
|
||||
}
|
||||
|
||||
/// Move the content of \a other to this.
|
||||
@@ -178,10 +178,11 @@ m4_define([b4_variant_define],
|
||||
template <typename T>
|
||||
void
|
||||
move (self_type& other)
|
||||
{
|
||||
build<T> ();
|
||||
swap<T> (other);
|
||||
other.destroy<T> ();
|
||||
{]b4_parse_assert_if([
|
||||
YYASSERT (!tname);])[
|
||||
build<T>();
|
||||
swap<T>(other);
|
||||
other.destroy<T>();
|
||||
}
|
||||
|
||||
/// Copy the content of \a other to this.
|
||||
@@ -198,7 +199,7 @@ m4_define([b4_variant_define],
|
||||
destroy ()
|
||||
{
|
||||
as<T> ().~T ();]b4_parse_assert_if([
|
||||
yytypeid_ = YY_NULLPTR;])[
|
||||
tname = YY_NULL;])[
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -206,34 +207,17 @@ m4_define([b4_variant_define],
|
||||
self_type& operator=(const self_type&);
|
||||
variant (const self_type&);
|
||||
|
||||
/// Accessor to raw memory as \a T.
|
||||
template <typename T>
|
||||
T*
|
||||
yyas_ ()
|
||||
{
|
||||
void *yyp = yybuffer_.yyraw;
|
||||
return static_cast<T*> (yyp);
|
||||
}
|
||||
|
||||
/// Const accessor to raw memory as \a T.
|
||||
template <typename T>
|
||||
const T*
|
||||
yyas_ () const
|
||||
{
|
||||
const void *yyp = yybuffer_.yyraw;
|
||||
return static_cast<const T*> (yyp);
|
||||
}
|
||||
|
||||
/// A buffer large enough to store any of the semantic values.
|
||||
/// Long double is chosen as it has the strongest alignment
|
||||
/// constraints.
|
||||
union
|
||||
{
|
||||
/// Strongest alignment constraints.
|
||||
long double yyalign_me;
|
||||
/// A buffer large enough to store any of the semantic values.
|
||||
char yyraw[S];
|
||||
} yybuffer_;]b4_parse_assert_if([
|
||||
long double align_me;
|
||||
char raw[S];
|
||||
} buffer;]b4_parse_assert_if([
|
||||
|
||||
/// Whether the content is built: if defined, the name of the stored type.
|
||||
const std::type_info *yytypeid_;])[
|
||||
const char* tname;])[
|
||||
};
|
||||
]])
|
||||
|
||||
@@ -243,16 +227,16 @@ m4_define([b4_variant_define],
|
||||
## -------------------------- ##
|
||||
|
||||
|
||||
# b4_value_type_declare
|
||||
# ---------------------
|
||||
# b4_semantic_type_declare
|
||||
# ------------------------
|
||||
# Declare semantic_type.
|
||||
m4_define([b4_value_type_declare],
|
||||
[[ /// An auxiliary type to compute the largest semantic type.
|
||||
m4_define([b4_semantic_type_declare],
|
||||
[ /// An auxiliary type to compute the largest semantic type.
|
||||
union union_type
|
||||
{]b4_type_foreach([b4_char_sizeof])[};
|
||||
|
||||
/// Symbol semantic values.
|
||||
typedef variant<sizeof(union_type)> semantic_type;][]dnl
|
||||
typedef variant<sizeof(union_type)> semantic_type;dnl
|
||||
])
|
||||
|
||||
|
||||
@@ -262,7 +246,7 @@ m4_define([b4_value_type_declare],
|
||||
# ----------------------------
|
||||
m4_define([b4_symbol_value],
|
||||
[m4_ifval([$2],
|
||||
[$1.as< $2 > ()],
|
||||
[$1.as< $2 >()],
|
||||
[$1])])
|
||||
|
||||
# b4_symbol_value_template(VAL, [TYPE])
|
||||
@@ -270,7 +254,7 @@ m4_define([b4_symbol_value],
|
||||
# Same as b4_symbol_value, but used in a template method.
|
||||
m4_define([b4_symbol_value_template],
|
||||
[m4_ifval([$2],
|
||||
[$1.template as< $2 > ()],
|
||||
[$1.template as< $2 >()],
|
||||
[$1])])
|
||||
|
||||
|
||||
@@ -320,13 +304,14 @@ b4_join(b4_symbol_if([$1], [has_type],
|
||||
return symbol_type (b4_join([token::b4_symbol([$1], [id])],
|
||||
b4_symbol_if([$1], [has_type], [v]),
|
||||
b4_locations_if([l])));
|
||||
|
||||
}
|
||||
|
||||
])])])
|
||||
|
||||
|
||||
# b4_basic_symbol_constructor_declare
|
||||
# -----------------------------------
|
||||
# ----------------------------------
|
||||
# Generate a constructor declaration for basic_symbol from given type.
|
||||
m4_define([b4_basic_symbol_constructor_declare],
|
||||
[[
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
bison.xsl - common templates for Bison XSLT.
|
||||
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2dot.xsl - transform Bison XML Report into DOT.
|
||||
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -201,8 +201,6 @@
|
||||
<xsl:if test="$point = 0">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<!-- RHS -->
|
||||
<xsl:for-each select="rhs/symbol|rhs/empty">
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="$point = position()">
|
||||
@@ -216,9 +214,7 @@
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
</xsl:template>
|
||||
<xsl:template match="empty"/>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
<xsl:text> [</xsl:text>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2text.xsl - transform Bison XML Report into plain text.
|
||||
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -350,7 +350,12 @@
|
||||
<xsl:if test="position() = $point + 1">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="position() = last() and position() = $point">
|
||||
<xsl:text> .</xsl:text>
|
||||
</xsl:if>
|
||||
@@ -368,7 +373,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
<xsl:text> /* empty */</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--
|
||||
xml2html.xsl - transform Bison XML Report into XHTML.
|
||||
|
||||
Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -532,7 +532,12 @@
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="point">.</span>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="$itemset = 'true' and name(.) != 'empty'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="$itemset != 'true'">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:if>
|
||||
<xsl:if test="position() = last() and position() = $point">
|
||||
<xsl:text> </xsl:text>
|
||||
<span class="point">.</span>
|
||||
@@ -558,7 +563,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="empty">
|
||||
<xsl:text> %empty</xsl:text>
|
||||
<xsl:text> ε</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lookaheads">
|
||||
|
||||
+47
-24
@@ -1,11 +1,11 @@
|
||||
-*- C -*-
|
||||
# Yacc compatible skeleton for Bison
|
||||
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation,
|
||||
# Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
m4_pushdef([b4_copyright_years],
|
||||
[1984, 1989-1990, 2000-2015])
|
||||
[1984, 1989-1990, 2000-2013])
|
||||
|
||||
# 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
|
||||
@@ -143,6 +143,7 @@ m4_define([b4_rhs_value],
|
||||
[b4_symbol_value([yyvsp@{b4_subtract([$2], [$1])@}], [$3])])
|
||||
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Locations. ##
|
||||
## ----------- ##
|
||||
@@ -175,19 +176,36 @@ m4_define([b4_declare_scanner_communication_variables], [[
|
||||
int yychar;
|
||||
|
||||
]b4_pure_if([[
|
||||
/* The semantic value of the lookahead symbol. */
|
||||
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
/* Default value used for initialization, for pacifying older GCCs
|
||||
or non-GCC compilers. */
|
||||
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
|
||||
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);]b4_locations_if([[
|
||||
static YYSTYPE yyval_default;
|
||||
# define YY_INITIAL_VALUE(Value) = Value
|
||||
#endif]b4_locations_if([[
|
||||
static YYLTYPE yyloc_default][]b4_yyloc_default[;]])])[
|
||||
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
#endif
|
||||
#ifndef YY_INITIAL_VALUE
|
||||
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
||||
#endif
|
||||
|
||||
/* The semantic value of the lookahead symbol. */
|
||||
YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);]b4_locations_if([[
|
||||
|
||||
/* Location data for the lookahead symbol. */
|
||||
static YYLTYPE yyloc_default]b4_yyloc_default[;
|
||||
YYLTYPE yylloc = yyloc_default;]])],
|
||||
[[/* The semantic value of the lookahead symbol. */
|
||||
YYSTYPE yylval;]b4_locations_if([[
|
||||
/* Location data for the lookahead symbol. */
|
||||
YYLTYPE yylloc]b4_yyloc_default[;]])[
|
||||
YYLTYPE yylloc]b4_pure_if([ = yyloc_default], [b4_yyloc_default])[;
|
||||
]])b4_pure_if([], [[
|
||||
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs;]])])
|
||||
|
||||
@@ -205,9 +223,9 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
|
||||
int yyerrstatus;
|
||||
|
||||
/* The stacks and their tools:
|
||||
'yyss': related to states.
|
||||
'yyvs': related to semantic values.]b4_locations_if([[
|
||||
'yyls': related to locations.]])[
|
||||
`yyss': related to states.
|
||||
`yyvs': related to semantic values.]b4_locations_if([[
|
||||
`yyls': related to locations.]])[
|
||||
|
||||
Refer to the stacks through separate pointers, to allow yyoverflow
|
||||
to reallocate them elsewhere. */
|
||||
@@ -413,7 +431,12 @@ typedef short int yytype_int16;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
]b4_attribute_define[
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#ifdef __GNUC__
|
||||
# define YYUSE(E) ((void) (E))
|
||||
#else
|
||||
# define YYUSE(E) /* empty */
|
||||
#endif
|
||||
|
||||
#if ]b4_lac_if([[1]], [[! defined yyoverflow || YYERROR_VERBOSE]])[
|
||||
|
||||
@@ -445,7 +468,7 @@ b4_push_if([], [b4_lac_if([], [[
|
||||
# endif]])])[
|
||||
|
||||
# ifdef YYSTACK_ALLOC
|
||||
/* Pacify GCC's 'empty if-body' warning. */
|
||||
/* Pacify GCC's `empty if-body' warning. */
|
||||
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
|
||||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||||
/* The OS might guarantee only one guard page at the bottom of the stack,
|
||||
@@ -1108,11 +1131,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
]b4_lac_if([[yytype_int16 *yyesa, yytype_int16 **yyes,
|
||||
YYSIZE_T *yyes_capacity, ]])[yytype_int16 *yyssp, int yytoken)
|
||||
{
|
||||
YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
|
||||
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULLPTR;
|
||||
const char *yyformat = YY_NULL;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
@@ -1187,7 +1210,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
{
|
||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
|
||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
@@ -1271,7 +1294,7 @@ static char yypstate_allocated = 0;]])b4_pull_if([
|
||||
|
||||
b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
{
|
||||
return yypull_parse (YY_NULLPTR]m4_ifset([b4_parse_param],
|
||||
return yypull_parse (YY_NULL]m4_ifset([b4_parse_param],
|
||||
[[, ]b4_args(b4_parse_param)])[);
|
||||
}
|
||||
|
||||
@@ -1313,10 +1336,10 @@ b4_function_define([[yyparse]], [[int]], b4_parse_param)[
|
||||
{
|
||||
yypstate *yyps;]b4_pure_if([], [[
|
||||
if (yypstate_allocated)
|
||||
return YY_NULLPTR;]])[
|
||||
return YY_NULL;]])[
|
||||
yyps = (yypstate *) malloc (sizeof *yyps);
|
||||
if (!yyps)
|
||||
return YY_NULLPTR;
|
||||
return YY_NULL;
|
||||
yyps->yynew = 1;]b4_pure_if([], [[
|
||||
yypstate_allocated = 1;]])[
|
||||
return yyps;
|
||||
@@ -1631,7 +1654,7 @@ yyreduce:
|
||||
yylen = yyr2[yyn];
|
||||
|
||||
/* If YYLEN is nonzero, implement the default value of the action:
|
||||
'$$ = $1'.
|
||||
`$$ = $1'.
|
||||
|
||||
Otherwise, the following line sets YYVAL to garbage.
|
||||
This behavior is undocumented and Bison
|
||||
@@ -1679,7 +1702,7 @@ yyreduce:
|
||||
*++yyvsp = yyval;]b4_locations_if([
|
||||
*++yylsp = yyloc;])[
|
||||
|
||||
/* Now 'shift' the result of the reduction. Determine what state
|
||||
/* Now `shift' the result of the reduction. Determine what state
|
||||
that goes to, based on the state we popped back to and the rule
|
||||
number reduced by. */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# DJGPP Maintainer's Makefile -*-Makefile-*-
|
||||
# Requires GNU sed
|
||||
|
||||
## Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
|
||||
|
||||
Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ Rem Configure Bison for DJGPP.
|
||||
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
|
||||
Rem format, or else stock DOS/Windows shells will refuse to run it.
|
||||
|
||||
Rem Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
|
||||
Rem This program is free software: you can redistribute it and/or modify
|
||||
Rem it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the configure script generated by autoconf 2.62.
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
# This is the config.site file for configuring GNU packages
|
||||
# which are to be built with DJGPP tools.
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# sed script for DJGPP specific editing of config.hin
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ Rem This batch file unpacks the Bison distribution while simultaneously
|
||||
Rem renaming some of the files whose names are invalid on DOS or conflict
|
||||
Rem with other file names after truncation to DOS 8+3 namespace.
|
||||
Rem
|
||||
Rem Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
Rem Copyright (C) 2005-2013 Free Software Foundation, Inc.
|
||||
Rem
|
||||
Rem This program is free software: you can redistribute it and/or modify
|
||||
Rem it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2008-2015 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2008-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Subprocesses with pipes.
|
||||
|
||||
Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# Sed script for additional DJGPP specific editing
|
||||
# of the testsuite script generated by autoconf 2.61.
|
||||
|
||||
# Copyright (C) 2007-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2007-2013 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
|
||||
|
||||
@@ -27,4 +27,3 @@
|
||||
/stamp-vti
|
||||
/version.texi
|
||||
/yacc.1
|
||||
/gendocs_template_min
|
||||
|
||||
+320
-773
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
This file is a stub, not used by the documentation. If you feel like
|
||||
contributing ASCII art for example.gv, please step forward!
|
||||
+17
-26
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2001-2003, 2005-2015 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001-2003, 2005-2013 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
|
||||
@@ -23,10 +23,9 @@ doc_bison_TEXINFOS = \
|
||||
# Cannot express dependencies directly on file names because of Automake.
|
||||
# Obfuscate with a variable.
|
||||
doc_bison = doc/bison
|
||||
$(doc_bison).dvi: $(FIGS_GV:.gv=.eps)
|
||||
$(doc_bison).info: $(FIGS_GV:.gv=.txt)
|
||||
$(doc_bison).pdf: $(FIGS_GV:.gv=.pdf)
|
||||
$(doc_bison).html: $(FIGS_GV:.gv=.png)
|
||||
$(doc_bison).dvi: $(FIGS_DOT:.dot=.eps)
|
||||
$(doc_bison).pdf: $(FIGS_DOT:.dot=.pdf)
|
||||
$(doc_bison).html: $(FIGS_DOT:.dot=.png)
|
||||
|
||||
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
|
||||
CLEANDIRS = doc/bison.t2d
|
||||
@@ -38,7 +37,7 @@ MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
|
||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
||||
$(CROSS_OPTIONS_TEXI): doc/bison.help $(CROSS_OPTIONS_PL)
|
||||
# Create $@~ which is the previous contents. Don't use 'mv' here so
|
||||
# Create $@~ which is the previous contents. Don't use `mv' here so
|
||||
# that even if we are interrupted, the file is still available for
|
||||
# diff in the next run. Note that $@ might not exist yet.
|
||||
$(AM_V_GEN){ test ! -f $@ || cat $@; } >$@~
|
||||
@@ -85,13 +84,11 @@ doc/refcard.pdf: doc/refcard.tex
|
||||
# repeated builds of bison.help.
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
||||
if ! CROSS_COMPILING
|
||||
MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
|
||||
$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
|
||||
$(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
|
||||
$(AM_V_at) src/bison$(EXEEXT) --help >>doc/bison.help.tmp
|
||||
$(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
|
||||
endif ! CROSS_COMPILING
|
||||
|
||||
|
||||
## ----------- ##
|
||||
@@ -108,11 +105,7 @@ remove_time_stamp = \
|
||||
sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
|
||||
|
||||
# Depend on configure to get version number changes.
|
||||
if ! CROSS_COMPILING
|
||||
MAN_DEPS = doc/bison.help doc/bison.x $(top_srcdir)/configure
|
||||
endif
|
||||
|
||||
$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
||||
$(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure
|
||||
$(AM_V_GEN)$(HELP2MAN) \
|
||||
--include=$(top_srcdir)/doc/bison.x \
|
||||
--output=$@.t src/bison$(EXEEXT)
|
||||
@@ -124,34 +117,32 @@ $(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
||||
fi
|
||||
$(AM_V_at)rm -f $@*.t
|
||||
|
||||
if ENABLE_YACC
|
||||
nodist_man_MANS = doc/yacc.1
|
||||
endif
|
||||
|
||||
## ----------------------------- ##
|
||||
## Graphviz examples generation. ##
|
||||
## ----------------------------- ##
|
||||
|
||||
CLEANFILES += $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
||||
FIGS_GV = \
|
||||
doc/figs/example.gv \
|
||||
doc/figs/example-reduce.gv doc/figs/example-shift.gv
|
||||
EXTRA_DIST += \
|
||||
$(FIGS_GV) $(FIGS_GV:.gv=.txt) \
|
||||
$(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) $(FIGS_GV:.gv=.png)
|
||||
SUFFIXES += .gv .eps .pdf .png
|
||||
CLEANDIRS += doc/figs
|
||||
FIGS_DOT = \
|
||||
doc/figs/example.dot \
|
||||
doc/figs/example-reduce.dot doc/figs/example-shift.dot
|
||||
EXTRA_DIST += \
|
||||
$(FIGS_DOT) \
|
||||
$(FIGS_DOT:.dot=.eps) $(FIGS_DOT:.dot=.pdf) $(FIGS_DOT:.dot=.png)
|
||||
SUFFIXES += .dot .eps .pdf .png
|
||||
|
||||
.gv.eps:
|
||||
.dot.eps:
|
||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
||||
$(AM_V_at) $(DOT) -Gmargin=0 -Teps $< >$@.tmp
|
||||
$(AM_V_at) mv $@.tmp $@
|
||||
|
||||
.gv.pdf:
|
||||
.dot.pdf:
|
||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
||||
$(AM_V_at) $(DOT) -Gmargin=0 -Tpdf $< >$@.tmp
|
||||
$(AM_V_at) mv $@.tmp $@
|
||||
|
||||
.gv.png:
|
||||
.dot.png:
|
||||
$(AM_V_GEN) $(MKDIR_P) `echo "./$@" | sed -e 's,/[^/]*$$,,'`
|
||||
$(AM_V_at) $(DOT) -Gmargin=0 -Tpng $< >$@.tmp
|
||||
$(AM_V_at) mv $@.tmp $@
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
\def\finalout{\overfullrule=0pt}
|
||||
%\finalout
|
||||
|
||||
% Copyright (c) 1998, 2001, 2009-2015 Free Software Foundation, Inc.
|
||||
% Copyright (c) 1998, 2001, 2009-2013 Free Software Foundation, Inc.
|
||||
%
|
||||
% This file is part of Bison.
|
||||
%
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ straightforward use of _build/src/bison would.)
|
||||
|
||||
--
|
||||
|
||||
Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
# Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of Bison, the GNU Compiler Compiler.
|
||||
#
|
||||
@@ -204,9 +204,9 @@ Format the list of directives for Bison for bench named C<$bench>.
|
||||
sub directives($@)
|
||||
{
|
||||
my ($bench, @directive) = @_;
|
||||
my $res = "/* Directives for bench '$bench'. */\n";
|
||||
my $res = "/* Directives for bench `$bench'. */\n";
|
||||
$res .= join ("\n", @directive) . "\n";
|
||||
$res .= "/* End of directives for bench '$bench'. */\n";
|
||||
$res .= "/* End of directives for bench `$bench'. */\n";
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2006, 2008-2013 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
+36
-45
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2006, 2008-2013 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
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
# Don't depend on $(BISON) otherwise we would rebuild these files
|
||||
# in srcdir, including during distcheck, which is forbidden.
|
||||
%D%/calc++-parser.stamp: $(BISON_IN)
|
||||
examples/calc++/calc++-parser.stamp: $(BISON_IN)
|
||||
SUFFIXES += .yy .stamp
|
||||
.yy.stamp:
|
||||
$(AM_V_YACC)rm -f $@
|
||||
@@ -27,14 +27,14 @@ SUFFIXES += .yy .stamp
|
||||
$(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
|
||||
$(AM_V_at)mv -f $@.tmp $@
|
||||
|
||||
$(calcxx_sources_generated): %D%/calc++-parser.stamp
|
||||
@test -f $@ || rm -f %D%/calc++-parser.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/calc++-parser.stamp
|
||||
$(calc_sources_generated): examples/calc++/calc++-parser.stamp
|
||||
@test -f $@ || rm -f examples/calc++/calc++-parser.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
|
||||
CLEANFILES += \
|
||||
$(calcxx_sources_generated) \
|
||||
%D%/calc++-parser.output \
|
||||
%D%/calc++-parser.stamp \
|
||||
%D%/calc++-scanner.cc
|
||||
$(calc_sources_generated) \
|
||||
examples/calc++/calc++-parser.output \
|
||||
examples/calc++/calc++-parser.stamp \
|
||||
examples/calc++/calc++-scanner.cc
|
||||
|
||||
|
||||
## -------------------- ##
|
||||
@@ -42,43 +42,34 @@ CLEANFILES += \
|
||||
## -------------------- ##
|
||||
|
||||
# Avoid using BUILT_SOURCES which is too global.
|
||||
$(%C%_calc___OBJECTS): $(calcxx_sources_generated)
|
||||
$(examples_calc___calc___OBJECTS): $(calc_sources_generated)
|
||||
|
||||
calcxx_sources_extracted = \
|
||||
%D%/calc++-driver.cc \
|
||||
%D%/calc++-driver.hh \
|
||||
%D%/calc++-scanner.ll \
|
||||
%D%/calc++.cc
|
||||
calcxx_extracted = \
|
||||
$(calcxx_sources_extracted) \
|
||||
%D%/calc++-parser.yy
|
||||
extracted += $(calcxx_extracted)
|
||||
calcxx_sources_generated = \
|
||||
%D%/calc++-parser.cc \
|
||||
%D%/calc++-parser.hh \
|
||||
%D%/location.hh \
|
||||
%D%/position.hh \
|
||||
%D%/stack.hh
|
||||
calcxx_sources = \
|
||||
$(calcxx_sources_extracted) \
|
||||
$(calcxx_sources_generated)
|
||||
calc_sources_extracted = \
|
||||
examples/calc++/calc++-driver.cc \
|
||||
examples/calc++/calc++-driver.hh \
|
||||
examples/calc++/calc++-scanner.ll \
|
||||
examples/calc++/calc++.cc
|
||||
calc_extracted = \
|
||||
$(calc_sources_extracted) \
|
||||
examples/calc++/calc++-parser.yy
|
||||
extracted += $(calc_extracted)
|
||||
calc_sources_generated = \
|
||||
examples/calc++/calc++-parser.cc \
|
||||
examples/calc++/calc++-parser.hh \
|
||||
examples/calc++/location.hh \
|
||||
examples/calc++/position.hh \
|
||||
examples/calc++/stack.hh
|
||||
calc_sources = \
|
||||
$(calc_sources_extracted) \
|
||||
$(calc_sources_generated)
|
||||
|
||||
if FLEX_CXX_WORKS
|
||||
check_PROGRAMS += %D%/calc++
|
||||
nodist_%C%_calc___SOURCES = \
|
||||
$(calcxx_sources)
|
||||
if BISON_CXX_WORKS
|
||||
check_PROGRAMS += examples/calc++/calc++
|
||||
nodist_examples_calc___calc___SOURCES = \
|
||||
$(calc_sources)
|
||||
|
||||
%C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
|
||||
%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||
dist_TESTS += %D%/calc++.test
|
||||
else
|
||||
EXTRA_DIST += %D%/calc++.test
|
||||
examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
|
||||
examples_calc___calc___CXXFLAGS = \
|
||||
$(AM_CXXFLAGS) $(WARN_NO_NULL_CONVERSION_CXXFLAGS)
|
||||
dist_TESTS += examples/calc++/calc++.test
|
||||
endif
|
||||
|
||||
|
||||
## ------------ ##
|
||||
## Installing. ##
|
||||
## ------------ ##
|
||||
|
||||
calcxxdir = $(docdir)/examples/calc++
|
||||
calcxx_DATA = $(calcxx_extracted)
|
||||
|
||||
+7
-14
@@ -3,7 +3,7 @@
|
||||
|
||||
# This file is part of GNU Bison
|
||||
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2015 Free Software
|
||||
# Copyright (C) 1992, 2000-2001, 2005-2006, 2009-2013 Free Software
|
||||
# Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -19,7 +19,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Usage: extexi [OPTION...] input-file.texi ... -- [FILES to extract]
|
||||
# Usage: extexi input-file.texi ... -- [FILES to extract]
|
||||
|
||||
# Look for @example environments preceded with lines such as:
|
||||
#
|
||||
@@ -35,9 +35,6 @@
|
||||
|
||||
use strict;
|
||||
|
||||
# Whether we generate synclines.
|
||||
my $synclines = 0;
|
||||
|
||||
# normalize($block)
|
||||
# -----------------
|
||||
# Remove Texinfo mark up.
|
||||
@@ -105,7 +102,7 @@ sub process ($)
|
||||
{
|
||||
# Bison supports synclines, but not Flex.
|
||||
$input .= sprintf ("#line %s \"$in\"\n", $. + 1)
|
||||
if $synclines && $file =~ /\.[chy]*$/;
|
||||
if $file =~ /\.[chy]*$/;
|
||||
next;
|
||||
}
|
||||
elsif (/^\@end (small)?example$/)
|
||||
@@ -139,18 +136,14 @@ my @input;
|
||||
my $seen_dash = 0;
|
||||
for my $arg (@ARGV)
|
||||
{
|
||||
if ($seen_dash)
|
||||
{
|
||||
use File::Basename;
|
||||
$file_wanted{basename($arg)} = $arg;
|
||||
}
|
||||
elsif ($arg eq '--')
|
||||
if ($arg eq '--')
|
||||
{
|
||||
$seen_dash = 1;
|
||||
}
|
||||
elsif ($arg eq '--synclines')
|
||||
elsif ($seen_dash)
|
||||
{
|
||||
$synclines = 1;
|
||||
use File::Basename;
|
||||
$file_wanted{basename($arg)} = $arg;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+14
-16
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005, 2008-2013 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
|
||||
@@ -13,10 +13,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/%D%/test
|
||||
dist_noinst_SCRIPTS = examples/extexi examples/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/examples/test
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(NO_STRICT_ALIAS_CXXFLAGS) \
|
||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||
|
||||
## ------------ ##
|
||||
@@ -24,23 +25,20 @@ AM_CXXFLAGS = \
|
||||
## ------------ ##
|
||||
|
||||
doc = $(top_srcdir)/doc/bison.texi
|
||||
extexi = $(top_srcdir)/%D%/extexi
|
||||
if ENABLE_GCC_WARNINGS
|
||||
extexiFLAGS = --synclines
|
||||
endif
|
||||
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(extexiFLAGS) $(doc) --
|
||||
extexi = $(top_srcdir)/examples/extexi
|
||||
extract = VERSION="$(VERSION)" $(PERL) -f $(extexi) $(doc) --
|
||||
extracted =
|
||||
CLEANFILES += $(extracted) %D%/extracted.stamp
|
||||
%D%/extracted.stamp: $(doc) $(extexi)
|
||||
CLEANFILES += $(extracted) examples/extracted.stamp
|
||||
examples/extracted.stamp: $(doc) $(extexi)
|
||||
$(AM_V_GEN)rm -f $@ $@.tmp
|
||||
$(AM_V_at)touch $@.tmp
|
||||
$(AM_V_at)$(extract) $(extracted)
|
||||
$(AM_V_at)mv $@.tmp $@
|
||||
|
||||
$(extracted): %D%/extracted.stamp
|
||||
@test -f $@ || rm -f %D%/extracted.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
|
||||
$(extracted): examples/extracted.stamp
|
||||
@test -f $@ || rm -f examples/extracted.stamp
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
|
||||
|
||||
include %D%/calc++/local.mk
|
||||
include %D%/mfcalc/local.mk
|
||||
include %D%/rpcalc/local.mk
|
||||
include examples/calc++/local.mk
|
||||
include examples/mfcalc/local.mk
|
||||
include examples/rpcalc/local.mk
|
||||
|
||||
+13
-16
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2006, 2008-2013 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
|
||||
@@ -18,22 +18,19 @@
|
||||
## -------------------- ##
|
||||
|
||||
BUILT_SOURCES += $(mfcalc_sources)
|
||||
CLEANFILES += %D%/mfcalc.[ch] %D%/mfcalc.output
|
||||
CLEANFILES += examples/mfcalc/mfcalc.[ch] examples/mfcalc/mfcalc.output
|
||||
|
||||
mfcalc_extracted = %D%/calc.h %D%/mfcalc.y
|
||||
mfcalc_sources = $(mfcalc_extracted)
|
||||
mfcalc_extracted = \
|
||||
examples/mfcalc/calc.h \
|
||||
examples/mfcalc/mfcalc.y
|
||||
mfcalc_sources = \
|
||||
$(mfcalc_extracted)
|
||||
extracted += $(mfcalc_extracted)
|
||||
|
||||
check_PROGRAMS += %D%/mfcalc
|
||||
%C%_mfcalc_LDADD = -lm
|
||||
nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
||||
check_PROGRAMS += examples/mfcalc/mfcalc
|
||||
examples_mfcalc_mfcalc_LDADD = -lm
|
||||
nodist_examples_mfcalc_mfcalc_SOURCES = \
|
||||
$(mfcalc_sources)
|
||||
|
||||
%C%_mfcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
dist_TESTS += %D%/mfcalc.test
|
||||
|
||||
## ------------ ##
|
||||
## Installing. ##
|
||||
## ------------ ##
|
||||
|
||||
mfcalcdir = $(docdir)/examples/mfcalc
|
||||
mfcalc_DATA = $(mfcalc_extracted)
|
||||
examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
|
||||
dist_TESTS += examples/mfcalc/mfcalc.test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/calc.h
|
||||
/rpcalc
|
||||
/rpcalc.c
|
||||
/rpcalc.h
|
||||
/rpcalc.output
|
||||
|
||||
+12
-16
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2006, 2008-2013 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
|
||||
@@ -18,22 +18,18 @@
|
||||
## -------------------- ##
|
||||
|
||||
BUILT_SOURCES += $(rpcalc_sources)
|
||||
CLEANFILES += %D%/rpcalc.[ch] %D%/rpcalc.output
|
||||
CLEANFILES += examples/rpcalc/rpcalc.[ch] examples/rpcalc/rpcalc.output
|
||||
|
||||
rpcalc_extracted = %D%/rpcalc.y
|
||||
rpcalc_sources = $(rpcalc_extracted)
|
||||
rpcalc_extracted = \
|
||||
examples/rpcalc/rpcalc.y
|
||||
rpcalc_sources = \
|
||||
$(rpcalc_extracted)
|
||||
extracted += $(rpcalc_extracted)
|
||||
|
||||
check_PROGRAMS += %D%/rpcalc
|
||||
%C%_rpcalc_LDADD = -lm
|
||||
nodist_%C%_rpcalc_SOURCES = $(rpcalc_sources)
|
||||
check_PROGRAMS += examples/rpcalc/rpcalc
|
||||
examples_rpcalc_rpcalc_LDADD = -lm
|
||||
nodist_examples_rpcalc_rpcalc_SOURCES = \
|
||||
$(rpcalc_sources)
|
||||
|
||||
%C%_rpcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
||||
dist_TESTS += %D%/rpcalc.test
|
||||
|
||||
## ------------ ##
|
||||
## Installing. ##
|
||||
## ------------ ##
|
||||
|
||||
rpcalcdir = $(docdir)/examples/rpcalc
|
||||
rpcalc_DATA = $(rpcalc_extracted)
|
||||
examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
|
||||
dist_TESTS += examples/rpcalc/rpcalc.test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2005-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2005-2013 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
|
||||
|
||||
+6
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 2008-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2013 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
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
%debug
|
||||
%language "c++"
|
||||
%skeleton "lalr1.cc"
|
||||
%defines
|
||||
%define api.token.constructor
|
||||
%define api.value.type variant
|
||||
@@ -48,17 +48,11 @@ typedef std::list<std::string> strings_type;
|
||||
namespace std
|
||||
{
|
||||
std::ostream&
|
||||
operator<< (std::ostream& o, const strings_type& ss)
|
||||
operator<< (std::ostream& o, const strings_type& s)
|
||||
{
|
||||
o << "(" << &ss << ") {";
|
||||
const char *sep = "";
|
||||
for (strings_type::const_iterator i = ss.begin(), end = ss.end();
|
||||
i != end; ++i)
|
||||
{
|
||||
o << sep << *i;
|
||||
sep = ", ";
|
||||
}
|
||||
return o << "}";
|
||||
std::copy (s.begin (), s.end (),
|
||||
std::ostream_iterator<strings_type::value_type> (o, "\n"));
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule gnulib updated: 7585eb3f16...c67e3c0414
@@ -272,7 +272,3 @@
|
||||
/sig-handler.c
|
||||
/unistd.c
|
||||
/wctype-h.c
|
||||
/lstat.c
|
||||
/unlink.c
|
||||
/gettimeofday.c
|
||||
/sys_time.in.h
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Array bitsets.
|
||||
|
||||
Copyright (C) 2002-2003, 2006, 2009-2015 Free Software Foundation,
|
||||
Copyright (C) 2002-2003, 2006, 2009-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support abitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Base bitset stuff.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2015 Free Software Foundation,
|
||||
Copyright (C) 2002-2004, 2006, 2009-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* General bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Generic bitsets.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset statistics.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support bitset statistics.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2001-2002, 2004, 2006, 2009-2015 Free Software
|
||||
Copyright (C) 2001-2002, 2004, 2006, 2009-2013 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Akim Demaille (akim@freefriends.org).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2001-2002, 2004-2006, 2009-2015 Free Software
|
||||
Copyright (C) 2001-2002, 2004-2006, 2009-2013 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Bitset vectors.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support expandable bitsets.
|
||||
|
||||
Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support ebitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.c - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2006, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2006, 2009-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* get-errno.h - get and set errno.
|
||||
|
||||
Copyright (C) 2002, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2013 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support link list bitsets.
|
||||
|
||||
Copyright (C) 2002-2004, 2006, 2009-2015 Free Software Foundation,
|
||||
Copyright (C) 2002-2004, 2006, 2009-2013 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Functions to support lbitsets.
|
||||
|
||||
Copyright (C) 2002, 2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* Fake libiberty.h for Bison.
|
||||
|
||||
Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2004, 2009-2013 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
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
/* Bison depends on libiberty's implementation of bitsets, which
|
||||
requires a 'libiberty.h' file. This file provides the minimum
|
||||
requires a `libiberty.h' file. This file provides the minimum
|
||||
services. */
|
||||
|
||||
#ifndef BISON_LIBIBERTY_H_
|
||||
|
||||
+2
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2001-2015 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 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,8 +51,6 @@ lib_libbison_a_SOURCES += \
|
||||
lib/get-errno.c
|
||||
|
||||
# The Yacc compatibility library.
|
||||
if ENABLE_YACC
|
||||
lib_LIBRARIES = lib/liby.a
|
||||
lib_LIBRARIES = $(YACC_LIBRARY)
|
||||
EXTRA_LIBRARIES = lib/liby.a
|
||||
lib_liby_a_SOURCES = lib/main.c lib/yyerror.c
|
||||
endif
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Yacc library main function.
|
||||
|
||||
Copyright (C) 2002, 2009-2015 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user