mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
%define: accept unquoted values.
* NEWS (2.5): Group all %define changes together, and document this one. Remove quotes in IELR and canonical LR entry. * doc/bison.texinfo: Remove quotes in most examples throughout. (Decl Summary): Update %define documentation. (Table of Symbols): Likewise. * src/ielr.c (LrType): Update documentation. * src/parse-gram.y (content.opt): Add production for ID. * tests/actions.at: Remove quotes in most tests. * tests/calc.at: Likewise. * tests/existing.at: Likewise. * tests/input.at: Likewise. * tests/local.at: Likewise. * tests/push.at: Likewise. * tests/reduce.at: Likewise. * tests/torture.at: Likewise.
This commit is contained in:
19
ChangeLog
19
ChangeLog
@@ -1,3 +1,22 @@
|
|||||||
|
2009-08-28 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
|
%define: accept unquoted values.
|
||||||
|
* NEWS (2.5): Group all %define changes together, and document
|
||||||
|
this one. Remove quotes in IELR and canonical LR entry.
|
||||||
|
* doc/bison.texinfo: Remove quotes in most examples throughout.
|
||||||
|
(Decl Summary): Update %define documentation.
|
||||||
|
(Table of Symbols): Likewise.
|
||||||
|
* src/ielr.c (LrType): Update documentation.
|
||||||
|
* src/parse-gram.y (content.opt): Add production for ID.
|
||||||
|
* tests/actions.at: Remove quotes in most tests.
|
||||||
|
* tests/calc.at: Likewise.
|
||||||
|
* tests/existing.at: Likewise.
|
||||||
|
* tests/input.at: Likewise.
|
||||||
|
* tests/local.at: Likewise.
|
||||||
|
* tests/push.at: Likewise.
|
||||||
|
* tests/reduce.at: Likewise.
|
||||||
|
* tests/torture.at: Likewise.
|
||||||
|
|
||||||
2009-08-28 Joel E. Denny <jdenny@clemson.edu>
|
2009-08-28 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
%define lr.type: make values lowercase IDs.
|
%define lr.type: make values lowercase IDs.
|
||||||
|
|||||||
27
NEWS
27
NEWS
@@ -55,9 +55,9 @@ Bison News
|
|||||||
default. You can specify the type of parser tables in the grammar
|
default. You can specify the type of parser tables in the grammar
|
||||||
file with these directives:
|
file with these directives:
|
||||||
|
|
||||||
%define lr.type "lalr"
|
%define lr.type lalr
|
||||||
%define lr.type "ielr"
|
%define lr.type ielr
|
||||||
%define lr.type "canonical-lr"
|
%define lr.type canonical-lr
|
||||||
|
|
||||||
The default reduction optimization in the parser tables can also be
|
The default reduction optimization in the parser tables can also be
|
||||||
adjusted using `%define lr.default-reductions'. See the documentation
|
adjusted using `%define lr.default-reductions'. See the documentation
|
||||||
@@ -68,9 +68,11 @@ Bison News
|
|||||||
These features are experimental. More user feedback will help to
|
These features are experimental. More user feedback will help to
|
||||||
stabilize them.
|
stabilize them.
|
||||||
|
|
||||||
** Multiple %define's for any variable is now an error not a warning.
|
** %define improvements.
|
||||||
|
|
||||||
** %define can now be invoked via the command line.
|
*** Multiple invocations for any variable is now an error not a warning.
|
||||||
|
|
||||||
|
*** Can now be invoked via the command line.
|
||||||
|
|
||||||
Each of these command-line options
|
Each of these command-line options
|
||||||
|
|
||||||
@@ -89,7 +91,7 @@ Bison News
|
|||||||
quietly override %define, but -D and --define do not. For further
|
quietly override %define, but -D and --define do not. For further
|
||||||
details, see the section "Bison Options" in the Bison manual.
|
details, see the section "Bison Options" in the Bison manual.
|
||||||
|
|
||||||
** %define variables renamed.
|
*** Variables renamed.
|
||||||
|
|
||||||
The following %define variables
|
The following %define variables
|
||||||
|
|
||||||
@@ -104,7 +106,18 @@ Bison News
|
|||||||
The old names are now deprecated but will be maintained indefinitely
|
The old names are now deprecated but will be maintained indefinitely
|
||||||
for backward compatibility.
|
for backward compatibility.
|
||||||
|
|
||||||
** Symbols names
|
*** Values no longer need to be quoted in grammar file.
|
||||||
|
|
||||||
|
If a %define value is an identifier, it no longer needs to be placed
|
||||||
|
within quotations marks. For example,
|
||||||
|
|
||||||
|
%define api.push-pull "push"
|
||||||
|
|
||||||
|
can be rewritten as
|
||||||
|
|
||||||
|
%define api.push-pull push
|
||||||
|
|
||||||
|
** Symbol names.
|
||||||
|
|
||||||
Consistently with directives (such as %error-verbose) and variables
|
Consistently with directives (such as %error-verbose) and variables
|
||||||
(e.g. push-pull), symbol names may include dashes in any position,
|
(e.g. push-pull), symbol names may include dashes in any position,
|
||||||
|
|||||||
@@ -4588,7 +4588,7 @@ The following Bison declaration says that you want the parser to be a push
|
|||||||
parser (@pxref{Decl Summary,,%define api.push-pull}):
|
parser (@pxref{Decl Summary,,%define api.push-pull}):
|
||||||
|
|
||||||
@example
|
@example
|
||||||
%define api.push-pull "push"
|
%define api.push-pull push
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
In almost all cases, you want to ensure that your push parser is also
|
In almost all cases, you want to ensure that your push parser is also
|
||||||
@@ -4599,7 +4599,7 @@ what you are doing, your declarations should look like this:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
%define api.pure
|
%define api.pure
|
||||||
%define api.push-pull "push"
|
%define api.push-pull push
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
There is a major notable functional difference between the pure push parser
|
There is a major notable functional difference between the pure push parser
|
||||||
@@ -4648,14 +4648,14 @@ for use by the next invocation of the @code{yypush_parse} function.
|
|||||||
|
|
||||||
Bison also supports both the push parser interface along with the pull parser
|
Bison also supports both the push parser interface along with the pull parser
|
||||||
interface in the same generated parser. In order to get this functionality,
|
interface in the same generated parser. In order to get this functionality,
|
||||||
you should replace the @samp{%define api.push-pull "push"} declaration with the
|
you should replace the @samp{%define api.push-pull push} declaration with the
|
||||||
@samp{%define api.push-pull "both"} declaration. Doing this will create all of
|
@samp{%define api.push-pull both} declaration. Doing this will create all of
|
||||||
the symbols mentioned earlier along with the two extra symbols, @code{yyparse}
|
the symbols mentioned earlier along with the two extra symbols, @code{yyparse}
|
||||||
and @code{yypull_parse}. @code{yyparse} can be used exactly as it normally
|
and @code{yypull_parse}. @code{yyparse} can be used exactly as it normally
|
||||||
would be used. However, the user should note that it is implemented in the
|
would be used. However, the user should note that it is implemented in the
|
||||||
generated parser by calling @code{yypull_parse}.
|
generated parser by calling @code{yypull_parse}.
|
||||||
This makes the @code{yyparse} function that is generated with the
|
This makes the @code{yyparse} function that is generated with the
|
||||||
@samp{%define api.push-pull "both"} declaration slower than the normal
|
@samp{%define api.push-pull both} declaration slower than the normal
|
||||||
@code{yyparse} function. If the user
|
@code{yyparse} function. If the user
|
||||||
calls the @code{yypull_parse} function it will parse the rest of the input
|
calls the @code{yypull_parse} function it will parse the rest of the input
|
||||||
stream. It is possible to @code{yypush_parse} tokens to select a subgrammar
|
stream. It is possible to @code{yypush_parse} tokens to select a subgrammar
|
||||||
@@ -4672,8 +4672,8 @@ yypstate_delete (ps);
|
|||||||
@end example
|
@end example
|
||||||
|
|
||||||
Adding the @samp{%define api.pure} declaration does exactly the same thing to
|
Adding the @samp{%define api.pure} declaration does exactly the same thing to
|
||||||
the generated parser with @samp{%define api.push-pull "both"} as it did for
|
the generated parser with @samp{%define api.push-pull both} as it did for
|
||||||
@samp{%define api.push-pull "push"}.
|
@samp{%define api.push-pull push}.
|
||||||
|
|
||||||
@node Decl Summary
|
@node Decl Summary
|
||||||
@subsection Bison Declaration Summary
|
@subsection Bison Declaration Summary
|
||||||
@@ -4842,6 +4842,7 @@ parse.trace}.
|
|||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Directive} %define @var{variable}
|
@deffn {Directive} %define @var{variable}
|
||||||
|
@deffnx {Directive} %define @var{variable} @var{value}
|
||||||
@deffnx {Directive} %define @var{variable} "@var{value}"
|
@deffnx {Directive} %define @var{variable} "@var{value}"
|
||||||
Define a variable to adjust Bison's behavior.
|
Define a variable to adjust Bison's behavior.
|
||||||
The possible choices for @var{variable}, as well as their meanings, depend on
|
The possible choices for @var{variable}, as well as their meanings, depend on
|
||||||
@@ -4851,7 +4852,11 @@ Summary,,%language}, @pxref{Decl Summary,,%skeleton}).
|
|||||||
It is an error if a @var{variable} is defined by @code{%define} multiple
|
It is an error if a @var{variable} is defined by @code{%define} multiple
|
||||||
times, but see @ref{Bison Options,,-D @var{name}[=@var{value}]}.
|
times, but see @ref{Bison Options,,-D @var{name}[=@var{value}]}.
|
||||||
|
|
||||||
Omitting @code{"@var{value}"} is always equivalent to specifying it as
|
@var{value} must be placed in quotation marks if it contains any
|
||||||
|
character other than a letter, underscore, period, dash, or non-initial
|
||||||
|
digit.
|
||||||
|
|
||||||
|
Omitting @code{"@var{value}"} entirely is always equivalent to specifying
|
||||||
@code{""}.
|
@code{""}.
|
||||||
|
|
||||||
Some @var{variable}s may be used as Booleans.
|
Some @var{variable}s may be used as Booleans.
|
||||||
@@ -4859,12 +4864,12 @@ In this case, Bison will complain if the variable definition does not meet one
|
|||||||
of the following four conditions:
|
of the following four conditions:
|
||||||
|
|
||||||
@enumerate
|
@enumerate
|
||||||
@item @code{"@var{value}"} is @code{"true"}
|
@item @code{@var{value}} is @code{true}
|
||||||
|
|
||||||
@item @code{"@var{value}"} is omitted (or is @code{""}).
|
@item @code{@var{value}} is omitted (or @code{""} is specified).
|
||||||
This is equivalent to @code{"true"}.
|
This is equivalent to @code{true}.
|
||||||
|
|
||||||
@item @code{"@var{value}"} is @code{"false"}.
|
@item @code{@var{value}} is @code{false}.
|
||||||
|
|
||||||
@item @var{variable} is never defined.
|
@item @var{variable} is never defined.
|
||||||
In this case, Bison selects a default value, which may depend on the selected
|
In this case, Bison selects a default value, which may depend on the selected
|
||||||
@@ -4940,7 +4945,7 @@ The parser namespace is @code{foo} and @code{yylex} is referenced as
|
|||||||
|
|
||||||
@item Accepted Values: Boolean
|
@item Accepted Values: Boolean
|
||||||
|
|
||||||
@item Default Value: @code{"false"}
|
@item Default Value: @code{false}
|
||||||
@end itemize
|
@end itemize
|
||||||
@c api.pure
|
@c api.pure
|
||||||
|
|
||||||
@@ -4958,9 +4963,9 @@ The parser namespace is @code{foo} and @code{yylex} is referenced as
|
|||||||
(The current push parsing interface is experimental and may evolve.
|
(The current push parsing interface is experimental and may evolve.
|
||||||
More user feedback will help to stabilize it.)
|
More user feedback will help to stabilize it.)
|
||||||
|
|
||||||
@item Accepted Values: @code{"pull"}, @code{"push"}, @code{"both"}
|
@item Accepted Values: @code{pull}, @code{push}, @code{both}
|
||||||
|
|
||||||
@item Default Value: @code{"pull"}
|
@item Default Value: @code{pull}
|
||||||
@end itemize
|
@end itemize
|
||||||
@c api.push-pull
|
@c api.push-pull
|
||||||
|
|
||||||
@@ -5025,7 +5030,7 @@ More user feedback will help to stabilize it.)
|
|||||||
|
|
||||||
@item Accepted Values:
|
@item Accepted Values:
|
||||||
@itemize
|
@itemize
|
||||||
@item @code{"all"}.
|
@item @code{all}.
|
||||||
For @acronym{LALR} and @acronym{IELR} parsers (@pxref{Decl
|
For @acronym{LALR} and @acronym{IELR} parsers (@pxref{Decl
|
||||||
Summary,,lr.type}) by default, all states are permitted to contain
|
Summary,,lr.type}) by default, all states are permitted to contain
|
||||||
default reductions.
|
default reductions.
|
||||||
@@ -5037,7 +5042,7 @@ That is, unlike in a canonical @acronym{LR} state, the lookahead sets of
|
|||||||
reductions in an @acronym{LALR} or @acronym{IELR} state can contain
|
reductions in an @acronym{LALR} or @acronym{IELR} state can contain
|
||||||
tokens that are syntactically incorrect for some left contexts.
|
tokens that are syntactically incorrect for some left contexts.
|
||||||
|
|
||||||
@item @code{"consistent"}.
|
@item @code{consistent}.
|
||||||
@cindex consistent states
|
@cindex consistent states
|
||||||
A consistent state is a state that has only one possible action.
|
A consistent state is a state that has only one possible action.
|
||||||
If that action is a reduction, then the parser does not need to request
|
If that action is a reduction, then the parser does not need to request
|
||||||
@@ -5049,7 +5054,7 @@ states, then a canonical @acronym{LR} parser reports a syntax error as
|
|||||||
soon as it @emph{needs} the syntactically unacceptable token from the
|
soon as it @emph{needs} the syntactically unacceptable token from the
|
||||||
scanner.
|
scanner.
|
||||||
|
|
||||||
@item @code{"accepting"}.
|
@item @code{accepting}.
|
||||||
@cindex accepting state
|
@cindex accepting state
|
||||||
By default, the only default reduction permitted in a canonical
|
By default, the only default reduction permitted in a canonical
|
||||||
@acronym{LR} parser is the accept action in the accepting state, which
|
@acronym{LR} parser is the accept action in the accepting state, which
|
||||||
@@ -5061,8 +5066,8 @@ without performing any extra reductions.
|
|||||||
|
|
||||||
@item Default Value:
|
@item Default Value:
|
||||||
@itemize
|
@itemize
|
||||||
@item @code{"accepting"} if @code{lr.type} is @code{"canonical-lr"}.
|
@item @code{accepting} if @code{lr.type} is @code{canonical-lr}.
|
||||||
@item @code{"all"} otherwise.
|
@item @code{all} otherwise.
|
||||||
@end itemize
|
@end itemize
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@@ -5083,7 +5088,7 @@ are useless in the generated parser.
|
|||||||
|
|
||||||
@item Accepted Values: Boolean
|
@item Accepted Values: Boolean
|
||||||
|
|
||||||
@item Default Value: @code{"false"}
|
@item Default Value: @code{false}
|
||||||
|
|
||||||
@item Caveats:
|
@item Caveats:
|
||||||
|
|
||||||
@@ -5126,7 +5131,7 @@ More user feedback will help to stabilize it.)
|
|||||||
|
|
||||||
@item Accepted Values:
|
@item Accepted Values:
|
||||||
@itemize
|
@itemize
|
||||||
@item @code{"lalr"}.
|
@item @code{lalr}.
|
||||||
While Bison generates @acronym{LALR} parser tables by default for
|
While Bison generates @acronym{LALR} parser tables by default for
|
||||||
historical reasons, @acronym{IELR} or canonical @acronym{LR} is almost
|
historical reasons, @acronym{IELR} or canonical @acronym{LR} is almost
|
||||||
always preferable for deterministic parsers.
|
always preferable for deterministic parsers.
|
||||||
@@ -5155,7 +5160,7 @@ investigate such problems while ignoring the more subtle differences
|
|||||||
from @acronym{IELR} and canonical @acronym{LR}.
|
from @acronym{IELR} and canonical @acronym{LR}.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@item @code{"ielr"}.
|
@item @code{ielr}.
|
||||||
@acronym{IELR} is a minimal @acronym{LR} algorithm.
|
@acronym{IELR} is a minimal @acronym{LR} algorithm.
|
||||||
That is, given any grammar (@acronym{LR} or non-@acronym{LR}),
|
That is, given any grammar (@acronym{LR} or non-@acronym{LR}),
|
||||||
@acronym{IELR} and canonical @acronym{LR} always accept exactly the same
|
@acronym{IELR} and canonical @acronym{LR} always accept exactly the same
|
||||||
@@ -5169,7 +5174,7 @@ grammars, the number of conflicts for @acronym{IELR} is often an order
|
|||||||
of magnitude less as well.
|
of magnitude less as well.
|
||||||
This can significantly reduce the complexity of developing of a grammar.
|
This can significantly reduce the complexity of developing of a grammar.
|
||||||
|
|
||||||
@item @code{"canonical-lr"}.
|
@item @code{canonical-lr}.
|
||||||
@cindex delayed syntax errors
|
@cindex delayed syntax errors
|
||||||
@cindex syntax errors delayed
|
@cindex syntax errors delayed
|
||||||
The only advantage of canonical @acronym{LR} over @acronym{IELR} is
|
The only advantage of canonical @acronym{LR} over @acronym{IELR} is
|
||||||
@@ -5185,7 +5190,7 @@ Even when canonical @acronym{LR} behavior is ultimately desired,
|
|||||||
facilitate the development of a grammar.
|
facilitate the development of a grammar.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@item Default Value: @code{"lalr"}
|
@item Default Value: @code{lalr}
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
|
|
||||||
@@ -5226,10 +5231,10 @@ function. @xref{Error Reporting, ,The Error Reporting Function
|
|||||||
@code{yyerror}}.
|
@code{yyerror}}.
|
||||||
@item Accepted Values:
|
@item Accepted Values:
|
||||||
@itemize
|
@itemize
|
||||||
@item @code{"simple"}
|
@item @code{simple}
|
||||||
Error messages passed to @code{yyerror} are simply @w{@code{"syntax
|
Error messages passed to @code{yyerror} are simply @w{@code{"syntax
|
||||||
error"}}.
|
error"}}.
|
||||||
@item @code{"verbose"}
|
@item @code{verbose}
|
||||||
Error messages report the unexpected token, and possibly the expected
|
Error messages report the unexpected token, and possibly the expected
|
||||||
ones.
|
ones.
|
||||||
@end itemize
|
@end itemize
|
||||||
@@ -5585,8 +5590,8 @@ exp: @dots{} @{ @dots{}; *randomness += 1; @dots{} @}
|
|||||||
More user feedback will help to stabilize it.)
|
More user feedback will help to stabilize it.)
|
||||||
|
|
||||||
You call the function @code{yypush_parse} to parse a single token. This
|
You call the function @code{yypush_parse} to parse a single token. This
|
||||||
function is available if either the @samp{%define api.push-pull "push"} or
|
function is available if either the @samp{%define api.push-pull push} or
|
||||||
@samp{%define api.push-pull "both"} declaration is used.
|
@samp{%define api.push-pull both} declaration is used.
|
||||||
@xref{Push Decl, ,A Push Parser}.
|
@xref{Push Decl, ,A Push Parser}.
|
||||||
|
|
||||||
@deftypefun int yypush_parse (yypstate *yyps)
|
@deftypefun int yypush_parse (yypstate *yyps)
|
||||||
@@ -5603,7 +5608,7 @@ is required to finish parsing the grammar.
|
|||||||
More user feedback will help to stabilize it.)
|
More user feedback will help to stabilize it.)
|
||||||
|
|
||||||
You call the function @code{yypull_parse} to parse the rest of the input
|
You call the function @code{yypull_parse} to parse the rest of the input
|
||||||
stream. This function is available if the @samp{%define api.push-pull "both"}
|
stream. This function is available if the @samp{%define api.push-pull both}
|
||||||
declaration is used.
|
declaration is used.
|
||||||
@xref{Push Decl, ,A Push Parser}.
|
@xref{Push Decl, ,A Push Parser}.
|
||||||
|
|
||||||
@@ -5619,8 +5624,8 @@ The value returned by @code{yypull_parse} is the same as for @code{yyparse}.
|
|||||||
More user feedback will help to stabilize it.)
|
More user feedback will help to stabilize it.)
|
||||||
|
|
||||||
You call the function @code{yypstate_new} to create a new parser instance.
|
You call the function @code{yypstate_new} to create a new parser instance.
|
||||||
This function is available if either the @samp{%define api.push-pull "push"} or
|
This function is available if either the @samp{%define api.push-pull push} or
|
||||||
@samp{%define api.push-pull "both"} declaration is used.
|
@samp{%define api.push-pull both} declaration is used.
|
||||||
@xref{Push Decl, ,A Push Parser}.
|
@xref{Push Decl, ,A Push Parser}.
|
||||||
|
|
||||||
@deftypefun yypstate *yypstate_new (void)
|
@deftypefun yypstate *yypstate_new (void)
|
||||||
@@ -5638,8 +5643,8 @@ allocated.
|
|||||||
More user feedback will help to stabilize it.)
|
More user feedback will help to stabilize it.)
|
||||||
|
|
||||||
You call the function @code{yypstate_delete} to delete a parser instance.
|
You call the function @code{yypstate_delete} to delete a parser instance.
|
||||||
function is available if either the @samp{%define api.push-pull "push"} or
|
function is available if either the @samp{%define api.push-pull push} or
|
||||||
@samp{%define api.push-pull "both"} declaration is used.
|
@samp{%define api.push-pull both} declaration is used.
|
||||||
@xref{Push Decl, ,A Push Parser}.
|
@xref{Push Decl, ,A Push Parser}.
|
||||||
|
|
||||||
@deftypefun void yypstate_delete (yypstate *yyps)
|
@deftypefun void yypstate_delete (yypstate *yyps)
|
||||||
@@ -5913,7 +5918,7 @@ receives one argument. For a syntax error, the string is normally
|
|||||||
@w{@code{"syntax error"}}.
|
@w{@code{"syntax error"}}.
|
||||||
|
|
||||||
@findex %define parse.error
|
@findex %define parse.error
|
||||||
If you invoke @samp{%define parse.error "verbose"} in the Bison
|
If you invoke @samp{%define parse.error verbose} in the Bison
|
||||||
declarations section (@pxref{Bison Declarations, ,The Bison Declarations
|
declarations section (@pxref{Bison Declarations, ,The Bison Declarations
|
||||||
Section}), then Bison provides a more verbose and specific error message
|
Section}), then Bison provides a more verbose and specific error message
|
||||||
string instead of just plain @w{@code{"syntax error"}}.
|
string instead of just plain @w{@code{"syntax error"}}.
|
||||||
@@ -8837,7 +8842,7 @@ error messages.
|
|||||||
@comment file: calc++-parser.yy
|
@comment file: calc++-parser.yy
|
||||||
@example
|
@example
|
||||||
%define parse.trace
|
%define parse.trace
|
||||||
%define parse.error "verbose"
|
%define parse.error verbose
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -9226,7 +9231,7 @@ in a file; Bison itself defines a class representing a @dfn{location},
|
|||||||
a range composed of a pair of positions (possibly spanning several
|
a range composed of a pair of positions (possibly spanning several
|
||||||
files). The location class is an inner class of the parser; the name
|
files). The location class is an inner class of the parser; the name
|
||||||
is @code{Location} by default, and may also be renamed using
|
is @code{Location} by default, and may also be renamed using
|
||||||
@samp{%define location_type "@var{class-name}}.
|
@samp{%define location_type "@var{class-name}"}.
|
||||||
|
|
||||||
The location class treats the position as a completely opaque value.
|
The location class treats the position as a completely opaque value.
|
||||||
By default, the class name is @code{Position}, but this can be changed
|
By default, the class name is @code{Position}, but this can be changed
|
||||||
@@ -9325,7 +9330,7 @@ Run the syntactic analysis, and return @code{true} on success,
|
|||||||
@deftypemethod {YYParser} {boolean} getErrorVerbose ()
|
@deftypemethod {YYParser} {boolean} getErrorVerbose ()
|
||||||
@deftypemethodx {YYParser} {void} setErrorVerbose (boolean @var{verbose})
|
@deftypemethodx {YYParser} {void} setErrorVerbose (boolean @var{verbose})
|
||||||
Get or set the option to produce verbose error messages. These are only
|
Get or set the option to produce verbose error messages. These are only
|
||||||
available with @samp{%define parse.error "verbose"}, which also turns on
|
available with @samp{%define parse.error verbose}, which also turns on
|
||||||
verbose error messages.
|
verbose error messages.
|
||||||
@end deftypemethod
|
@end deftypemethod
|
||||||
|
|
||||||
@@ -10212,6 +10217,7 @@ Precedence}.
|
|||||||
|
|
||||||
@deffn {Directive} %define @var{define-variable}
|
@deffn {Directive} %define @var{define-variable}
|
||||||
@deffnx {Directive} %define @var{define-variable} @var{value}
|
@deffnx {Directive} %define @var{define-variable} @var{value}
|
||||||
|
@deffnx {Directive} %define @var{define-variable} "@var{value}"
|
||||||
Define a variable to adjust Bison's behavior.
|
Define a variable to adjust Bison's behavior.
|
||||||
@xref{Decl Summary,,%define}.
|
@xref{Decl Summary,,%define}.
|
||||||
@end deffn
|
@end deffn
|
||||||
@@ -10254,7 +10260,7 @@ token is reset to the token that originally caused the violation.
|
|||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Directive} %error-verbose
|
@deffn {Directive} %error-verbose
|
||||||
An obsolete directive standing for @samp{%define parse.error "verbose"}.
|
An obsolete directive standing for @samp{%define parse.error verbose}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Directive} %file-prefix "@var{prefix}"
|
@deffn {Directive} %file-prefix "@var{prefix}"
|
||||||
@@ -10460,7 +10466,7 @@ An obsolete macro used in the @file{yacc.c} skeleton, that you define
|
|||||||
with @code{#define} in the prologue to request verbose, specific error
|
with @code{#define} in the prologue to request verbose, specific error
|
||||||
message strings when @code{yyerror} is called. It doesn't matter what
|
message strings when @code{yyerror} is called. It doesn't matter what
|
||||||
definition you use for @code{YYERROR_VERBOSE}, just whether you define
|
definition you use for @code{YYERROR_VERBOSE}, just whether you define
|
||||||
it. Using @samp{%define parse.error "verbose"} is preferred
|
it. Using @samp{%define parse.error verbose} is preferred
|
||||||
(@pxref{Error Reporting, ,The Error Reporting Function @code{yyerror}}).
|
(@pxref{Error Reporting, ,The Error Reporting Function @code{yyerror}}).
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include "state.h"
|
#include "state.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
|
||||||
/** Records the value of the \%define variable "lr.type". */
|
/** Records the value of the \%define variable lr.type. */
|
||||||
typedef enum { LR_TYPE__LALR, LR_TYPE__IELR, LR_TYPE__CANONICAL_LR } LrType;
|
typedef enum { LR_TYPE__LALR, LR_TYPE__IELR, LR_TYPE__CANONICAL_LR } LrType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
218
src/parse-gram.c
218
src/parse-gram.c
@@ -1,4 +1,4 @@
|
|||||||
/* A Bison parser, made by GNU Bison 2.4.394-10e5b80-dirty. */
|
/* A Bison parser, made by GNU Bison 2.4.395-7910-dirty. */
|
||||||
|
|
||||||
/* Implementation for Bison's Yacc-like parsers in C
|
/* Implementation for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
#define YYBISON 1
|
#define YYBISON 1
|
||||||
|
|
||||||
/* Bison version. */
|
/* Bison version. */
|
||||||
#define YYBISON_VERSION "2.4.394-10e5b80-dirty"
|
#define YYBISON_VERSION "2.4.395-7910-dirty"
|
||||||
|
|
||||||
/* Skeleton name. */
|
/* Skeleton name. */
|
||||||
#define YYSKELETON_NAME "yacc.c"
|
#define YYSKELETON_NAME "yacc.c"
|
||||||
@@ -553,16 +553,16 @@ union yyalloc
|
|||||||
/* YYFINAL -- State number of the termination state. */
|
/* YYFINAL -- State number of the termination state. */
|
||||||
#define YYFINAL 3
|
#define YYFINAL 3
|
||||||
/* YYLAST -- Last index in YYTABLE. */
|
/* YYLAST -- Last index in YYTABLE. */
|
||||||
#define YYLAST 160
|
#define YYLAST 161
|
||||||
|
|
||||||
/* YYNTOKENS -- Number of terminals. */
|
/* YYNTOKENS -- Number of terminals. */
|
||||||
#define YYNTOKENS 57
|
#define YYNTOKENS 57
|
||||||
/* YYNNTS -- Number of nonterminals. */
|
/* YYNNTS -- Number of nonterminals. */
|
||||||
#define YYNNTS 34
|
#define YYNNTS 34
|
||||||
/* YYNRULES -- Number of rules. */
|
/* YYNRULES -- Number of rules. */
|
||||||
#define YYNRULES 106
|
#define YYNRULES 107
|
||||||
/* YYNSTATES -- Number of states. */
|
/* YYNSTATES -- Number of states. */
|
||||||
#define YYNSTATES 146
|
#define YYNSTATES 147
|
||||||
|
|
||||||
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
|
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
|
||||||
by yylex, with out-of-bounds checking. */
|
by yylex, with out-of-bounds checking. */
|
||||||
@@ -623,8 +623,8 @@ static const yytype_uint16 yyrline[] =
|
|||||||
435, 440, 442, 447, 448, 452, 453, 454, 455, 460,
|
435, 440, 442, 447, 448, 452, 453, 454, 455, 460,
|
||||||
465, 470, 476, 482, 493, 494, 503, 504, 510, 511,
|
465, 470, 476, 482, 493, 494, 503, 504, 510, 511,
|
||||||
512, 519, 519, 524, 525, 526, 531, 533, 535, 537,
|
512, 519, 519, 524, 525, 526, 531, 533, 535, 537,
|
||||||
539, 541, 546, 548, 559, 560, 565, 566, 575, 595,
|
539, 541, 546, 548, 559, 560, 565, 566, 567, 576,
|
||||||
597, 606, 611, 612, 617, 624, 626
|
596, 598, 607, 612, 613, 618, 625, 627
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -672,12 +672,12 @@ static const yytype_uint16 yytoknum[] =
|
|||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#define YYPACT_NINF -53
|
#define YYPACT_NINF -136
|
||||||
|
|
||||||
#define yypact_value_is_default(yystate) \
|
#define yypact_value_is_default(yystate) \
|
||||||
((yystate) == (-53))
|
((yystate) == (-136))
|
||||||
|
|
||||||
#define YYTABLE_NINF -106
|
#define YYTABLE_NINF -107
|
||||||
|
|
||||||
#define yytable_value_is_error(yytable_value) \
|
#define yytable_value_is_error(yytable_value) \
|
||||||
YYID (0)
|
YYID (0)
|
||||||
@@ -686,21 +686,21 @@ static const yytype_uint16 yytoknum[] =
|
|||||||
STATE-NUM. */
|
STATE-NUM. */
|
||||||
static const yytype_int16 yypact[] =
|
static const yytype_int16 yypact[] =
|
||||||
{
|
{
|
||||||
-53, 5, 102, -53, -53, -53, -10, 8, 27, -53,
|
-136, 36, 103, -136, -136, -136, -2, 18, 22, -136,
|
||||||
-53, -53, -53, 18, -53, 32, 55, -53, 70, 77,
|
-136, -136, -136, -1, -136, 32, 66, -136, 70, 90,
|
||||||
-53, 17, -53, 43, 91, 53, 41, -53, -53, -53,
|
-136, 17, -136, 53, 93, 55, 39, -136, -136, -136,
|
||||||
42, 54, 94, 96, 0, -53, -53, -53, 16, -53,
|
41, 56, 97, 98, 0, -136, -136, -136, 16, -136,
|
||||||
-53, 56, -53, -53, -53, -53, 48, 30, 30, 0,
|
-136, 57, -136, -136, -136, -136, 52, 30, 30, 0,
|
||||||
13, 13, -53, 61, -53, -53, -53, 101, -53, -53,
|
13, 13, -136, 63, -136, -136, -136, 35, -136, -136,
|
||||||
-53, -53, 113, -53, -53, -53, -53, 114, -53, 115,
|
-136, -136, 114, -136, -136, -136, -136, 115, -136, 116,
|
||||||
-53, -53, -53, -53, -53, -53, -53, -53, -53, 93,
|
-136, -136, -136, -136, -136, -136, -136, -136, -136, 94,
|
||||||
-53, 95, 1, -53, -53, 50, -53, 61, -53, 0,
|
-136, 95, 1, -136, -136, 51, -136, 63, -136, 0,
|
||||||
-53, -53, 30, 33, 30, 0, -53, -53, -53, -53,
|
-136, -136, 30, 89, 30, 0, -136, -136, -136, -136,
|
||||||
13, -53, -53, 13, -53, -53, -53, -53, -53, -53,
|
13, -136, -136, 13, -136, -136, -136, -136, -136, -136,
|
||||||
-53, -53, 103, -53, -53, -53, -53, -53, 0, -53,
|
-136, -136, -136, 104, -136, -136, -136, -136, -136, 0,
|
||||||
141, -53, 145, -53, -53, -53, -53, -53, -53, -53,
|
-136, 143, -136, 146, -136, -136, -136, -136, -136, -136,
|
||||||
-53, 39, 37, -53, -53, 0, 147, 97, 50, 50,
|
-136, -136, 19, 37, -136, -136, 0, 148, 105, 51,
|
||||||
37, -53, -53, -53, -53, -53
|
51, 37, -136, -136, -136, -136, -136
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
/* YYDEFACT[S] -- default reduction number in state S. Performed when
|
||||||
@@ -713,34 +713,34 @@ static const yytype_uint8 yydefact[] =
|
|||||||
7, 0, 16, 0, 0, 0, 0, 39, 22, 23,
|
7, 0, 16, 0, 0, 0, 0, 39, 22, 23,
|
||||||
0, 0, 0, 0, 0, 29, 30, 31, 0, 6,
|
0, 0, 0, 0, 0, 29, 30, 31, 0, 6,
|
||||||
32, 42, 4, 5, 34, 33, 55, 0, 0, 0,
|
32, 42, 4, 5, 34, 33, 55, 0, 0, 0,
|
||||||
0, 0, 98, 0, 40, 95, 94, 96, 10, 12,
|
0, 0, 99, 0, 40, 95, 94, 96, 10, 12,
|
||||||
13, 14, 0, 17, 18, 19, 20, 0, 24, 0,
|
13, 14, 0, 17, 18, 19, 20, 0, 24, 0,
|
||||||
26, 27, 28, 104, 100, 99, 102, 35, 103, 0,
|
26, 27, 28, 105, 101, 100, 103, 35, 104, 0,
|
||||||
101, 0, 0, 76, 78, 92, 43, 0, 56, 0,
|
102, 0, 0, 76, 78, 92, 43, 0, 56, 0,
|
||||||
69, 74, 48, 70, 46, 49, 61, 66, 67, 68,
|
69, 74, 48, 70, 46, 49, 61, 66, 67, 68,
|
||||||
36, 63, 65, 37, 41, 97, 8, 15, 21, 25,
|
36, 63, 65, 37, 41, 98, 97, 8, 15, 21,
|
||||||
80, 79, 0, 77, 2, 93, 81, 44, 50, 57,
|
25, 80, 79, 0, 77, 2, 93, 81, 44, 50,
|
||||||
59, 75, 71, 72, 62, 64, 106, 86, 58, 60,
|
57, 59, 75, 71, 72, 62, 64, 107, 86, 58,
|
||||||
73, 82, 83, 86, 85, 0, 0, 0, 92, 92,
|
60, 73, 82, 83, 86, 85, 0, 0, 0, 92,
|
||||||
84, 89, 90, 91, 88, 87
|
92, 84, 89, 90, 91, 88, 87
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYPGOTO[NTERM-NUM]. */
|
/* YYPGOTO[NTERM-NUM]. */
|
||||||
static const yytype_int16 yypgoto[] =
|
static const yytype_int16 yypgoto[] =
|
||||||
{
|
{
|
||||||
-53, -53, -53, -53, 152, -53, -53, -53, -53, -53,
|
-136, -136, -136, -136, 153, -136, -136, -136, -136, -136,
|
||||||
-53, -53, -53, 38, -53, 104, -32, -3, 109, -53,
|
-136, -136, -136, 31, -136, 107, -13, -3, 108, -136,
|
||||||
78, -53, -53, -53, 26, -46, -53, -53, -49, -17,
|
78, -136, -136, -136, 27, -135, -136, -136, -16, -17,
|
||||||
-53, -34, -52, -53
|
-136, -34, -35, -136
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYDEFGOTO[NTERM-NUM]. */
|
/* YYDEFGOTO[NTERM-NUM]. */
|
||||||
static const yytype_int16 yydefgoto[] =
|
static const yytype_int16 yydefgoto[] =
|
||||||
{
|
{
|
||||||
-1, 1, 2, 42, 81, 87, 44, 48, 47, 45,
|
-1, 1, 2, 42, 81, 87, 44, 48, 47, 45,
|
||||||
46, 89, 118, 119, 95, 100, 101, 91, 92, 82,
|
46, 89, 119, 120, 95, 100, 101, 91, 92, 82,
|
||||||
83, 84, 127, 131, 132, 116, 57, 106, 54, 76,
|
83, 84, 128, 132, 133, 117, 57, 107, 54, 76,
|
||||||
85, 102, 78, 114
|
85, 102, 78, 115
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
||||||
@@ -748,44 +748,44 @@ static const yytype_int16 yydefgoto[] =
|
|||||||
number is the opposite. If YYTABLE_NINF, syntax error. */
|
number is the opposite. If YYTABLE_NINF, syntax error. */
|
||||||
static const yytype_int16 yytable[] =
|
static const yytype_int16 yytable[] =
|
||||||
{
|
{
|
||||||
77, -105, 79, 73, 104, 3, 4, 5, 6, 7,
|
77, -106, 79, 73, 145, 146, 4, 5, 6, 7,
|
||||||
8, 9, 10, 11, 12, 96, 73, 79, 13, 14,
|
8, 9, 10, 11, 12, 96, 73, 79, 13, 14,
|
||||||
61, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
61, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||||
93, 93, 27, 13, 14, 55, 73, 122, 117, 34,
|
93, 93, 27, 13, 14, 55, 3, 104, 105, 34,
|
||||||
73, 123, 49, 74, 66, 68, 75, 27, 80, 112,
|
73, 52, 66, 74, 68, 53, 75, 27, 80, 113,
|
||||||
50, 135, 136, 137, 34, 120, 74, 41, 58, 75,
|
49, 136, 137, 138, 34, 121, 74, 41, 124, 75,
|
||||||
52, 124, 62, 80, 53, 97, 98, 99, 125, 51,
|
50, 125, 62, 80, 51, 97, 98, 99, 134, 58,
|
||||||
130, 125, 41, 74, 59, 93, 75, 93, 56, 138,
|
135, 118, 41, 74, 59, 93, 75, 93, 56, 139,
|
||||||
74, 60, 90, 75, 120, 63, 67, 69, 133, 121,
|
74, 106, 90, 75, 67, 121, 69, 126, 131, 122,
|
||||||
134, 121, 144, 145, 64, 65, 70, 71, 139, 72,
|
126, 122, 73, 123, 60, 63, 64, 65, 70, 140,
|
||||||
88, 141, 86, 52, 105, 115, 139, 4, 5, 6,
|
71, 72, 142, 86, 88, 52, 116, 140, 4, 5,
|
||||||
7, 8, 9, 10, 11, 12, 107, 108, 109, 13,
|
6, 7, 8, 9, 10, 11, 12, 108, 109, 110,
|
||||||
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
|
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
||||||
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
|
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
|
||||||
34, 35, 36, 37, 110, 129, 111, 126, 73, 143,
|
33, 34, 35, 36, 37, 111, 112, 130, 127, 73,
|
||||||
38, 142, 39, 40, 43, 103, 128, 94, 41, 140,
|
129, 38, 143, 39, 40, 43, 94, 144, 103, 41,
|
||||||
113
|
114, 141
|
||||||
};
|
};
|
||||||
|
|
||||||
static const yytype_uint8 yycheck[] =
|
static const yytype_uint8 yycheck[] =
|
||||||
{
|
{
|
||||||
34, 0, 1, 3, 53, 0, 5, 6, 7, 8,
|
34, 0, 1, 3, 139, 140, 5, 6, 7, 8,
|
||||||
9, 10, 11, 12, 13, 49, 3, 1, 17, 18,
|
9, 10, 11, 12, 13, 49, 3, 1, 17, 18,
|
||||||
3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
3, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
||||||
47, 48, 31, 17, 18, 3, 3, 4, 87, 38,
|
47, 48, 31, 17, 18, 3, 0, 53, 3, 38,
|
||||||
3, 93, 52, 43, 3, 3, 46, 31, 47, 48,
|
3, 42, 3, 43, 3, 46, 46, 31, 47, 48,
|
||||||
42, 14, 15, 16, 38, 89, 43, 56, 3, 46,
|
52, 14, 15, 16, 38, 89, 43, 56, 93, 46,
|
||||||
42, 95, 45, 47, 46, 52, 53, 54, 100, 42,
|
42, 95, 45, 47, 42, 52, 53, 54, 49, 3,
|
||||||
122, 103, 56, 43, 4, 92, 46, 94, 46, 42,
|
51, 87, 56, 43, 4, 92, 46, 94, 46, 42,
|
||||||
43, 4, 52, 46, 118, 42, 45, 45, 49, 92,
|
43, 46, 52, 46, 45, 119, 45, 100, 123, 92,
|
||||||
51, 94, 138, 139, 3, 42, 42, 3, 132, 3,
|
103, 94, 3, 4, 4, 42, 3, 42, 42, 133,
|
||||||
52, 135, 46, 42, 3, 55, 140, 5, 6, 7,
|
3, 3, 136, 46, 52, 42, 55, 141, 5, 6,
|
||||||
8, 9, 10, 11, 12, 13, 3, 3, 3, 17,
|
7, 8, 9, 10, 11, 12, 13, 3, 3, 3,
|
||||||
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
|
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
|
||||||
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
|
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
|
||||||
38, 39, 40, 41, 51, 4, 51, 44, 3, 52,
|
37, 38, 39, 40, 41, 51, 51, 4, 44, 3,
|
||||||
48, 4, 50, 51, 2, 51, 118, 48, 56, 133,
|
119, 48, 4, 50, 51, 2, 48, 52, 51, 56,
|
||||||
82
|
82, 134
|
||||||
};
|
};
|
||||||
|
|
||||||
/* STOS_[STATE-NUM] -- The (internal number of the) accessing
|
/* STOS_[STATE-NUM] -- The (internal number of the) accessing
|
||||||
@@ -802,11 +802,11 @@ static const yytype_uint8 yystos[] =
|
|||||||
42, 3, 3, 3, 43, 46, 86, 88, 89, 1,
|
42, 3, 3, 3, 43, 46, 86, 88, 89, 1,
|
||||||
47, 61, 76, 77, 78, 87, 46, 62, 52, 68,
|
47, 61, 76, 77, 78, 87, 46, 62, 52, 68,
|
||||||
52, 74, 75, 86, 75, 71, 88, 52, 53, 54,
|
52, 74, 75, 86, 75, 71, 88, 52, 53, 54,
|
||||||
72, 73, 88, 72, 85, 3, 84, 3, 3, 3,
|
72, 73, 88, 72, 85, 3, 46, 84, 3, 3,
|
||||||
51, 51, 48, 77, 90, 55, 82, 85, 69, 70,
|
3, 51, 51, 48, 77, 90, 55, 82, 85, 69,
|
||||||
88, 74, 4, 89, 88, 73, 44, 79, 70, 4,
|
70, 88, 74, 4, 89, 88, 73, 44, 79, 70,
|
||||||
89, 80, 81, 49, 51, 14, 15, 16, 42, 88,
|
4, 89, 80, 81, 49, 51, 14, 15, 16, 42,
|
||||||
81, 88, 4, 52, 82, 82
|
88, 81, 88, 4, 52, 82, 82
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
||||||
@@ -821,8 +821,8 @@ static const yytype_uint8 yyr1[] =
|
|||||||
70, 71, 71, 72, 72, 73, 73, 73, 73, 74,
|
70, 71, 71, 72, 72, 73, 73, 73, 73, 74,
|
||||||
74, 74, 74, 74, 75, 75, 76, 76, 77, 77,
|
74, 74, 74, 74, 75, 75, 76, 76, 77, 77,
|
||||||
77, 79, 78, 80, 80, 80, 81, 81, 81, 81,
|
77, 79, 78, 80, 80, 80, 81, 81, 81, 81,
|
||||||
81, 81, 82, 82, 83, 83, 84, 84, 85, 86,
|
81, 81, 82, 82, 83, 83, 84, 84, 84, 85,
|
||||||
86, 87, 88, 88, 89, 90, 90
|
86, 86, 87, 88, 88, 89, 90, 90
|
||||||
};
|
};
|
||||||
|
|
||||||
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
||||||
@@ -838,7 +838,7 @@ static const yytype_uint8 yyr2[] =
|
|||||||
1, 2, 2, 3, 1, 2, 1, 2, 1, 2,
|
1, 2, 2, 3, 1, 2, 1, 2, 1, 2,
|
||||||
2, 0, 4, 1, 3, 2, 0, 3, 3, 3,
|
2, 0, 4, 1, 3, 2, 0, 3, 3, 3,
|
||||||
3, 3, 0, 1, 1, 1, 0, 1, 1, 1,
|
3, 3, 0, 1, 1, 1, 0, 1, 1, 1,
|
||||||
1, 1, 1, 1, 1, 0, 2
|
1, 1, 1, 1, 1, 1, 0, 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -2602,9 +2602,17 @@ yyreduce:
|
|||||||
#line 2603 "src/parse-gram.c"
|
#line 2603 "src/parse-gram.c"
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 98:
|
case 97:
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 576 "parse-gram.y"
|
#line 566 "parse-gram.y"
|
||||||
|
{ (yyval.chars) = (yyvsp[0].uniqstr); }
|
||||||
|
/* Line 1388 of yacc.c */
|
||||||
|
#line 2611 "src/parse-gram.c"
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 99:
|
||||||
|
/* Line 1388 of yacc.c */
|
||||||
|
#line 577 "parse-gram.y"
|
||||||
{
|
{
|
||||||
code_props plain_code;
|
code_props plain_code;
|
||||||
(yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
|
(yyvsp[0].code)[strlen ((yyvsp[0].code)) - 1] = '\n';
|
||||||
@@ -2614,51 +2622,51 @@ yyreduce:
|
|||||||
(yyval.chars) = plain_code.code;
|
(yyval.chars) = plain_code.code;
|
||||||
}
|
}
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 2618 "src/parse-gram.c"
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 99:
|
|
||||||
/* Line 1388 of yacc.c */
|
|
||||||
#line 596 "parse-gram.y"
|
|
||||||
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
|
|
||||||
/* Line 1388 of yacc.c */
|
|
||||||
#line 2626 "src/parse-gram.c"
|
#line 2626 "src/parse-gram.c"
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 100:
|
case 100:
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 598 "parse-gram.y"
|
#line 597 "parse-gram.y"
|
||||||
|
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
|
||||||
|
/* Line 1388 of yacc.c */
|
||||||
|
#line 2634 "src/parse-gram.c"
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 101:
|
||||||
|
/* Line 1388 of yacc.c */
|
||||||
|
#line 599 "parse-gram.y"
|
||||||
{
|
{
|
||||||
(yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
|
(yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0]));
|
||||||
symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
|
symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
|
||||||
symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
|
symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0]));
|
||||||
}
|
}
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 2638 "src/parse-gram.c"
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 101:
|
|
||||||
/* Line 1388 of yacc.c */
|
|
||||||
#line 606 "parse-gram.y"
|
|
||||||
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
|
|
||||||
/* Line 1388 of yacc.c */
|
|
||||||
#line 2646 "src/parse-gram.c"
|
#line 2646 "src/parse-gram.c"
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 104:
|
case 102:
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 618 "parse-gram.y"
|
#line 607 "parse-gram.y"
|
||||||
|
{ (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); }
|
||||||
|
/* Line 1388 of yacc.c */
|
||||||
|
#line 2654 "src/parse-gram.c"
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 105:
|
||||||
|
/* Line 1388 of yacc.c */
|
||||||
|
#line 619 "parse-gram.y"
|
||||||
{
|
{
|
||||||
(yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
|
(yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0]));
|
||||||
symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
|
symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false);
|
||||||
}
|
}
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 2657 "src/parse-gram.c"
|
#line 2665 "src/parse-gram.c"
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 106:
|
case 107:
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 627 "parse-gram.y"
|
#line 628 "parse-gram.y"
|
||||||
{
|
{
|
||||||
code_props plain_code;
|
code_props plain_code;
|
||||||
code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
|
code_props_plain_init (&plain_code, (yyvsp[0].chars), (yylsp[0]));
|
||||||
@@ -2668,12 +2676,12 @@ yyreduce:
|
|||||||
code_scanner_last_string_free ();
|
code_scanner_last_string_free ();
|
||||||
}
|
}
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 2672 "src/parse-gram.c"
|
#line 2680 "src/parse-gram.c"
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
/* Line 1388 of yacc.c */
|
/* Line 1388 of yacc.c */
|
||||||
#line 2677 "src/parse-gram.c"
|
#line 2685 "src/parse-gram.c"
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
||||||
@@ -2890,7 +2898,7 @@ yyreturn:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Line 1607 of yacc.c */
|
/* Line 1607 of yacc.c */
|
||||||
#line 637 "parse-gram.y"
|
#line 638 "parse-gram.y"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* A Bison parser, made by GNU Bison 2.4.394-10e5b80-dirty. */
|
/* A Bison parser, made by GNU Bison 2.4.395-7910-dirty. */
|
||||||
|
|
||||||
/* Interface for Bison's Yacc-like parsers in C
|
/* Interface for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
|
|||||||
@@ -563,6 +563,7 @@ variable:
|
|||||||
/* Some content or empty by default. */
|
/* Some content or empty by default. */
|
||||||
content.opt:
|
content.opt:
|
||||||
/* Nothing. */ { $$ = ""; }
|
/* Nothing. */ { $$ = ""; }
|
||||||
|
| ID { $$ = $1; }
|
||||||
| STRING
|
| STRING
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ AT_SETUP([Mid-rule actions])
|
|||||||
# action.
|
# action.
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[%define parse.error "verbose"
|
[[%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
%{
|
%{
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
@@ -93,7 +93,7 @@ AT_CLEANUP
|
|||||||
AT_SETUP([Exotic Dollars])
|
AT_SETUP([Exotic Dollars])
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[%define parse.error "verbose"
|
[[%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
%{
|
%{
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
@@ -557,7 +557,7 @@ m4_define([AT_CHECK_PRINTER_AND_DESTRUCTOR],
|
|||||||
|
|
||||||
$3
|
$3
|
||||||
_AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4],
|
_AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4],
|
||||||
[%define parse.error "verbose"
|
[%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
%verbose
|
%verbose
|
||||||
%locations
|
%locations
|
||||||
@@ -588,7 +588,7 @@ AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [with union])
|
|||||||
AT_SETUP([Default tagless %printer and %destructor])
|
AT_SETUP([Default tagless %printer and %destructor])
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[%define parse.error "verbose"
|
[[%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
%locations
|
%locations
|
||||||
%initial-action {
|
%initial-action {
|
||||||
@@ -706,7 +706,7 @@ AT_CLEANUP
|
|||||||
AT_SETUP([Default tagged and per-type %printer and %destructor])
|
AT_SETUP([Default tagged and per-type %printer and %destructor])
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[%define parse.error "verbose"
|
[[%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
|
|
||||||
%{
|
%{
|
||||||
@@ -850,7 +850,7 @@ m4_define([_AT_CHECK_DEFAULT_PRINTER_AND_DESTRUCTOR_FOR_END_TOKEN],
|
|||||||
[m4_pushdef([kind], [*]) m4_pushdef([not_kind], [])])
|
[m4_pushdef([kind], [*]) m4_pushdef([not_kind], [])])
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([[input]]$1[[.y]],
|
AT_DATA_GRAMMAR([[input]]$1[[.y]],
|
||||||
[[%define parse.error "verbose"
|
[[%define parse.error verbose
|
||||||
%debug
|
%debug
|
||||||
%locations
|
%locations
|
||||||
%initial-action {
|
%initial-action {
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ AT_PARSER_CHECK([./calc input], 0, [], [stderr])
|
|||||||
# If BISON-OPTIONS contains `%location', then make sure the ERROR-LOCATION
|
# If BISON-OPTIONS contains `%location', then make sure the ERROR-LOCATION
|
||||||
# is correctly output on stderr.
|
# is correctly output on stderr.
|
||||||
#
|
#
|
||||||
# If BISON-OPTIONS contains `%define parse.error "verbose"', then make sure the
|
# If BISON-OPTIONS contains `%define parse.error verbose', then make sure the
|
||||||
# IF-YYERROR-VERBOSE message is properly output after `syntax error, '
|
# IF-YYERROR-VERBOSE message is properly output after `syntax error, '
|
||||||
# on STDERR.
|
# on STDERR.
|
||||||
#
|
#
|
||||||
@@ -443,7 +443,7 @@ AT_YYERROR_SEES_LOC_IF([],
|
|||||||
[[sed 's/^[-0-9.]*: //' expout >at-expout
|
[[sed 's/^[-0-9.]*: //' expout >at-expout
|
||||||
mv at-expout expout]])
|
mv at-expout expout]])
|
||||||
# 4. If error-verbose is not used, strip the`, unexpected....' part.
|
# 4. If error-verbose is not used, strip the`, unexpected....' part.
|
||||||
m4_bmatch([$1], [%define parse.error "verbose"], [],
|
m4_bmatch([$1], [%define parse.error verbose], [],
|
||||||
[[sed 's/syntax error, .*$/syntax error/' expout >at-expout
|
[[sed 's/syntax error, .*$/syntax error/' expout >at-expout
|
||||||
mv at-expout expout]])
|
mv at-expout expout]])
|
||||||
# 5. Check
|
# 5. Check
|
||||||
@@ -572,22 +572,22 @@ AT_CHECK_CALC_LALR([%locations])
|
|||||||
AT_CHECK_CALC_LALR([%name-prefix="calc"]) dnl test deprecated `='
|
AT_CHECK_CALC_LALR([%name-prefix="calc"]) dnl test deprecated `='
|
||||||
AT_CHECK_CALC_LALR([%verbose])
|
AT_CHECK_CALC_LALR([%verbose])
|
||||||
AT_CHECK_CALC_LALR([%yacc])
|
AT_CHECK_CALC_LALR([%yacc])
|
||||||
AT_CHECK_CALC_LALR([%define parse.error "verbose"])
|
AT_CHECK_CALC_LALR([%define parse.error verbose])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR([%define api.pure %locations])
|
AT_CHECK_CALC_LALR([%define api.pure %locations])
|
||||||
AT_CHECK_CALC_LALR([%define api.push-pull "both" %define api.pure %locations])
|
AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %locations])
|
||||||
AT_CHECK_CALC_LALR([%define parse.error "verbose" %locations])
|
AT_CHECK_CALC_LALR([%define parse.error verbose %locations])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR([%define parse.error "verbose" %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
AT_CHECK_CALC_LALR([%define parse.error "verbose" %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR([%debug])
|
AT_CHECK_CALC_LALR([%debug])
|
||||||
AT_CHECK_CALC_LALR([%define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
AT_CHECK_CALC_LALR([%define api.push-pull "both" %define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
AT_CHECK_CALC_LALR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
||||||
|
|
||||||
|
|
||||||
# ----------------------- #
|
# ----------------------- #
|
||||||
@@ -611,20 +611,20 @@ AT_CHECK_CALC_GLR([%locations])
|
|||||||
AT_CHECK_CALC_GLR([%name-prefix "calc"])
|
AT_CHECK_CALC_GLR([%name-prefix "calc"])
|
||||||
AT_CHECK_CALC_GLR([%verbose])
|
AT_CHECK_CALC_GLR([%verbose])
|
||||||
AT_CHECK_CALC_GLR([%yacc])
|
AT_CHECK_CALC_GLR([%yacc])
|
||||||
AT_CHECK_CALC_GLR([%define parse.error "verbose"])
|
AT_CHECK_CALC_GLR([%define parse.error verbose])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR([%define api.pure %locations])
|
AT_CHECK_CALC_GLR([%define api.pure %locations])
|
||||||
AT_CHECK_CALC_GLR([%define parse.error "verbose" %locations])
|
AT_CHECK_CALC_GLR([%define parse.error verbose %locations])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR([%define parse.error "verbose" %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_GLR([%define parse.error verbose %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR([%debug])
|
AT_CHECK_CALC_GLR([%debug])
|
||||||
AT_CHECK_CALC_GLR([%define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
AT_CHECK_CALC_GLR([%define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
AT_CHECK_CALC_GLR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR([%define api.pure %define parse.error "verbose" %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
AT_CHECK_CALC_GLR([%define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------- #
|
# ----------------------------- #
|
||||||
@@ -645,14 +645,14 @@ m4_define([AT_CHECK_CALC_LALR1_CC],
|
|||||||
|
|
||||||
AT_CHECK_CALC_LALR1_CC([])
|
AT_CHECK_CALC_LALR1_CC([])
|
||||||
AT_CHECK_CALC_LALR1_CC([%locations])
|
AT_CHECK_CALC_LALR1_CC([%locations])
|
||||||
AT_CHECK_CALC_LALR1_CC([%locations %define parse.error "verbose" %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR1_CC([%locations %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR1_CC([%locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
|
||||||
AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
AT_CHECK_CALC_LALR1_CC([%locations %pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -673,12 +673,12 @@ m4_define([AT_CHECK_CALC_GLR_CC],
|
|||||||
[AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)])
|
[AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR_CC([])
|
AT_CHECK_CALC_GLR_CC([])
|
||||||
AT_CHECK_CALC_GLR_CC([%define parse.error "verbose" %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_GLR_CC([%define parse.error verbose %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR_CC([%debug])
|
AT_CHECK_CALC_GLR_CC([%debug])
|
||||||
AT_CHECK_CALC_GLR_CC([%define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_GLR_CC([%define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc])
|
AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc])
|
||||||
AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %define api.tokens.prefix "TOK_" %verbose %yacc])
|
||||||
|
|
||||||
AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error "verbose" %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
AT_CHECK_CALC_GLR_CC([%pure-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
||||||
|
|||||||
@@ -42,18 +42,18 @@ AT_CHECK([[diff -u input-lalr.output input.output \
|
|||||||
[[0]], [$1])])
|
[[0]], [$1])])
|
||||||
|
|
||||||
AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
|
AT_TEST_TABLES_AND_PARSE([$2[: LALR(1)]], [[LALR]], [[last-state]],
|
||||||
[[%define lr.type "lalr"
|
[[%define lr.type lalr
|
||||||
]$3],
|
]$3],
|
||||||
[$4], [$5], [$6], [$7],
|
[$4], [$5], [$6], [$7],
|
||||||
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
|
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
|
||||||
AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]],
|
AT_TEST_TABLES_AND_PARSE([$2[: IELR(1)]], [[IELR]], [[last-state]],
|
||||||
[[%define lr.type "ielr"
|
[[%define lr.type ielr
|
||||||
]$3],
|
]$3],
|
||||||
[$4], [$5], [$6], [$7],
|
[$4], [$5], [$6], [$7],
|
||||||
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
|
[AT_LALR1_DIFF_CHECK([$8])$9], [$10], [$11], [$12])
|
||||||
AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]],
|
AT_TEST_TABLES_AND_PARSE([$2[: Canonical LR(1)]], [[canonical LR]],
|
||||||
[[last-state,no-xml]],
|
[[last-state,no-xml]],
|
||||||
[[%define lr.type "canonical-lr"
|
[[%define lr.type canonical-lr
|
||||||
]$3],
|
]$3],
|
||||||
[$4], [$5], [$6], [$7],
|
[$4], [$5], [$6], [$7],
|
||||||
[$9], [$10], [$11], [$12])
|
[$9], [$10], [$11], [$12])
|
||||||
|
|||||||
@@ -999,7 +999,7 @@ AT_SETUP([[%define enum variables]])
|
|||||||
|
|
||||||
# Front-end.
|
# Front-end.
|
||||||
AT_DATA([[input.y]],
|
AT_DATA([[input.y]],
|
||||||
[[%define lr.default-reductions "bogus"
|
[[%define lr.default-reductions bogus
|
||||||
%%
|
%%
|
||||||
start: ;
|
start: ;
|
||||||
]])
|
]])
|
||||||
@@ -1012,7 +1012,7 @@ input.y:1.9-29: accepted value: `accepting'
|
|||||||
|
|
||||||
# Back-end.
|
# Back-end.
|
||||||
AT_DATA([[input.y]],
|
AT_DATA([[input.y]],
|
||||||
[[%define api.push-pull "neither"
|
[[%define api.push-pull neither
|
||||||
%%
|
%%
|
||||||
start: ;
|
start: ;
|
||||||
]])
|
]])
|
||||||
@@ -1047,7 +1047,7 @@ input.y:1.9-21: accepted value: `both'
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_DATA([[input.y]],
|
AT_DATA([[input.y]],
|
||||||
[[%define lr.keep_unreachable_states "maybe"
|
[[%define lr.keep_unreachable_states maybe
|
||||||
%%
|
%%
|
||||||
start: ;
|
start: ;
|
||||||
]])
|
]])
|
||||||
@@ -1102,11 +1102,11 @@ AT_BISON_CHECK([[input.y]], [0], [],
|
|||||||
])
|
])
|
||||||
|
|
||||||
AT_CHECK_API_PURE([[%language "c++" %defines]], [[]])
|
AT_CHECK_API_PURE([[%language "c++" %defines]], [[]])
|
||||||
AT_CHECK_API_PURE([[%language "c++" %defines]], [["false"]])
|
AT_CHECK_API_PURE([[%language "c++" %defines]], [[false]])
|
||||||
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[""]])
|
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[""]])
|
||||||
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [["false"]])
|
AT_CHECK_API_PURE([[%language "c++" %defines %glr-parser]], [[false]])
|
||||||
AT_CHECK_API_PURE([[%language "java"]], [["true"]])
|
AT_CHECK_API_PURE([[%language "java"]], [[true]])
|
||||||
AT_CHECK_API_PURE([[%language "java"]], [["false"]])
|
AT_CHECK_API_PURE([[%language "java"]], [[false]])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ m4_pushdef([AT_LOCATION_IF],
|
|||||||
[m4_bmatch([$3], [%locations], [$1], [$2])])
|
[m4_bmatch([$3], [%locations], [$1], [$2])])
|
||||||
m4_pushdef([AT_PURE_IF],
|
m4_pushdef([AT_PURE_IF],
|
||||||
[m4_bmatch([$3], [%define *api\.pure\|%pure-parser],
|
[m4_bmatch([$3], [%define *api\.pure\|%pure-parser],
|
||||||
[m4_bmatch([$3], [%define *api\.pure *"false"], [$2], [$1])],
|
[m4_bmatch([$3], [%define *api\.pure *"?false"?], [$2], [$1])],
|
||||||
[$2])])
|
[$2])])
|
||||||
m4_pushdef([AT_PURE_AND_LOC_IF],
|
m4_pushdef([AT_PURE_AND_LOC_IF],
|
||||||
[m4_bmatch([$3], [%locations], [AT_PURE_IF($@)], [$2])])
|
[m4_bmatch([$3], [%locations], [AT_PURE_IF($@)], [$2])])
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
void yyerror (char const *msg);
|
void yyerror (char const *msg);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%define api.pure %define api.push-pull "push"
|
%define api.pure %define api.push-pull push
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
int yylex (void);
|
int yylex (void);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%define api.push-pull "]$1["
|
%define api.push-pull ]$1[
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ AT_SETUP([[Push Parsing: Unsupported Skeletons]])
|
|||||||
|
|
||||||
AT_DATA([[input.y]],
|
AT_DATA([[input.y]],
|
||||||
[[%glr-parser
|
[[%glr-parser
|
||||||
%define api.push-pull "push"
|
%define api.push-pull push
|
||||||
%%
|
%%
|
||||||
start: ;
|
start: ;
|
||||||
]])
|
]])
|
||||||
|
|||||||
@@ -375,19 +375,19 @@ m4_define([AT_TEST_LR_TYPE],
|
|||||||
AT_TEST_TABLES_AND_PARSE([[no %define lr.type: ]$1],
|
AT_TEST_TABLES_AND_PARSE([[no %define lr.type: ]$1],
|
||||||
[[LALR]], [[]],
|
[[LALR]], [[]],
|
||||||
[$2], m4_shiftn(2, $@))
|
[$2], m4_shiftn(2, $@))
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.type "lalr": ]$1],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.type lalr: ]$1],
|
||||||
[[LALR]], [[]],
|
[[LALR]], [[]],
|
||||||
[[%define lr.type "lalr"
|
[[%define lr.type lalr
|
||||||
]$2],
|
]$2],
|
||||||
m4_shiftn(2, $@))
|
m4_shiftn(2, $@))
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.type "ielr": ]$1],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.type ielr: ]$1],
|
||||||
[[IELR]], [[]],
|
[[IELR]], [[]],
|
||||||
[[%define lr.type "ielr"
|
[[%define lr.type ielr
|
||||||
]$2],
|
]$2],
|
||||||
m4_shiftn(2, $@))
|
m4_shiftn(2, $@))
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.type "canonical-lr": ]$1],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.type canonical-lr: ]$1],
|
||||||
[[canonical LR]], [[]],
|
[[canonical LR]], [[]],
|
||||||
[[%define lr.type "canonical-lr"
|
[[%define lr.type canonical-lr
|
||||||
]$2],
|
]$2],
|
||||||
m4_shiftn(2, $@))
|
m4_shiftn(2, $@))
|
||||||
])
|
])
|
||||||
@@ -1454,17 +1454,17 @@ AT_TEST_TABLES_AND_PARSE([[no %define lr.default-reductions]],
|
|||||||
[[all]], [[]],
|
[[all]], [[]],
|
||||||
[[]],
|
[[]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "all"]],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions all]],
|
||||||
[[all]], [[]],
|
[[all]], [[]],
|
||||||
[[%define lr.default-reductions "all"]],
|
[[%define lr.default-reductions all]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "consistent"]],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions consistent]],
|
||||||
[[consistent]], [[]],
|
[[consistent]], [[]],
|
||||||
[[%define lr.default-reductions "consistent"]],
|
[[%define lr.default-reductions consistent]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions "accepting"]],
|
AT_TEST_TABLES_AND_PARSE([[%define lr.default-reductions accepting]],
|
||||||
[[accepting]], [[]],
|
[[accepting]], [[]],
|
||||||
[[%define lr.default-reductions "accepting"]],
|
[[%define lr.default-reductions accepting]],
|
||||||
[$1], [$2], [[]], [$3])
|
[$1], [$2], [[]], [$3])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore],
|
|||||||
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
|
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
|
||||||
# push parsers.
|
# push parsers.
|
||||||
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
|
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
|
||||||
[[%define api.push-pull "both"
|
[[%define api.push-pull both
|
||||||
]])
|
]])
|
||||||
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
|
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
|
||||||
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
|
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
|
||||||
@@ -534,7 +534,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore],
|
|||||||
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
|
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
|
||||||
|
|
||||||
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
|
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
|
||||||
[[%define api.push-pull "both"
|
[[%define api.push-pull both
|
||||||
]])
|
]])
|
||||||
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
|
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
|
||||||
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
|
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
|
||||||
|
|||||||
Reference in New Issue
Block a user