* doc/bison.texinfo (Debugging): Split into...

(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
This commit is contained in:
Akim Demaille
2002-05-25 16:12:40 +00:00
parent 78df825093
commit ec3bc3961d
25 changed files with 735 additions and 304 deletions

View File

@@ -1,3 +1,26 @@
2002-05-25 Akim Demaille <akim@epita.fr>
* doc/bison.texinfo (Debugging): Split into...
(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU> 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
and Paul Eggert <eggert@twinsun.com> and Paul Eggert <eggert@twinsun.com>

7
NEWS
View File

@@ -81,6 +81,13 @@ Changes in version 1.49b:
the compiler supports ANSI C or is a C++ compiler, as enums. the compiler supports ANSI C or is a C++ compiler, as enums.
This helps debuggers producing symbols instead of values. This helps debuggers producing symbols instead of values.
* Reports
In addition to --verbose, bison supports --report=THINGS, which
produces additional information:
`itemset' complete the core item sets with their closure
`lookahead' explicitly associate lookaheads to items
Changes in version 1.35, 2002-03-25: Changes in version 1.35, 2002-03-25:

148
TODO
View File

@@ -1,5 +1,20 @@
-*- outline -*- -*- outline -*-
* documentation
Explain $axiom (and maybe change its name: BTYacc names it goal).
Complete the glossary (item, axiom, ?).
* report documentation
Extend with error. The hard part will probably be finding the right
rule so that a single state does not exhibit to many yet 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?
* documentation
Some history of Bison and some bibliography would be most welcome.
Are there any Texinfo standards for bibliography?
* Several %unions * Several %unions
I think this is a pleasant (but useless currently) feature, but in the I think this is a pleasant (but useless currently) feature, but in the
future, I want a means to %include other bits of grammars, and _then_ future, I want a means to %include other bits of grammars, and _then_
@@ -21,130 +36,25 @@ When implementing multiple-%union support, bare the following in mind:
char *sval; char *sval;
} }
* Experimental report features * --report=conflict-path
Decide whether they should be enabled, or optional. For instance, on: Provide better assistance for understanding the conflicts by providing
a sample text exhibiting the (LALR) ambiguity.
input: * report
exp Solved conflicts should not be reported in the beginning of the file.
| input exp Rather they should be reported within each state description. Also,
; now that the symbol providing the precedence of a rule is kept, it is
possible to explain why a conflict was solved this way. E.g., instead
of
exp: Conflict in state 8 between rule 2 and token '+' resolved as reduce.
token1 "1"
| token2 "2"
| token3 "3"
;
token1: token; we can (in state 8) report something like
token2: token;
token3: token;
the traditional Bison reports: Conflict between rule 2 and token '+' resolved as reduce
because '*' < '+'.
state 0
$axiom -> . input $ (rule 0)
token shift, and go to state 1
input go to state 2
exp go to state 3
token1 go to state 4
token2 go to state 5
token3 go to state 6
state 1
token1 -> token . (rule 6)
token2 -> token . (rule 7)
token3 -> token . (rule 8)
"2" reduce using rule 7 (token2)
"3" reduce using rule 8 (token3)
$default reduce using rule 6 (token1)
while with --trace, i.e., when enabling both the display of non-core
item sets and the display of lookaheads, Bison now displays:
state 0
$axiom -> . input $ (rule 0)
input -> . exp (rule 1)
input -> . input exp (rule 2)
exp -> . token1 "1" (rule 3)
exp -> . token2 "2" (rule 4)
exp -> . token3 "3" (rule 5)
token1 -> . token (rule 6)
token2 -> . token (rule 7)
token3 -> . token (rule 8)
token shift, and go to state 1
input go to state 2
exp go to state 3
token1 go to state 4
token2 go to state 5
token3 go to state 6
state 1
token1 -> token . ["1"] (rule 6)
token2 -> token . ["2"] (rule 7)
token3 -> token . ["3"] (rule 8)
"2" reduce using rule 7 (token2)
"3" reduce using rule 8 (token3)
$default reduce using rule 6 (token1)
so decide whether this should be an option, or always enabled. I'm in
favor of making it the default, but maybe we should tune the output to
distinguish core item sets from non core:
state 0
Core:
$axiom -> . input $ (rule 0)
Derived:
input -> . exp (rule 1)
input -> . input exp (rule 2)
exp -> . token1 "1" (rule 3)
exp -> . token2 "2" (rule 4)
exp -> . token3 "3" (rule 5)
token1 -> . token (rule 6)
token2 -> . token (rule 7)
token3 -> . token (rule 8)
token shift, and go to state 1
input go to state 2
exp go to state 3
token1 go to state 4
token2 go to state 5
token3 go to state 6
> So, it seems clear that it has to be an additional option :)
Paul:
There will be further such options in the future, so I'd make
them all operands of the --report option. E.g., you could do
something like this:
--report=state --report=lookahead --report=itemset
--report=conflict-path
where "--verbose" is equivalent to "--report=state", and where
"--report=conflict-path" reports each path to a conflict
state.
(As a minor point, I prefer avoiding plurals in option names.
It's partly for brevity, and partly to avoid wearing out the
's' keys in our keyboards. :-)
To implement this, see in the Fileutils the latest versions of
argmatch and so forth.
or something like that.
* Coding system independence * Coding system independence
Paul notes: Paul notes:

View File

