[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using deffn in the documentation
From: |
Akim Demaille |
Subject: |
Using deffn in the documentation |
Date: |
14 Nov 2002 09:32:38 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
plus a few other adjustments.
Index: ChangeLog
from Akim Demaille <address@hidden>
* doc/bison.texinfo: Various formatting changes (alignments in
samples, additional @group/@end group, GCS in samples.
Use @deffn instead of simple @table to define the directives,
macros, variables etc.
Index: doc/bison.texinfo
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.texinfo,v
retrieving revision 1.80
diff -u -u -r1.80 bison.texinfo
--- doc/bison.texinfo 12 Nov 2002 09:07:37 -0000 1.80
+++ doc/bison.texinfo 14 Nov 2002 08:31:25 -0000
@@ -1088,18 +1088,18 @@
;
line: '\n'
- | exp '\n' @{ printf ("\t%.10g\n", $1); @}
+ | exp '\n' @{ printf ("\t%.10g\n", $1); @}
;
-exp: NUM @{ $$ = $1; @}
- | exp exp '+' @{ $$ = $1 + $2; @}
- | exp exp '-' @{ $$ = $1 - $2; @}
- | exp exp '*' @{ $$ = $1 * $2; @}
- | exp exp '/' @{ $$ = $1 / $2; @}
- /* Exponentiation */
- | exp exp '^' @{ $$ = pow ($1, $2); @}
- /* Unary minus */
- | exp 'n' @{ $$ = -$1; @}
+exp: NUM @{ $$ = $1; @}
+ | exp exp '+' @{ $$ = $1 + $2; @}
+ | exp exp '-' @{ $$ = $1 - $2; @}
+ | exp exp '*' @{ $$ = $1 * $2; @}
+ | exp exp '/' @{ $$ = $1 / $2; @}
+ /* Exponentiation */
+ | exp exp '^' @{ $$ = pow ($1, $2); @}
+ /* Unary minus */
+ | exp 'n' @{ $$ = -$1; @}
;
%%
@end example
@@ -1706,11 +1706,15 @@
yylex (void)
@{
int c;
address@hidden group
address@hidden
/* Skip white space. */
while ((c = getchar ()) == ' ' || c == '\t')
++yylloc.last_column;
address@hidden group
address@hidden
/* Step. */
yylloc.first_line = yylloc.last_line;
yylloc.first_column = yylloc.last_column;
@@ -1832,25 +1836,29 @@
Here are the C and Bison declarations for the multi-function calculator.
@smallexample
address@hidden
address@hidden
#include <math.h> /* For math functions, cos(), sin(), etc. */
-#include "calc.h" /* Contains definition of `symrec' */
+#include "calc.h" /* Contains definition of `symrec' */
address@hidden
address@hidden group
address@hidden
%union @{
-double val; /* For returning numbers. */
-symrec *tptr; /* For returning symbol-table pointers */
+ double val; /* For returning numbers. */
+ symrec *tptr; /* For returning symbol-table pointers. */
@}
-
-%token <val> NUM /* Simple double precision number */
-%token <tptr> VAR FNCT /* Variable and Function */
address@hidden group
+%token <val> NUM /* Simple double precision number. */
+%token <tptr> VAR FNCT /* Variable and Function. */
%type <val> exp
address@hidden
%right '='
%left '-' '+'
%left '*' '/'
%left NEG /* Negation--unary minus */
%right '^' /* Exponentiation */
-
address@hidden group
/* Grammar follows */
%%
@end smallexample
@@ -1885,16 +1893,21 @@
those which mention @code{VAR} or @code{FNCT}, are new.
@smallexample
address@hidden
input: /* empty */
| input line
;
address@hidden group
address@hidden
line:
'\n'
| exp '\n' @{ printf ("\t%.10g\n", $1); @}
| error '\n' @{ yyerrok; @}
;
address@hidden group
address@hidden
exp: NUM @{ $$ = $1; @}
| VAR @{ $$ = $1->value.var; @}
| VAR '=' exp @{ $$ = $3; $1->value.var = $3; @}
@@ -1907,6 +1920,7 @@
| exp '^' exp @{ $$ = pow ($1, $3); @}
| '(' exp ')' @{ $$ = $2; @}
;
address@hidden group
/* End of grammar */
%%
@end smallexample
@@ -1961,9 +1975,9 @@
@code{init_table} as well:
@smallexample
address@hidden
#include <stdio.h>
address@hidden
int
main (void)
@{
@@ -1978,7 +1992,9 @@
@{
printf ("%s\n", s);
@}
address@hidden group
address@hidden
struct init
@{
char *fname;
@@ -1997,7 +2013,9 @@
"sqrt", sqrt,
0, 0
@};
address@hidden group
address@hidden
/* The symbol table: a chain of `struct symrec'. */
symrec *sym_table = (symrec *) 0;
@end group
@@ -2073,7 +2091,9 @@
@smallexample
@group
#include <ctype.h>
address@hidden group
address@hidden
int
yylex (void)
@{
@@ -2121,7 +2141,7 @@
if (i == length)
@{
length *= 2;
- symbuf = (char *)realloc (symbuf, length + 1);
+ symbuf = (char *) realloc (symbuf, length + 1);
@}
/* Add this character to the buffer. */
symbuf[i++] = c;
@@ -3544,53 +3564,60 @@
Here is a summary of the declarations used to define a grammar:
address@hidden @code
address@hidden %union
address@hidden {Directive} %union
Declare the collection of data types that semantic values may have
(@pxref{Union Decl, ,The Collection of Value Types}).
address@hidden deffn
address@hidden %token
address@hidden {Directive} %token
Declare a terminal symbol (token type name) with no precedence
or associativity specified (@pxref{Token Decl, ,Token Type Names}).
address@hidden deffn
address@hidden %right
address@hidden {Directive} %right
Declare a terminal symbol (token type name) that is right-associative
(@pxref{Precedence Decl, ,Operator Precedence}).
address@hidden deffn
address@hidden %left
address@hidden {Directive} %left
Declare a terminal symbol (token type name) that is left-associative
(@pxref{Precedence Decl, ,Operator Precedence}).
address@hidden deffn
address@hidden %nonassoc
address@hidden {Directive} %nonassoc
Declare a terminal symbol (token type name) that is nonassociative
(using it in a way that would be associative is a syntax error)
address@hidden deffn
(@pxref{Precedence Decl, ,Operator Precedence}).
address@hidden %type
address@hidden {Directive} %type
Declare the type of semantic values for a nonterminal symbol
(@pxref{Type Decl, ,Nonterminal Symbols}).
address@hidden deffn
address@hidden %start
address@hidden {Directive} %start
Specify the grammar's start symbol (@pxref{Start Decl, ,The
Start-Symbol}).
address@hidden deffn
address@hidden %expect
address@hidden {Directive} %expect
Declare the expected number of shift-reduce conflicts
(@pxref{Expect Decl, ,Suppressing Conflict Warnings}).
address@hidden table
address@hidden deffn
+
@sp 1
@noindent
In order to change the behavior of @command{bison}, use the following
directives:
address@hidden @code
address@hidden %debug
address@hidden {Directive} %debug
In the parser file, define the macro @code{YYDEBUG} to 1 if it is not
already defined, so that the debugging facilities are compiled.
address@hidden deffn
@xref{Tracing, ,Tracing Your Parser}.
address@hidden %defines
address@hidden {Directive} %defines
Write an extra output file containing macro definitions for the token
type names defined in the grammar and the semantic value type
@code{YYSTYPE}, as well as a few @code{extern} variable declarations.
@@ -3602,31 +3629,27 @@
@code{yylex} in a separate source file, because @code{yylex} needs to
be able to refer to token type codes and the variable
@code{yylval}. @xref{Token Values, ,Semantic Values of Tokens}.
address@hidden deffn
address@hidden %destructor
address@hidden {Directive} %destructor
Specifying how the parser should reclaim the memory associated to
discarded symbols. @xref{Destructor Decl, , Freeing Discarded Symbols}.
address@hidden deffn
address@hidden %file-prefix="@var{prefix}"
address@hidden {Directive} %file-prefix="@var{prefix}"
Specify a prefix to use for all Bison output file names. The names are
chosen as if the input file were named @address@hidden
address@hidden deffn
address@hidden @item %header-extension
address@hidden Specify the extension of the parser header file generated when
address@hidden @code{%define} or @samp{-d} are used.
address@hidden
address@hidden For example, a grammar file named @file{foo.ypp} and containing a
address@hidden @code{%header-extension .hh} directive will produce a header file
address@hidden named @file{foo.tab.hh}
-
address@hidden %locations
address@hidden {Directive} %locations
Generate the code processing the locations (@pxref{Action Features,
,Special Features for Use in Actions}). This mode is enabled as soon as
the grammar uses the special @samp{@@@var{n}} tokens, but if your
grammar does not use it, using @samp{%locations} allows for more
accurate parse error messages.
address@hidden deffn
address@hidden %name-prefix="@var{prefix}"
address@hidden {Directive} %name-prefix="@var{prefix}"
Rename the external symbols used in the parser so that they start with
@var{prefix} instead of @samp{yy}. The precise list of symbols renamed
is @code{yyparse}, @code{yylex}, @code{yyerror}, @code{yynerrs},
@@ -3635,8 +3658,9 @@
@samp{%name-prefix="c_"}, the names become @code{c_parse}, @code{c_lex},
and so on. @xref{Multiple Parsers, ,Multiple Parsers in the Same
Program}.
address@hidden deffn
address@hidden %no-parser
address@hidden {Directive} %no-parser
Do not include any C code in the parser file; generate tables only. The
parser file contains just @code{#define} directives and static variable
declarations.
@@ -3644,30 +3668,27 @@
This option also tells Bison to write the C code for the grammar actions
into a file named @address@hidden, in the form of a
brace-surrounded body fit for a @code{switch} statement.
address@hidden deffn
address@hidden %no-lines
address@hidden {Directive} %no-lines
Don't generate any @code{#line} preprocessor commands in the parser
file. Ordinarily Bison writes these commands in the parser file so that
the C compiler and debuggers will associate errors and object code with
your source file (the grammar file). This directive causes them to
associate errors with the parser file, treating it an independent source
file in its own right.
address@hidden deffn
address@hidden %output="@var{filename}"
address@hidden {Directive} %output="@var{filename}"
Specify the @var{filename} for the parser file.
address@hidden deffn
address@hidden %pure-parser
address@hidden {Directive} %pure-parser
Request a pure (reentrant) parser program (@pxref{Pure Decl, ,A Pure
(Reentrant) Parser}).
address@hidden deffn
address@hidden @item %source-extension
address@hidden Specify the extension of the parser output file.
address@hidden
address@hidden For example, a grammar file named @file{foo.yy} and containing a
address@hidden @code{%source-extension .cpp} directive will produce a parser
file
address@hidden named @file{foo.tab.cpp}
-
address@hidden %token-table
address@hidden {Directive} %token-table
Generate an array of token names in the parser file. The name of the
array is @code{yytname}; @address@hidden is the name of the
token whose internal Bison token code number is @var{i}. The first
@@ -3699,19 +3720,19 @@
@item YYNSTATES
The number of parser states (@pxref{Parser States}).
@end table
address@hidden deffn
address@hidden %verbose
address@hidden {Directive} %verbose
Write an extra output file containing verbose descriptions of the
parser states and what is done for each type of look-ahead token in
that state. @xref{Understanding, , Understanding Your Parser}, for more
information.
address@hidden deffn
address@hidden %yacc
address@hidden {Directive} %yacc
Pretend the option @option{--yacc} was given, i.e., imitate Yacc,
including its naming conventions. @xref{Bison Options}, for more.
address@hidden table
-
-
address@hidden deffn
@node Multiple Parsers
@@ -4198,34 +4219,39 @@
Here is a table of Bison constructs, variables and macros that
are useful in actions.
address@hidden @samp
address@hidden $$
address@hidden {Variable} $$
Acts like a variable that contains the semantic value for the
grouping made by the current rule. @xref{Actions}.
address@hidden deffn
address@hidden address@hidden
address@hidden {Variable} address@hidden
Acts like a variable that contains the semantic value for the
@var{n}th component of the current rule. @xref{Actions}.
address@hidden deffn
address@hidden $<@var{typealt}>$
address@hidden {Variable} $<@var{typealt}>$
Like @code{$$} but specifies alternative @var{typealt} in the union
specified by the @code{%union} declaration. @xref{Action Types, ,Data
Types of Values in Actions}.
address@hidden deffn
address@hidden $<@var{typealt}>@var{n}
address@hidden {Variable} $<@var{typealt}>@var{n}
Like @address@hidden but specifies alternative @var{typealt} in the
union specified by the @code{%union} declaration.
@xref{Action Types, ,Data Types of Values in Actions}.
address@hidden deffn
address@hidden YYABORT;
address@hidden {Macro} YYABORT;
Return immediately from @code{yyparse}, indicating failure.
@xref{Parser Function, ,The Parser Function @code{yyparse}}.
address@hidden deffn
address@hidden YYACCEPT;
address@hidden {Macro} YYACCEPT;
Return immediately from @code{yyparse}, indicating success.
@xref{Parser Function, ,The Parser Function @code{yyparse}}.
address@hidden deffn
address@hidden YYBACKUP (@var{token}, @var{value});
address@hidden {Macro} YYBACKUP (@var{token}, @var{value});
@findex YYBACKUP
Unshift a token. This macro is allowed only for rules that reduce
a single value, and only when there is no look-ahead token.
@@ -4240,40 +4266,47 @@
recovery.
In either case, the rest of the action is not executed.
address@hidden deffn
address@hidden YYEMPTY
address@hidden {Macro} YYEMPTY
@vindex YYEMPTY
Value stored in @code{yychar} when there is no look-ahead token.
address@hidden deffn
address@hidden YYERROR;
address@hidden {Macro} YYERROR;
@findex YYERROR
Cause an immediate syntax error. This statement initiates error
recovery just as if the parser itself had detected an error; however, it
does not call @code{yyerror}, and does not print any message. If you
want to print an error message, call @code{yyerror} explicitly before
the @samp{YYERROR;} statement. @xref{Error Recovery}.
address@hidden deffn
address@hidden YYRECOVERING
address@hidden {Macro} YYRECOVERING
This macro stands for an expression that has the value 1 when the parser
is recovering from a syntax error, and 0 the rest of the time.
@xref{Error Recovery}.
address@hidden deffn
address@hidden yychar
address@hidden {Variable} yychar
Variable containing the current look-ahead token. (In a pure parser,
this is actually a local variable within @code{yyparse}.) When there is
no look-ahead token, the value @code{YYEMPTY} is stored in the variable.
@xref{Look-Ahead, ,Look-Ahead Tokens}.
address@hidden deffn
address@hidden yyclearin;
address@hidden {Macro} yyclearin;
Discard the current look-ahead token. This is useful primarily in
error rules. @xref{Error Recovery}.
address@hidden deffn
address@hidden yyerrok;
address@hidden {Macro} yyerrok;
Resume generating error messages immediately for subsequent syntax
errors. This is useful primarily in error rules.
@xref{Error Recovery}.
address@hidden deffn
address@hidden @@$
address@hidden {Value} @@$
@findex @@$
Acts like a structure variable containing information on the textual position
of the grouping made by the current rule. @xref{Locations, ,
@@ -4297,14 +4330,15 @@
@c those members.
@c The use of this feature makes the parser noticeably slower.
address@hidden deffn
address@hidden @@@var{n}
address@hidden {Value} @@@var{n}
@findex @@@var{n}
Acts like a structure variable containing information on the textual position
of the @var{n}th component of the current rule. @xref{Locations, ,
Tracking Locations}.
address@hidden deffn
address@hidden table
@node Algorithm
@chapter The Bison Parser Algorithm
@@ -6200,38 +6234,44 @@
@cindex Bison symbols, table of
@cindex symbols in Bison, table of
address@hidden @code
address@hidden @@$
address@hidden {Variable} @@$
In an action, the location of the left-hand side of the rule.
@xref{Locations, , Locations Overview}.
address@hidden deffn
address@hidden @@@var{n}
address@hidden {Variable} @@@var{n}
In an action, the location of the @var{n}-th symbol of the right-hand
side of the rule. @xref{Locations, , Locations Overview}.
address@hidden deffn
address@hidden $$
address@hidden {Variable} $$
In an action, the semantic value of the left-hand side of the rule.
@xref{Actions}.
address@hidden deffn
address@hidden address@hidden
address@hidden {Variable} address@hidden
In an action, the semantic value of the @var{n}-th symbol of the
right-hand side of the rule. @xref{Actions}.
address@hidden deffn
address@hidden $accept
address@hidden {Symbol} $accept
The predefined nonterminal whose only rule is @samp{$accept: @var{start}
$end}, where @var{start} is the start symbol. @xref{Start Decl, , The
Start-Symbol}. It cannot be used in the grammar.
address@hidden deffn
address@hidden $end
address@hidden {Symbol} $end
The predefined token marking the end of the token stream. It cannot be
used in the grammar.
address@hidden deffn
address@hidden $undefined
address@hidden {Symbol} $undefined
The predefined token onto which all undefined values returned by
@code{yylex} are mapped. It cannot be used in the grammar, rather, use
@code{error}.
address@hidden deffn
address@hidden error
address@hidden {Symbol} error
A token name reserved for error recovery. This token may be used in
grammar rules so as to allow the Bison parser to recognize an error in
the grammar without halting the process. In effect, a sentence
@@ -6240,267 +6280,312 @@
corresponding to @code{error} are then executed, and the look-ahead
token is reset to the token that originally caused the violation.
@xref{Error Recovery}.
address@hidden deffn
address@hidden YYABORT
address@hidden {Macro} YYABORT
Macro to pretend that an unrecoverable syntax error has occurred, by
making @code{yyparse} return 1 immediately. The error reporting
function @code{yyerror} is not called. @xref{Parser Function, ,The
Parser Function @code{yyparse}}.
address@hidden deffn
address@hidden YYACCEPT
address@hidden {Macro} YYACCEPT
Macro to pretend that a complete utterance of the language has been
read, by making @code{yyparse} return 0 immediately.
@xref{Parser Function, ,The Parser Function @code{yyparse}}.
address@hidden deffn
address@hidden YYBACKUP
address@hidden {Macro} YYBACKUP
Macro to discard a value from the parser stack and fake a look-ahead
token. @xref{Action Features, ,Special Features for Use in Actions}.
address@hidden deffn
address@hidden YYDEBUG
address@hidden {Macro} YYDEBUG
Macro to define to equip the parser with tracing code. @xref{Tracing,
,Tracing Your Parser}.
address@hidden deffn
address@hidden YYERROR
address@hidden {Macro} YYERROR
Macro to pretend that a syntax error has just been detected: call
@code{yyerror} and then perform normal error recovery if possible
(@pxref{Error Recovery}), or (if recovery is impossible) make
@code{yyparse} return 1. @xref{Error Recovery}.
address@hidden deffn
address@hidden YYERROR_VERBOSE
address@hidden {Macro} YYERROR_VERBOSE
An obsolete macro that you define with @code{#define} in the Bison
declarations section to request verbose, specific error message strings
when @code{yyerror} is called. It doesn't matter what definition you
use for @code{YYERROR_VERBOSE}, just whether you define it. Using
@code{%error-verbose} is preferred.
address@hidden deffn
address@hidden YYINITDEPTH
address@hidden {Macro} YYINITDEPTH
Macro for specifying the initial size of the parser stack.
@xref{Stack Overflow}.
address@hidden deffn
address@hidden YYLEX_PARAM
address@hidden {Macro} YYLEX_PARAM
An obsolete macro for specifying an extra argument (or list of extra
arguments) for @code{yyparse} to pass to @code{yylex}. he use of this
macro is deprecated, and is supported only for Yacc like parsers.
@xref{Pure Calling,, Calling Conventions for Pure Parsers}.
address@hidden deffn
address@hidden YYLTYPE
address@hidden {Macro} YYLTYPE
Macro for the data type of @code{yylloc}; a structure with four
members. @xref{Location Type, , Data Types of Locations}.
address@hidden deffn
address@hidden yyltype
address@hidden {Type} yyltype
Default value for YYLTYPE.
address@hidden deffn
address@hidden YYMAXDEPTH
-Macro for specifying the maximum size of the parser stack.
address@hidden Overflow}.
address@hidden {Macro} YYMAXDEPTH
+Macro for specifying the maximum size of the parser stack. @xref{Stack
+Overflow}.
address@hidden deffn
address@hidden YYPARSE_PARAM
address@hidden {Macro} YYPARSE_PARAM
An obsolete macro for specifying the name of a parameter that
@code{yyparse} should accept. The use of this macro is deprecated, and
is supported only for Yacc like parsers. @xref{Pure Calling,, Calling
Conventions for Pure Parsers}.
address@hidden deffn
address@hidden YYRECOVERING
address@hidden {Macro} YYRECOVERING
Macro whose value indicates whether the parser is recovering from a
syntax error. @xref{Action Features, ,Special Features for Use in Actions}.
address@hidden deffn
address@hidden YYSTACK_USE_ALLOCA
address@hidden {Macro} YYSTACK_USE_ALLOCA
Macro used to control the use of @code{alloca}. If defined to @samp{0},
the parser will not use @code{alloca} but @code{malloc} when trying to
grow its internal stacks. Do @emph{not} define @code{YYSTACK_USE_ALLOCA}
to anything else.
address@hidden deffn
address@hidden YYSTYPE
address@hidden {Macro} YYSTYPE
Macro for the data type of semantic values; @code{int} by default.
@xref{Value Type, ,Data Types of Semantic Values}.
address@hidden deffn
address@hidden yychar
address@hidden {Variable} yychar
External integer variable that contains the integer value of the current
look-ahead token. (In a pure parser, it is a local variable within
@code{yyparse}.) Error-recovery rule actions may examine this variable.
@xref{Action Features, ,Special Features for Use in Actions}.
address@hidden deffn
address@hidden yyclearin
address@hidden {Variable} yyclearin
Macro used in error-recovery rule actions. It clears the previous
look-ahead token. @xref{Error Recovery}.
address@hidden deffn
address@hidden yydebug
address@hidden {Variable} yydebug
External integer variable set to zero by default. If @code{yydebug}
is given a nonzero value, the parser will output information on input
symbols and parser action. @xref{Tracing, ,Tracing Your Parser}.
address@hidden deffn
address@hidden yyerrok
address@hidden {Macro} yyerrok
Macro to cause parser to recover immediately to its normal mode
after a parse error. @xref{Error Recovery}.
address@hidden deffn
address@hidden yyerror
address@hidden {Function} yyerror
User-supplied function to be called by @code{yyparse} on error. The
function receives one argument, a pointer to a character string
containing an error message. @xref{Error Reporting, ,The Error
Reporting Function @code{yyerror}}.
address@hidden deffn
address@hidden yylex
address@hidden {Function} yylex
User-supplied lexical analyzer function, called with no arguments to get
the next token. @xref{Lexical, ,The Lexical Analyzer Function
@code{yylex}}.
address@hidden deffn
address@hidden yylval
address@hidden {Variable} yylval
External variable in which @code{yylex} should place the semantic
value associated with a token. (In a pure parser, it is a local
variable within @code{yyparse}, and its address is passed to
@code{yylex}.) @xref{Token Values, ,Semantic Values of Tokens}.
address@hidden deffn
address@hidden yylloc
address@hidden {Variable} yylloc
External variable in which @code{yylex} should place the line and column
numbers associated with a token. (In a pure parser, it is a local
variable within @code{yyparse}, and its address is passed to
@code{yylex}.) You can ignore this variable if you don't use the
@samp{@@} feature in the grammar actions. @xref{Token Positions,
,Textual Positions of Tokens}.
address@hidden deffn
address@hidden yynerrs
address@hidden {Variable} yynerrs
Global variable which Bison increments each time there is a parse error.
(In a pure parser, it is a local variable within @code{yyparse}.)
@xref{Error Reporting, ,The Error Reporting Function @code{yyerror}}.
address@hidden deffn
address@hidden yyparse
address@hidden {Function} yyparse
The parser function produced by Bison; call this function to start
parsing. @xref{Parser Function, ,The Parser Function @code{yyparse}}.
address@hidden deffn
address@hidden %debug
address@hidden {Directive} %debug
Equip the parser for debugging. @xref{Decl Summary}.
address@hidden deffn
address@hidden %defines
address@hidden {Directive} %defines
Bison declaration to create a header file meant for the scanner.
@xref{Decl Summary}.
address@hidden deffn
address@hidden %destructor
address@hidden {Directive} %destructor
Specifying how the parser should reclaim the memory associated to
discarded symbols. @xref{Destructor Decl, , Freeing Discarded Symbols}.
address@hidden deffn
address@hidden %dprec
address@hidden {Directive} %dprec
Bison declaration to assign a precedence to a rule that is used at parse
time to resolve reduce/reduce conflicts. @xref{GLR Parsers, ,Writing
@acronym{GLR} Parsers}.
address@hidden deffn
address@hidden %error-verbose
address@hidden {Directive} %error-verbose
Bison declaration to request verbose, specific error message strings
when @code{yyerror} is called.
address@hidden deffn
address@hidden %file-prefix="@var{prefix}"
address@hidden {Directive} %file-prefix="@var{prefix}"
Bison declaration to set the prefix of the output files. @xref{Decl
Summary}.
address@hidden deffn
address@hidden %glr-parser
address@hidden {Directive} %glr-parser
Bison declaration to produce a @acronym{GLR} parser. @xref{GLR
Parsers, ,Writing @acronym{GLR} Parsers}.
address@hidden deffn
address@hidden @item %source-extension
address@hidden Bison declaration to specify the generated parser output file
extension.
address@hidden @xref{Decl Summary}.
address@hidden
address@hidden @item %header-extension
address@hidden Bison declaration to specify the generated parser header file
extension
address@hidden if required. @xref{Decl Summary}.
-
address@hidden %left
address@hidden {Directive} %left
Bison declaration to assign left associativity to token(s).
@xref{Precedence Decl, ,Operator Precedence}.
address@hidden deffn
address@hidden %lex-param "@var{argument-declaration}" "@var{argument-name}"
address@hidden {Directive} %lex-param "@var{argument-declaration}"
"@var{argument-name}"
Bison declaration to specifying an additional parameter that
@code{yylex} should accept. @xref{Pure Calling,, Calling Conventions
for Pure Parsers}.
address@hidden deffn
address@hidden %merge
address@hidden {Directive} %merge
Bison declaration to assign a merging function to a rule. If there is a
reduce/reduce conflict with a rule having the same merging function, the
function is applied to the two semantic values to get a single result.
@xref{GLR Parsers, ,Writing @acronym{GLR} Parsers}.
address@hidden deffn
address@hidden %name-prefix="@var{prefix}"
address@hidden {Directive} %name-prefix="@var{prefix}"
Bison declaration to rename the external symbols. @xref{Decl Summary}.
address@hidden deffn
address@hidden %no-lines
address@hidden {Directive} %no-lines
Bison declaration to avoid generating @code{#line} directives in the
parser file. @xref{Decl Summary}.
address@hidden deffn
address@hidden %nonassoc
address@hidden {Directive} %nonassoc
Bison declaration to assign non-associativity to token(s).
@xref{Precedence Decl, ,Operator Precedence}.
address@hidden deffn
address@hidden %output="@var{filename}"
address@hidden {Directive} %output="@var{filename}"
Bison declaration to set the name of the parser file. @xref{Decl
Summary}.
address@hidden deffn
address@hidden %parse-param "@var{argument-declaration}" "@var{argument-name}"
address@hidden {Directive} %parse-param "@var{argument-declaration}"
"@var{argument-name}"
Bison declaration to specifying an additional parameter that
@code{yyparse} should accept. @xref{Parser Function,, The Parser
Function @code{yyparse}}.
address@hidden deffn
address@hidden %prec
address@hidden {Directive} %prec
Bison declaration to assign a precedence to a specific rule.
@xref{Contextual Precedence, ,Context-Dependent Precedence}.
address@hidden deffn
address@hidden %pure-parser
address@hidden {Directive} %pure-parser
Bison declaration to request a pure (reentrant) parser.
@xref{Pure Decl, ,A Pure (Reentrant) Parser}.
address@hidden deffn
address@hidden %right
address@hidden {Directive} %right
Bison declaration to assign right associativity to token(s).
@xref{Precedence Decl, ,Operator Precedence}.
address@hidden deffn
address@hidden %start
address@hidden {Directive} %start
Bison declaration to specify the start symbol. @xref{Start Decl, ,The
Start-Symbol}.
address@hidden deffn
address@hidden %token
address@hidden {Directive} %token
Bison declaration to declare token(s) without specifying precedence.
@xref{Token Decl, ,Token Type Names}.
address@hidden deffn
address@hidden %token-table
address@hidden {Directive} %token-table
Bison declaration to include a token name table in the parser file.
@xref{Decl Summary}.
address@hidden deffn
address@hidden %type
address@hidden {Directive} %type
Bison declaration to declare nonterminals. @xref{Type Decl,
,Nonterminal Symbols}.
address@hidden deffn
address@hidden %union
address@hidden {Directive} %union
Bison declaration to specify several possible data types for semantic
values. @xref{Union Decl, ,The Collection of Value Types}.
address@hidden table
address@hidden deffn
@sp 1
These are the punctuation and delimiters used in Bison input:
address@hidden @samp
address@hidden %%
address@hidden {Delimiter} %%
Delimiter used to separate the grammar rule section from the
Bison declarations section or the epilogue.
@xref{Grammar Layout, ,The Overall Layout of a Bison Grammar}.
address@hidden deffn
address@hidden address@hidden address@hidden
address@hidden Don't insert spaces, or check the DVI output.
address@hidden {Delimiter} address@hidden@address@hidden
All code listed between @address@hidden and @address@hidden is copied directly
to
the output file uninterpreted. Such code forms the prologue of the input
file. @xref{Grammar Outline, ,Outline of a Bison
Grammar}.
address@hidden deffn
address@hidden /address@hidden/
address@hidden {Construct} /address@hidden/
Comment delimiters, as in C.
address@hidden deffn
address@hidden :
address@hidden {Delimiter} :
Separates a rule's result from its components. @xref{Rules, ,Syntax of
Grammar Rules}.
address@hidden deffn
address@hidden ;
address@hidden {Delimiter} ;
Terminates a rule. @xref{Rules, ,Syntax of Grammar Rules}.
address@hidden deffn
address@hidden |
address@hidden {Delimiter} |
Separates alternate rules for the same result nonterminal.
@xref{Rules, ,Syntax of Grammar Rules}.
address@hidden table
address@hidden deffn
@node Glossary
@appendix Glossary
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Using deffn in the documentation,
Akim Demaille <=