mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 07:43:03 +00:00
doc: fix environment issues.
* doc/bison.texinfo: Do not use @verbatim, in particular when
we use @group inside.
Use @quotation instead of @display for frequently asked questions,
it looks much nicer.
(cherry picked from commit 71b52b1342)
Conflicts:
doc/bison.texinfo
This commit is contained in:
@@ -10067,10 +10067,10 @@ are addressed.
|
|||||||
@node Memory Exhausted
|
@node Memory Exhausted
|
||||||
@section Memory Exhausted
|
@section Memory Exhausted
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
My parser returns with error with a @samp{memory exhausted}
|
My parser returns with error with a @samp{memory exhausted}
|
||||||
message. What can I do?
|
message. What can I do?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
This question is already addressed elsewhere, @xref{Recursion,
|
This question is already addressed elsewhere, @xref{Recursion,
|
||||||
,Recursive Rules}.
|
,Recursive Rules}.
|
||||||
@@ -10081,20 +10081,20 @@ This question is already addressed elsewhere, @xref{Recursion,
|
|||||||
The following phenomenon has several symptoms, resulting in the
|
The following phenomenon has several symptoms, resulting in the
|
||||||
following typical questions:
|
following typical questions:
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
I invoke @code{yyparse} several times, and on correct input it works
|
I invoke @code{yyparse} several times, and on correct input it works
|
||||||
properly; but when a parse error is found, all the other calls fail
|
properly; but when a parse error is found, all the other calls fail
|
||||||
too. How can I reset the error flag of @code{yyparse}?
|
too. How can I reset the error flag of @code{yyparse}?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
or
|
or
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
My parser includes support for an @samp{#include}-like feature, in
|
My parser includes support for an @samp{#include}-like feature, in
|
||||||
which case I run @code{yyparse} from @code{yyparse}. This fails
|
which case I run @code{yyparse} from @code{yyparse}. This fails
|
||||||
although I did specify @code{%define api.pure}.
|
although I did specify @samp{%define api.pure}.
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
These problems typically come not from Bison itself, but from
|
These problems typically come not from Bison itself, but from
|
||||||
Lex-generated scanners. Because these scanners use large buffers for
|
Lex-generated scanners. Because these scanners use large buffers for
|
||||||
@@ -10149,10 +10149,10 @@ main (void)
|
|||||||
@noindent
|
@noindent
|
||||||
If the file @file{input} contains
|
If the file @file{input} contains
|
||||||
|
|
||||||
@verbatim
|
@example
|
||||||
input:1: Hello,
|
input:1: Hello,
|
||||||
input:2: World!
|
input:2: World!
|
||||||
@end verbatim
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
then instead of getting the first line twice, you get:
|
then instead of getting the first line twice, you get:
|
||||||
@@ -10183,22 +10183,22 @@ start condition, through a call to @samp{BEGIN (0)}.
|
|||||||
@node Strings are Destroyed
|
@node Strings are Destroyed
|
||||||
@section Strings are Destroyed
|
@section Strings are Destroyed
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
My parser seems to destroy old strings, or maybe it loses track of
|
My parser seems to destroy old strings, or maybe it loses track of
|
||||||
them. Instead of reporting @samp{"foo", "bar"}, it reports
|
them. Instead of reporting @samp{"foo", "bar"}, it reports
|
||||||
@samp{"bar", "bar"}, or even @samp{"foo\nbar", "bar"}.
|
@samp{"bar", "bar"}, or even @samp{"foo\nbar", "bar"}.
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
This error is probably the single most frequent ``bug report'' sent to
|
This error is probably the single most frequent ``bug report'' sent to
|
||||||
Bison lists, but is only concerned with a misunderstanding of the role
|
Bison lists, but is only concerned with a misunderstanding of the role
|
||||||
of the scanner. Consider the following Lex code:
|
of the scanner. Consider the following Lex code:
|
||||||
|
|
||||||
@verbatim
|
@example
|
||||||
@group
|
@group
|
||||||
%{
|
%@{
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
char *yylval = NULL;
|
char *yylval = NULL;
|
||||||
%}
|
%@}
|
||||||
@end group
|
@end group
|
||||||
@group
|
@group
|
||||||
%%
|
%%
|
||||||
@@ -10209,15 +10209,15 @@ char *yylval = NULL;
|
|||||||
@group
|
@group
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
@{
|
||||||
/* Similar to using $1, $2 in a Bison action. */
|
/* Similar to using $1, $2 in a Bison action. */
|
||||||
char *fst = (yylex (), yylval);
|
char *fst = (yylex (), yylval);
|
||||||
char *snd = (yylex (), yylval);
|
char *snd = (yylex (), yylval);
|
||||||
printf ("\"%s\", \"%s\"\n", fst, snd);
|
printf ("\"%s\", \"%s\"\n", fst, snd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
@}
|
||||||
@end group
|
@end group
|
||||||
@end verbatim
|
@end example
|
||||||
|
|
||||||
If you compile and run this code, you get:
|
If you compile and run this code, you get:
|
||||||
|
|
||||||
@@ -10248,10 +10248,10 @@ $ @kbd{printf 'one\ntwo\n' | ./split-lines}
|
|||||||
@node Implementing Gotos/Loops
|
@node Implementing Gotos/Loops
|
||||||
@section Implementing Gotos/Loops
|
@section Implementing Gotos/Loops
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
My simple calculator supports variables, assignments, and functions,
|
My simple calculator supports variables, assignments, and functions,
|
||||||
but how can I implement gotos, or loops?
|
but how can I implement gotos, or loops?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
Although very pedagogical, the examples included in the document blur
|
Although very pedagogical, the examples included in the document blur
|
||||||
the distinction to make between the parser---whose job is to recover
|
the distinction to make between the parser---whose job is to recover
|
||||||
@@ -10278,11 +10278,11 @@ invited to consult the dedicated literature.
|
|||||||
@node Multiple start-symbols
|
@node Multiple start-symbols
|
||||||
@section Multiple start-symbols
|
@section Multiple start-symbols
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
I have several closely related grammars, and I would like to share their
|
I have several closely related grammars, and I would like to share their
|
||||||
implementations. In fact, I could use a single grammar but with
|
implementations. In fact, I could use a single grammar but with
|
||||||
multiple entry points.
|
multiple entry points.
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
Bison does not support multiple start-symbols, but there is a very
|
Bison does not support multiple start-symbols, but there is a very
|
||||||
simple means to simulate them. If @code{foo} and @code{bar} are the two
|
simple means to simulate them. If @code{foo} and @code{bar} are the two
|
||||||
@@ -10327,9 +10327,9 @@ available in the scanner (e.g., a global variable or using
|
|||||||
@node Secure? Conform?
|
@node Secure? Conform?
|
||||||
@section Secure? Conform?
|
@section Secure? Conform?
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
Is Bison secure? Does it conform to POSIX?
|
Is Bison secure? Does it conform to POSIX?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
If you're looking for a guarantee or certification, we don't provide it.
|
If you're looking for a guarantee or certification, we don't provide it.
|
||||||
However, Bison is intended to be a reliable program that conforms to the
|
However, Bison is intended to be a reliable program that conforms to the
|
||||||
@@ -10339,11 +10339,11 @@ please send us a bug report.
|
|||||||
@node I can't build Bison
|
@node I can't build Bison
|
||||||
@section I can't build Bison
|
@section I can't build Bison
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
I can't build Bison because @command{make} complains that
|
I can't build Bison because @command{make} complains that
|
||||||
@code{msgfmt} is not found.
|
@code{msgfmt} is not found.
|
||||||
What should I do?
|
What should I do?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
Like most GNU packages with internationalization support, that feature
|
Like most GNU packages with internationalization support, that feature
|
||||||
is turned on by default. If you have problems building in the @file{po}
|
is turned on by default. If you have problems building in the @file{po}
|
||||||
@@ -10357,9 +10357,9 @@ Bison. See the file @file{ABOUT-NLS} for more information.
|
|||||||
@node Where can I find help?
|
@node Where can I find help?
|
||||||
@section Where can I find help?
|
@section Where can I find help?
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
I'm having trouble using Bison. Where can I find help?
|
I'm having trouble using Bison. Where can I find help?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
First, read this fine manual. Beyond that, you can send mail to
|
First, read this fine manual. Beyond that, you can send mail to
|
||||||
@email{help-bison@@gnu.org}. This mailing list is intended to be
|
@email{help-bison@@gnu.org}. This mailing list is intended to be
|
||||||
@@ -10374,9 +10374,9 @@ hearts.
|
|||||||
@node Bug Reports
|
@node Bug Reports
|
||||||
@section Bug Reports
|
@section Bug Reports
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
I found a bug. What should I include in the bug report?
|
I found a bug. What should I include in the bug report?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
Before you send a bug report, make sure you are using the latest
|
Before you send a bug report, make sure you are using the latest
|
||||||
version. Check @url{ftp://ftp.gnu.org/pub/gnu/bison/} or one of its
|
version. Check @url{ftp://ftp.gnu.org/pub/gnu/bison/} or one of its
|
||||||
@@ -10405,10 +10405,10 @@ Send bug reports to @email{bug-bison@@gnu.org}.
|
|||||||
@node More Languages
|
@node More Languages
|
||||||
@section More Languages
|
@section More Languages
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
Will Bison ever have C++ and Java support? How about @var{insert your
|
Will Bison ever have C++ and Java support? How about @var{insert your
|
||||||
favorite language here}?
|
favorite language here}?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
C++ and Java support is there now, and is documented. We'd love to add other
|
C++ and Java support is there now, and is documented. We'd love to add other
|
||||||
languages; contributions are welcome.
|
languages; contributions are welcome.
|
||||||
@@ -10416,9 +10416,9 @@ languages; contributions are welcome.
|
|||||||
@node Beta Testing
|
@node Beta Testing
|
||||||
@section Beta Testing
|
@section Beta Testing
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
What is involved in being a beta tester?
|
What is involved in being a beta tester?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
It's not terribly involved. Basically, you would download a test
|
It's not terribly involved. Basically, you would download a test
|
||||||
release, compile it, and use it to build and run a parser or two. After
|
release, compile it, and use it to build and run a parser or two. After
|
||||||
@@ -10436,9 +10436,9 @@ systems are especially welcome.
|
|||||||
@node Mailing Lists
|
@node Mailing Lists
|
||||||
@section Mailing Lists
|
@section Mailing Lists
|
||||||
|
|
||||||
@display
|
@quotation
|
||||||
How do I join the help-bison and bug-bison mailing lists?
|
How do I join the help-bison and bug-bison mailing lists?
|
||||||
@end display
|
@end quotation
|
||||||
|
|
||||||
See @url{http://lists.gnu.org/}.
|
See @url{http://lists.gnu.org/}.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user