133 |
## Defining symbol actions, e.g., printers and destructors. ## |
## Defining symbol actions, e.g., printers and destructors. ## |
134 |
## --------------------------------------------------------- ## |
## --------------------------------------------------------- ## |
135 |
|
|
|
# b4_symbol_actions(FILENAME, LINENO, |
|
|
# SYMBOL-TAG, SYMBOL-NUM, |
|
|
# SYMBOL-ACTION, SYMBOL-TYPENAME) |
|
|
# ------------------------------------------------- |
|
|
m4_define([b4_symbol_actions], |
|
|
[m4_pushdef([b4_dollar_dollar], [yyvalue.$6])dnl |
|
|
m4_pushdef([b4_at_dollar], [yylocation])dnl |
|
|
case $4: /* $3 */ |
|
|
b4_syncline([$2], [$1]) |
|
|
$5; |
|
|
b4_syncline([@oline@], [@ofile@]) |
|
|
break; |
|
|
m4_popdef([b4_at_dollar])dnl |
|
|
m4_popdef([b4_dollar_dollar])dnl |
|
|
]) |
|
|
|
|
|
|
|
136 |
# We do want M4 expansion after # for CPP macros. |
# We do want M4 expansion after # for CPP macros. |
137 |
m4_changecom() |
m4_changecom() |
138 |
m4_divert(0)dnl |
m4_divert(0)dnl |
331 |
|
|
332 |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
333 |
#define YYUNDEFTOK b4_undef_token_number |
#define YYUNDEFTOK b4_undef_token_number |
334 |
#define YYMAXUTOK b4_user_token_number_max |
#define YYMAXUTOK b4_user_token_number_max[ |
335 |
|
|
336 |
#define YYTRANSLATE(X) \ |
#define YYTRANSLATE(YYX) \ |
337 |
((unsigned)(X) <= YYMAXUTOK ? yytranslate[[X]] : YYUNDEFTOK) |
((YYX <= 0) ? YYEOF : \ |
338 |
|
(unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
339 |
|
|
340 |
/* YYTRANSLATE[[YYLEX]] -- Bison symbol number corresponding to YYLEX. */ |
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
341 |
static const b4_int_type_for([b4_translate]) yytranslate[[]] = |
static const ]b4_int_type_for([b4_translate])[ yytranslate[] = |
342 |
{ |
{ |
343 |
b4_translate |
]b4_translate |
344 |
}; |
}; |
345 |
|
|
346 |
#if YYDEBUG |
#if YYDEBUG |
461 |
#endif |
#endif |
462 |
|
|
463 |
#define yyerrok (yyerrstatus = 0) |
#define yyerrok (yyerrstatus = 0) |
464 |
#define yyclearin (yychar = YYEMPTY) |
#define yyclearin (yytoken = YYEMPTY) |
465 |
#define YYEMPTY -2 |
#define YYEMPTY -2 |
466 |
#define YYEOF 0 |
#define YYEOF 0 |
467 |
|
|
479 |
|
|
480 |
#define YYBACKUP(Token, Value) \ |
#define YYBACKUP(Token, Value) \ |
481 |
do \ |
do \ |
482 |
if (yychar == YYEMPTY && yylen == 1) \ |
if (yytoken == YYEMPTY && yylen == 1) \ |
483 |
{ \ |
{ \ |
484 |
yychar = (Token); \ |
yychar = (Token); \ |
485 |
yylval = (Value); \ |
yylval = (Value); \ |
486 |
yychar1 = YYTRANSLATE (yychar); \ |
yytoken = YYTRANSLATE (yychar); \ |
487 |
YYPOPSTACK; \ |
YYPOPSTACK; \ |
488 |
goto yybackup; \ |
goto yybackup; \ |
489 |
} \ |
} \ |
656 |
} |
} |
657 |
#endif /* YYDEBUG. */ |
#endif /* YYDEBUG. */ |
658 |
|
|
659 |
|
b4_yydestruct_generate([b4_c_function_def]) |
|
/*-----------------------------------------------. |
|
|
| Release the memory associated to this symbol. | |
|
|
`-----------------------------------------------*/ |
|
|
|
|
|
b4_c_function_def([yydestruct], |
|
|
[static void], |
|
|
[[int yytype], [yytype]], |
|
|
[[YYSTYPE yyvalue], [yyvalue]]b4_location_if([, |
|
|
[[YYLTYPE yylocation], [yylocation]]])) |
|
|
{ |
|
|
/* Pacify ``unused variable'' warnings. */ |
|
|
(void) yyvalue; |
|
|
b4_location_if([ (void) yylocation; |
|
|
])dnl |
|
|
|
|
|
switch (yytype) |
|
|
{ |
|
|
m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))dnl |
|
|
default: |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
660 |
|
|
661 |
|
|
662 |
/* Prevent warnings from -Wmissing-prototypes. */ |
/* Prevent warnings from -Wmissing-prototypes. */ |
717 |
/* Number of tokens to shift before error messages enabled. */ |
/* Number of tokens to shift before error messages enabled. */ |
718 |
int yyerrstatus; |
int yyerrstatus; |
719 |
/* Lookahead token as an internal (translated) token number. */ |
/* Lookahead token as an internal (translated) token number. */ |
720 |
int yychar1 = 0; |
int yytoken = 0; |
721 |
|
|
722 |
/* Three stacks and their tools: |
/* Three stacks and their tools: |
723 |
`yyss': related to states, |
`yyss': related to states, |
761 |
yystate = 0; |
yystate = 0; |
762 |
yyerrstatus = 0; |
yyerrstatus = 0; |
763 |
yynerrs = 0; |
yynerrs = 0; |
764 |
yychar = YYEMPTY; /* Cause a token to be read. */ |
yychar = yytoken = YYEMPTY; /* Cause a token to be read. */ |
765 |
|
|
766 |
/* Initialize stack pointers. |
/* Initialize stack pointers. |
767 |
Waste one element of value and location stack |
Waste one element of value and location stack |
871 |
|
|
872 |
/* Not known => get a lookahead token if don't already have one. */ |
/* Not known => get a lookahead token if don't already have one. */ |
873 |
|
|
874 |
/* yychar is either YYEMPTY or YYEOF |
/* YYTOKEN is either YYEMPTY or YYEOF or a valid token. */ |
875 |
or a valid token in external form. */ |
if (yytoken == YYEMPTY) |
|
|
|
|
if (yychar == YYEMPTY) |
|
876 |
{ |
{ |
877 |
YYDPRINTF ((stderr, "Reading a token: ")); |
YYDPRINTF ((stderr, "Reading a token: ")); |
878 |
yychar = YYLEX; |
yychar = YYLEX; |
879 |
|
yytoken = YYTRANSLATE (yychar); |
880 |
} |
} |
881 |
|
|
882 |
/* Convert token to internal form (in yychar1) for indexing tables with. */ |
if (yytoken == YYEOF) |
|
|
|
|
if (yychar <= 0) /* This means end of input. */ |
|
883 |
{ |
{ |
|
yychar1 = 0; |
|
|
yychar = YYEOF; /* Don't call YYLEX any more. */ |
|
|
|
|
884 |
YYDPRINTF ((stderr, "Now at end of input.\n")); |
YYDPRINTF ((stderr, "Now at end of input.\n")); |
885 |
} |
} |
886 |
else |
else |
887 |
{ |
{ |
|
yychar1 = YYTRANSLATE (yychar); |
|
|
|
|
888 |
/* We have to keep this `#if YYDEBUG', since we use variables |
/* We have to keep this `#if YYDEBUG', since we use variables |
889 |
which are defined only if `YYDEBUG' is set. */ |
which are defined only if `YYDEBUG' is set. */ |
890 |
YYDPRINTF ((stderr, "Next token is ")); |
YYDPRINTF ((stderr, "Next token is ")); |
891 |
YYDSYMPRINT ((stderr, yychar1, yylval]b4_location_if([, yyloc])[)); |
YYDSYMPRINT ((stderr, yytoken, yylval]b4_location_if([, yyloc])[)); |
892 |
YYDPRINTF ((stderr, "\n")); |
YYDPRINTF ((stderr, "\n")); |
893 |
} |
} |
894 |
|
|
895 |
/* If the proper action on seeing token YYCHAR1 is to reduce or to |
/* If the proper action on seeing token YYTOKEN is to reduce or to |
896 |
detect an error, take that action. */ |
detect an error, take that action. */ |
897 |
yyn += yychar1; |
yyn += yytoken; |
898 |
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) |
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
899 |
goto yydefault; |
goto yydefault; |
900 |
yyn = yytable[yyn]; |
yyn = yytable[yyn]; |
901 |
if (yyn <= 0) |
if (yyn <= 0) |
911 |
|
|
912 |
/* Shift the lookahead token. */ |
/* Shift the lookahead token. */ |
913 |
YYDPRINTF ((stderr, "Shifting token %d (%s), ", |
YYDPRINTF ((stderr, "Shifting token %d (%s), ", |
914 |
yychar, yytname[yychar1])); |
yytoken, yytname[yytoken])); |
915 |
|
|
916 |
/* Discard the token being shifted unless it is eof. */ |
/* Discard the token being shifted unless it is eof. */ |
917 |
if (yychar != YYEOF) |
if (yytoken != YYEOF) |
918 |
yychar = YYEMPTY; |
yytoken = YYEMPTY; |
919 |
|
|
920 |
*++yyvsp = yylval; |
*++yyvsp = yylval; |
921 |
]b4_location_if([ *++yylsp = yylloc;])[ |
]b4_location_if([ *++yylsp = yylloc;])[ |
1087 |
error, discard it. */ |
error, discard it. */ |
1088 |
|
|
1089 |
/* Return failure if at end of input. */ |
/* Return failure if at end of input. */ |
1090 |
if (yychar == YYEOF) |
if (yytoken == YYEOF) |
1091 |
{ |
{ |
1092 |
/* Pop the error token. */ |
/* Pop the error token. */ |
1093 |
YYPOPSTACK; |
YYPOPSTACK; |
1106 |
} |
} |
1107 |
|
|
1108 |
YYDPRINTF ((stderr, "Discarding token %d (%s).\n", |
YYDPRINTF ((stderr, "Discarding token %d (%s).\n", |
1109 |
yychar, yytname[yychar1])); |
yytoken, yytname[yytoken])); |
1110 |
yydestruct (yychar1, yylval]b4_location_if([, yylloc])[); |
yydestruct (yytoken, yylval]b4_location_if([, yylloc])[); |
1111 |
yychar = YYEMPTY; |
yytoken = YYEMPTY; |
1112 |
} |
} |
1113 |
|
|
1114 |
/* Else will try to reuse lookahead token after shifting the error |
/* Else will try to reuse lookahead token after shifting the error |