Skip to content

Commit 88bd814

Browse files
committed
doc: update GLR sections
Reported by Christian Schoenebeck. * doc/bison.texi (GLR Parsers): Minor fixes. (Compiler Requirements for GLR): Remove, quite useless today.
1 parent 4f9ae5d commit 88bd814

File tree

1 file changed

+11
-43
lines changed

1 file changed

+11
-43
lines changed

doc/bison.texi

Lines changed: 11 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ Writing GLR Parsers
263263
* Merging GLR Parses:: Using GLR parsers to resolve ambiguities.
264264
* GLR Semantic Actions:: Considerations for semantic values and deferred actions.
265265
* Semantic Predicates:: Controlling a parse with arbitrary computations.
266-
* Compiler Requirements for GLR:: GLR parsers require a modern C compiler.
267266

268267
Examples
269268

@@ -943,7 +942,6 @@ on the resulting values to produce an arbitrary merged result.
943942
* Merging GLR Parses:: Using GLR parsers to resolve ambiguities.
944943
* GLR Semantic Actions:: Considerations for semantic values and deferred actions.
945944
* Semantic Predicates:: Controlling a parse with arbitrary computations.
946-
* Compiler Requirements for GLR:: GLR parsers require a modern C compiler.
947945
@end menu
948946

949947
@node Simple GLR Parsers
@@ -1372,14 +1370,14 @@ widget:
13721370
@noindent
13731371
is one way to allow the same parser to handle two different syntaxes for
13741372
widgets. The clause preceded by @code{%?} is treated like an ordinary
1375-
action, except that its text is treated as an expression and is always
1373+
midrule action, except that its text is handled as an expression and is always
13761374
evaluated immediately (even when in nondeterministic mode). If the
13771375
expression yields 0 (false), the clause is treated as a syntax error,
13781376
which, in a nondeterministic parser, causes the stack in which it is reduced
1379-
to die. In a deterministic parser, it acts like YYERROR.
1377+
to die. In a deterministic parser, it acts like @code{YYERROR}.
13801378

13811379
As the example shows, predicates otherwise look like semantic actions, and
1382-
therefore you must be take them into account when determining the numbers
1380+
therefore you must take them into account when determining the numbers
13831381
to use for denoting the semantic values of right-hand side symbols.
13841382
Predicate actions, however, have no defined value, and may not be given
13851383
labels.
@@ -1393,7 +1391,7 @@ widget:
13931391
@{ if (!new_syntax) YYERROR; @}
13941392
"widget" id new_args @{ $$ = f($3, $4); @}
13951393
| @{ if (new_syntax) YYERROR; @}
1396-
"widget" id old_args @{ $$ = f($3, $4); @}
1394+
"widget" id old_args @{ $$ = f($3, $4); @}
13971395
;
13981396
@end example
13991397

@@ -1411,36 +1409,6 @@ reports an error.
14111409
Finally, be careful in writing predicates: deferred actions have not been
14121410
evaluated, so that using them in a predicate will have undefined effects.
14131411

1414-
@node Compiler Requirements for GLR
1415-
@subsection Considerations when Compiling GLR Parsers
1416-
@cindex @code{inline}
1417-
@cindex GLR parsers and @code{inline}
1418-
1419-
The GLR parsers require a compiler for ISO C89 or
1420-
later. In addition, they use the @code{inline} keyword, which is not
1421-
C89, but is C99 and is a common extension in pre-C99 compilers. It is
1422-
up to the user of these parsers to handle
1423-
portability issues. For instance, if using Autoconf and the Autoconf
1424-
macro @code{AC_C_INLINE}, a mere
1425-
1426-
@example
1427-
%@{
1428-
#include <config.h>
1429-
%@}
1430-
@end example
1431-
1432-
@noindent
1433-
will suffice. Otherwise, we suggest
1434-
1435-
@example
1436-
%@{
1437-
#if (__STDC_VERSION__ < 199901 && ! defined __GNUC__ \
1438-
&& ! defined inline)
1439-
# define inline
1440-
#endif
1441-
%@}
1442-
@end example
1443-
14441412
@node Locations
14451413
@section Locations
14461414
@cindex location
@@ -14824,13 +14792,13 @@ Bison. See the file @file{ABOUT-NLS} for more information.
1482414792
I can't build Bison because my C compiler is too old.
1482514793
@end quotation
1482614794

14827-
Except for GLR parsers (@pxref{Compiler Requirements for GLR}), the C
14828-
code that Bison generates requires only C89 or later. However, Bison
14829-
itself requires common C99 features such as declarations after
14830-
statements. Bison's @code{configure} script attempts to enable C99 (or
14831-
later) support on compilers that default to pre-C99. If your compiler
14832-
lacks these C99 features entirely, GCC may well be a better choice; or
14833-
you can try upgrading to your compiler's latest version.
14795+
Except for GLR parsers (which require C99), the C code that Bison generates
14796+
requires only C89 or later. However, Bison itself requires common C99
14797+
features such as declarations after statements. Bison's @code{configure}
14798+
script attempts to enable C99 (or later) support on compilers that default
14799+
to pre-C99. If your compiler lacks these C99 features entirely, GCC may
14800+
well be a better choice; or you can try upgrading to your compiler's latest
14801+
version.
1483414802

1483514803
@node Where can I find help?
1483614804
@section Where can I find help?

0 commit comments

Comments
 (0)