3102 |
four members: |
four members: |
3103 |
|
|
3104 |
@example |
@example |
3105 |
struct |
typedef struct YYLTYPE |
3106 |
@{ |
@{ |
3107 |
int first_line; |
int first_line; |
3108 |
int first_column; |
int first_column; |
3109 |
int last_line; |
int last_line; |
3110 |
int last_column; |
int last_column; |
3111 |
@} |
@} YYLTYPE; |
3112 |
@end example |
@end example |
3113 |
|
|
3114 |
@node Actions and Locations |
@node Actions and Locations |
3417 |
in the @code{%token} and @code{%type} declarations to pick one of the types |
in the @code{%token} and @code{%type} declarations to pick one of the types |
3418 |
for a terminal or nonterminal symbol (@pxref{Type Decl, ,Nonterminal Symbols}). |
for a terminal or nonterminal symbol (@pxref{Type Decl, ,Nonterminal Symbols}). |
3419 |
|
|
3420 |
Note that, unlike making a @code{union} declaration in C, you do not write |
As an extension to @acronym{POSIX}, a tag is allowed after the |
3421 |
|
@code{union}. For example: |
3422 |
|
|
3423 |
|
@example |
3424 |
|
@group |
3425 |
|
%union value @{ |
3426 |
|
double val; |
3427 |
|
symrec *tptr; |
3428 |
|
@} |
3429 |
|
@end group |
3430 |
|
@end example |
3431 |
|
|
3432 |
|
specifies the union tag @code{value}, so the corresponding C type is |
3433 |
|
@code{union value}. If you do not specify a tag, it defaults to |
3434 |
|
@code{YYSTYPE}. |
3435 |
|
|
3436 |
|
Note that, unlike making a @code{union} declaration in C, you need not write |
3437 |
a semicolon after the closing brace. |
a semicolon after the closing brace. |
3438 |
|
|
3439 |
@node Type Decl |
@node Type Decl |
6468 |
@xref{Pure Calling,, Calling Conventions for Pure Parsers}. |
@xref{Pure Calling,, Calling Conventions for Pure Parsers}. |
6469 |
@end deffn |
@end deffn |
6470 |
|
|
6471 |
@deffn {Macro} YYLTYPE |
@deffn {Type} YYLTYPE |
6472 |
Macro for the data type of @code{yylloc}; a structure with four |
Data type of @code{yylloc}; by default, a structure with four |
6473 |
members. @xref{Location Type, , Data Types of Locations}. |
members. @xref{Location Type, , Data Types of Locations}. |
6474 |
@end deffn |
@end deffn |
6475 |
|
|
|
@deffn {Type} yyltype |
|
|
Default value for YYLTYPE. |
|
|
@end deffn |
|
|
|
|
6476 |
@deffn {Macro} YYMAXDEPTH |
@deffn {Macro} YYMAXDEPTH |
6477 |
Macro for specifying the maximum size of the parser stack. @xref{Stack |
Macro for specifying the maximum size of the parser stack. @xref{Stack |
6478 |
Overflow}. |
Overflow}. |
6497 |
to anything else. |
to anything else. |
6498 |
@end deffn |
@end deffn |
6499 |
|
|
6500 |
@deffn {Macro} YYSTYPE |
@deffn {Type} YYSTYPE |
6501 |
Macro for the data type of semantic values; @code{int} by default. |
Data type of semantic values; @code{int} by default. |
6502 |
@xref{Value Type, ,Data Types of Semantic Values}. |
@xref{Value Type, ,Data Types of Semantic Values}. |
6503 |
@end deffn |
@end deffn |
6504 |
|
|