115 |
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH |
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH |
116 |
# symbols on RHS. |
# symbols on RHS. |
117 |
m4_define([b4_rhs_value], |
m4_define([b4_rhs_value], |
118 |
[yyvsp@<:@m4_eval([$2 - $1])@:>@.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3])]) |
[yyvsp@{m4_eval([$2 - $1])@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3])]) |
119 |
|
|
120 |
|
|
121 |
|
|
135 |
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols |
# Expansion of @NUM, where the current rule has RULE-LENGTH symbols |
136 |
# on RHS. |
# on RHS. |
137 |
m4_define([b4_rhs_location], |
m4_define([b4_rhs_location], |
138 |
[yyvsp@<:@m4_eval([$2 - $1])@:>@.yystate.yyloc]) |
[yyvsp@{m4_eval([$2 - $1])@}.yystate.yyloc]) |
|
|
|
|
|
|
|
|
|
|
## ------------------- ## |
|
|
## Output file names. ## |
|
|
## ------------------- ## |
|
|
|
|
|
m4_define_default([b4_input_suffix], [.y]) |
|
|
|
|
|
m4_define_default([b4_output_parser_suffix], |
|
|
[m4_translit(b4_input_suffix, [yY], [cC])]) |
|
|
|
|
|
m4_define_default([b4_output_parser_name], |
|
|
[b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]]) |
|
|
|
|
|
|
|
|
m4_define_default([b4_output_header_suffix], |
|
|
[m4_translit(b4_input_suffix, [yY], [hH])]) |
|
|
|
|
|
m4_define_default([b4_output_header_name], |
|
|
[b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]]) |
|
|
|
|
|
m4_define_default([b4_header_guard], |
|
|
[m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name), |
|
|
[[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])]) |
|
139 |
|
|
140 |
|
|
141 |
# We do want M4 expansion after # for CPP macros. |
# We do want M4 expansion after # for CPP macros. |
142 |
m4_changecom() |
m4_changecom() |
143 |
m4_divert(0)dnl |
m4_divert(0)dnl |
144 |
#output "b4_output_parser_name" |
@output @output_parser_name@ |
145 |
b4_copyright([Skeleton parser for GLR parsing with Bison], [2002]) |
b4_copyright([Skeleton parser for GLR parsing with Bison], [2002]) |
146 |
[ |
[ |
147 |
/* This is the parser code for GLR (Generalized LR) parser. */ |
/* This is the parser code for GLR (Generalized LR) parser. */ |
189 |
[b4_syncline([b4_stype_line], [b4_filename]) |
[b4_syncline([b4_stype_line], [b4_filename]) |
190 |
typedef union b4_stype yystype; |
typedef union b4_stype yystype; |
191 |
/* Line __line__ of __file__. */ |
/* Line __line__ of __file__. */ |
192 |
b4_syncline([__oline__], [__ofile__])], |
b4_syncline([@oline@], [@ofile@])], |
193 |
[typedef int yystype;])[ |
[typedef int yystype;])[ |
194 |
# define YYSTYPE yystype |
# define YYSTYPE yystype |
195 |
# define YYSTYPE_IS_TRIVIAL 1 |
# define YYSTYPE_IS_TRIVIAL 1 |
209 |
|
|
210 |
/* Default (constant) values used for initialization for null |
/* Default (constant) values used for initialization for null |
211 |
right-hand sides. Unlike the standard bison.simple template, |
right-hand sides. Unlike the standard bison.simple template, |
212 |
here we set the default values of the $$ and $@ to zeroed-out |
here we set the default values of $$ and $@@ to zeroed-out |
213 |
values. Since the default value of these quantities is undefined, |
values. Since the default value of these quantities is undefined, |
214 |
this behavior is technically correct. */ |
this behavior is technically correct. */ |
215 |
static YYSTYPE yyval_default; |
static YYSTYPE yyval_default; |
219 |
]b4_post_prologue[ |
]b4_post_prologue[ |
220 |
|
|
221 |
]/* Line __line__ of __file__. */ |
]/* Line __line__ of __file__. */ |
222 |
b4_syncline([__oline__], [__ofile__]) |
b4_syncline([@oline@], [@ofile@]) |
223 |
[ |
[ |
224 |
#if ! defined (__cplusplus) |
#if ! defined (__cplusplus) |
225 |
typedef char bool; |
typedef char bool; |
590 |
/** Perform user action for rule number YYN, with RHS length YYRHSLEN, |
/** Perform user action for rule number YYN, with RHS length YYRHSLEN, |
591 |
* and top stack item YYVSP. YYLVALP points to place to put semantic |
* and top stack item YYVSP. YYLVALP points to place to put semantic |
592 |
* value ($$), and yylocp points to place for location information |
* value ($$), and yylocp points to place for location information |
593 |
* (@$). Returns yyok for normal return, yyaccept for YYACCEPT, |
* (@@$). Returns yyok for normal return, yyaccept for YYACCEPT, |
594 |
* yyerr for YYERROR, yyabort for YYABORT. */ |
* yyerr for YYERROR, yyabort for YYABORT. */ |
595 |
static YYRESULTTAG |
static YYRESULTTAG |
596 |
yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, |
yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, |
647 |
# undef yyclearin |
# undef yyclearin |
648 |
# undef YYRECOVERING |
# undef YYRECOVERING |
649 |
/* Line __line__ of __file__. */ |
/* Line __line__ of __file__. */ |
650 |
b4_syncline([__oline__], [__ofile__]) |
b4_syncline([@oline@], [@ofile@]) |
651 |
} |
} |
652 |
|
|
653 |
|
|
1842 |
yy_yypstack (yys->yypred); |
yy_yypstack (yys->yypred); |
1843 |
fprintf (stderr, " -> "); |
fprintf (stderr, " -> "); |
1844 |
} |
} |
1845 |
fprintf (stderr, "%d@%lu", yys->yylrState, (unsigned long) yys->yyposn); |
fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long) yys->yyposn); |
1846 |
} |
} |
1847 |
|
|
1848 |
static void |
static void |
1902 |
|
|
1903 |
b4_epilogue |
b4_epilogue |
1904 |
m4_if(b4_defines_flag, 0, [], |
m4_if(b4_defines_flag, 0, [], |
1905 |
[#output "b4_output_header_name" |
[@output @output_header_name@ |
1906 |
b4_copyright([Skeleton parser for GLR parsing with Bison], [2002]) |
b4_copyright([Skeleton parser for GLR parsing with Bison], [2002]) |
|
#ifndef b4_header_guard |
|
|
# define b4_header_guard |
|
1907 |
|
|
1908 |
b4_token_defines(b4_tokens) |
b4_token_defines(b4_tokens) |
1909 |
|
|
1912 |
[b4_syncline([b4_stype_line], [b4_filename]) |
[b4_syncline([b4_stype_line], [b4_filename]) |
1913 |
typedef union b4_stype yystype; |
typedef union b4_stype yystype; |
1914 |
/* Line __line__ of __file__. */ |
/* Line __line__ of __file__. */ |
1915 |
b4_syncline([__oline__], [__ofile__])], |
b4_syncline([@oline@], [@ofile@])], |
1916 |
[typedef int yystype;]) |
[typedef int yystype;]) |
1917 |
# define YYSTYPE yystype |
# define YYSTYPE yystype |
1918 |
|
# define YYSTYPE_IS_TRIVIAL 1 |
1919 |
#endif |
#endif |
1920 |
|
|
1921 |
b4_pure_if([], |
b4_pure_if([], |
1936 |
m4_if(b4_pure, [0], |
m4_if(b4_pure, [0], |
1937 |
[extern YYLTYPE b4_prefix[]lloc;]) |
[extern YYLTYPE b4_prefix[]lloc;]) |
1938 |
]) |
]) |
|
#endif /* not b4_header_guard */ |
|
1939 |
]) |
]) |