@@ -5,9 +5,7 @@
@settitle Bison @value{VERSION} @settitle Bison @value{VERSION}
@setchapternewpage odd @setchapternewpage odd
@iftex
@finalout @finalout
@end iftex
@c SMALL BOOK version @c SMALL BOOK version
@c This edition has been formatted so that you can format and print it in @c This edition has been formatted so that you can format and print it in
@@ -23,6 +21,7 @@
@c Check COPYRIGHT dates. should be updated in the titlepage, ifinfo @c Check COPYRIGHT dates. should be updated in the titlepage, ifinfo
@c titlepage; should NOT be changed in the GPL. --mew @c titlepage; should NOT be changed in the GPL. --mew
@c FIXME: I don't understand this `iftex'. Obsolete? --akim.
@iftex @iftex
@syncodeindex fn cp @syncodeindex fn cp
@syncodeindex vr cp @syncodeindex vr cp
@@ -154,7 +153,7 @@ Reference sections:
* Error Recovery:: Writing rules for error recovery. * Error Recovery:: Writing rules for error recovery.
* Context Dependency:: What to do if your language syntax is too * Context Dependency:: What to do if your language syntax is too
messy for Bison to handle straightforwardly. messy for Bison to handle straightforwardly.
* Debugging:: Debugging Bison parsers that parse wrong. * Debugging:: Understanding or debugging Bison parsers.
* Invocation:: How to run Bison (to produce the parser source file). * Invocation:: How to run Bison (to produce the parser source file).
* Table of Symbols:: All the keywords of the Bison language are explained. * Table of Symbols:: All the keywords of the Bison language are explained.
* Glossary:: Basic concepts are explained. * Glossary:: Basic concepts are explained.
@@ -299,6 +298,11 @@ Handling Context Dependencies
* Tie-in Recovery:: Lexical tie-ins have implications for how * Tie-in Recovery:: Lexical tie-ins have implications for how
error recovery rules must be written. error recovery rules must be written.
Understanding or Debugging Your Parser
* Understanding:: Understanding the structure of your parser.
* Tracing:: Tracing the execution of your parser.
Invoking Bison Invoking Bison
* Bison Options:: All the options described in detail, * Bison Options:: All the options described in detail,
@@ -707,9 +711,9 @@ In some cases the Bison parser file includes system headers, and in
those cases your code should respect the identifiers reserved by those those cases your code should respect the identifiers reserved by those
headers. On some non-@sc{gnu} hosts, @code{<alloca.h>}, headers. On some non-@sc{gnu} hosts, @code{<alloca.h>},
@code{<stddef.h>}, and @code{<stdlib.h>} are included as needed to @code{<stddef.h>}, and @code{<stdlib.h>} are included as needed to
declare memory allocators and related types. declare memory allocators and related types. Other system headers may
Other system headers may be included if you define @code{YYDEBUG} to a be included if you define @code{YYDEBUG} to a nonzero value
nonzero value (@pxref{Debugging, ,Debugging Your Parser}). (@pxref{Tracing, ,Tracing Your Parser}).
@node Stages @node Stages
@section Stages in Using Bison @section Stages in Using Bison
@@ -2351,14 +2355,14 @@ expseq1: exp
@end example @end example
@noindent @noindent
Any kind of sequence can be defined using either left recursion or Any kind of sequence can be defined using either left recursion or right
right recursion, but you should always use left recursion, because it recursion, but you should always use left recursion, because it can
can parse a sequence of any number of elements with bounded stack parse a sequence of any number of elements with bounded stack space.
space. Right recursion uses up space on the Bison stack in proportion Right recursion uses up space on the Bison stack in proportion to the
to the number of elements in the sequence, because all the elements number of elements in the sequence, because all the elements must be
must be shifted onto the stack before the rule can be applied even shifted onto the stack before the rule can be applied even once.
once. @xref{Algorithm, ,The Bison Parser Algorithm }, for @xref{Algorithm, ,The Bison Parser Algorithm}, for further explanation
further explanation of this. of this.
@cindex mutual recursion @cindex mutual recursion
@dfn{Indirect} or @dfn{mutual} recursion occurs when the result of the @dfn{Indirect} or @dfn{mutual} recursion occurs when the result of the
@@ -3276,7 +3280,7 @@ directives:
@item %debug @item %debug
In the parser file, define the macro @code{YYDEBUG} to 1 if it is not In the parser file, define the macro @code{YYDEBUG} to 1 if it is not
already defined, so that the debugging facilities are compiled. already defined, so that the debugging facilities are compiled.
@xref{Debugging, ,Debugging Your Parser}. @xref{Tracing, ,Tracing Your Parser}.
@item %defines @item %defines
Write an extra output file containing macro definitions for the token Write an extra output file containing macro definitions for the token
@@ -3386,17 +3390,10 @@ The number of parser states (@pxref{Parser States}).
@item %verbose @item %verbose
Write an extra output file containing verbose descriptions of the Write an extra output file containing verbose descriptions of the
parser states and what is done for each type of look-ahead token in parser states and what is done for each type of look-ahead token in
that state. that state. @xref{Understanding, , Understanding Your Parser}, for more
information.
This file also describes all the conflicts, both those resolved by
operator precedence and the unresolved ones.
The file's name is made by removing @samp{.tab.c} or @samp{.c} from
the parser output file name, and adding @samp{.output} instead.
Therefore, if the input file is @file{foo.y}, then the parser file is
called @file{foo.tab.c} by default. As a consequence, the verbose
output file is called @file{foo.output}.
@item %yacc @item %yacc
Pretend the option @option{--yacc} was given, i.e., imitate Yacc, Pretend the option @option{--yacc} was given, i.e., imitate Yacc,
@@ -4954,8 +4951,414 @@ make sure your error recovery rules are not of this kind. Each rule must
be such that you can be sure that it always will, or always won't, have to be such that you can be sure that it always will, or always won't, have to
clear the flag. clear the flag.
@c ================================================== Debugging Your Parser
@node Debugging @node Debugging
@chapter Debugging Your Parser @chapter Debugging Your Parser
Developing a parser can be a challenge, especially if you don't
understand the algorithm (@pxref{Algorithm, ,The Bison Parser
Algorithm}). Even so, sometimes a detailed description of the automaton
can help (@pxref{Understanding, , Understanding Your Parser}), or
tracing the execution of the parser can give some insight on why it
behaves improperly (@pxref{Tracing, , Tracing Your Parser}).
@menu
* Understanding:: Understanding the structure of your parser.
* Tracing:: Tracing the execution of your parser.
@end menu
@node Understanding
@section Understanding Your Parser
As documented elsewhere (@pxref{Algorithm, ,The Bison Parser Algorithm})
Bison parsers are @dfn{shift/reduce automata}. In some cases (much more
frequent than one would hope), looking at this automaton is required to
tune or simply fix a parser. Bison provides two different
representation of it, either textually or graphically (as a @sc{vcg}
file).
The textual file is generated when the options @option{--report} or
@option{--verbose} are specified, see @xref{Invocation, , Invoking
Bison}. Its name is made by removing @samp{.tab.c} or @samp{.c} from
the parser output file name, and adding @samp{.output} instead.
Therefore, if the input file is @file{foo.y}, then the parser file is
called @file{foo.tab.c} by default. As a consequence, the verbose
output file is called @file{foo.output}.
The following grammar file, @file{calc.y}, will be used in the sequel:
@example
%token NUM STR
%left '+' '-'
%left '*'
%%
exp: exp '+' exp
| exp '-' exp
| exp '*' exp
| exp '/' exp
| NUM
;
useless: STR;
%%
@end example
@command{bison} reports that @samp{calc.y contains 1 useless nonterminal
and 1 useless rule} and that @samp{calc.y contains 7 shift/reduce
conflicts}. When given @option{--report=state}, in addition to
@file{calc.tab.c}, it creates a file @file{calc.output} with contents
detailed below. The order of the output and the exact presentation
might vary, but the interpretation is the same.
The first section includes details on conflicts that were solved thanks
to precedence and/or associativity:
@example
Conflict in state 8 between rule 2 and token '+' resolved as reduce.
Conflict in state 8 between rule 2 and token '-' resolved as reduce.
Conflict in state 8 between rule 2 and token '*' resolved as shift.
@exdent @dots{}
@end example
@noindent
The next section lists states that still have conflicts.
@example
State 8 contains 1 shift/reduce conflict.
State 9 contains 1 shift/reduce conflict.
State 10 contains 1 shift/reduce conflict.
State 11 contains 4 shift/reduce conflicts.
@end example
@noindent
@cindex token, useless
@cindex useless token
@cindex nonterminal, useless
@cindex useless nonterminal
@cindex rule, useless
@cindex useless rule
The next section reports useless tokens, nonterminal and rules. Useless
nonterminals and rules are removed in order to produce a smaller parser,
but useless tokens are preserved, since they might be used by the
scanner (note the difference between ``useless'' and ``not used''
below):
@example
Useless nonterminals:
useless
Terminals which are not used:
STR
Useless rules:
#6 useless: STR;
@end example
@noindent
The next section reproduces the exact grammar that Bison used:
@example
Grammar
Number, Line, Rule
0 5 $axiom -> exp $
1 5 exp -> exp '+' exp
2 6 exp -> exp '-' exp
3 7 exp -> exp '*' exp
4 8 exp -> exp '/' exp
5 9 exp -> NUM
@end example
@noindent
and reports the uses of the symbols:
@example
Terminals, with rules where they appear
$ (0) 0
'*' (42) 3
'+' (43) 1
'-' (45) 2
'/' (47) 4
error (256)
NUM (258) 5
Nonterminals, with rules where they appear
$axiom (8)
on left: 0
exp (9)
on left: 1 2 3 4 5, on right: 0 1 2 3 4
@end example
@noindent
@cindex item
@cindex pointed rule
@cindex rule, pointed
Bison then proceeds onto the automaton itself, describing each state
with it set of @dfn{items}, also known as @dfn{pointed rules}. Each
item is a production rule together with a point (marked by @samp{.})
that the input cursor.
@example
state 0
$axiom -> . exp $ (rule 0)
NUM shift, and go to state 1
exp go to state 2
@end example
This reads as follows: ``state 0 corresponds to being at the very
beginning of the parsing, in the initial rule, right before the start
symbol (here, @code{exp}). When the parser returns to this state right
after having reduced a rule that produced an @code{exp}, the control
flow jumps to state 2. If there is no such transition on a nonterminal
symbol, and the lookahead is a @code{NUM}, then this token is shifted on
the parse stack, and the control flow jumps to state 1. Any other
lookahead triggers a parse error.''
@cindex core, item set
@cindex item set core
@cindex kernel, item set
@cindex item set core
Even though the only active rule in state 0 seems to be rule 0, the
report lists @code{NUM} as a lookahead symbol because @code{NUM} can be
at the beginning of any rule deriving an @code{exp}. By default Bison
reports the so-called @dfn{core} or @dfn{kernel} of the item set, but if
you want to see more detail you can invoke @command{bison} with
@option{--report=itemset} to list all the items, include those that can
be derived:
@example
state 0
$axiom -> . exp $ (rule 0)
exp -> . exp '+' exp (rule 1)
exp -> . exp '-' exp (rule 2)
exp -> . exp '*' exp (rule 3)
exp -> . exp '/' exp (rule 4)
exp -> . NUM (rule 5)
NUM shift, and go to state 1
exp go to state 2
@end example
@noindent
In the state 1...
@example
state 1
exp -> NUM . (rule 5)
$default reduce using rule 5 (exp)
@end example
@noindent
the rule 5, @samp{exp: NUM;}, is completed. Whatever the lookahead
(@samp{$default}), the parser will reduce it. If it was coming from
state 0, then, after this reduction it will return to state 0, and will
jump to state 2 (@samp{exp: go to state 2}).
@example
state 2
$axiom -> exp . $ (rule 0)
exp -> exp . '+' exp (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
$ shift, and go to state 3
'+' shift, and go to state 4
'-' shift, and go to state 5
'*' shift, and go to state 6
'/' shift, and go to state 7
@end example
@noindent
In state 2, the automaton can only shift a symbol. For instance,
because of the item @samp{exp -> exp . '+' exp}, if the lookahead if
@samp{+}, it will be shifted on the parse stack, and the automaton
control will jump to state 4, corresponding to the item @samp{exp -> exp
'+' . exp}. Since there is no default action, any other token than
those listed above will trigger a parse error.
The state 3 is named the @dfn{final state}, or the @dfn{accepting
state}:
@example
state 3
$axiom -> exp $ . (rule 0)
$default accept
@end example
@noindent
the initial rule is completed (the start symbol and the end
of input were read), the parsing exits successfully.
The interpretation of states 4 to 7 is straightforward, and is left to
the reader.
@example
state 4
exp -> exp '+' . exp (rule 1)
NUM shift, and go to state 1
exp go to state 8
state 5
exp -> exp '-' . exp (rule 2)
NUM shift, and go to state 1
exp go to state 9
state 6
exp -> exp '*' . exp (rule 3)
NUM shift, and go to state 1
exp go to state 10
state 7
exp -> exp '/' . exp (rule 4)
NUM shift, and go to state 1
exp go to state 11
@end example
As was announced in beginning of the report, @samp{State 8 contains 1
shift/reduce conflict}:
@example
state 8
exp -> exp . '+' exp (rule 1)
exp -> exp '+' exp . (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
'*' shift, and go to state 6
'/' shift, and go to state 7
'/' [reduce using rule 1 (exp)]
$default reduce using rule 1 (exp)
@end example
Indeed, there are two actions associated to the lookahead @samp{/}:
either shifting (and going to state 7), or reducing rule 1. The
conflict means that either the grammar is ambiguous, or the parser lacks
information to make the right decision. Indeed the grammar is
ambiguous, as, since we did not specify the precedence of @samp{/}, the
sentence @samp{NUM + NUM / NUM} can be parsed as @samp{NUM + (NUM /
NUM)}, which corresponds to shifting @samp{/}, or as @samp{(NUM + NUM) /
NUM}, which corresponds to reducing rule 1.
Because in LALR(1) parsing a single decision can be made, Bison
arbitrarily chose to disable the reduction, see @ref{Shift/Reduce, ,
Shift/Reduce Conflicts}. Discarded actions are reported in between
square brackets.
Note that all the previous states had a single possible action: either
shifting the next token and going to the corresponding state, or
reducing a single rule. In the other cases, i.e., when shifting
@emph{and} reducing is possible or when @emph{several} reductions are
possible, the lookahead is required to select the action. State 8 is
one such state: if the lookahead is @samp{*} or @samp{/} then the action
is shifting, otherwise the action is reducing rule 1. In other words,
the first two items, corresponding to rule 1, are not eligible when the
lookahead is @samp{*}, since we specified that @samp{*} has higher
precedence that @samp{+}. More generally, some items are eligible only
with some set of possible lookaheads. When run with
@option{--report=lookahead}, Bison specifies these lookaheads:
@example
state 8
exp -> exp . '+' exp [$, '+', '-', '/'] (rule 1)
exp -> exp '+' exp . [$, '+', '-', '/'] (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
'*' shift, and go to state 6
'/' shift, and go to state 7
'/' [reduce using rule 1 (exp)]
$default reduce using rule 1 (exp)
@end example
The remaining states are similar:
@example
state 9
exp -> exp . '+' exp (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp '-' exp . (rule 2)
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
'*' shift, and go to state 6
'/' shift, and go to state 7
'/' [reduce using rule 2 (exp)]
$default reduce using rule 2 (exp)
state 10
exp -> exp . '+' exp (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp . '*' exp (rule 3)
exp -> exp '*' exp . (rule 3)
exp -> exp . '/' exp (rule 4)
'/' shift, and go to state 7
'/' [reduce using rule 3 (exp)]
$default reduce using rule 3 (exp)
state 11
exp -> exp . '+' exp (rule 1)
exp -> exp . '-' exp (rule 2)
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
exp -> exp '/' exp . (rule 4)
'+' shift, and go to state 4
'-' shift, and go to state 5
'*' shift, and go to state 6
'/' shift, and go to state 7
'+' [reduce using rule 4 (exp)]
'-' [reduce using rule 4 (exp)]
'*' [reduce using rule 4 (exp)]
'/' [reduce using rule 4 (exp)]
$default reduce using rule 4 (exp)
@end example
@noindent
Observe that state 11 contains conflicts due to the lack of precedence
of @samp{/} wrt @samp{+}, @samp{-}, and @samp{*}, but also because the
associativity of @samp{/} is not specified.
@node Tracing
@section Tracing Your Parser
@findex yydebug @findex yydebug
@cindex debugging @cindex debugging
@cindex tracing the parser @cindex tracing the parser
@@ -5059,6 +5462,8 @@ yyprint (FILE *file, int type, YYSTYPE value)
@} @}
@end smallexample @end smallexample
@c ================================================= Invoking Bison
@node Invocation @node Invocation
@chapter Invoking Bison @chapter Invoking Bison
@cindex invoking Bison @cindex invoking Bison
@@ -5158,7 +5563,7 @@ you are developing Bison.
@itemx --debug @itemx --debug
In the parser file, define the macro @code{YYDEBUG} to 1 if it is not In the parser file, define the macro @code{YYDEBUG} to 1 if it is not
already defined, so that the debugging facilities are compiled. already defined, so that the debugging facilities are compiled.
@xref{Debugging, ,Debugging Your Parser}. @xref{Tracing, ,Tracing Your Parser}.
@item --locations @item --locations
Pretend that @code{%locations} was specified. @xref{Decl Summary}. Pretend that @code{%locations} was specified. @xref{Decl Summary}.
@@ -5204,6 +5609,27 @@ Same as above, but save in the file @var{defines-file}.
Pretend that @code{%verbose} was specified, i.e, specify prefix to use Pretend that @code{%verbose} was specified, i.e, specify prefix to use
for all Bison output file names. @xref{Decl Summary}. for all Bison output file names. @xref{Decl Summary}.
@item -r @var{things}
@itemx --report=@var{things}
Write an extra output file containing verbose description of the comma
separated list of @var{things} among:
@table @code
@item state
Description of the grammar, conflicts (resolved and unresolved), and
LALR automaton.
@item lookahead
Implies @code{state} and augments the description of the automaton with
each rule's lookahead set.
@item itemset
Implies @code{state} and augments the description of the automaton with
the full set of items for each state, instead of its core only.
@end table
For instance, on the following grammar
@item -v @item -v
@itemx --verbose @itemx --verbose
Pretend that @code{%verbose} was specified, i.e, write an extra output Pretend that @code{%verbose} was specified, i.e, write an extra output
@@ -5365,8 +5791,8 @@ Macro to discard a value from the parser stack and fake a look-ahead
token. @xref{Action Features, ,Special Features for Use in Actions}. token. @xref{Action Features, ,Special Features for Use in Actions}.
@item YYDEBUG @item YYDEBUG
Macro to define to equip the parser with tracing code. @xref{Debugging, Macro to define to equip the parser with tracing code. @xref{Tracing,
,Debugging Your Parser}. ,Tracing Your Parser}.
@item YYERROR @item YYERROR
Macro to pretend that a syntax error has just been detected: call Macro to pretend that a syntax error has just been detected: call
@@ -5430,7 +5856,7 @@ look-ahead token. @xref{Error Recovery}.
@item yydebug @item yydebug
External integer variable set to zero by default. If @code{yydebug} External integer variable set to zero by default. If @code{yydebug}
is given a nonzero value, the parser will output information on input is given a nonzero value, the parser will output information on input
symbols and parser action. @xref{Debugging, ,Debugging Your Parser}. symbols and parser action. @xref{Tracing, ,Tracing Your Parser}.
@item yyerrok @item yyerrok
Macro to cause parser to recover immediately to its normal mode Macro to cause parser to recover immediately to its normal mode

View File

@@ -35,6 +35,7 @@ INCLUDES = -I$(top_builddir)/intl \
EXTRA_DIST = malloc.c realloc.c strnlen.c EXTRA_DIST = malloc.c realloc.c strnlen.c
libbison_a_SOURCES = \ libbison_a_SOURCES = \
argmatch.h argmatch.c \
gettext.h \ gettext.h \
basename.c dirname.h dirname.c \ basename.c dirname.h dirname.c \
getopt.h getopt.c getopt1.c \ getopt.h getopt.c getopt1.c \

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.35\n" "Project-Id-Version: bison 1.35\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-04-26 11:58:57+0200\n" "PO-Revision-Date: 2002-04-26 11:58:57+0200\n"
"Last-Translator: Michael Piefel <piefel@informatik.hu-berlin.de>\n" "Last-Translator: Michael Piefel <piefel@informatik.hu-berlin.de>\n"
"Language-Team: German <de@li.org>\n" "Language-Team: German <de@li.org>\n"
@@ -86,7 +86,7 @@ msgstr " %d Schiebe/Reduziere"
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d Reduziere/Reduziere" msgstr " %d Reduziere/Reduziere"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s enthält " msgstr "%s enthält "
@@ -608,44 +608,44 @@ msgstr "das Startsymbol %s ist undefiniert"
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "das Startsymbol %s ist ein Token" msgstr "das Startsymbol %s ist ein Token"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Nutzlose Nicht-Terminale:" msgstr "Nutzlose Nicht-Terminale:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Nicht genutzte Terminale:" msgstr "Nicht genutzte Terminale:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Ungenutzte Regeln:" msgstr "Ungenutzte Regeln:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d Regel wurde niemals reduziert\n" msgstr[0] "%d Regel wurde niemals reduziert\n"
msgstr[1] "%d Regeln wurden niemals reduziert\n" msgstr[1] "%d Regeln wurden niemals reduziert\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d nutzloses Nicht-Terminal" msgstr[0] "%d nutzloses Nicht-Terminal"
msgstr[1] "%d nutzlose Nicht-Terminale" msgstr[1] "%d nutzlose Nicht-Terminale"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " und " msgstr " und "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d nutzlose Regel" msgstr[0] "%d nutzlose Regel"
msgstr[1] "%d nutzlose Regeln" msgstr[1] "%d nutzlose Regeln"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "es lassen sich keine Sätze vom Startsymbol %s ableiten" msgstr "es lassen sich keine Sätze vom Startsymbol %s ableiten"

View File

@@ -29,7 +29,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: GNU bison 1.35\n" "Project-Id-Version: GNU bison 1.35\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-04-03 10:19+0200\n" "PO-Revision-Date: 2002-04-03 10:19+0200\n"
"Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n" "Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
"Language-Team: Spanish <es@li.org>\n" "Language-Team: Spanish <es@li.org>\n"
@@ -142,7 +142,7 @@ msgstr " %d desplazamiento(s)/reducci
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d reducción(ones)/reducción(ones)" msgstr " %d reducción(ones)/reducción(ones)"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s contiene " msgstr "%s contiene "
@@ -684,44 +684,44 @@ msgstr "el s
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "el símbolo de inicio (axioma) %s es un terminal" msgstr "el símbolo de inicio (axioma) %s es un terminal"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "No terminales sin uso:" msgstr "No terminales sin uso:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Terminales que no se usan:" msgstr "Terminales que no se usan:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Reglas sin uso:" msgstr "Reglas sin uso:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d regla que nunca se ha reducido\n" msgstr[0] "%d regla que nunca se ha reducido\n"
msgstr[1] "%d reglas que nunca se han reducido\n" msgstr[1] "%d reglas que nunca se han reducido\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d no terminal sin uso" msgstr[0] "%d no terminal sin uso"
msgstr[1] "%d no terminales sin uso" msgstr[1] "%d no terminales sin uso"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " y " msgstr " y "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d regla sin uso" msgstr[0] "%d regla sin uso"
msgstr[1] "%d reglas sin uso" msgstr[1] "%d reglas sin uso"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "El símbolo de inicio (axioma) %s no deriva ninguna sentencia" msgstr "El símbolo de inicio (axioma) %s no deriva ninguna sentencia"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.33b\n" "Project-Id-Version: bison 1.33b\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-03-05 16:27+0200\n" "PO-Revision-Date: 2002-03-05 16:27+0200\n"
"Last-Translator: Toomas Soome <tsoome@ut.ee>\n" "Last-Translator: Toomas Soome <tsoome@ut.ee>\n"
"Language-Team: Estonian <et@li.org>\n" "Language-Team: Estonian <et@li.org>\n"
@@ -85,7 +85,7 @@ msgstr " %d nihutamine/redutseerimine"
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d redutseerimine/redutseerimine" msgstr " %d redutseerimine/redutseerimine"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s sisaldab " msgstr "%s sisaldab "
@@ -597,44 +597,44 @@ msgstr "stardis
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "stardisümbol %s on märk" msgstr "stardisümbol %s on märk"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Kasutamata mitteterminalid:" msgstr "Kasutamata mitteterminalid:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Terminalid, mida ei kasutatud:" msgstr "Terminalid, mida ei kasutatud:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Kasutamata reeglid:" msgstr "Kasutamata reeglid:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d reegel ei redutseeru\n" msgstr[0] "%d reegel ei redutseeru\n"
msgstr[1] "%d reeglit ei redutseeru\n" msgstr[1] "%d reeglit ei redutseeru\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d kasutamata mitteterminal" msgstr[0] "%d kasutamata mitteterminal"
msgstr[1] "%d kasutamata mitteterminali" msgstr[1] "%d kasutamata mitteterminali"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " ja " msgstr " ja "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d kasutamata reegel" msgstr[0] "%d kasutamata reegel"
msgstr[1] "%d kasutamata reeglit" msgstr[1] "%d kasutamata reeglit"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "Stardisümbolist %s ei tuletata ühtegi lauset" msgstr "Stardisümbolist %s ei tuletata ühtegi lauset"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: GNU bison 1.34a\n" "Project-Id-Version: GNU bison 1.34a\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-03-21 15:00-0500\n" "PO-Revision-Date: 2002-03-21 15:00-0500\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n" "Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <traduc@traduc.org>\n" "Language-Team: French <traduc@traduc.org>\n"
@@ -87,7 +87,7 @@ msgstr " %d d
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d réduction/réduction" msgstr " %d réduction/réduction"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s contient " msgstr "%s contient "
@@ -605,44 +605,44 @@ msgstr "le symbole de d
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "le symbole de départ %s est un terminal" msgstr "le symbole de départ %s est un terminal"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Non-terminaux inutiles:" msgstr "Non-terminaux inutiles:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Terminaux non utilisés:" msgstr "Terminaux non utilisés:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Règles inutiles:" msgstr "Règles inutiles:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d règle n'a jamais été réduite\n" msgstr[0] "%d règle n'a jamais été réduite\n"
msgstr[1] "%d règles n'ont jamais été réduites\n" msgstr[1] "%d règles n'ont jamais été réduites\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d nonterminal inutilisable" msgstr[0] "%d nonterminal inutilisable"
msgstr[1] "%d nonterminals inutilisables" msgstr[1] "%d nonterminals inutilisables"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " et " msgstr " et "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d règle inutilisable" msgstr[0] "%d règle inutilisable"
msgstr[1] "%d règles inutilisables" msgstr[1] "%d règles inutilisables"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "Aucune phrase ne peut être dérivée du symbole de départ %s" msgstr "Aucune phrase ne peut être dérivée du symbole de départ %s"

View File

@@ -7,7 +7,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.34a\n" "Project-Id-Version: bison 1.34a\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-04-10 22:20+01\n" "PO-Revision-Date: 2002-04-10 22:20+01\n"
"Last-Translator: Denis Lackovic <delacko@fly.srk.fer.hr>\n" "Last-Translator: Denis Lackovic <delacko@fly.srk.fer.hr>\n"
"Language-Team: Croatian <lokalizacija@linux.hr>\n" "Language-Team: Croatian <lokalizacija@linux.hr>\n"
@@ -87,7 +87,7 @@ msgstr " %d pomakni/reduciraj"
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d reduviraj/reduciraj" msgstr " %d reduviraj/reduciraj"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s sadr¾i" msgstr "%s sadr¾i"
@@ -598,44 +598,44 @@ msgstr "po
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "poèetni simbol %s je znak" msgstr "poèetni simbol %s je znak"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Beskorisni nezavr¹ni znakovi:" msgstr "Beskorisni nezavr¹ni znakovi:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Zavr¹ni znakovi koji nisu kori¹teni:" msgstr "Zavr¹ni znakovi koji nisu kori¹teni:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Beskorisna pravila:" msgstr "Beskorisna pravila:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d pravilo nije nikad reducirano\n" msgstr[0] "%d pravilo nije nikad reducirano\n"
msgstr[1] "%d pravila nisu nikad reducirana\n" msgstr[1] "%d pravila nisu nikad reducirana\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d beskorisan nezavr¹ni znak" msgstr[0] "%d beskorisan nezavr¹ni znak"
msgstr[1] "%d beskorisnih nezavr¹nih znakova" msgstr[1] "%d beskorisnih nezavr¹nih znakova"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " i" msgstr " i"
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d beskorisno pravilo" msgstr[0] "%d beskorisno pravilo"
msgstr[1] "%d beskorisnih pravila" msgstr[1] "%d beskorisnih pravila"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "Poèetni simbol %s ne daje niti jednu reèenicu" msgstr "Poèetni simbol %s ne daje niti jednu reèenicu"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.31\n" "Project-Id-Version: bison 1.31\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-01-18 12:40 CET\n" "PO-Revision-Date: 2002-01-18 12:40 CET\n"
"Last-Translator: Paolo Bonzini <bonzini@gnu.org>\n" "Last-Translator: Paolo Bonzini <bonzini@gnu.org>\n"
"Language-Team: Italian <it@li.org>\n" "Language-Team: Italian <it@li.org>\n"
@@ -86,7 +86,7 @@ msgstr " %d shift/riduzione"
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d riduzione/riduzione" msgstr " %d riduzione/riduzione"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s contiene " msgstr "%s contiene "
@@ -597,44 +597,44 @@ msgstr "simbolo iniziale %s non definito"
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "specificato il token %s come simbolo iniziale" msgstr "specificato il token %s come simbolo iniziale"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Simboli nonterminali inutili:" msgstr "Simboli nonterminali inutili:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Simboli terminali inutilizzati:" msgstr "Simboli terminali inutilizzati:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Regole inutili:" msgstr "Regole inutili:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d regola non applicata\n" msgstr[0] "%d regola non applicata\n"
msgstr[1] "%d regole non applicate\n" msgstr[1] "%d regole non applicate\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d simbolo nonterminale inutilizzato" msgstr[0] "%d simbolo nonterminale inutilizzato"
msgstr[1] "%d simboli nonterminali inutilizzati" msgstr[1] "%d simboli nonterminali inutilizzati"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " e " msgstr " e "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d regola inutile" msgstr[0] "%d regola inutile"
msgstr[1] "%d regole inutili" msgstr[1] "%d regole inutili"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "dal simbolo iniziale %s non deriva alcuna frase" msgstr "dal simbolo iniziale %s non deriva alcuna frase"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: GNU bison 1.30f\n" "Project-Id-Version: GNU bison 1.30f\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2001-12-10 15:59+0900\n" "PO-Revision-Date: 2001-12-10 15:59+0900\n"
"Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n" "Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n"
"Language-Team: Japanese <ja@li.org>\n" "Language-Team: Japanese <ja@li.org>\n"
@@ -83,7 +83,7 @@ msgstr " %d
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d 還元/還元" msgstr " %d 還元/還元"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s の中身は" msgstr "%s の中身は"
@@ -596,41 +596,41 @@ msgstr "
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "開始シンボル %s はトークンです" msgstr "開始シンボル %s はトークンです"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "無意味な非終端子:" msgstr "無意味な非終端子:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "利用されない終端子:" msgstr "利用されない終端子:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "無意味な規則:" msgstr "無意味な規則:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d 個の規則は決して還元されません\n" msgstr[0] "%d 個の規則は決して還元されません\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d 個の無意味な非終端子" msgstr[0] "%d 個の無意味な非終端子"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr "および" msgstr "および"
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d 個の無意味な規則" msgstr[0] "%d 個の無意味な規則"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "開始シンボル %s はどの文にも由来しません" msgstr "開始シンボル %s はどの文にも由来しません"

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.34a\n" "Project-Id-Version: bison 1.34a\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-03-20 12:54+0100\n" "PO-Revision-Date: 2002-03-20 12:54+0100\n"
"Last-Translator: Tim Van Holder <tim.van.holder@pandora.be>\n" "Last-Translator: Tim Van Holder <tim.van.holder@pandora.be>\n"
"Language-Team: Dutch <vertaling@nl.linux.org>\n" "Language-Team: Dutch <vertaling@nl.linux.org>\n"
@@ -87,7 +87,7 @@ msgstr " %d vershuif/reductie"
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d reductie/reductie" msgstr " %d reductie/reductie"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s bevat" msgstr "%s bevat"
@@ -614,37 +614,37 @@ msgstr "het startsymbool %s is niet gedefinieerd"
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "het startsymbool %s is een token" msgstr "het startsymbool %s is een token"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Nutteloze niet-eindsymbolen:" msgstr "Nutteloze niet-eindsymbolen:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Eindsymbolen die niet gebruikt worden:" msgstr "Eindsymbolen die niet gebruikt worden:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Nutteloze regels:" msgstr "Nutteloze regels:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d regel wordt nooit gereduceerd\n" msgstr[0] "%d regel wordt nooit gereduceerd\n"
msgstr[1] "%d regels worden nooit gereduceerd\n" msgstr[1] "%d regels worden nooit gereduceerd\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d nutteloos niet-eindsymbool" msgstr[0] "%d nutteloos niet-eindsymbool"
msgstr[1] "%d nutteloze niet-eindsymbolen" msgstr[1] "%d nutteloze niet-eindsymbolen"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " en " msgstr " en "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
@@ -652,7 +652,7 @@ msgstr[0] "%d nutteloze regel"
msgstr[1] "%d nutteloze regels" msgstr[1] "%d nutteloze regels"
# Ik _denk_ dat dit correct weergeeft wat er bedoeld wordt (m.a.w. er is geen regel voor het startsymbool) # Ik _denk_ dat dit correct weergeeft wat er bedoeld wordt (m.a.w. er is geen regel voor het startsymbool)
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "Startsymbool %s wordt vanuit geen enkele zin bereikt" msgstr "Startsymbool %s wordt vanuit geen enkele zin bereikt"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.32\n" "Project-Id-Version: bison 1.32\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-01-25 12:19+0300\n" "PO-Revision-Date: 2002-01-25 12:19+0300\n"
"Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n" "Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
"Language-Team: Russian <ru@li.org>\n" "Language-Team: Russian <ru@li.org>\n"
@@ -89,7 +89,7 @@ msgstr " %d
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d ×Ù×ÏÄ/×Ù×ÏÄ" msgstr " %d ×Ù×ÏÄ/×Ù×ÏÄ"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s ÓÏÄÅÒÖÉÔ " msgstr "%s ÓÏÄÅÒÖÉÔ "
@@ -606,19 +606,19 @@ msgstr "
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "ÎÁÞÁÌØÎÙÊ ÓÉÍ×ÏÌ %s Ñ×ÌÑÅÔÓÑ ÌÅËÓÅÍÏÊ" msgstr "ÎÁÞÁÌØÎÙÊ ÓÉÍ×ÏÌ %s Ñ×ÌÑÅÔÓÑ ÌÅËÓÅÍÏÊ"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "âÅÓÐÏÌÅÚÎÙÅ ÎÅÔÅÒÍÉÎÁÌÙ:" msgstr "âÅÓÐÏÌÅÚÎÙÅ ÎÅÔÅÒÍÉÎÁÌÙ:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "îÅÉÓÐÏÌØÚÏ×ÁÎÎÙÅ ÔÅÒÍÉÎÁÌÙ:" msgstr "îÅÉÓÐÏÌØÚÏ×ÁÎÎÙÅ ÔÅÒÍÉÎÁÌÙ:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "âÅÓÐÏÌÅÚÎÙÅ ÐÒÁ×ÉÌÁ:" msgstr "âÅÓÐÏÌÅÚÎÙÅ ÐÒÁ×ÉÌÁ:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
@@ -626,7 +626,7 @@ msgstr[0] "%d
msgstr[1] "%d ÐÒÁ×ÉÌÁ ÎÅ Ó×ÅÄÅÎÏ\n" msgstr[1] "%d ÐÒÁ×ÉÌÁ ÎÅ Ó×ÅÄÅÎÏ\n"
msgstr[2] "%d ÐÒÁ×ÉÌ ÎÅ Ó×ÅÄÅÎÏ\n" msgstr[2] "%d ÐÒÁ×ÉÌ ÎÅ Ó×ÅÄÅÎÏ\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
@@ -634,11 +634,11 @@ msgstr[0] "%d
msgstr[1] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÎÅÔÅÒÍÉÎÁÌÁ" msgstr[1] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÎÅÔÅÒÍÉÎÁÌÁ"
msgstr[2] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÎÅÔÅÒÍÉÎÁÌÏ×" msgstr[2] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÎÅÔÅÒÍÉÎÁÌÏ×"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " É " msgstr " É "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
@@ -646,7 +646,7 @@ msgstr[0] "%d
msgstr[1] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÐÒÁ×ÉÌÁ" msgstr[1] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÐÒÁ×ÉÌÁ"
msgstr[2] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÐÒÁ×ÉÌ" msgstr[2] "%d ÂÅÓÐÏÌÅÚÎÙÈ ÐÒÁ×ÉÌ"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "îÁÞÁÌØÎÙÊ ÓÉÍ×ÏÌ %s ÎÅ ×Ù×ÏÄÉÔ ÎÉ ÏÄÎÏÇÏ ÐÒÅÄÌÏÖÅÎÉÑ" msgstr "îÁÞÁÌØÎÙÊ ÓÉÍ×ÏÌ %s ÎÅ ×Ù×ÏÄÉÔ ÎÉ ÏÄÎÏÇÏ ÐÒÅÄÌÏÖÅÎÉÑ"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.33b\n" "Project-Id-Version: bison 1.33b\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-03-05 10:18+0100\n" "PO-Revision-Date: 2002-03-05 10:18+0100\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.pp.se>\n" "Last-Translator: Göran Uddeborg <goeran@uddeborg.pp.se>\n"
"Language-Team: Swedish <sv@li.org>\n" "Language-Team: Swedish <sv@li.org>\n"
@@ -86,7 +86,7 @@ msgstr " %d skifta/reducera"
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d reducera/reducera" msgstr " %d reducera/reducera"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s innehåller " msgstr "%s innehåller "
@@ -602,44 +602,44 @@ msgstr "startsymbolen %s
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "startsymbolen %s är ett element" msgstr "startsymbolen %s är ett element"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Oanvändbara icketerminaler:" msgstr "Oanvändbara icketerminaler:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Terminaler som inte används:" msgstr "Terminaler som inte används:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Oanvändbara regler:" msgstr "Oanvändbara regler:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d regel reduceras aldrig\n" msgstr[0] "%d regel reduceras aldrig\n"
msgstr[1] "%d regler reduceras aldrig\n" msgstr[1] "%d regler reduceras aldrig\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d oanvändbar icketerminal" msgstr[0] "%d oanvändbar icketerminal"
msgstr[1] "%d oanvändbara icketerminaler" msgstr[1] "%d oanvändbara icketerminaler"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " och " msgstr " och "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d oanvändbar regel" msgstr[0] "%d oanvändbar regel"
msgstr[1] "%d oanvändbara regler" msgstr[1] "%d oanvändbara regler"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "Startsymbolen %s genererar inga meningar" msgstr "Startsymbolen %s genererar inga meningar"

View File

@@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: bison 1.34\n" "Project-Id-Version: bison 1.34\n"
"POT-Creation-Date: 2002-05-06 10:24+0200\n" "POT-Creation-Date: 2002-05-21 19:56+0200\n"
"PO-Revision-Date: 2002-03-14 11:03GMT +02:00\n" "PO-Revision-Date: 2002-03-14 11:03GMT +02:00\n"
"Last-Translator: Altuð Bayram <altugbayram_2000@yahoo.com>\n" "Last-Translator: Altuð Bayram <altugbayram_2000@yahoo.com>\n"
"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n" "Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
@@ -88,7 +88,7 @@ msgstr " %d
msgid " %d reduce/reduce" msgid " %d reduce/reduce"
msgstr " %d indirgeme/indirgeme" msgstr " %d indirgeme/indirgeme"
#: src/conflicts.c:380 src/reduce.c:391 #: src/conflicts.c:380 src/reduce.c:397
#, c-format #, c-format
msgid "%s contains " msgid "%s contains "
msgstr "%s içerir" msgstr "%s içerir"
@@ -605,44 +605,44 @@ msgstr "ba
msgid "the start symbol %s is a token" msgid "the start symbol %s is a token"
msgstr "baþlangýç simgesi %s bir andaçtýr" msgstr "baþlangýç simgesi %s bir andaçtýr"
#: src/reduce.c:332 #: src/reduce.c:338
msgid "Useless nonterminals:" msgid "Useless nonterminals:"
msgstr "Yararsýz deðiþken simgeler:" msgstr "Yararsýz deðiþken simgeler:"
#: src/reduce.c:346 #: src/reduce.c:352
msgid "Terminals which are not used:" msgid "Terminals which are not used:"
msgstr "Kullanýlmayan sabit simgeler:" msgstr "Kullanýlmayan sabit simgeler:"
#: src/reduce.c:358 #: src/reduce.c:364
msgid "Useless rules:" msgid "Useless rules:"
msgstr "Yararsýz kurallar:" msgstr "Yararsýz kurallar:"
#: src/reduce.c:386 #: src/reduce.c:392
#, c-format #, c-format
msgid "%d rule never reduced\n" msgid "%d rule never reduced\n"
msgid_plural "%d rules never reduced\n" msgid_plural "%d rules never reduced\n"
msgstr[0] "%d kural asla indirgenmedi\n" msgstr[0] "%d kural asla indirgenmedi\n"
msgstr[1] "%d kural asla indirgenmedi\n" msgstr[1] "%d kural asla indirgenmedi\n"
#: src/reduce.c:394 #: src/reduce.c:400
#, c-format #, c-format
msgid "%d useless nonterminal" msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals" msgid_plural "%d useless nonterminals"
msgstr[0] "%d yararsýz deðiþken simge" msgstr[0] "%d yararsýz deðiþken simge"
msgstr[1] "%d yararsýz deðiþken simge" msgstr[1] "%d yararsýz deðiþken simge"
#: src/reduce.c:400 #: src/reduce.c:406
msgid " and " msgid " and "
msgstr " ve " msgstr " ve "
#: src/reduce.c:403 #: src/reduce.c:409
#, c-format #, c-format
msgid "%d useless rule" msgid "%d useless rule"
msgid_plural "%d useless rules" msgid_plural "%d useless rules"
msgstr[0] "%d yararsýz kural" msgstr[0] "%d yararsýz kural"
msgstr[1] "%d yararsýz kural" msgstr[1] "%d yararsýz kural"
#: src/reduce.c:433 #: src/reduce.c:439
#, c-format #, c-format
msgid "Start symbol %s does not derive any sentence" msgid "Start symbol %s does not derive any sentence"
msgstr "Baþlangýç simgesi %s herhangi bir cümleden türemez" msgstr "Baþlangýç simgesi %s herhangi bir cümleden türemez"

View File

@@ -43,7 +43,7 @@ static bitset lookaheadset;
static inline void static inline void
log_resolution (state_t *state, int LAno, int token, const char *resolution) log_resolution (state_t *state, int LAno, int token, const char *resolution)
{ {
if (verbose_flag) if (report_flag & report_states)
obstack_fgrow4 (&output_obstack, obstack_fgrow4 (&output_obstack,
_("\ _("\
Conflict in state %d between rule %d and token %s resolved as %s.\n"), Conflict in state %d between rule %d and token %s resolved as %s.\n"),

View File

@@ -19,22 +19,21 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 02111-1307, USA. */
#include <stdio.h>
#include "getopt.h"
#include "system.h" #include "system.h"
#include "files.h" #include "getopt.h"
#include "argmatch.h"
#include "complain.h" #include "complain.h"
#include "getargs.h" #include "getargs.h"
#include "xalloc.h"
#include "options.h" #include "options.h"
#include "files.h"
int debug_flag = 0; int debug_flag = 0;
int defines_flag = 0; int defines_flag = 0;
int locations_flag = 0; int locations_flag = 0;
int no_lines_flag = 0; int no_lines_flag = 0;
int no_parser_flag = 0; int no_parser_flag = 0;
int report_flag = 0;
int token_table_flag = 0; int token_table_flag = 0;
int verbose_flag = 0;
int yacc_flag = 0; /* for -y */ int yacc_flag = 0; /* for -y */
int graph_flag = 0; int graph_flag = 0;
int trace_flag = 0; int trace_flag = 0;
@@ -44,6 +43,48 @@ const char *include = NULL;
extern char *program_name; extern char *program_name;
/*----------------------.
| --report's handling. |
`----------------------*/
static const char * const report_args[] =
{
/* In a series of synonyms, present the most meaningful first, so
that argmatch_valid be more readable. */
"none",
"state", "states",
"itemset", "itemsets",
"lookahead", "lookaheads",
"all",
0
};
static const int report_types[] =
{
report_none,
report_states, report_states,
report_states | report_itemsets, report_states | report_itemsets,
report_states | report_lookaheads, report_states | report_lookaheads,
report_all
};
static void
report_argmatch (char *args)
{
ARGMATCH_ASSERT (report_args, report_types);
do
{
int report = XARGMATCH ("--report", args,
report_args, report_types);
if (report == report_none)
report_flag = report_none;
else
report_flag |= report;
}
while ((args = strtok (NULL, ",")));
}
/*---------------------------. /*---------------------------.
| Display the help message. | | Display the help message. |
`---------------------------*/ `---------------------------*/
@@ -89,10 +130,18 @@ Parser:\n\
fputs (_("\ fputs (_("\
Output:\n\ Output:\n\
-d, --defines also produce a header file\n\ -d, --defines also produce a header file\n\
-v, --verbose also produce an explanation of the automaton\n\ -r, --report=THINGS also produce details on the automaton\n\
-v, --verbose same as `--report=state'\n\
-b, --file-prefix=PREFIX specify a PREFIX for output files\n\ -b, --file-prefix=PREFIX specify a PREFIX for output files\n\
-o, --output=FILE leave output to FILE\n\ -o, --output=FILE leave output to FILE\n\
-g, --graph also produce a VCG description of the automaton\n\ -g, --graph also produce a VCG description of the automaton\n\
\n\
THINGS is a list of comma separated words that can include:\n\
`state' describe the states\n\
`itemset' complete the core item sets with their closure\n\
`lookahead' explicitly associate lookaheads to items\n\
`all' include all the above information\n\
`none' disable the report\n\
"), stream); "), stream);
putc ('\n', stream); putc ('\n', stream);
@@ -170,7 +219,7 @@ getargs (int argc, char *argv[])
break; break;
case 'v': case 'v':
verbose_flag = 1; report_flag |= report_states;
break; break;
case 'S': case 'S':
@@ -196,10 +245,6 @@ getargs (int argc, char *argv[])
token_table_flag = 1; token_table_flag = 1;
break; break;
case 'r':
fatal (_("`%s' is no longer supported"), "--raw");
break;
case 'n': case 'n':
no_parser_flag = 1; no_parser_flag = 1;
break; break;
@@ -220,6 +265,10 @@ getargs (int argc, char *argv[])
spec_name_prefix = optarg; spec_name_prefix = optarg;
break; break;
case 'r':
report_argmatch (optarg);
break;
default: default:
fprintf (stderr, _("Try `%s --help' for more information.\n"), fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name); program_name);

View File

@@ -1,5 +1,6 @@
/* Parse command line arguments for bison. /* Parse command line arguments for bison.
Copyright 1984, 1986, 1989, 1992, 2000, 2001 Free Software Foundation, Inc. Copyright 1984, 1986, 1989, 1992, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -31,11 +32,22 @@ extern int locations_flag;
extern int no_lines_flag; /* for -l */ extern int no_lines_flag; /* for -l */
extern int no_parser_flag; /* for -n */ extern int no_parser_flag; /* for -n */
extern int token_table_flag; /* for -k */ extern int token_table_flag; /* for -k */
extern int verbose_flag; /* for -v */
extern int graph_flag; /* for -g */ extern int graph_flag; /* for -g */
extern int yacc_flag; /* for -y */ extern int yacc_flag; /* for -y */
extern int trace_flag; extern int trace_flag;
/* --report. */
enum
{
report_none = 0,
report_states = 1 << 0,
report_itemsets = 1 << 1,
report_lookaheads = 1 << 2,
report_all = ~0
};
extern int report_flag;
void getargs PARAMS ((int argc, char *argv[])); void getargs PARAMS ((int argc, char *argv[]));
#endif /* !GETARGS_H_ */ #endif /* !GETARGS_H_ */

View File

@@ -484,7 +484,7 @@ option_strcmp (const char *left, const char *right)
token_t token_t
parse_percent_token (void) parse_percent_token (void)
{ {
const struct option_table_struct *tx = NULL; const struct option_table_s *tx = NULL;
const char *arg = NULL; const char *arg = NULL;
/* Where the ARG was found in token_buffer. */ /* Where the ARG was found in token_buffer. */
size_t arg_offset = 0; size_t arg_offset = 0;
@@ -578,15 +578,16 @@ parse_percent_token (void)
switch (tx->ret_val) switch (tx->ret_val)
{ {
case tok_stropt: case tok_stropt:
assert (tx->set_flag); assert (tx->flag);
if (arg) if (arg)
{ {
char **flag = (char **) tx->flag;
/* Keep only the first assignment: command line options have /* Keep only the first assignment: command line options have
already been processed, and we want them to have already been processed, and we want them to have
precedence. Side effect: if this %-option is used precedence. Side effect: if this %-option is used
several times, only the first is honored. Bah. */ several times, only the first is honored. Bah. */
if (!*((char **) (tx->set_flag))) if (!*flag)
*((char **) (tx->set_flag)) = xstrdup (arg); *flag = xstrdup (arg);
} }
else else
fatal (_("`%s' requires an argument"), token_buffer); fatal (_("`%s' requires an argument"), token_buffer);
@@ -594,8 +595,8 @@ parse_percent_token (void)
break; break;
case tok_intopt: case tok_intopt:
assert (tx->set_flag); assert (tx->flag);
*((int *) (tx->set_flag)) = 1; *((int *) (tx->flag)) = 1;
return tok_noop; return tok_noop;
break; break;

View File

@@ -50,7 +50,10 @@ typedef enum token_e
tok_define, tok_define,
tok_skel, tok_skel,
tok_noop, tok_noop,
/* A directive that sets to true its associated variable. */
tok_intopt, tok_intopt,
/* A directive that sets its associated variable to the string
argument. */
tok_stropt, tok_stropt,
tok_illegal, tok_illegal,
tok_obsolete tok_obsolete

View File

@@ -91,7 +91,7 @@ main (int argc, char *argv[])
compute_output_file_names (); compute_output_file_names ();
/* Output the detailed report on the grammar. */ /* Output the detailed report on the grammar. */
if (verbose_flag) if (report_flag)
print_results (); print_results ();
/* Stop if there were errors, to avoid trashing previous output /* Stop if there were errors, to avoid trashing previous output

View File

@@ -29,7 +29,7 @@
#include "options.h" #include "options.h"
/* Shorts options. */ /* Shorts options. */
const char *shortopts = "yvegdhrltknVo:b:p:S:"; const char *shortopts = "yvegdhr:ltknVo:b:p:S:";
/* A CLI option only. /* A CLI option only.
Arguments is the policy: `no', `optional', `required'. Arguments is the policy: `no', `optional', `required'.
@@ -52,7 +52,7 @@ const char *shortopts = "yvegdhrltknVo:b:p:S:";
(String), (Arguments##_argument), (Var), (Token), (OptionChar) }, (String), (Arguments##_argument), (Var), (Token), (OptionChar) },
const struct option_table_struct option_table[] = const struct option_table_s option_table[] =
{ {
/* /*
* Command line. * Command line.
@@ -71,6 +71,8 @@ const struct option_table_struct option_table[] =
OPTN ("output", required, 0, 0, 'o') OPTN ("output", required, 0, 0, 'o')
OPTN ("output-file", required, 0, 0, 'o') OPTN ("output-file", required, 0, 0, 'o')
OPTN ("graph", optional, 0, 0, 'g') OPTN ("graph", optional, 0, 0, 'g')
OPTN ("report", required, 0, 0, 'r')
OPTN ("verbose", no, 0, 0, 'v')
/* Hidden. */ /* Hidden. */
OPTN ("trace", no, &trace_flag, 0, 1) OPTN ("trace", no, &trace_flag, 0, 1)
@@ -92,6 +94,7 @@ const struct option_table_struct option_table[] =
DRTV ("nonassoc", no, NULL, tok_nonassoc) DRTV ("nonassoc", no, NULL, tok_nonassoc)
DRTV ("binary", no, NULL, tok_nonassoc) DRTV ("binary", no, NULL, tok_nonassoc)
DRTV ("prec", no, NULL, tok_prec) DRTV ("prec", no, NULL, tok_prec)
DRTV ("verbose", no, &report_flag, tok_intopt)
DRTV ("error-verbose",no, &error_verbose, tok_intopt) DRTV ("error-verbose",no, &error_verbose, tok_intopt)
/* FIXME: semantic parsers will output an `include' of an /* FIXME: semantic parsers will output an `include' of an
@@ -111,7 +114,6 @@ const struct option_table_struct option_table[] =
/* Output. */ /* Output. */
BOTH ("defines", optional, &defines_flag, tok_intopt, 'd') BOTH ("defines", optional, &defines_flag, tok_intopt, 'd')
BOTH ("verbose", no, &verbose_flag, tok_intopt, 'v')
/* Operation modes. */ /* Operation modes. */
BOTH ("fixed-output-files", no, &yacc_flag, tok_intopt, 'y') BOTH ("fixed-output-files", no, &yacc_flag, tok_intopt, 'y')
@@ -122,7 +124,7 @@ const struct option_table_struct option_table[] =
BOTH ("locations", no, &locations_flag, tok_intopt, 1) BOTH ("locations", no, &locations_flag, tok_intopt, 1)
BOTH ("no-lines", no, &no_lines_flag, tok_intopt, 'l') BOTH ("no-lines", no, &no_lines_flag, tok_intopt, 'l')
BOTH ("no-parser", no, &no_parser_flag, tok_intopt, 'n') BOTH ("no-parser", no, &no_parser_flag, tok_intopt, 'n')
BOTH ("raw", no, 0, tok_obsolete, 'r') BOTH ("raw", no, 0, tok_obsolete, 0)
BOTH ("skeleton", required, 0, tok_skel, 'S') BOTH ("skeleton", required, 0, tok_skel, 'S')
BOTH ("token-table", no, &token_table_flag, tok_intopt, 'k') BOTH ("token-table", no, &token_table_flag, tok_intopt, 'k')
@@ -153,17 +155,16 @@ long_option_table_new ()
if (option_table[i].access == opt_cmd_line if (option_table[i].access == opt_cmd_line
|| option_table[i].access == opt_both) || option_table[i].access == opt_both)
{ {
/* Copy the struct information in the longoptions. */
res[j].name = option_table[i].name; res[j].name = option_table[i].name;
res[j].has_arg = option_table[i].has_arg; res[j].has_arg = option_table[i].has_arg;
/* When an options is declared having 'optional_argument' and /* When a getopt_long option has an associated variable
a flag is specified to be set, the option is skipped on (member FLAG), then it is set of the VAL member value. In
command line. So we never use a flag when a command line other words, we cannot expect getopt_long to store the
option is declared 'optional_argument. */ argument if we also want a short option. */
if (res[j].has_arg == optional_argument) if (res[j].has_arg == optional_argument)
res[j].flag = NULL; res[j].flag = NULL;
else else
res[j].flag = option_table[i].set_flag; res[j].flag = option_table[i].flag;
res[j++].val = option_table[i].val; res[j++].val = option_table[i].val;
} }
res[number_options].name = NULL; res[number_options].name = NULL;

View File

@@ -1,5 +1,5 @@
/* Concentrate all options use in bison, /* Concentrate all options use in bison,
Copyright 2001 Free Software Foundation, Inc. Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -34,7 +34,7 @@ typedef enum opt_access_e
/* This is the general struct, which contains user's options from /* This is the general struct, which contains user's options from
command line or in grammar with percent flag. */ command line or in grammar with percent flag. */
struct option_table_struct struct option_table_s
{ {
/* Set the accessibility. */ /* Set the accessibility. */
opt_access_t access; opt_access_t access;
@@ -42,8 +42,8 @@ struct option_table_struct
const char *name; const char *name;
/* Use for command line. */ /* Use for command line. */
int has_arg; int has_arg;
/* A set_flag value causes the named flag to be set. */ /* An optional lvalue to be set. */
void *set_flag; void *flag;
/* A retval action returns the code. */ /* A retval action returns the code. */
int ret_val; int ret_val;
/* The short option value, frequently a letter. */ /* The short option value, frequently a letter. */
@@ -53,9 +53,9 @@ struct option_table_struct
extern const char *shortopts; extern const char *shortopts;
/* Table which contain all options. */ /* Table which contain all options. */
extern const struct option_table_struct option_table[]; extern const struct option_table_s option_table[];
/* Set the longopts variable from option_table. */ /* Return a malloc'd list of the options for getopt_long. */
struct option *long_option_table_new PARAMS ((void)); struct option *long_option_table_new PARAMS ((void));
#endif /* !OPTIONS_H_ */ #endif /* !OPTIONS_H_ */

View File

@@ -72,9 +72,8 @@ print_core (FILE *out, state_t *state)
item_number_t *sitems = state->items; item_number_t *sitems = state->items;
int snritems = state->nitems; int snritems = state->nitems;
/* New experimental feature: if TRACE_FLAGS output all the items of /* Output all the items of a state, not only its kernel. */
a state, not only its kernel. */ if (report_flag & report_itemsets)
if (trace_flag)
{ {
closure (sitems, snritems); closure (sitems, snritems);
sitems = itemset; sitems = itemset;
@@ -105,8 +104,8 @@ print_core (FILE *out, state_t *state)
for (/* Nothing */; *sp >= 0; ++sp) for (/* Nothing */; *sp >= 0; ++sp)
fprintf (out, " %s", escape (symbols[*sp]->tag)); fprintf (out, " %s", escape (symbols[*sp]->tag));
/* Experimental feature: display the lookaheads. */ /* Display the lookaheads? */
if (trace_flag && state->nlookaheads) if (report_flag & report_lookaheads)
{ {
int j, k; int j, k;
int nlookaheads = 0; int nlookaheads = 0;
@@ -513,10 +512,9 @@ print_results (void)
print_grammar (out); print_grammar (out);
/* New experimental feature: output all the items of a state, not /* If the whole state item sets, not only the kernels, are wanted,
only its kernel. Requires to run closure, which need memory `closure' will be run, which needs memory allocation/deallocation. */
allocation/deallocation. */ if (report_flag & report_itemsets)
if (trace_flag)
new_closure (nritems); new_closure (nritems);
/* Storage for print_reductions. */ /* Storage for print_reductions. */
shiftset = bitset_create (ntokens, BITSET_FIXED); shiftset = bitset_create (ntokens, BITSET_FIXED);
@@ -525,7 +523,7 @@ print_results (void)
print_state (out, states[i]); print_state (out, states[i]);
bitset_free (shiftset); bitset_free (shiftset);
bitset_free (lookaheadset); bitset_free (lookaheadset);
if (trace_flag) if (report_flag & report_itemsets)
free_closure (); free_closure ();
xfclose (out); xfclose (out);