mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
style: use 'nonterminal' consistently
* doc/bison.texi: Formatting changes. * src/gram.h, src/gram.c (nvars): Rename as... (nnterms): this. Adjust dependencies. (section): New. Use it. Replace "non terminal" and "non-terminal" by "nonterminal".
This commit is contained in:
@@ -2834,13 +2834,13 @@ predefined variables such as @code{pi} or @code{e} as well.
|
||||
Add some new functions from @file{math.h} to the initialization list.
|
||||
|
||||
@item
|
||||
Add another array that contains constants and their values. Then
|
||||
modify @code{init_table} to add these constants to the symbol table.
|
||||
It will be easiest to give the constants type @code{VAR}.
|
||||
Add another array that contains constants and their values. Then modify
|
||||
@code{init_table} to add these constants to the symbol table. It will be
|
||||
easiest to give the constants type @code{VAR}.
|
||||
|
||||
@item
|
||||
Make the program report an error if the user refers to an
|
||||
uninitialized variable in any way except to store a value in it.
|
||||
Make the program report an error if the user refers to an uninitialized
|
||||
variable in any way except to store a value in it.
|
||||
@end enumerate
|
||||
|
||||
@node Grammar File
|
||||
@@ -5513,12 +5513,12 @@ do @{
|
||||
yypstate_delete (ps);
|
||||
@end example
|
||||
|
||||
If the user decided to use an impure push parser, a few things about
|
||||
the generated parser will change. The @code{yychar} variable becomes
|
||||
a global variable instead of a variable in the @code{yypush_parse} function.
|
||||
For this reason, the signature of the @code{yypush_parse} function is
|
||||
changed to remove the token as a parameter. A nonreentrant push parser
|
||||
example would thus look like this:
|
||||
If the user decided to use an impure push parser, a few things about the
|
||||
generated parser will change. The @code{yychar} variable becomes a global
|
||||
variable instead of a local one in the @code{yypush_parse} function. For
|
||||
this reason, the signature of the @code{yypush_parse} function is changed to
|
||||
remove the token as a parameter. A nonreentrant push parser example would
|
||||
thus look like this:
|
||||
|
||||
@example
|
||||
extern int yychar;
|
||||
@@ -8104,10 +8104,9 @@ doing so would produce on the stack the sequence of symbols @code{expr
|
||||
@vindex yychar
|
||||
@vindex yylval
|
||||
@vindex yylloc
|
||||
The lookahead token is stored in the variable @code{yychar}.
|
||||
Its semantic value and location, if any, are stored in the variables
|
||||
@code{yylval} and @code{yylloc}.
|
||||
@xref{Action Features}.
|
||||
The lookahead token is stored in the variable @code{yychar}. Its semantic
|
||||
value and location, if any, are stored in the variables @code{yylval} and
|
||||
@code{yylloc}. @xref{Action Features}.
|
||||
|
||||
@node Shift/Reduce
|
||||
@section Shift/Reduce Conflicts
|
||||
@@ -14263,14 +14262,13 @@ start:
|
||||
These tokens prevents the introduction of new conflicts. As far as the
|
||||
parser goes, that is all that is needed.
|
||||
|
||||
Now the difficult part is ensuring that the scanner will send these
|
||||
tokens first. If your scanner is hand-written, that should be
|
||||
straightforward. If your scanner is generated by Lex, them there is
|
||||
simple means to do it: recall that anything between @samp{%@{ ... %@}}
|
||||
after the first @code{%%} is copied verbatim in the top of the generated
|
||||
@code{yylex} function. Make sure a variable @code{start_token} is
|
||||
available in the scanner (e.g., a global variable or using
|
||||
@code{%lex-param} etc.), and use the following:
|
||||
Now the difficult part is ensuring that the scanner will send these tokens
|
||||
first. If your scanner is hand-written, that should be straightforward. If
|
||||
your scanner is generated by Lex, them there is simple means to do it:
|
||||
recall that anything between @samp{%@{ ... %@}} after the first @code{%%} is
|
||||
copied verbatim in the top of the generated @code{yylex} function. Make
|
||||
sure a variable @code{start_token} is available in the scanner (e.g., a
|
||||
global variable or using @code{%lex-param} etc.), and use the following:
|
||||
|
||||
@example
|
||||
/* @r{Prologue.} */
|
||||
|
||||
Reference in New Issue
Block a user