xref: /freebsd/contrib/byacc/test/btyacc/quote_calc2-s.tab.c (revision 8e022d3cdea10ee1039a632f670c27fd93f65625)
10c8de5b0SBaptiste Daroussin /* original parser id follows */
20c8de5b0SBaptiste Daroussin /* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
3c5b5d71aSJung-uk Kim /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
40c8de5b0SBaptiste Daroussin 
50c8de5b0SBaptiste Daroussin #define YYBYACC 1
6*8e022d3cSDag-Erling Smørgrav #define YYMAJOR 2
7*8e022d3cSDag-Erling Smørgrav #define YYMINOR 0
80c8de5b0SBaptiste Daroussin #define YYCHECK "yyyymmdd"
90c8de5b0SBaptiste Daroussin 
100c8de5b0SBaptiste Daroussin #define YYEMPTY        (-1)
110c8de5b0SBaptiste Daroussin #define yyclearin      (yychar = YYEMPTY)
120c8de5b0SBaptiste Daroussin #define yyerrok        (yyerrflag = 0)
130c8de5b0SBaptiste Daroussin #define YYRECOVERING() (yyerrflag != 0)
140c8de5b0SBaptiste Daroussin #define YYENOMEM       (-2)
150c8de5b0SBaptiste Daroussin #define YYEOF          0
160c8de5b0SBaptiste Daroussin #undef YYBTYACC
170c8de5b0SBaptiste Daroussin #define YYBTYACC 0
180c8de5b0SBaptiste Daroussin #define YYDEBUGSTR YYPREFIX "debug"
190c8de5b0SBaptiste Daroussin 
200c8de5b0SBaptiste Daroussin #ifndef yyparse
210c8de5b0SBaptiste Daroussin #define yyparse    quote_calc2_parse
220c8de5b0SBaptiste Daroussin #endif /* yyparse */
230c8de5b0SBaptiste Daroussin 
240c8de5b0SBaptiste Daroussin #ifndef yylex
250c8de5b0SBaptiste Daroussin #define yylex      quote_calc2_lex
260c8de5b0SBaptiste Daroussin #endif /* yylex */
270c8de5b0SBaptiste Daroussin 
280c8de5b0SBaptiste Daroussin #ifndef yyerror
290c8de5b0SBaptiste Daroussin #define yyerror    quote_calc2_error
300c8de5b0SBaptiste Daroussin #endif /* yyerror */
310c8de5b0SBaptiste Daroussin 
320c8de5b0SBaptiste Daroussin #ifndef yychar
330c8de5b0SBaptiste Daroussin #define yychar     quote_calc2_char
340c8de5b0SBaptiste Daroussin #endif /* yychar */
350c8de5b0SBaptiste Daroussin 
360c8de5b0SBaptiste Daroussin #ifndef yyval
370c8de5b0SBaptiste Daroussin #define yyval      quote_calc2_val
380c8de5b0SBaptiste Daroussin #endif /* yyval */
390c8de5b0SBaptiste Daroussin 
400c8de5b0SBaptiste Daroussin #ifndef yylval
410c8de5b0SBaptiste Daroussin #define yylval     quote_calc2_lval
420c8de5b0SBaptiste Daroussin #endif /* yylval */
430c8de5b0SBaptiste Daroussin 
440c8de5b0SBaptiste Daroussin #ifndef yydebug
450c8de5b0SBaptiste Daroussin #define yydebug    quote_calc2_debug
460c8de5b0SBaptiste Daroussin #endif /* yydebug */
470c8de5b0SBaptiste Daroussin 
480c8de5b0SBaptiste Daroussin #ifndef yynerrs
490c8de5b0SBaptiste Daroussin #define yynerrs    quote_calc2_nerrs
500c8de5b0SBaptiste Daroussin #endif /* yynerrs */
510c8de5b0SBaptiste Daroussin 
520c8de5b0SBaptiste Daroussin #ifndef yyerrflag
530c8de5b0SBaptiste Daroussin #define yyerrflag  quote_calc2_errflag
540c8de5b0SBaptiste Daroussin #endif /* yyerrflag */
550c8de5b0SBaptiste Daroussin 
560c8de5b0SBaptiste Daroussin #ifndef yylhs
570c8de5b0SBaptiste Daroussin #define yylhs      quote_calc2_lhs
580c8de5b0SBaptiste Daroussin #endif /* yylhs */
590c8de5b0SBaptiste Daroussin 
600c8de5b0SBaptiste Daroussin #ifndef yylen
610c8de5b0SBaptiste Daroussin #define yylen      quote_calc2_len
620c8de5b0SBaptiste Daroussin #endif /* yylen */
630c8de5b0SBaptiste Daroussin 
640c8de5b0SBaptiste Daroussin #ifndef yydefred
650c8de5b0SBaptiste Daroussin #define yydefred   quote_calc2_defred
660c8de5b0SBaptiste Daroussin #endif /* yydefred */
670c8de5b0SBaptiste Daroussin 
680c8de5b0SBaptiste Daroussin #ifndef yystos
690c8de5b0SBaptiste Daroussin #define yystos     quote_calc2_stos
700c8de5b0SBaptiste Daroussin #endif /* yystos */
710c8de5b0SBaptiste Daroussin 
720c8de5b0SBaptiste Daroussin #ifndef yydgoto
730c8de5b0SBaptiste Daroussin #define yydgoto    quote_calc2_dgoto
740c8de5b0SBaptiste Daroussin #endif /* yydgoto */
750c8de5b0SBaptiste Daroussin 
760c8de5b0SBaptiste Daroussin #ifndef yysindex
770c8de5b0SBaptiste Daroussin #define yysindex   quote_calc2_sindex
780c8de5b0SBaptiste Daroussin #endif /* yysindex */
790c8de5b0SBaptiste Daroussin 
800c8de5b0SBaptiste Daroussin #ifndef yyrindex
810c8de5b0SBaptiste Daroussin #define yyrindex   quote_calc2_rindex
820c8de5b0SBaptiste Daroussin #endif /* yyrindex */
830c8de5b0SBaptiste Daroussin 
840c8de5b0SBaptiste Daroussin #ifndef yygindex
850c8de5b0SBaptiste Daroussin #define yygindex   quote_calc2_gindex
860c8de5b0SBaptiste Daroussin #endif /* yygindex */
870c8de5b0SBaptiste Daroussin 
880c8de5b0SBaptiste Daroussin #ifndef yytable
890c8de5b0SBaptiste Daroussin #define yytable    quote_calc2_table
900c8de5b0SBaptiste Daroussin #endif /* yytable */
910c8de5b0SBaptiste Daroussin 
920c8de5b0SBaptiste Daroussin #ifndef yycheck
930c8de5b0SBaptiste Daroussin #define yycheck    quote_calc2_check
940c8de5b0SBaptiste Daroussin #endif /* yycheck */
950c8de5b0SBaptiste Daroussin 
960c8de5b0SBaptiste Daroussin #ifndef yyname
970c8de5b0SBaptiste Daroussin #define yyname     quote_calc2_name
980c8de5b0SBaptiste Daroussin #endif /* yyname */
990c8de5b0SBaptiste Daroussin 
1000c8de5b0SBaptiste Daroussin #ifndef yyrule
1010c8de5b0SBaptiste Daroussin #define yyrule     quote_calc2_rule
1020c8de5b0SBaptiste Daroussin #endif /* yyrule */
1030c8de5b0SBaptiste Daroussin 
1040c8de5b0SBaptiste Daroussin #if YYBTYACC
1050c8de5b0SBaptiste Daroussin 
1060c8de5b0SBaptiste Daroussin #ifndef yycindex
1070c8de5b0SBaptiste Daroussin #define yycindex   quote_calc2_cindex
1080c8de5b0SBaptiste Daroussin #endif /* yycindex */
1090c8de5b0SBaptiste Daroussin 
1100c8de5b0SBaptiste Daroussin #ifndef yyctable
1110c8de5b0SBaptiste Daroussin #define yyctable   quote_calc2_ctable
1120c8de5b0SBaptiste Daroussin #endif /* yyctable */
1130c8de5b0SBaptiste Daroussin 
1140c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
1150c8de5b0SBaptiste Daroussin 
1160c8de5b0SBaptiste Daroussin #define YYPREFIX "quote_calc2_"
1170c8de5b0SBaptiste Daroussin 
1180c8de5b0SBaptiste Daroussin #define YYPURE 0
1190c8de5b0SBaptiste Daroussin 
1200c8de5b0SBaptiste Daroussin #line 2 "quote_calc2.y"
1210c8de5b0SBaptiste Daroussin # include <stdio.h>
1220c8de5b0SBaptiste Daroussin # include <ctype.h>
1230c8de5b0SBaptiste Daroussin 
1240c8de5b0SBaptiste Daroussin int regs[26];
1250c8de5b0SBaptiste Daroussin int base;
1260c8de5b0SBaptiste Daroussin 
1270c8de5b0SBaptiste Daroussin int yylex(void);
1280c8de5b0SBaptiste Daroussin static void yyerror(const char *s);
1290c8de5b0SBaptiste Daroussin 
1300c8de5b0SBaptiste Daroussin #line 131 "quote_calc2-s.tab.c"
1310c8de5b0SBaptiste Daroussin 
1320c8de5b0SBaptiste Daroussin #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
1330c8de5b0SBaptiste Daroussin /* Default: YYSTYPE is the semantic value type. */
1340c8de5b0SBaptiste Daroussin typedef int YYSTYPE;
1350c8de5b0SBaptiste Daroussin # define YYSTYPE_IS_DECLARED 1
1360c8de5b0SBaptiste Daroussin #endif
1370c8de5b0SBaptiste Daroussin 
1380c8de5b0SBaptiste Daroussin /* compatibility with bison */
1390c8de5b0SBaptiste Daroussin #ifdef YYPARSE_PARAM
1400c8de5b0SBaptiste Daroussin /* compatibility with FreeBSD */
1410c8de5b0SBaptiste Daroussin # ifdef YYPARSE_PARAM_TYPE
1420c8de5b0SBaptiste Daroussin #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
1430c8de5b0SBaptiste Daroussin # else
1440c8de5b0SBaptiste Daroussin #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
1450c8de5b0SBaptiste Daroussin # endif
1460c8de5b0SBaptiste Daroussin #else
1470c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(void)
1480c8de5b0SBaptiste Daroussin #endif
1490c8de5b0SBaptiste Daroussin 
1500c8de5b0SBaptiste Daroussin /* Parameters sent to lex. */
1510c8de5b0SBaptiste Daroussin #ifdef YYLEX_PARAM
1520c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
1530c8de5b0SBaptiste Daroussin # define YYLEX yylex(YYLEX_PARAM)
1540c8de5b0SBaptiste Daroussin #else
1550c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(void)
1560c8de5b0SBaptiste Daroussin # define YYLEX yylex()
1570c8de5b0SBaptiste Daroussin #endif
1580c8de5b0SBaptiste Daroussin 
1590c8de5b0SBaptiste Daroussin /* Parameters sent to yyerror. */
1600c8de5b0SBaptiste Daroussin #ifndef YYERROR_DECL
1610c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(const char *s)
1620c8de5b0SBaptiste Daroussin #endif
1630c8de5b0SBaptiste Daroussin #ifndef YYERROR_CALL
1640c8de5b0SBaptiste Daroussin #define YYERROR_CALL(msg) yyerror(msg)
1650c8de5b0SBaptiste Daroussin #endif
1660c8de5b0SBaptiste Daroussin 
1670c8de5b0SBaptiste Daroussin extern int YYPARSE_DECL();
1680c8de5b0SBaptiste Daroussin 
1690c8de5b0SBaptiste Daroussin #define OP_ADD 257
1700c8de5b0SBaptiste Daroussin #define OP_SUB 259
1710c8de5b0SBaptiste Daroussin #define OP_MUL 261
1720c8de5b0SBaptiste Daroussin #define OP_DIV 263
1730c8de5b0SBaptiste Daroussin #define OP_MOD 265
1740c8de5b0SBaptiste Daroussin #define OP_AND 267
1750c8de5b0SBaptiste Daroussin #define DIGIT 269
1760c8de5b0SBaptiste Daroussin #define LETTER 270
1770c8de5b0SBaptiste Daroussin #define UMINUS 271
1780c8de5b0SBaptiste Daroussin #define YYERRCODE 256
179b53bb29fSJung-uk Kim typedef int YYINT;
1800c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_lhs[] = {                 -1,
1810c8de5b0SBaptiste Daroussin     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
1820c8de5b0SBaptiste Daroussin     2,    2,    2,    2,    2,    2,    3,    3,
1830c8de5b0SBaptiste Daroussin };
1840c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_len[] = {                  2,
1850c8de5b0SBaptiste Daroussin     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
1860c8de5b0SBaptiste Daroussin     3,    3,    3,    2,    1,    1,    1,    2,
1870c8de5b0SBaptiste Daroussin };
1880c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_defred[] = {               1,
1890c8de5b0SBaptiste Daroussin     0,    0,    0,   17,    0,    0,    0,    0,    0,    3,
1900c8de5b0SBaptiste Daroussin    15,    0,    0,    0,    2,    0,    0,    0,    0,    0,
1910c8de5b0SBaptiste Daroussin     0,    0,   18,    0,    6,    0,    0,    0,    0,    0,
1920c8de5b0SBaptiste Daroussin     0,    0,
1930c8de5b0SBaptiste Daroussin };
1942aca18c7SJung-uk Kim #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
1950c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_stos[] = {                 0,
1960c8de5b0SBaptiste Daroussin   273,  256,  260,  269,  270,   40,  274,  275,  276,   10,
1970c8de5b0SBaptiste Daroussin   270,  275,   61,  275,   10,  258,  260,  262,  264,  266,
1980c8de5b0SBaptiste Daroussin   268,  124,  269,  275,   41,  275,  275,  275,  275,  275,
1990c8de5b0SBaptiste Daroussin   275,  275,
2000c8de5b0SBaptiste Daroussin };
2012aca18c7SJung-uk Kim #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
2020c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_dgoto[] = {                1,
2030c8de5b0SBaptiste Daroussin     7,    8,    9,
2040c8de5b0SBaptiste Daroussin };
2050c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_sindex[] = {               0,
2060c8de5b0SBaptiste Daroussin   -38,    4,  -36,    0,  -51,  -36,    6, -121, -249,    0,
2070c8de5b0SBaptiste Daroussin     0, -243,  -36,  -23,    0,  -36,  -36,  -36,  -36,  -36,
2080c8de5b0SBaptiste Daroussin   -36,  -36,    0, -121,    0, -121, -121, -121, -121, -121,
2090c8de5b0SBaptiste Daroussin  -121, -243,
2100c8de5b0SBaptiste Daroussin };
2110c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_rindex[] = {               0,
2120c8de5b0SBaptiste Daroussin     0,    0,    0,    0,   -9,    0,    0,   12,  -10,    0,
2130c8de5b0SBaptiste Daroussin     0,   -5,    0,    0,    0,    0,    0,    0,    0,    0,
2140c8de5b0SBaptiste Daroussin     0,    0,    0,   14,    0,   -3,   -2,   -1,    1,    2,
2150c8de5b0SBaptiste Daroussin     3,   -4,
2160c8de5b0SBaptiste Daroussin };
2170c8de5b0SBaptiste Daroussin #if YYBTYACC
2180c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_cindex[] = {               0,
2190c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2200c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2210c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2220c8de5b0SBaptiste Daroussin     0,    0,
2230c8de5b0SBaptiste Daroussin };
2240c8de5b0SBaptiste Daroussin #endif
2250c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_gindex[] = {               0,
2260c8de5b0SBaptiste Daroussin     0,   42,    0,
2270c8de5b0SBaptiste Daroussin };
2280c8de5b0SBaptiste Daroussin #define YYTABLESIZE 259
2290c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_table[] = {               16,
2300c8de5b0SBaptiste Daroussin    15,    6,   22,    6,   14,   13,    7,    8,    9,   13,
2310c8de5b0SBaptiste Daroussin    10,   11,   12,   10,   16,   15,   17,   25,   18,   23,
2320c8de5b0SBaptiste Daroussin    19,    4,   20,    5,   21,    0,    0,    0,    0,    0,
2330c8de5b0SBaptiste Daroussin    16,    0,    0,    0,    0,   14,   13,    7,    8,    9,
2340c8de5b0SBaptiste Daroussin     0,   10,   11,   12,   12,    0,    0,   14,    0,    0,
2350c8de5b0SBaptiste Daroussin     0,    0,    0,    0,   24,    0,    0,   26,   27,   28,
2360c8de5b0SBaptiste Daroussin    29,   30,   31,   32,    0,    0,    0,    0,    0,    0,
2370c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2380c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2390c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2400c8de5b0SBaptiste Daroussin    22,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2410c8de5b0SBaptiste Daroussin     0,    0,    0,   16,   15,    0,    0,    0,   14,   13,
2420c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2430c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,   16,    0,   17,    0,
2440c8de5b0SBaptiste Daroussin    18,    0,   19,    0,   20,    0,   21,    0,    0,    0,
2450c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2460c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2470c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2480c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2490c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2500c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
2510c8de5b0SBaptiste Daroussin     0,    0,    0,    0,    0,    0,    0,    2,    0,    0,
2520c8de5b0SBaptiste Daroussin     0,    3,    0,    3,    0,    0,    0,    0,    0,    0,
2530c8de5b0SBaptiste Daroussin     4,    5,    4,   11,   16,    0,   17,    0,   18,    0,
2540c8de5b0SBaptiste Daroussin    19,    0,   20,    0,   21,    0,    0,   16,   15,   16,
2550c8de5b0SBaptiste Daroussin    15,   16,   15,   16,   15,   16,   15,   16,   15,
2560c8de5b0SBaptiste Daroussin };
2570c8de5b0SBaptiste Daroussin static const YYINT quote_calc2_check[] = {               10,
2580c8de5b0SBaptiste Daroussin    10,   40,  124,   40,   10,   10,   10,   10,   10,   61,
2590c8de5b0SBaptiste Daroussin    10,   10,   10,   10,  258,   10,  260,   41,  262,  269,
2600c8de5b0SBaptiste Daroussin   264,   10,  266,   10,  268,   -1,   -1,   -1,   -1,   -1,
2610c8de5b0SBaptiste Daroussin    41,   -1,   -1,   -1,   -1,   41,   41,   41,   41,   41,
2620c8de5b0SBaptiste Daroussin    -1,   41,   41,   41,    3,   -1,   -1,    6,   -1,   -1,
2630c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   13,   -1,   -1,   16,   17,   18,
2640c8de5b0SBaptiste Daroussin    19,   20,   21,   22,   -1,   -1,   -1,   -1,   -1,   -1,
2650c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2660c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2670c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2680c8de5b0SBaptiste Daroussin   124,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2690c8de5b0SBaptiste Daroussin    -1,   -1,   -1,  124,  124,   -1,   -1,   -1,  124,  124,
2700c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2710c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,  258,   -1,  260,   -1,
2720c8de5b0SBaptiste Daroussin   262,   -1,  264,   -1,  266,   -1,  268,   -1,   -1,   -1,
2730c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2740c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2750c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2760c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2770c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2780c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
2790c8de5b0SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,  256,   -1,   -1,
2800c8de5b0SBaptiste Daroussin    -1,  260,   -1,  260,   -1,   -1,   -1,   -1,   -1,   -1,
2810c8de5b0SBaptiste Daroussin   269,  270,  269,  270,  258,   -1,  260,   -1,  262,   -1,
2820c8de5b0SBaptiste Daroussin   264,   -1,  266,   -1,  268,   -1,   -1,  258,  258,  260,
2830c8de5b0SBaptiste Daroussin   260,  262,  262,  264,  264,  266,  266,  268,  268,
2840c8de5b0SBaptiste Daroussin };
28511fce282SBaptiste Daroussin #if YYBTYACC
28611fce282SBaptiste Daroussin static const YYINT quote_calc2_ctable[] = {              -1,
28711fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
28811fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
28911fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29011fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29111fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29211fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29311fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29411fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29511fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29611fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29711fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29811fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
29911fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30011fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30111fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30211fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30311fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30411fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30511fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30611fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30711fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30811fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
30911fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
31011fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
31111fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
31211fce282SBaptiste Daroussin    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
31311fce282SBaptiste Daroussin };
31411fce282SBaptiste Daroussin #endif
3150c8de5b0SBaptiste Daroussin #define YYFINAL 1
3160c8de5b0SBaptiste Daroussin #ifndef YYDEBUG
3170c8de5b0SBaptiste Daroussin #define YYDEBUG 0
3180c8de5b0SBaptiste Daroussin #endif
3190c8de5b0SBaptiste Daroussin #define YYMAXTOKEN 271
3200c8de5b0SBaptiste Daroussin #define YYUNDFTOKEN 277
3210c8de5b0SBaptiste Daroussin #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
3220c8de5b0SBaptiste Daroussin #if YYDEBUG
3230c8de5b0SBaptiste Daroussin static const char *const quote_calc2_name[] = {
3240c8de5b0SBaptiste Daroussin 
3250c8de5b0SBaptiste Daroussin "$end",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3260c8de5b0SBaptiste Daroussin 0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,
3270c8de5b0SBaptiste Daroussin 0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3280c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0,0,0,0,
3290c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3300c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3310c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3320c8de5b0SBaptiste Daroussin 0,0,"error","OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV",
3330c8de5b0SBaptiste Daroussin "\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS",
3340c8de5b0SBaptiste Daroussin "$accept","list","stat","expr","number","illegal-symbol",
3350c8de5b0SBaptiste Daroussin };
3360c8de5b0SBaptiste Daroussin static const char *const quote_calc2_rule[] = {
3370c8de5b0SBaptiste Daroussin "$accept : list",
3380c8de5b0SBaptiste Daroussin "list :",
3390c8de5b0SBaptiste Daroussin "list : list stat '\\n'",
3400c8de5b0SBaptiste Daroussin "list : list error '\\n'",
3410c8de5b0SBaptiste Daroussin "stat : expr",
3420c8de5b0SBaptiste Daroussin "stat : LETTER '=' expr",
3430c8de5b0SBaptiste Daroussin "expr : '(' expr ')'",
3440c8de5b0SBaptiste Daroussin "expr : expr \"ADD\" expr",
3450c8de5b0SBaptiste Daroussin "expr : expr \"SUB\" expr",
3460c8de5b0SBaptiste Daroussin "expr : expr \"MUL\" expr",
3470c8de5b0SBaptiste Daroussin "expr : expr \"DIV\" expr",
3480c8de5b0SBaptiste Daroussin "expr : expr \"MOD\" expr",
3490c8de5b0SBaptiste Daroussin "expr : expr \"AND\" expr",
3500c8de5b0SBaptiste Daroussin "expr : expr '|' expr",
3510c8de5b0SBaptiste Daroussin "expr : \"SUB\" expr",
3520c8de5b0SBaptiste Daroussin "expr : LETTER",
3530c8de5b0SBaptiste Daroussin "expr : number",
3540c8de5b0SBaptiste Daroussin "number : DIGIT",
3550c8de5b0SBaptiste Daroussin "number : number DIGIT",
3560c8de5b0SBaptiste Daroussin 
3570c8de5b0SBaptiste Daroussin };
3580c8de5b0SBaptiste Daroussin #endif
3590c8de5b0SBaptiste Daroussin 
360b53bb29fSJung-uk Kim #if YYDEBUG
3610c8de5b0SBaptiste Daroussin int      yydebug;
362b53bb29fSJung-uk Kim #endif
3630c8de5b0SBaptiste Daroussin 
3640c8de5b0SBaptiste Daroussin int      yyerrflag;
3650c8de5b0SBaptiste Daroussin int      yychar;
3660c8de5b0SBaptiste Daroussin YYSTYPE  yyval;
3670c8de5b0SBaptiste Daroussin YYSTYPE  yylval;
368b53bb29fSJung-uk Kim int      yynerrs;
369b53bb29fSJung-uk Kim 
3700c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
3710c8de5b0SBaptiste Daroussin YYLTYPE  yyloc; /* position returned by actions */
3720c8de5b0SBaptiste Daroussin YYLTYPE  yylloc; /* position from the lexer */
3730c8de5b0SBaptiste Daroussin #endif
3740c8de5b0SBaptiste Daroussin 
3750c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
3760c8de5b0SBaptiste Daroussin #ifndef YYLLOC_DEFAULT
3770c8de5b0SBaptiste Daroussin #define YYLLOC_DEFAULT(loc, rhs, n) \
3780c8de5b0SBaptiste Daroussin do \
3790c8de5b0SBaptiste Daroussin { \
3800c8de5b0SBaptiste Daroussin     if (n == 0) \
3810c8de5b0SBaptiste Daroussin     { \
382b53bb29fSJung-uk Kim         (loc).first_line   = YYRHSLOC(rhs, 0).last_line; \
383b53bb29fSJung-uk Kim         (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
384b53bb29fSJung-uk Kim         (loc).last_line    = YYRHSLOC(rhs, 0).last_line; \
385b53bb29fSJung-uk Kim         (loc).last_column  = YYRHSLOC(rhs, 0).last_column; \
3860c8de5b0SBaptiste Daroussin     } \
3870c8de5b0SBaptiste Daroussin     else \
3880c8de5b0SBaptiste Daroussin     { \
389b53bb29fSJung-uk Kim         (loc).first_line   = YYRHSLOC(rhs, 1).first_line; \
390b53bb29fSJung-uk Kim         (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
391b53bb29fSJung-uk Kim         (loc).last_line    = YYRHSLOC(rhs, n).last_line; \
392b53bb29fSJung-uk Kim         (loc).last_column  = YYRHSLOC(rhs, n).last_column; \
3930c8de5b0SBaptiste Daroussin     } \
3940c8de5b0SBaptiste Daroussin } while (0)
3950c8de5b0SBaptiste Daroussin #endif /* YYLLOC_DEFAULT */
3960c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
3970c8de5b0SBaptiste Daroussin #if YYBTYACC
3980c8de5b0SBaptiste Daroussin 
3990c8de5b0SBaptiste Daroussin #ifndef YYLVQUEUEGROWTH
4000c8de5b0SBaptiste Daroussin #define YYLVQUEUEGROWTH 32
4010c8de5b0SBaptiste Daroussin #endif
4020c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
4030c8de5b0SBaptiste Daroussin 
4040c8de5b0SBaptiste Daroussin /* define the initial stack-sizes */
4050c8de5b0SBaptiste Daroussin #ifdef YYSTACKSIZE
4060c8de5b0SBaptiste Daroussin #undef YYMAXDEPTH
4070c8de5b0SBaptiste Daroussin #define YYMAXDEPTH  YYSTACKSIZE
4080c8de5b0SBaptiste Daroussin #else
4090c8de5b0SBaptiste Daroussin #ifdef YYMAXDEPTH
4100c8de5b0SBaptiste Daroussin #define YYSTACKSIZE YYMAXDEPTH
4110c8de5b0SBaptiste Daroussin #else
4120c8de5b0SBaptiste Daroussin #define YYSTACKSIZE 10000
4130c8de5b0SBaptiste Daroussin #define YYMAXDEPTH  10000
4140c8de5b0SBaptiste Daroussin #endif
4150c8de5b0SBaptiste Daroussin #endif
4160c8de5b0SBaptiste Daroussin 
4170c8de5b0SBaptiste Daroussin #ifndef YYINITSTACKSIZE
4180c8de5b0SBaptiste Daroussin #define YYINITSTACKSIZE 200
4190c8de5b0SBaptiste Daroussin #endif
4200c8de5b0SBaptiste Daroussin 
4210c8de5b0SBaptiste Daroussin typedef struct {
4220c8de5b0SBaptiste Daroussin     unsigned stacksize;
423c5b5d71aSJung-uk Kim     YYINT    *s_base;
424c5b5d71aSJung-uk Kim     YYINT    *s_mark;
425c5b5d71aSJung-uk Kim     YYINT    *s_last;
4260c8de5b0SBaptiste Daroussin     YYSTYPE  *l_base;
4270c8de5b0SBaptiste Daroussin     YYSTYPE  *l_mark;
4280c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
4290c8de5b0SBaptiste Daroussin     YYLTYPE  *p_base;
4300c8de5b0SBaptiste Daroussin     YYLTYPE  *p_mark;
4310c8de5b0SBaptiste Daroussin #endif
4320c8de5b0SBaptiste Daroussin } YYSTACKDATA;
4330c8de5b0SBaptiste Daroussin #if YYBTYACC
4340c8de5b0SBaptiste Daroussin 
4350c8de5b0SBaptiste Daroussin struct YYParseState_s
4360c8de5b0SBaptiste Daroussin {
4370c8de5b0SBaptiste Daroussin     struct YYParseState_s *save;    /* Previously saved parser state */
4380c8de5b0SBaptiste Daroussin     YYSTACKDATA            yystack; /* saved parser stack */
4390c8de5b0SBaptiste Daroussin     int                    state;   /* saved parser state */
4400c8de5b0SBaptiste Daroussin     int                    errflag; /* saved error recovery status */
4410c8de5b0SBaptiste Daroussin     int                    lexeme;  /* saved index of the conflict lexeme in the lexical queue */
4420c8de5b0SBaptiste Daroussin     YYINT                  ctry;    /* saved index in yyctable[] for this conflict */
4430c8de5b0SBaptiste Daroussin };
4440c8de5b0SBaptiste Daroussin typedef struct YYParseState_s YYParseState;
4450c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
4460c8de5b0SBaptiste Daroussin /* variables for the parser stack */
4470c8de5b0SBaptiste Daroussin static YYSTACKDATA yystack;
4480c8de5b0SBaptiste Daroussin #if YYBTYACC
4490c8de5b0SBaptiste Daroussin 
4500c8de5b0SBaptiste Daroussin /* Current parser state */
4510c8de5b0SBaptiste Daroussin static YYParseState *yyps = 0;
4520c8de5b0SBaptiste Daroussin 
4530c8de5b0SBaptiste Daroussin /* yypath != NULL: do the full parse, starting at *yypath parser state. */
4540c8de5b0SBaptiste Daroussin static YYParseState *yypath = 0;
4550c8de5b0SBaptiste Daroussin 
4560c8de5b0SBaptiste Daroussin /* Base of the lexical value queue */
4570c8de5b0SBaptiste Daroussin static YYSTYPE *yylvals = 0;
4580c8de5b0SBaptiste Daroussin 
4590c8de5b0SBaptiste Daroussin /* Current position at lexical value queue */
4600c8de5b0SBaptiste Daroussin static YYSTYPE *yylvp = 0;
4610c8de5b0SBaptiste Daroussin 
4620c8de5b0SBaptiste Daroussin /* End position of lexical value queue */
4630c8de5b0SBaptiste Daroussin static YYSTYPE *yylve = 0;
4640c8de5b0SBaptiste Daroussin 
4650c8de5b0SBaptiste Daroussin /* The last allocated position at the lexical value queue */
4660c8de5b0SBaptiste Daroussin static YYSTYPE *yylvlim = 0;
4670c8de5b0SBaptiste Daroussin 
4680c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
4690c8de5b0SBaptiste Daroussin /* Base of the lexical position queue */
4700c8de5b0SBaptiste Daroussin static YYLTYPE *yylpsns = 0;
4710c8de5b0SBaptiste Daroussin 
4720c8de5b0SBaptiste Daroussin /* Current position at lexical position queue */
4730c8de5b0SBaptiste Daroussin static YYLTYPE *yylpp = 0;
4740c8de5b0SBaptiste Daroussin 
4750c8de5b0SBaptiste Daroussin /* End position of lexical position queue */
4760c8de5b0SBaptiste Daroussin static YYLTYPE *yylpe = 0;
4770c8de5b0SBaptiste Daroussin 
4780c8de5b0SBaptiste Daroussin /* The last allocated position at the lexical position queue */
4790c8de5b0SBaptiste Daroussin static YYLTYPE *yylplim = 0;
4800c8de5b0SBaptiste Daroussin #endif
4810c8de5b0SBaptiste Daroussin 
4820c8de5b0SBaptiste Daroussin /* Current position at lexical token queue */
4832aca18c7SJung-uk Kim static YYINT  *yylexp = 0;
4840c8de5b0SBaptiste Daroussin 
4852aca18c7SJung-uk Kim static YYINT  *yylexemes = 0;
4860c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
4870c8de5b0SBaptiste Daroussin #line 73 "quote_calc2.y"
4880c8de5b0SBaptiste Daroussin  /* start of programs */
4890c8de5b0SBaptiste Daroussin 
4900c8de5b0SBaptiste Daroussin int
main(void)4910c8de5b0SBaptiste Daroussin main (void)
4920c8de5b0SBaptiste Daroussin {
4930c8de5b0SBaptiste Daroussin     while(!feof(stdin)) {
4940c8de5b0SBaptiste Daroussin 	yyparse();
4950c8de5b0SBaptiste Daroussin     }
4960c8de5b0SBaptiste Daroussin     return 0;
4970c8de5b0SBaptiste Daroussin }
4980c8de5b0SBaptiste Daroussin 
4990c8de5b0SBaptiste Daroussin static void
yyerror(const char * s)5000c8de5b0SBaptiste Daroussin yyerror(const char *s)
5010c8de5b0SBaptiste Daroussin {
5020c8de5b0SBaptiste Daroussin     fprintf(stderr, "%s\n", s);
5030c8de5b0SBaptiste Daroussin }
5040c8de5b0SBaptiste Daroussin 
5050c8de5b0SBaptiste Daroussin int
yylex(void)5060c8de5b0SBaptiste Daroussin yylex(void) {
5070c8de5b0SBaptiste Daroussin 	/* lexical analysis routine */
5080c8de5b0SBaptiste Daroussin 	/* returns LETTER for a lower case letter, yylval = 0 through 25 */
5090c8de5b0SBaptiste Daroussin 	/* return DIGIT for a digit, yylval = 0 through 9 */
5100c8de5b0SBaptiste Daroussin 	/* all other characters are returned immediately */
5110c8de5b0SBaptiste Daroussin 
5120c8de5b0SBaptiste Daroussin     int c;
5130c8de5b0SBaptiste Daroussin 
5140c8de5b0SBaptiste Daroussin     while( (c=getchar()) == ' ' )   { /* skip blanks */ }
5150c8de5b0SBaptiste Daroussin 
5160c8de5b0SBaptiste Daroussin     /* c is now nonblank */
5170c8de5b0SBaptiste Daroussin 
5180c8de5b0SBaptiste Daroussin     if( islower( c )) {
5190c8de5b0SBaptiste Daroussin 	yylval = c - 'a';
5200c8de5b0SBaptiste Daroussin 	return ( LETTER );
5210c8de5b0SBaptiste Daroussin     }
5220c8de5b0SBaptiste Daroussin     if( isdigit( c )) {
5230c8de5b0SBaptiste Daroussin 	yylval = c - '0';
5240c8de5b0SBaptiste Daroussin 	return ( DIGIT );
5250c8de5b0SBaptiste Daroussin     }
5260c8de5b0SBaptiste Daroussin     return( c );
5270c8de5b0SBaptiste Daroussin }
528b53bb29fSJung-uk Kim #line 529 "quote_calc2-s.tab.c"
5290c8de5b0SBaptiste Daroussin 
5300c8de5b0SBaptiste Daroussin /* For use in generated program */
5310c8de5b0SBaptiste Daroussin #define yydepth (int)(yystack.s_mark - yystack.s_base)
5320c8de5b0SBaptiste Daroussin #if YYBTYACC
5330c8de5b0SBaptiste Daroussin #define yytrial (yyps->save)
5340c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
5350c8de5b0SBaptiste Daroussin 
5360c8de5b0SBaptiste Daroussin #if YYDEBUG
5370c8de5b0SBaptiste Daroussin #include <stdio.h>	/* needed for printf */
5380c8de5b0SBaptiste Daroussin #endif
5390c8de5b0SBaptiste Daroussin 
5400c8de5b0SBaptiste Daroussin #include <stdlib.h>	/* needed for malloc, etc */
5410c8de5b0SBaptiste Daroussin #include <string.h>	/* needed for memset */
5420c8de5b0SBaptiste Daroussin 
5430c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */
yygrowstack(YYSTACKDATA * data)5440c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data)
5450c8de5b0SBaptiste Daroussin {
5460c8de5b0SBaptiste Daroussin     int i;
5470c8de5b0SBaptiste Daroussin     unsigned newsize;
548c5b5d71aSJung-uk Kim     YYINT *newss;
5490c8de5b0SBaptiste Daroussin     YYSTYPE *newvs;
5500c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5510c8de5b0SBaptiste Daroussin     YYLTYPE *newps;
5520c8de5b0SBaptiste Daroussin #endif
5530c8de5b0SBaptiste Daroussin 
5540c8de5b0SBaptiste Daroussin     if ((newsize = data->stacksize) == 0)
5550c8de5b0SBaptiste Daroussin         newsize = YYINITSTACKSIZE;
5560c8de5b0SBaptiste Daroussin     else if (newsize >= YYMAXDEPTH)
5570c8de5b0SBaptiste Daroussin         return YYENOMEM;
5580c8de5b0SBaptiste Daroussin     else if ((newsize *= 2) > YYMAXDEPTH)
5590c8de5b0SBaptiste Daroussin         newsize = YYMAXDEPTH;
5600c8de5b0SBaptiste Daroussin 
5610c8de5b0SBaptiste Daroussin     i = (int) (data->s_mark - data->s_base);
562c5b5d71aSJung-uk Kim     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
563bf80e08eSJung-uk Kim     if (newss == NULL)
5640c8de5b0SBaptiste Daroussin         return YYENOMEM;
5650c8de5b0SBaptiste Daroussin 
5660c8de5b0SBaptiste Daroussin     data->s_base = newss;
5670c8de5b0SBaptiste Daroussin     data->s_mark = newss + i;
5680c8de5b0SBaptiste Daroussin 
5690c8de5b0SBaptiste Daroussin     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
570bf80e08eSJung-uk Kim     if (newvs == NULL)
5710c8de5b0SBaptiste Daroussin         return YYENOMEM;
5720c8de5b0SBaptiste Daroussin 
5730c8de5b0SBaptiste Daroussin     data->l_base = newvs;
5740c8de5b0SBaptiste Daroussin     data->l_mark = newvs + i;
5750c8de5b0SBaptiste Daroussin 
5760c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5770c8de5b0SBaptiste Daroussin     newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
578bf80e08eSJung-uk Kim     if (newps == NULL)
5790c8de5b0SBaptiste Daroussin         return YYENOMEM;
5800c8de5b0SBaptiste Daroussin 
5810c8de5b0SBaptiste Daroussin     data->p_base = newps;
5820c8de5b0SBaptiste Daroussin     data->p_mark = newps + i;
5830c8de5b0SBaptiste Daroussin #endif
5840c8de5b0SBaptiste Daroussin 
5850c8de5b0SBaptiste Daroussin     data->stacksize = newsize;
5860c8de5b0SBaptiste Daroussin     data->s_last = data->s_base + newsize - 1;
5870c8de5b0SBaptiste Daroussin 
5880c8de5b0SBaptiste Daroussin #if YYDEBUG
5890c8de5b0SBaptiste Daroussin     if (yydebug)
5900c8de5b0SBaptiste Daroussin         fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
5910c8de5b0SBaptiste Daroussin #endif
5920c8de5b0SBaptiste Daroussin     return 0;
5930c8de5b0SBaptiste Daroussin }
5940c8de5b0SBaptiste Daroussin 
5950c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS)
yyfreestack(YYSTACKDATA * data)5960c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data)
5970c8de5b0SBaptiste Daroussin {
5980c8de5b0SBaptiste Daroussin     free(data->s_base);
5990c8de5b0SBaptiste Daroussin     free(data->l_base);
6000c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6010c8de5b0SBaptiste Daroussin     free(data->p_base);
6020c8de5b0SBaptiste Daroussin #endif
6030c8de5b0SBaptiste Daroussin     memset(data, 0, sizeof(*data));
6040c8de5b0SBaptiste Daroussin }
6050c8de5b0SBaptiste Daroussin #else
6060c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */
6070c8de5b0SBaptiste Daroussin #endif /* YYPURE || defined(YY_NO_LEAKS) */
6080c8de5b0SBaptiste Daroussin #if YYBTYACC
6090c8de5b0SBaptiste Daroussin 
6100c8de5b0SBaptiste Daroussin static YYParseState *
yyNewState(unsigned size)6110c8de5b0SBaptiste Daroussin yyNewState(unsigned size)
6120c8de5b0SBaptiste Daroussin {
6130c8de5b0SBaptiste Daroussin     YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
6140c8de5b0SBaptiste Daroussin     if (p == NULL) return NULL;
6150c8de5b0SBaptiste Daroussin 
6160c8de5b0SBaptiste Daroussin     p->yystack.stacksize = size;
6170c8de5b0SBaptiste Daroussin     if (size == 0)
6180c8de5b0SBaptiste Daroussin     {
6190c8de5b0SBaptiste Daroussin         p->yystack.s_base = NULL;
6200c8de5b0SBaptiste Daroussin         p->yystack.l_base = NULL;
6210c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6220c8de5b0SBaptiste Daroussin         p->yystack.p_base = NULL;
6230c8de5b0SBaptiste Daroussin #endif
6240c8de5b0SBaptiste Daroussin         return p;
6250c8de5b0SBaptiste Daroussin     }
626c5b5d71aSJung-uk Kim     p->yystack.s_base    = (YYINT *) malloc(size * sizeof(YYINT));
6270c8de5b0SBaptiste Daroussin     if (p->yystack.s_base == NULL) return NULL;
6280c8de5b0SBaptiste Daroussin     p->yystack.l_base    = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
6290c8de5b0SBaptiste Daroussin     if (p->yystack.l_base == NULL) return NULL;
6300c8de5b0SBaptiste Daroussin     memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
6310c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6320c8de5b0SBaptiste Daroussin     p->yystack.p_base    = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
6330c8de5b0SBaptiste Daroussin     if (p->yystack.p_base == NULL) return NULL;
6340c8de5b0SBaptiste Daroussin     memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
6350c8de5b0SBaptiste Daroussin #endif
6360c8de5b0SBaptiste Daroussin 
6370c8de5b0SBaptiste Daroussin     return p;
6380c8de5b0SBaptiste Daroussin }
6390c8de5b0SBaptiste Daroussin 
6400c8de5b0SBaptiste Daroussin static void
yyFreeState(YYParseState * p)6410c8de5b0SBaptiste Daroussin yyFreeState(YYParseState *p)
6420c8de5b0SBaptiste Daroussin {
6430c8de5b0SBaptiste Daroussin     yyfreestack(&p->yystack);
6440c8de5b0SBaptiste Daroussin     free(p);
6450c8de5b0SBaptiste Daroussin }
6460c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6470c8de5b0SBaptiste Daroussin 
6480c8de5b0SBaptiste Daroussin #define YYABORT  goto yyabort
6490c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort
6500c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept
6510c8de5b0SBaptiste Daroussin #define YYERROR  goto yyerrlab
6520c8de5b0SBaptiste Daroussin #if YYBTYACC
6530c8de5b0SBaptiste Daroussin #define YYVALID        do { if (yyps->save)            goto yyvalid; } while(0)
6540c8de5b0SBaptiste Daroussin #define YYVALID_NESTED do { if (yyps->save && \
6550c8de5b0SBaptiste Daroussin                                 yyps->save->save == 0) goto yyvalid; } while(0)
6560c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6570c8de5b0SBaptiste Daroussin 
6580c8de5b0SBaptiste Daroussin int
YYPARSE_DECL()6590c8de5b0SBaptiste Daroussin YYPARSE_DECL()
6600c8de5b0SBaptiste Daroussin {
6610c8de5b0SBaptiste Daroussin     int yym, yyn, yystate, yyresult;
6620c8de5b0SBaptiste Daroussin #if YYBTYACC
6630c8de5b0SBaptiste Daroussin     int yynewerrflag;
6640c8de5b0SBaptiste Daroussin     YYParseState *yyerrctx = NULL;
6650c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6660c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
667b53bb29fSJung-uk Kim     YYLTYPE  yyerror_loc_range[3]; /* position of error start/end (0 unused) */
6680c8de5b0SBaptiste Daroussin #endif
6690c8de5b0SBaptiste Daroussin #if YYDEBUG
6700c8de5b0SBaptiste Daroussin     const char *yys;
6710c8de5b0SBaptiste Daroussin 
672bf80e08eSJung-uk Kim     if ((yys = getenv("YYDEBUG")) != NULL)
6730c8de5b0SBaptiste Daroussin     {
6740c8de5b0SBaptiste Daroussin         yyn = *yys;
6750c8de5b0SBaptiste Daroussin         if (yyn >= '0' && yyn <= '9')
6760c8de5b0SBaptiste Daroussin             yydebug = yyn - '0';
6770c8de5b0SBaptiste Daroussin     }
6780c8de5b0SBaptiste Daroussin     if (yydebug)
6790c8de5b0SBaptiste Daroussin         fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
6800c8de5b0SBaptiste Daroussin #endif
6816166fdceSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6826166fdceSJung-uk Kim     memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
6836166fdceSJung-uk Kim #endif
6840c8de5b0SBaptiste Daroussin 
6850c8de5b0SBaptiste Daroussin #if YYBTYACC
6860c8de5b0SBaptiste Daroussin     yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
6870c8de5b0SBaptiste Daroussin     yyps->save = 0;
6880c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
689c5b5d71aSJung-uk Kim     yym = 0;
690*8e022d3cSDag-Erling Smørgrav     /* yyn is set below */
6910c8de5b0SBaptiste Daroussin     yynerrs = 0;
6920c8de5b0SBaptiste Daroussin     yyerrflag = 0;
6930c8de5b0SBaptiste Daroussin     yychar = YYEMPTY;
6940c8de5b0SBaptiste Daroussin     yystate = 0;
6950c8de5b0SBaptiste Daroussin 
6960c8de5b0SBaptiste Daroussin #if YYPURE
6970c8de5b0SBaptiste Daroussin     memset(&yystack, 0, sizeof(yystack));
6980c8de5b0SBaptiste Daroussin #endif
6990c8de5b0SBaptiste Daroussin 
7000c8de5b0SBaptiste Daroussin     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
7010c8de5b0SBaptiste Daroussin     yystack.s_mark = yystack.s_base;
7020c8de5b0SBaptiste Daroussin     yystack.l_mark = yystack.l_base;
7030c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7040c8de5b0SBaptiste Daroussin     yystack.p_mark = yystack.p_base;
7050c8de5b0SBaptiste Daroussin #endif
7060c8de5b0SBaptiste Daroussin     yystate = 0;
7070c8de5b0SBaptiste Daroussin     *yystack.s_mark = 0;
7080c8de5b0SBaptiste Daroussin 
7090c8de5b0SBaptiste Daroussin yyloop:
7100c8de5b0SBaptiste Daroussin     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
7110c8de5b0SBaptiste Daroussin     if (yychar < 0)
7120c8de5b0SBaptiste Daroussin     {
7130c8de5b0SBaptiste Daroussin #if YYBTYACC
7140c8de5b0SBaptiste Daroussin         do {
7150c8de5b0SBaptiste Daroussin         if (yylvp < yylve)
7160c8de5b0SBaptiste Daroussin         {
7170c8de5b0SBaptiste Daroussin             /* we're currently re-reading tokens */
7180c8de5b0SBaptiste Daroussin             yylval = *yylvp++;
7190c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7200c8de5b0SBaptiste Daroussin             yylloc = *yylpp++;
7210c8de5b0SBaptiste Daroussin #endif
7220c8de5b0SBaptiste Daroussin             yychar = *yylexp++;
7230c8de5b0SBaptiste Daroussin             break;
7240c8de5b0SBaptiste Daroussin         }
7250c8de5b0SBaptiste Daroussin         if (yyps->save)
7260c8de5b0SBaptiste Daroussin         {
7270c8de5b0SBaptiste Daroussin             /* in trial mode; save scanner results for future parse attempts */
7280c8de5b0SBaptiste Daroussin             if (yylvp == yylvlim)
7290c8de5b0SBaptiste Daroussin             {   /* Enlarge lexical value queue */
73011fce282SBaptiste Daroussin                 size_t p = (size_t) (yylvp - yylvals);
73111fce282SBaptiste Daroussin                 size_t s = (size_t) (yylvlim - yylvals);
7320c8de5b0SBaptiste Daroussin 
7330c8de5b0SBaptiste Daroussin                 s += YYLVQUEUEGROWTH;
734b53bb29fSJung-uk Kim                 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
735b53bb29fSJung-uk Kim                 if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
7360c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
737b53bb29fSJung-uk Kim                 if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
7380c8de5b0SBaptiste Daroussin #endif
7390c8de5b0SBaptiste Daroussin                 yylvp   = yylve = yylvals + p;
7400c8de5b0SBaptiste Daroussin                 yylvlim = yylvals + s;
7410c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7420c8de5b0SBaptiste Daroussin                 yylpp   = yylpe = yylpsns + p;
7430c8de5b0SBaptiste Daroussin                 yylplim = yylpsns + s;
7440c8de5b0SBaptiste Daroussin #endif
7450c8de5b0SBaptiste Daroussin                 yylexp  = yylexemes + p;
7460c8de5b0SBaptiste Daroussin             }
7472aca18c7SJung-uk Kim             *yylexp = (YYINT) YYLEX;
7480c8de5b0SBaptiste Daroussin             *yylvp++ = yylval;
7490c8de5b0SBaptiste Daroussin             yylve++;
7500c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7510c8de5b0SBaptiste Daroussin             *yylpp++ = yylloc;
7520c8de5b0SBaptiste Daroussin             yylpe++;
7530c8de5b0SBaptiste Daroussin #endif
7540c8de5b0SBaptiste Daroussin             yychar = *yylexp++;
7550c8de5b0SBaptiste Daroussin             break;
7560c8de5b0SBaptiste Daroussin         }
7570c8de5b0SBaptiste Daroussin         /* normal operation, no conflict encountered */
7580c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7590c8de5b0SBaptiste Daroussin         yychar = YYLEX;
7600c8de5b0SBaptiste Daroussin #if YYBTYACC
7610c8de5b0SBaptiste Daroussin         } while (0);
7620c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7630c8de5b0SBaptiste Daroussin         if (yychar < 0) yychar = YYEOF;
7640c8de5b0SBaptiste Daroussin #if YYDEBUG
7650c8de5b0SBaptiste Daroussin         if (yydebug)
7660c8de5b0SBaptiste Daroussin         {
767c5b5d71aSJung-uk Kim             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
7680c8de5b0SBaptiste Daroussin             fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
7690c8de5b0SBaptiste Daroussin                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
7700c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
7710c8de5b0SBaptiste Daroussin #if YYBTYACC
7720c8de5b0SBaptiste Daroussin             if (!yytrial)
7730c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7740c8de5b0SBaptiste Daroussin                 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
7750c8de5b0SBaptiste Daroussin #endif
7760c8de5b0SBaptiste Daroussin             fputc('\n', stderr);
7770c8de5b0SBaptiste Daroussin         }
7780c8de5b0SBaptiste Daroussin #endif
7790c8de5b0SBaptiste Daroussin     }
7800c8de5b0SBaptiste Daroussin #if YYBTYACC
7810c8de5b0SBaptiste Daroussin 
7820c8de5b0SBaptiste Daroussin     /* Do we have a conflict? */
7830c8de5b0SBaptiste Daroussin     if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
7840c8de5b0SBaptiste Daroussin         yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
7850c8de5b0SBaptiste Daroussin     {
7860c8de5b0SBaptiste Daroussin         YYINT ctry;
7870c8de5b0SBaptiste Daroussin 
7880c8de5b0SBaptiste Daroussin         if (yypath)
7890c8de5b0SBaptiste Daroussin         {
7900c8de5b0SBaptiste Daroussin             YYParseState *save;
7910c8de5b0SBaptiste Daroussin #if YYDEBUG
7920c8de5b0SBaptiste Daroussin             if (yydebug)
7930c8de5b0SBaptiste Daroussin                 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
7940c8de5b0SBaptiste Daroussin                                 YYDEBUGSTR, yydepth, yystate);
7950c8de5b0SBaptiste Daroussin #endif
7960c8de5b0SBaptiste Daroussin             /* Switch to the next conflict context */
7970c8de5b0SBaptiste Daroussin             save = yypath;
7980c8de5b0SBaptiste Daroussin             yypath = save->save;
7990c8de5b0SBaptiste Daroussin             save->save = NULL;
8000c8de5b0SBaptiste Daroussin             ctry = save->ctry;
8010c8de5b0SBaptiste Daroussin             if (save->state != yystate) YYABORT;
8020c8de5b0SBaptiste Daroussin             yyFreeState(save);
8030c8de5b0SBaptiste Daroussin 
8040c8de5b0SBaptiste Daroussin         }
8050c8de5b0SBaptiste Daroussin         else
8060c8de5b0SBaptiste Daroussin         {
8070c8de5b0SBaptiste Daroussin 
8080c8de5b0SBaptiste Daroussin             /* Unresolved conflict - start/continue trial parse */
8090c8de5b0SBaptiste Daroussin             YYParseState *save;
8100c8de5b0SBaptiste Daroussin #if YYDEBUG
8110c8de5b0SBaptiste Daroussin             if (yydebug)
8120c8de5b0SBaptiste Daroussin             {
8130c8de5b0SBaptiste Daroussin                 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
8140c8de5b0SBaptiste Daroussin                 if (yyps->save)
8150c8de5b0SBaptiste Daroussin                     fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
8160c8de5b0SBaptiste Daroussin                 else
8170c8de5b0SBaptiste Daroussin                     fputs("Starting trial parse.\n", stderr);
8180c8de5b0SBaptiste Daroussin             }
8190c8de5b0SBaptiste Daroussin #endif
8200c8de5b0SBaptiste Daroussin             save                  = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
8210c8de5b0SBaptiste Daroussin             if (save == NULL) goto yyenomem;
8220c8de5b0SBaptiste Daroussin             save->save            = yyps->save;
8230c8de5b0SBaptiste Daroussin             save->state           = yystate;
8240c8de5b0SBaptiste Daroussin             save->errflag         = yyerrflag;
8250c8de5b0SBaptiste Daroussin             save->yystack.s_mark  = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
826c5b5d71aSJung-uk Kim             memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
8270c8de5b0SBaptiste Daroussin             save->yystack.l_mark  = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
82811fce282SBaptiste Daroussin             memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
8290c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8300c8de5b0SBaptiste Daroussin             save->yystack.p_mark  = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
83111fce282SBaptiste Daroussin             memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
8320c8de5b0SBaptiste Daroussin #endif
8330c8de5b0SBaptiste Daroussin             ctry                  = yytable[yyn];
8340c8de5b0SBaptiste Daroussin             if (yyctable[ctry] == -1)
8350c8de5b0SBaptiste Daroussin             {
8360c8de5b0SBaptiste Daroussin #if YYDEBUG
8370c8de5b0SBaptiste Daroussin                 if (yydebug && yychar >= YYEOF)
8380c8de5b0SBaptiste Daroussin                     fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
8390c8de5b0SBaptiste Daroussin #endif
8400c8de5b0SBaptiste Daroussin                 ctry++;
8410c8de5b0SBaptiste Daroussin             }
8420c8de5b0SBaptiste Daroussin             save->ctry = ctry;
8430c8de5b0SBaptiste Daroussin             if (yyps->save == NULL)
8440c8de5b0SBaptiste Daroussin             {
8450c8de5b0SBaptiste Daroussin                 /* If this is a first conflict in the stack, start saving lexemes */
8460c8de5b0SBaptiste Daroussin                 if (!yylexemes)
8470c8de5b0SBaptiste Daroussin                 {
848b53bb29fSJung-uk Kim                     yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
8490c8de5b0SBaptiste Daroussin                     if (yylexemes == NULL) goto yyenomem;
8500c8de5b0SBaptiste Daroussin                     yylvals   = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
8510c8de5b0SBaptiste Daroussin                     if (yylvals == NULL) goto yyenomem;
8520c8de5b0SBaptiste Daroussin                     yylvlim   = yylvals + YYLVQUEUEGROWTH;
8530c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8540c8de5b0SBaptiste Daroussin                     yylpsns   = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
8550c8de5b0SBaptiste Daroussin                     if (yylpsns == NULL) goto yyenomem;
8560c8de5b0SBaptiste Daroussin                     yylplim   = yylpsns + YYLVQUEUEGROWTH;
8570c8de5b0SBaptiste Daroussin #endif
8580c8de5b0SBaptiste Daroussin                 }
8590c8de5b0SBaptiste Daroussin                 if (yylvp == yylve)
8600c8de5b0SBaptiste Daroussin                 {
8610c8de5b0SBaptiste Daroussin                     yylvp  = yylve = yylvals;
8620c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8630c8de5b0SBaptiste Daroussin                     yylpp  = yylpe = yylpsns;
8640c8de5b0SBaptiste Daroussin #endif
8650c8de5b0SBaptiste Daroussin                     yylexp = yylexemes;
8660c8de5b0SBaptiste Daroussin                     if (yychar >= YYEOF)
8670c8de5b0SBaptiste Daroussin                     {
8680c8de5b0SBaptiste Daroussin                         *yylve++ = yylval;
8690c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8700c8de5b0SBaptiste Daroussin                         *yylpe++ = yylloc;
8710c8de5b0SBaptiste Daroussin #endif
8722aca18c7SJung-uk Kim                         *yylexp  = (YYINT) yychar;
8730c8de5b0SBaptiste Daroussin                         yychar   = YYEMPTY;
8740c8de5b0SBaptiste Daroussin                     }
8750c8de5b0SBaptiste Daroussin                 }
8760c8de5b0SBaptiste Daroussin             }
8770c8de5b0SBaptiste Daroussin             if (yychar >= YYEOF)
8780c8de5b0SBaptiste Daroussin             {
8790c8de5b0SBaptiste Daroussin                 yylvp--;
8800c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8810c8de5b0SBaptiste Daroussin                 yylpp--;
8820c8de5b0SBaptiste Daroussin #endif
8830c8de5b0SBaptiste Daroussin                 yylexp--;
8840c8de5b0SBaptiste Daroussin                 yychar = YYEMPTY;
8850c8de5b0SBaptiste Daroussin             }
88611fce282SBaptiste Daroussin             save->lexeme = (int) (yylvp - yylvals);
8870c8de5b0SBaptiste Daroussin             yyps->save   = save;
8880c8de5b0SBaptiste Daroussin         }
8890c8de5b0SBaptiste Daroussin         if (yytable[yyn] == ctry)
8900c8de5b0SBaptiste Daroussin         {
8910c8de5b0SBaptiste Daroussin #if YYDEBUG
8920c8de5b0SBaptiste Daroussin             if (yydebug)
8930c8de5b0SBaptiste Daroussin                 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
8940c8de5b0SBaptiste Daroussin                                 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
8950c8de5b0SBaptiste Daroussin #endif
8960c8de5b0SBaptiste Daroussin             if (yychar < 0)
8970c8de5b0SBaptiste Daroussin             {
8980c8de5b0SBaptiste Daroussin                 yylvp++;
8990c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9000c8de5b0SBaptiste Daroussin                 yylpp++;
9010c8de5b0SBaptiste Daroussin #endif
9020c8de5b0SBaptiste Daroussin                 yylexp++;
9030c8de5b0SBaptiste Daroussin             }
9040c8de5b0SBaptiste Daroussin             if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
9050c8de5b0SBaptiste Daroussin                 goto yyoverflow;
9060c8de5b0SBaptiste Daroussin             yystate = yyctable[ctry];
907c5b5d71aSJung-uk Kim             *++yystack.s_mark = (YYINT) yystate;
9080c8de5b0SBaptiste Daroussin             *++yystack.l_mark = yylval;
9090c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9100c8de5b0SBaptiste Daroussin             *++yystack.p_mark = yylloc;
9110c8de5b0SBaptiste Daroussin #endif
9120c8de5b0SBaptiste Daroussin             yychar  = YYEMPTY;
9130c8de5b0SBaptiste Daroussin             if (yyerrflag > 0) --yyerrflag;
9140c8de5b0SBaptiste Daroussin             goto yyloop;
9150c8de5b0SBaptiste Daroussin         }
9160c8de5b0SBaptiste Daroussin         else
9170c8de5b0SBaptiste Daroussin         {
9180c8de5b0SBaptiste Daroussin             yyn = yyctable[ctry];
9190c8de5b0SBaptiste Daroussin             goto yyreduce;
9200c8de5b0SBaptiste Daroussin         }
9210c8de5b0SBaptiste Daroussin     } /* End of code dealing with conflicts */
9220c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
9230c8de5b0SBaptiste Daroussin     if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
9240c8de5b0SBaptiste Daroussin             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
9250c8de5b0SBaptiste Daroussin     {
9260c8de5b0SBaptiste Daroussin #if YYDEBUG
9270c8de5b0SBaptiste Daroussin         if (yydebug)
9280c8de5b0SBaptiste Daroussin             fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
9290c8de5b0SBaptiste Daroussin                             YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
9300c8de5b0SBaptiste Daroussin #endif
9310c8de5b0SBaptiste Daroussin         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
9320c8de5b0SBaptiste Daroussin         yystate = yytable[yyn];
9330c8de5b0SBaptiste Daroussin         *++yystack.s_mark = yytable[yyn];
9340c8de5b0SBaptiste Daroussin         *++yystack.l_mark = yylval;
9350c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9360c8de5b0SBaptiste Daroussin         *++yystack.p_mark = yylloc;
9370c8de5b0SBaptiste Daroussin #endif
9380c8de5b0SBaptiste Daroussin         yychar = YYEMPTY;
9390c8de5b0SBaptiste Daroussin         if (yyerrflag > 0)  --yyerrflag;
9400c8de5b0SBaptiste Daroussin         goto yyloop;
9410c8de5b0SBaptiste Daroussin     }
9420c8de5b0SBaptiste Daroussin     if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
9430c8de5b0SBaptiste Daroussin             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
9440c8de5b0SBaptiste Daroussin     {
9450c8de5b0SBaptiste Daroussin         yyn = yytable[yyn];
9460c8de5b0SBaptiste Daroussin         goto yyreduce;
9470c8de5b0SBaptiste Daroussin     }
9480c8de5b0SBaptiste Daroussin     if (yyerrflag != 0) goto yyinrecovery;
9490c8de5b0SBaptiste Daroussin #if YYBTYACC
9500c8de5b0SBaptiste Daroussin 
9510c8de5b0SBaptiste Daroussin     yynewerrflag = 1;
9520c8de5b0SBaptiste Daroussin     goto yyerrhandler;
953c5b5d71aSJung-uk Kim     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
9540c8de5b0SBaptiste Daroussin 
9550c8de5b0SBaptiste Daroussin yyerrlab:
956c5b5d71aSJung-uk Kim     /* explicit YYERROR from an action -- pop the rhs of the rule reduced
957c5b5d71aSJung-uk Kim      * before looking for error recovery */
958c5b5d71aSJung-uk Kim     yystack.s_mark -= yym;
959c5b5d71aSJung-uk Kim     yystate = *yystack.s_mark;
960c5b5d71aSJung-uk Kim     yystack.l_mark -= yym;
961c5b5d71aSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
962c5b5d71aSJung-uk Kim     yystack.p_mark -= yym;
963c5b5d71aSJung-uk Kim #endif
964c5b5d71aSJung-uk Kim 
9650c8de5b0SBaptiste Daroussin     yynewerrflag = 0;
9660c8de5b0SBaptiste Daroussin yyerrhandler:
9670c8de5b0SBaptiste Daroussin     while (yyps->save)
9680c8de5b0SBaptiste Daroussin     {
9690c8de5b0SBaptiste Daroussin         int ctry;
9700c8de5b0SBaptiste Daroussin         YYParseState *save = yyps->save;
9710c8de5b0SBaptiste Daroussin #if YYDEBUG
9720c8de5b0SBaptiste Daroussin         if (yydebug)
9730c8de5b0SBaptiste Daroussin             fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
9740c8de5b0SBaptiste Daroussin                             YYDEBUGSTR, yydepth, yystate, yyps->save->state,
9750c8de5b0SBaptiste Daroussin                     (int)(yylvp - yylvals - yyps->save->lexeme));
9760c8de5b0SBaptiste Daroussin #endif
9770c8de5b0SBaptiste Daroussin         /* Memorize most forward-looking error state in case it's really an error. */
9780c8de5b0SBaptiste Daroussin         if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
9790c8de5b0SBaptiste Daroussin         {
9800c8de5b0SBaptiste Daroussin             /* Free old saved error context state */
9810c8de5b0SBaptiste Daroussin             if (yyerrctx) yyFreeState(yyerrctx);
9820c8de5b0SBaptiste Daroussin             /* Create and fill out new saved error context state */
9830c8de5b0SBaptiste Daroussin             yyerrctx                 = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
9840c8de5b0SBaptiste Daroussin             if (yyerrctx == NULL) goto yyenomem;
9850c8de5b0SBaptiste Daroussin             yyerrctx->save           = yyps->save;
9860c8de5b0SBaptiste Daroussin             yyerrctx->state          = yystate;
9870c8de5b0SBaptiste Daroussin             yyerrctx->errflag        = yyerrflag;
9880c8de5b0SBaptiste Daroussin             yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
989c5b5d71aSJung-uk Kim             memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
9900c8de5b0SBaptiste Daroussin             yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
99111fce282SBaptiste Daroussin             memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
9920c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9930c8de5b0SBaptiste Daroussin             yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
99411fce282SBaptiste Daroussin             memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
9950c8de5b0SBaptiste Daroussin #endif
99611fce282SBaptiste Daroussin             yyerrctx->lexeme         = (int) (yylvp - yylvals);
9970c8de5b0SBaptiste Daroussin         }
9980c8de5b0SBaptiste Daroussin         yylvp          = yylvals   + save->lexeme;
9990c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10000c8de5b0SBaptiste Daroussin         yylpp          = yylpsns   + save->lexeme;
10010c8de5b0SBaptiste Daroussin #endif
10020c8de5b0SBaptiste Daroussin         yylexp         = yylexemes + save->lexeme;
10030c8de5b0SBaptiste Daroussin         yychar         = YYEMPTY;
10040c8de5b0SBaptiste Daroussin         yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1005c5b5d71aSJung-uk Kim         memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10060c8de5b0SBaptiste Daroussin         yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
100711fce282SBaptiste Daroussin         memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10080c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10090c8de5b0SBaptiste Daroussin         yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
101011fce282SBaptiste Daroussin         memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10110c8de5b0SBaptiste Daroussin #endif
10120c8de5b0SBaptiste Daroussin         ctry           = ++save->ctry;
10130c8de5b0SBaptiste Daroussin         yystate        = save->state;
10140c8de5b0SBaptiste Daroussin         /* We tried shift, try reduce now */
10150c8de5b0SBaptiste Daroussin         if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
10160c8de5b0SBaptiste Daroussin         yyps->save     = save->save;
10170c8de5b0SBaptiste Daroussin         save->save     = NULL;
10180c8de5b0SBaptiste Daroussin         yyFreeState(save);
10190c8de5b0SBaptiste Daroussin 
10200c8de5b0SBaptiste Daroussin         /* Nothing left on the stack -- error */
10210c8de5b0SBaptiste Daroussin         if (!yyps->save)
10220c8de5b0SBaptiste Daroussin         {
10230c8de5b0SBaptiste Daroussin #if YYDEBUG
10240c8de5b0SBaptiste Daroussin             if (yydebug)
10250c8de5b0SBaptiste Daroussin                 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
10260c8de5b0SBaptiste Daroussin                                 YYPREFIX, yydepth);
10270c8de5b0SBaptiste Daroussin #endif
10280c8de5b0SBaptiste Daroussin             /* Restore state as it was in the most forward-advanced error */
10290c8de5b0SBaptiste Daroussin             yylvp          = yylvals   + yyerrctx->lexeme;
10300c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10310c8de5b0SBaptiste Daroussin             yylpp          = yylpsns   + yyerrctx->lexeme;
10320c8de5b0SBaptiste Daroussin #endif
10330c8de5b0SBaptiste Daroussin             yylexp         = yylexemes + yyerrctx->lexeme;
10340c8de5b0SBaptiste Daroussin             yychar         = yylexp[-1];
10350c8de5b0SBaptiste Daroussin             yylval         = yylvp[-1];
10360c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10370c8de5b0SBaptiste Daroussin             yylloc         = yylpp[-1];
10380c8de5b0SBaptiste Daroussin #endif
10390c8de5b0SBaptiste Daroussin             yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1040c5b5d71aSJung-uk Kim             memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10410c8de5b0SBaptiste Daroussin             yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
104211fce282SBaptiste Daroussin             memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10430c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10440c8de5b0SBaptiste Daroussin             yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
104511fce282SBaptiste Daroussin             memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10460c8de5b0SBaptiste Daroussin #endif
10470c8de5b0SBaptiste Daroussin             yystate        = yyerrctx->state;
10480c8de5b0SBaptiste Daroussin             yyFreeState(yyerrctx);
10490c8de5b0SBaptiste Daroussin             yyerrctx       = NULL;
10500c8de5b0SBaptiste Daroussin         }
10510c8de5b0SBaptiste Daroussin         yynewerrflag = 1;
10520c8de5b0SBaptiste Daroussin     }
10530c8de5b0SBaptiste Daroussin     if (yynewerrflag == 0) goto yyinrecovery;
10540c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
10550c8de5b0SBaptiste Daroussin 
10560c8de5b0SBaptiste Daroussin     YYERROR_CALL("syntax error");
10570c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1058b53bb29fSJung-uk Kim     yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
10590c8de5b0SBaptiste Daroussin #endif
10600c8de5b0SBaptiste Daroussin 
10610c8de5b0SBaptiste Daroussin #if !YYBTYACC
1062c5b5d71aSJung-uk Kim     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
10630c8de5b0SBaptiste Daroussin yyerrlab:
10640c8de5b0SBaptiste Daroussin #endif
10650c8de5b0SBaptiste Daroussin     ++yynerrs;
10660c8de5b0SBaptiste Daroussin 
10670c8de5b0SBaptiste Daroussin yyinrecovery:
10680c8de5b0SBaptiste Daroussin     if (yyerrflag < 3)
10690c8de5b0SBaptiste Daroussin     {
10700c8de5b0SBaptiste Daroussin         yyerrflag = 3;
10710c8de5b0SBaptiste Daroussin         for (;;)
10720c8de5b0SBaptiste Daroussin         {
10730c8de5b0SBaptiste Daroussin             if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
10740c8de5b0SBaptiste Daroussin                     yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
10750c8de5b0SBaptiste Daroussin             {
10760c8de5b0SBaptiste Daroussin #if YYDEBUG
10770c8de5b0SBaptiste Daroussin                 if (yydebug)
10780c8de5b0SBaptiste Daroussin                     fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
10790c8de5b0SBaptiste Daroussin                                     YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
10800c8de5b0SBaptiste Daroussin #endif
10810c8de5b0SBaptiste Daroussin                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
10820c8de5b0SBaptiste Daroussin                 yystate = yytable[yyn];
10830c8de5b0SBaptiste Daroussin                 *++yystack.s_mark = yytable[yyn];
10840c8de5b0SBaptiste Daroussin                 *++yystack.l_mark = yylval;
10850c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10860c8de5b0SBaptiste Daroussin                 /* lookahead position is error end position */
1087b53bb29fSJung-uk Kim                 yyerror_loc_range[2] = yylloc;
10880c8de5b0SBaptiste Daroussin                 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
10890c8de5b0SBaptiste Daroussin                 *++yystack.p_mark = yyloc;
10900c8de5b0SBaptiste Daroussin #endif
10910c8de5b0SBaptiste Daroussin                 goto yyloop;
10920c8de5b0SBaptiste Daroussin             }
10930c8de5b0SBaptiste Daroussin             else
10940c8de5b0SBaptiste Daroussin             {
10950c8de5b0SBaptiste Daroussin #if YYDEBUG
10960c8de5b0SBaptiste Daroussin                 if (yydebug)
10970c8de5b0SBaptiste Daroussin                     fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
10980c8de5b0SBaptiste Daroussin                                     YYDEBUGSTR, yydepth, *yystack.s_mark);
10990c8de5b0SBaptiste Daroussin #endif
11000c8de5b0SBaptiste Daroussin                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
11010c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11020c8de5b0SBaptiste Daroussin                 /* the current TOS position is the error start position */
1103b53bb29fSJung-uk Kim                 yyerror_loc_range[1] = *yystack.p_mark;
11040c8de5b0SBaptiste Daroussin #endif
11050c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
11060c8de5b0SBaptiste Daroussin #if YYBTYACC
11070c8de5b0SBaptiste Daroussin                 if (!yytrial)
11080c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11090c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11100c8de5b0SBaptiste Daroussin                     YYDESTRUCT_CALL("error: discarding state",
11110c8de5b0SBaptiste Daroussin                                     yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
11120c8de5b0SBaptiste Daroussin #else
11130c8de5b0SBaptiste Daroussin                     YYDESTRUCT_CALL("error: discarding state",
11140c8de5b0SBaptiste Daroussin                                     yystos[*yystack.s_mark], yystack.l_mark);
11150c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
11160c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
11170c8de5b0SBaptiste Daroussin                 --yystack.s_mark;
11180c8de5b0SBaptiste Daroussin                 --yystack.l_mark;
11190c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11200c8de5b0SBaptiste Daroussin                 --yystack.p_mark;
11210c8de5b0SBaptiste Daroussin #endif
11220c8de5b0SBaptiste Daroussin             }
11230c8de5b0SBaptiste Daroussin         }
11240c8de5b0SBaptiste Daroussin     }
11250c8de5b0SBaptiste Daroussin     else
11260c8de5b0SBaptiste Daroussin     {
11270c8de5b0SBaptiste Daroussin         if (yychar == YYEOF) goto yyabort;
11280c8de5b0SBaptiste Daroussin #if YYDEBUG
11290c8de5b0SBaptiste Daroussin         if (yydebug)
11300c8de5b0SBaptiste Daroussin         {
1131c5b5d71aSJung-uk Kim             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
11320c8de5b0SBaptiste Daroussin             fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
11330c8de5b0SBaptiste Daroussin                             YYDEBUGSTR, yydepth, yystate, yychar, yys);
11340c8de5b0SBaptiste Daroussin         }
11350c8de5b0SBaptiste Daroussin #endif
11360c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
11370c8de5b0SBaptiste Daroussin #if YYBTYACC
11380c8de5b0SBaptiste Daroussin         if (!yytrial)
11390c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11400c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11410c8de5b0SBaptiste Daroussin             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
11420c8de5b0SBaptiste Daroussin #else
11430c8de5b0SBaptiste Daroussin             YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
11440c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
11450c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
11460c8de5b0SBaptiste Daroussin         yychar = YYEMPTY;
11470c8de5b0SBaptiste Daroussin         goto yyloop;
11480c8de5b0SBaptiste Daroussin     }
11490c8de5b0SBaptiste Daroussin 
11500c8de5b0SBaptiste Daroussin yyreduce:
11510c8de5b0SBaptiste Daroussin     yym = yylen[yyn];
11520c8de5b0SBaptiste Daroussin #if YYDEBUG
11530c8de5b0SBaptiste Daroussin     if (yydebug)
11540c8de5b0SBaptiste Daroussin     {
11550c8de5b0SBaptiste Daroussin         fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
11560c8de5b0SBaptiste Daroussin                         YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
11570c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
11580c8de5b0SBaptiste Daroussin #if YYBTYACC
11590c8de5b0SBaptiste Daroussin         if (!yytrial)
11600c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11610c8de5b0SBaptiste Daroussin             if (yym > 0)
11620c8de5b0SBaptiste Daroussin             {
11630c8de5b0SBaptiste Daroussin                 int i;
11640c8de5b0SBaptiste Daroussin                 fputc('<', stderr);
11650c8de5b0SBaptiste Daroussin                 for (i = yym; i > 0; i--)
11660c8de5b0SBaptiste Daroussin                 {
11670c8de5b0SBaptiste Daroussin                     if (i != yym) fputs(", ", stderr);
11680c8de5b0SBaptiste Daroussin                     fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
11690c8de5b0SBaptiste Daroussin                                            yystack.l_mark[1-i]), stderr);
11700c8de5b0SBaptiste Daroussin                 }
11710c8de5b0SBaptiste Daroussin                 fputc('>', stderr);
11720c8de5b0SBaptiste Daroussin             }
11730c8de5b0SBaptiste Daroussin #endif
11740c8de5b0SBaptiste Daroussin         fputc('\n', stderr);
11750c8de5b0SBaptiste Daroussin     }
11760c8de5b0SBaptiste Daroussin #endif
11770c8de5b0SBaptiste Daroussin     if (yym > 0)
11780c8de5b0SBaptiste Daroussin         yyval = yystack.l_mark[1-yym];
11790c8de5b0SBaptiste Daroussin     else
11800c8de5b0SBaptiste Daroussin         memset(&yyval, 0, sizeof yyval);
11810c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11820c8de5b0SBaptiste Daroussin 
11830c8de5b0SBaptiste Daroussin     /* Perform position reduction */
11840c8de5b0SBaptiste Daroussin     memset(&yyloc, 0, sizeof(yyloc));
11850c8de5b0SBaptiste Daroussin #if YYBTYACC
11860c8de5b0SBaptiste Daroussin     if (!yytrial)
11870c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11880c8de5b0SBaptiste Daroussin     {
1189b53bb29fSJung-uk Kim         YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
11900c8de5b0SBaptiste Daroussin         /* just in case YYERROR is invoked within the action, save
11910c8de5b0SBaptiste Daroussin            the start of the rhs as the error start position */
1192b53bb29fSJung-uk Kim         yyerror_loc_range[1] = yystack.p_mark[1-yym];
11930c8de5b0SBaptiste Daroussin     }
11940c8de5b0SBaptiste Daroussin #endif
11950c8de5b0SBaptiste Daroussin 
11960c8de5b0SBaptiste Daroussin     switch (yyn)
11970c8de5b0SBaptiste Daroussin     {
11980c8de5b0SBaptiste Daroussin case 3:
11990c8de5b0SBaptiste Daroussin #line 35 "quote_calc2.y"
12000c8de5b0SBaptiste Daroussin 	{  yyerrok ; }
1201*8e022d3cSDag-Erling Smørgrav #line 1202 "quote_calc2-s.tab.c"
12020c8de5b0SBaptiste Daroussin break;
12030c8de5b0SBaptiste Daroussin case 4:
12040c8de5b0SBaptiste Daroussin #line 39 "quote_calc2.y"
12050c8de5b0SBaptiste Daroussin 	{  printf("%d\n",yystack.l_mark[0]);}
1206*8e022d3cSDag-Erling Smørgrav #line 1207 "quote_calc2-s.tab.c"
12070c8de5b0SBaptiste Daroussin break;
12080c8de5b0SBaptiste Daroussin case 5:
12090c8de5b0SBaptiste Daroussin #line 41 "quote_calc2.y"
12100c8de5b0SBaptiste Daroussin 	{  regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
1211*8e022d3cSDag-Erling Smørgrav #line 1212 "quote_calc2-s.tab.c"
12120c8de5b0SBaptiste Daroussin break;
12130c8de5b0SBaptiste Daroussin case 6:
12140c8de5b0SBaptiste Daroussin #line 45 "quote_calc2.y"
12150c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-1]; }
1216*8e022d3cSDag-Erling Smørgrav #line 1217 "quote_calc2-s.tab.c"
12170c8de5b0SBaptiste Daroussin break;
12180c8de5b0SBaptiste Daroussin case 7:
12190c8de5b0SBaptiste Daroussin #line 47 "quote_calc2.y"
12200c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
1221*8e022d3cSDag-Erling Smørgrav #line 1222 "quote_calc2-s.tab.c"
12220c8de5b0SBaptiste Daroussin break;
12230c8de5b0SBaptiste Daroussin case 8:
12240c8de5b0SBaptiste Daroussin #line 49 "quote_calc2.y"
12250c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
1226*8e022d3cSDag-Erling Smørgrav #line 1227 "quote_calc2-s.tab.c"
12270c8de5b0SBaptiste Daroussin break;
12280c8de5b0SBaptiste Daroussin case 9:
12290c8de5b0SBaptiste Daroussin #line 51 "quote_calc2.y"
12300c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
1231*8e022d3cSDag-Erling Smørgrav #line 1232 "quote_calc2-s.tab.c"
12320c8de5b0SBaptiste Daroussin break;
12330c8de5b0SBaptiste Daroussin case 10:
12340c8de5b0SBaptiste Daroussin #line 53 "quote_calc2.y"
12350c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
1236*8e022d3cSDag-Erling Smørgrav #line 1237 "quote_calc2-s.tab.c"
12370c8de5b0SBaptiste Daroussin break;
12380c8de5b0SBaptiste Daroussin case 11:
12390c8de5b0SBaptiste Daroussin #line 55 "quote_calc2.y"
12400c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
1241*8e022d3cSDag-Erling Smørgrav #line 1242 "quote_calc2-s.tab.c"
12420c8de5b0SBaptiste Daroussin break;
12430c8de5b0SBaptiste Daroussin case 12:
12440c8de5b0SBaptiste Daroussin #line 57 "quote_calc2.y"
12450c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
1246*8e022d3cSDag-Erling Smørgrav #line 1247 "quote_calc2-s.tab.c"
12470c8de5b0SBaptiste Daroussin break;
12480c8de5b0SBaptiste Daroussin case 13:
12490c8de5b0SBaptiste Daroussin #line 59 "quote_calc2.y"
12500c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
1251*8e022d3cSDag-Erling Smørgrav #line 1252 "quote_calc2-s.tab.c"
12520c8de5b0SBaptiste Daroussin break;
12530c8de5b0SBaptiste Daroussin case 14:
12540c8de5b0SBaptiste Daroussin #line 61 "quote_calc2.y"
12550c8de5b0SBaptiste Daroussin 	{  yyval = - yystack.l_mark[0]; }
1256*8e022d3cSDag-Erling Smørgrav #line 1257 "quote_calc2-s.tab.c"
12570c8de5b0SBaptiste Daroussin break;
12580c8de5b0SBaptiste Daroussin case 15:
12590c8de5b0SBaptiste Daroussin #line 63 "quote_calc2.y"
12600c8de5b0SBaptiste Daroussin 	{  yyval = regs[yystack.l_mark[0]]; }
1261*8e022d3cSDag-Erling Smørgrav #line 1262 "quote_calc2-s.tab.c"
12620c8de5b0SBaptiste Daroussin break;
12630c8de5b0SBaptiste Daroussin case 17:
12640c8de5b0SBaptiste Daroussin #line 68 "quote_calc2.y"
12650c8de5b0SBaptiste Daroussin 	{  yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
1266*8e022d3cSDag-Erling Smørgrav #line 1267 "quote_calc2-s.tab.c"
12670c8de5b0SBaptiste Daroussin break;
12680c8de5b0SBaptiste Daroussin case 18:
12690c8de5b0SBaptiste Daroussin #line 70 "quote_calc2.y"
12700c8de5b0SBaptiste Daroussin 	{  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
1271*8e022d3cSDag-Erling Smørgrav #line 1272 "quote_calc2-s.tab.c"
12720c8de5b0SBaptiste Daroussin break;
1273*8e022d3cSDag-Erling Smørgrav #line 1274 "quote_calc2-s.tab.c"
12740c8de5b0SBaptiste Daroussin     default:
12750c8de5b0SBaptiste Daroussin         break;
12760c8de5b0SBaptiste Daroussin     }
12770c8de5b0SBaptiste Daroussin     yystack.s_mark -= yym;
12780c8de5b0SBaptiste Daroussin     yystate = *yystack.s_mark;
12790c8de5b0SBaptiste Daroussin     yystack.l_mark -= yym;
12800c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
12810c8de5b0SBaptiste Daroussin     yystack.p_mark -= yym;
12820c8de5b0SBaptiste Daroussin #endif
12830c8de5b0SBaptiste Daroussin     yym = yylhs[yyn];
12840c8de5b0SBaptiste Daroussin     if (yystate == 0 && yym == 0)
12850c8de5b0SBaptiste Daroussin     {
12860c8de5b0SBaptiste Daroussin #if YYDEBUG
12870c8de5b0SBaptiste Daroussin         if (yydebug)
12880c8de5b0SBaptiste Daroussin         {
12890c8de5b0SBaptiste Daroussin             fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
12900c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
12910c8de5b0SBaptiste Daroussin #if YYBTYACC
12920c8de5b0SBaptiste Daroussin             if (!yytrial)
12930c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
12940c8de5b0SBaptiste Daroussin                 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
12950c8de5b0SBaptiste Daroussin #endif
12960c8de5b0SBaptiste Daroussin             fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
12970c8de5b0SBaptiste Daroussin         }
12980c8de5b0SBaptiste Daroussin #endif
12990c8de5b0SBaptiste Daroussin         yystate = YYFINAL;
13000c8de5b0SBaptiste Daroussin         *++yystack.s_mark = YYFINAL;
13010c8de5b0SBaptiste Daroussin         *++yystack.l_mark = yyval;
13020c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13030c8de5b0SBaptiste Daroussin         *++yystack.p_mark = yyloc;
13040c8de5b0SBaptiste Daroussin #endif
13050c8de5b0SBaptiste Daroussin         if (yychar < 0)
13060c8de5b0SBaptiste Daroussin         {
13070c8de5b0SBaptiste Daroussin #if YYBTYACC
13080c8de5b0SBaptiste Daroussin             do {
13090c8de5b0SBaptiste Daroussin             if (yylvp < yylve)
13100c8de5b0SBaptiste Daroussin             {
13110c8de5b0SBaptiste Daroussin                 /* we're currently re-reading tokens */
13120c8de5b0SBaptiste Daroussin                 yylval = *yylvp++;
13130c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13140c8de5b0SBaptiste Daroussin                 yylloc = *yylpp++;
13150c8de5b0SBaptiste Daroussin #endif
13160c8de5b0SBaptiste Daroussin                 yychar = *yylexp++;
13170c8de5b0SBaptiste Daroussin                 break;
13180c8de5b0SBaptiste Daroussin             }
13190c8de5b0SBaptiste Daroussin             if (yyps->save)
13200c8de5b0SBaptiste Daroussin             {
13210c8de5b0SBaptiste Daroussin                 /* in trial mode; save scanner results for future parse attempts */
13220c8de5b0SBaptiste Daroussin                 if (yylvp == yylvlim)
13230c8de5b0SBaptiste Daroussin                 {   /* Enlarge lexical value queue */
132411fce282SBaptiste Daroussin                     size_t p = (size_t) (yylvp - yylvals);
132511fce282SBaptiste Daroussin                     size_t s = (size_t) (yylvlim - yylvals);
13260c8de5b0SBaptiste Daroussin 
13270c8de5b0SBaptiste Daroussin                     s += YYLVQUEUEGROWTH;
1328b53bb29fSJung-uk Kim                     if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
13290c8de5b0SBaptiste Daroussin                         goto yyenomem;
1330b53bb29fSJung-uk Kim                     if ((yylvals   = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
13310c8de5b0SBaptiste Daroussin                         goto yyenomem;
13320c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1333b53bb29fSJung-uk Kim                     if ((yylpsns   = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
13340c8de5b0SBaptiste Daroussin                         goto yyenomem;
13350c8de5b0SBaptiste Daroussin #endif
13360c8de5b0SBaptiste Daroussin                     yylvp   = yylve = yylvals + p;
13370c8de5b0SBaptiste Daroussin                     yylvlim = yylvals + s;
13380c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13390c8de5b0SBaptiste Daroussin                     yylpp   = yylpe = yylpsns + p;
13400c8de5b0SBaptiste Daroussin                     yylplim = yylpsns + s;
13410c8de5b0SBaptiste Daroussin #endif
13420c8de5b0SBaptiste Daroussin                     yylexp  = yylexemes + p;
13430c8de5b0SBaptiste Daroussin                 }
13442aca18c7SJung-uk Kim                 *yylexp = (YYINT) YYLEX;
13450c8de5b0SBaptiste Daroussin                 *yylvp++ = yylval;
13460c8de5b0SBaptiste Daroussin                 yylve++;
13470c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13480c8de5b0SBaptiste Daroussin                 *yylpp++ = yylloc;
13490c8de5b0SBaptiste Daroussin                 yylpe++;
13500c8de5b0SBaptiste Daroussin #endif
13510c8de5b0SBaptiste Daroussin                 yychar = *yylexp++;
13520c8de5b0SBaptiste Daroussin                 break;
13530c8de5b0SBaptiste Daroussin             }
13540c8de5b0SBaptiste Daroussin             /* normal operation, no conflict encountered */
13550c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13560c8de5b0SBaptiste Daroussin             yychar = YYLEX;
13570c8de5b0SBaptiste Daroussin #if YYBTYACC
13580c8de5b0SBaptiste Daroussin             } while (0);
13590c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13600c8de5b0SBaptiste Daroussin             if (yychar < 0) yychar = YYEOF;
13610c8de5b0SBaptiste Daroussin #if YYDEBUG
13620c8de5b0SBaptiste Daroussin             if (yydebug)
13630c8de5b0SBaptiste Daroussin             {
1364c5b5d71aSJung-uk Kim                 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1365c5b5d71aSJung-uk Kim                 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
13660c8de5b0SBaptiste Daroussin                                 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
13670c8de5b0SBaptiste Daroussin             }
13680c8de5b0SBaptiste Daroussin #endif
13690c8de5b0SBaptiste Daroussin         }
13700c8de5b0SBaptiste Daroussin         if (yychar == YYEOF) goto yyaccept;
13710c8de5b0SBaptiste Daroussin         goto yyloop;
13720c8de5b0SBaptiste Daroussin     }
13730c8de5b0SBaptiste Daroussin     if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
13740c8de5b0SBaptiste Daroussin             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
13750c8de5b0SBaptiste Daroussin         yystate = yytable[yyn];
13760c8de5b0SBaptiste Daroussin     else
13770c8de5b0SBaptiste Daroussin         yystate = yydgoto[yym];
13780c8de5b0SBaptiste Daroussin #if YYDEBUG
13790c8de5b0SBaptiste Daroussin     if (yydebug)
13800c8de5b0SBaptiste Daroussin     {
13810c8de5b0SBaptiste Daroussin         fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
13820c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
13830c8de5b0SBaptiste Daroussin #if YYBTYACC
13840c8de5b0SBaptiste Daroussin         if (!yytrial)
13850c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13860c8de5b0SBaptiste Daroussin             fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
13870c8de5b0SBaptiste Daroussin #endif
13880c8de5b0SBaptiste Daroussin         fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
13890c8de5b0SBaptiste Daroussin     }
13900c8de5b0SBaptiste Daroussin #endif
13910c8de5b0SBaptiste Daroussin     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1392c5b5d71aSJung-uk Kim     *++yystack.s_mark = (YYINT) yystate;
13930c8de5b0SBaptiste Daroussin     *++yystack.l_mark = yyval;
13940c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13950c8de5b0SBaptiste Daroussin     *++yystack.p_mark = yyloc;
13960c8de5b0SBaptiste Daroussin #endif
13970c8de5b0SBaptiste Daroussin     goto yyloop;
13980c8de5b0SBaptiste Daroussin #if YYBTYACC
13990c8de5b0SBaptiste Daroussin 
14000c8de5b0SBaptiste Daroussin     /* Reduction declares that this path is valid. Set yypath and do a full parse */
14010c8de5b0SBaptiste Daroussin yyvalid:
14020c8de5b0SBaptiste Daroussin     if (yypath) YYABORT;
14030c8de5b0SBaptiste Daroussin     while (yyps->save)
14040c8de5b0SBaptiste Daroussin     {
14050c8de5b0SBaptiste Daroussin         YYParseState *save = yyps->save;
14060c8de5b0SBaptiste Daroussin         yyps->save = save->save;
14070c8de5b0SBaptiste Daroussin         save->save = yypath;
14080c8de5b0SBaptiste Daroussin         yypath = save;
14090c8de5b0SBaptiste Daroussin     }
14100c8de5b0SBaptiste Daroussin #if YYDEBUG
14110c8de5b0SBaptiste Daroussin     if (yydebug)
14120c8de5b0SBaptiste Daroussin         fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
14130c8de5b0SBaptiste Daroussin                         YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
14140c8de5b0SBaptiste Daroussin #endif
14150c8de5b0SBaptiste Daroussin     if (yyerrctx)
14160c8de5b0SBaptiste Daroussin     {
14170c8de5b0SBaptiste Daroussin         yyFreeState(yyerrctx);
14180c8de5b0SBaptiste Daroussin         yyerrctx = NULL;
14190c8de5b0SBaptiste Daroussin     }
14200c8de5b0SBaptiste Daroussin     yylvp          = yylvals + yypath->lexeme;
14210c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14220c8de5b0SBaptiste Daroussin     yylpp          = yylpsns + yypath->lexeme;
14230c8de5b0SBaptiste Daroussin #endif
14240c8de5b0SBaptiste Daroussin     yylexp         = yylexemes + yypath->lexeme;
14250c8de5b0SBaptiste Daroussin     yychar         = YYEMPTY;
14260c8de5b0SBaptiste Daroussin     yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1427c5b5d71aSJung-uk Kim     memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
14280c8de5b0SBaptiste Daroussin     yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
142911fce282SBaptiste Daroussin     memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
14300c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14310c8de5b0SBaptiste Daroussin     yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
143211fce282SBaptiste Daroussin     memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
14330c8de5b0SBaptiste Daroussin #endif
14340c8de5b0SBaptiste Daroussin     yystate        = yypath->state;
14350c8de5b0SBaptiste Daroussin     goto yyloop;
14360c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14370c8de5b0SBaptiste Daroussin 
14380c8de5b0SBaptiste Daroussin yyoverflow:
14390c8de5b0SBaptiste Daroussin     YYERROR_CALL("yacc stack overflow");
14400c8de5b0SBaptiste Daroussin #if YYBTYACC
14410c8de5b0SBaptiste Daroussin     goto yyabort_nomem;
14420c8de5b0SBaptiste Daroussin yyenomem:
14430c8de5b0SBaptiste Daroussin     YYERROR_CALL("memory exhausted");
14440c8de5b0SBaptiste Daroussin yyabort_nomem:
14450c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14460c8de5b0SBaptiste Daroussin     yyresult = 2;
14470c8de5b0SBaptiste Daroussin     goto yyreturn;
14480c8de5b0SBaptiste Daroussin 
14490c8de5b0SBaptiste Daroussin yyabort:
14500c8de5b0SBaptiste Daroussin     yyresult = 1;
14510c8de5b0SBaptiste Daroussin     goto yyreturn;
14520c8de5b0SBaptiste Daroussin 
14530c8de5b0SBaptiste Daroussin yyaccept:
14540c8de5b0SBaptiste Daroussin #if YYBTYACC
14550c8de5b0SBaptiste Daroussin     if (yyps->save) goto yyvalid;
14560c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14570c8de5b0SBaptiste Daroussin     yyresult = 0;
14580c8de5b0SBaptiste Daroussin 
14590c8de5b0SBaptiste Daroussin yyreturn:
14600c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
14610c8de5b0SBaptiste Daroussin     if (yychar != YYEOF && yychar != YYEMPTY)
14620c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14630c8de5b0SBaptiste Daroussin         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
14640c8de5b0SBaptiste Daroussin #else
14650c8de5b0SBaptiste Daroussin         YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
14660c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
14670c8de5b0SBaptiste Daroussin 
14680c8de5b0SBaptiste Daroussin     {
14690c8de5b0SBaptiste Daroussin         YYSTYPE *pv;
14700c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14710c8de5b0SBaptiste Daroussin         YYLTYPE *pp;
14720c8de5b0SBaptiste Daroussin 
14730c8de5b0SBaptiste Daroussin         for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
14740c8de5b0SBaptiste Daroussin              YYDESTRUCT_CALL("cleanup: discarding state",
14750c8de5b0SBaptiste Daroussin                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
14760c8de5b0SBaptiste Daroussin #else
14770c8de5b0SBaptiste Daroussin         for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
14780c8de5b0SBaptiste Daroussin              YYDESTRUCT_CALL("cleanup: discarding state",
14790c8de5b0SBaptiste Daroussin                              yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
14800c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
14810c8de5b0SBaptiste Daroussin     }
14820c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
14830c8de5b0SBaptiste Daroussin 
14840c8de5b0SBaptiste Daroussin #if YYBTYACC
14850c8de5b0SBaptiste Daroussin     if (yyerrctx)
14860c8de5b0SBaptiste Daroussin     {
14870c8de5b0SBaptiste Daroussin         yyFreeState(yyerrctx);
14880c8de5b0SBaptiste Daroussin         yyerrctx = NULL;
14890c8de5b0SBaptiste Daroussin     }
14900c8de5b0SBaptiste Daroussin     while (yyps)
14910c8de5b0SBaptiste Daroussin     {
14920c8de5b0SBaptiste Daroussin         YYParseState *save = yyps;
14930c8de5b0SBaptiste Daroussin         yyps = save->save;
14940c8de5b0SBaptiste Daroussin         save->save = NULL;
14950c8de5b0SBaptiste Daroussin         yyFreeState(save);
14960c8de5b0SBaptiste Daroussin     }
14970c8de5b0SBaptiste Daroussin     while (yypath)
14980c8de5b0SBaptiste Daroussin     {
14990c8de5b0SBaptiste Daroussin         YYParseState *save = yypath;
15000c8de5b0SBaptiste Daroussin         yypath = save->save;
15010c8de5b0SBaptiste Daroussin         save->save = NULL;
15020c8de5b0SBaptiste Daroussin         yyFreeState(save);
15030c8de5b0SBaptiste Daroussin     }
15040c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
15050c8de5b0SBaptiste Daroussin     yyfreestack(&yystack);
15060c8de5b0SBaptiste Daroussin     return (yyresult);
15070c8de5b0SBaptiste Daroussin }
1508