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_calc_parse
220c8de5b0SBaptiste Daroussin #endif /* yyparse */
230c8de5b0SBaptiste Daroussin
240c8de5b0SBaptiste Daroussin #ifndef yylex
250c8de5b0SBaptiste Daroussin #define yylex quote_calc_lex
260c8de5b0SBaptiste Daroussin #endif /* yylex */
270c8de5b0SBaptiste Daroussin
280c8de5b0SBaptiste Daroussin #ifndef yyerror
290c8de5b0SBaptiste Daroussin #define yyerror quote_calc_error
300c8de5b0SBaptiste Daroussin #endif /* yyerror */
310c8de5b0SBaptiste Daroussin
320c8de5b0SBaptiste Daroussin #ifndef yychar
330c8de5b0SBaptiste Daroussin #define yychar quote_calc_char
340c8de5b0SBaptiste Daroussin #endif /* yychar */
350c8de5b0SBaptiste Daroussin
360c8de5b0SBaptiste Daroussin #ifndef yyval
370c8de5b0SBaptiste Daroussin #define yyval quote_calc_val
380c8de5b0SBaptiste Daroussin #endif /* yyval */
390c8de5b0SBaptiste Daroussin
400c8de5b0SBaptiste Daroussin #ifndef yylval
410c8de5b0SBaptiste Daroussin #define yylval quote_calc_lval
420c8de5b0SBaptiste Daroussin #endif /* yylval */
430c8de5b0SBaptiste Daroussin
440c8de5b0SBaptiste Daroussin #ifndef yydebug
450c8de5b0SBaptiste Daroussin #define yydebug quote_calc_debug
460c8de5b0SBaptiste Daroussin #endif /* yydebug */
470c8de5b0SBaptiste Daroussin
480c8de5b0SBaptiste Daroussin #ifndef yynerrs
490c8de5b0SBaptiste Daroussin #define yynerrs quote_calc_nerrs
500c8de5b0SBaptiste Daroussin #endif /* yynerrs */
510c8de5b0SBaptiste Daroussin
520c8de5b0SBaptiste Daroussin #ifndef yyerrflag
530c8de5b0SBaptiste Daroussin #define yyerrflag quote_calc_errflag
540c8de5b0SBaptiste Daroussin #endif /* yyerrflag */
550c8de5b0SBaptiste Daroussin
560c8de5b0SBaptiste Daroussin #ifndef yylhs
570c8de5b0SBaptiste Daroussin #define yylhs quote_calc_lhs
580c8de5b0SBaptiste Daroussin #endif /* yylhs */
590c8de5b0SBaptiste Daroussin
600c8de5b0SBaptiste Daroussin #ifndef yylen
610c8de5b0SBaptiste Daroussin #define yylen quote_calc_len
620c8de5b0SBaptiste Daroussin #endif /* yylen */
630c8de5b0SBaptiste Daroussin
640c8de5b0SBaptiste Daroussin #ifndef yydefred
650c8de5b0SBaptiste Daroussin #define yydefred quote_calc_defred
660c8de5b0SBaptiste Daroussin #endif /* yydefred */
670c8de5b0SBaptiste Daroussin
680c8de5b0SBaptiste Daroussin #ifndef yystos
690c8de5b0SBaptiste Daroussin #define yystos quote_calc_stos
700c8de5b0SBaptiste Daroussin #endif /* yystos */
710c8de5b0SBaptiste Daroussin
720c8de5b0SBaptiste Daroussin #ifndef yydgoto
730c8de5b0SBaptiste Daroussin #define yydgoto quote_calc_dgoto
740c8de5b0SBaptiste Daroussin #endif /* yydgoto */
750c8de5b0SBaptiste Daroussin
760c8de5b0SBaptiste Daroussin #ifndef yysindex
770c8de5b0SBaptiste Daroussin #define yysindex quote_calc_sindex
780c8de5b0SBaptiste Daroussin #endif /* yysindex */
790c8de5b0SBaptiste Daroussin
800c8de5b0SBaptiste Daroussin #ifndef yyrindex
810c8de5b0SBaptiste Daroussin #define yyrindex quote_calc_rindex
820c8de5b0SBaptiste Daroussin #endif /* yyrindex */
830c8de5b0SBaptiste Daroussin
840c8de5b0SBaptiste Daroussin #ifndef yygindex
850c8de5b0SBaptiste Daroussin #define yygindex quote_calc_gindex
860c8de5b0SBaptiste Daroussin #endif /* yygindex */
870c8de5b0SBaptiste Daroussin
880c8de5b0SBaptiste Daroussin #ifndef yytable
890c8de5b0SBaptiste Daroussin #define yytable quote_calc_table
900c8de5b0SBaptiste Daroussin #endif /* yytable */
910c8de5b0SBaptiste Daroussin
920c8de5b0SBaptiste Daroussin #ifndef yycheck
930c8de5b0SBaptiste Daroussin #define yycheck quote_calc_check
940c8de5b0SBaptiste Daroussin #endif /* yycheck */
950c8de5b0SBaptiste Daroussin
960c8de5b0SBaptiste Daroussin #ifndef yyname
970c8de5b0SBaptiste Daroussin #define yyname quote_calc_name
980c8de5b0SBaptiste Daroussin #endif /* yyname */
990c8de5b0SBaptiste Daroussin
1000c8de5b0SBaptiste Daroussin #ifndef yyrule
1010c8de5b0SBaptiste Daroussin #define yyrule quote_calc_rule
1020c8de5b0SBaptiste Daroussin #endif /* yyrule */
1030c8de5b0SBaptiste Daroussin
1040c8de5b0SBaptiste Daroussin #if YYBTYACC
1050c8de5b0SBaptiste Daroussin
1060c8de5b0SBaptiste Daroussin #ifndef yycindex
1070c8de5b0SBaptiste Daroussin #define yycindex quote_calc_cindex
1080c8de5b0SBaptiste Daroussin #endif /* yycindex */
1090c8de5b0SBaptiste Daroussin
1100c8de5b0SBaptiste Daroussin #ifndef yyctable
1110c8de5b0SBaptiste Daroussin #define yyctable quote_calc_ctable
1120c8de5b0SBaptiste Daroussin #endif /* yyctable */
1130c8de5b0SBaptiste Daroussin
1140c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
1150c8de5b0SBaptiste Daroussin
1160c8de5b0SBaptiste Daroussin #define YYPREFIX "quote_calc_"
1170c8de5b0SBaptiste Daroussin
1180c8de5b0SBaptiste Daroussin #define YYPURE 0
1190c8de5b0SBaptiste Daroussin
1200c8de5b0SBaptiste Daroussin #line 2 "quote_calc.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_calc.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 ADD 258
1710c8de5b0SBaptiste Daroussin #define OP_SUB 259
1720c8de5b0SBaptiste Daroussin #define SUB 260
1730c8de5b0SBaptiste Daroussin #define OP_MUL 261
1740c8de5b0SBaptiste Daroussin #define MUL 262
1750c8de5b0SBaptiste Daroussin #define OP_DIV 263
1760c8de5b0SBaptiste Daroussin #define DIV 264
1770c8de5b0SBaptiste Daroussin #define OP_MOD 265
1780c8de5b0SBaptiste Daroussin #define MOD 266
1790c8de5b0SBaptiste Daroussin #define OP_AND 267
1800c8de5b0SBaptiste Daroussin #define AND 268
1810c8de5b0SBaptiste Daroussin #define DIGIT 269
1820c8de5b0SBaptiste Daroussin #define LETTER 270
1830c8de5b0SBaptiste Daroussin #define UMINUS 271
1840c8de5b0SBaptiste Daroussin #define YYERRCODE 256
185b53bb29fSJung-uk Kim typedef int YYINT;
1860c8de5b0SBaptiste Daroussin static const YYINT quote_calc_lhs[] = { -1,
1870c8de5b0SBaptiste Daroussin 0, 0, 0, 1, 1, 2, 2, 2, 2, 2,
1880c8de5b0SBaptiste Daroussin 2, 2, 2, 2, 2, 2, 3, 3,
1890c8de5b0SBaptiste Daroussin };
1900c8de5b0SBaptiste Daroussin static const YYINT quote_calc_len[] = { 2,
1910c8de5b0SBaptiste Daroussin 0, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1920c8de5b0SBaptiste Daroussin 3, 3, 3, 2, 1, 1, 1, 2,
1930c8de5b0SBaptiste Daroussin };
1940c8de5b0SBaptiste Daroussin static const YYINT quote_calc_defred[] = { 1,
1950c8de5b0SBaptiste Daroussin 0, 0, 0, 17, 0, 0, 0, 0, 0, 3,
1960c8de5b0SBaptiste Daroussin 15, 0, 0, 0, 2, 0, 0, 0, 0, 0,
1970c8de5b0SBaptiste Daroussin 0, 0, 18, 0, 6, 0, 0, 0, 0, 0,
1980c8de5b0SBaptiste Daroussin 0, 0,
1990c8de5b0SBaptiste Daroussin };
2002aca18c7SJung-uk Kim #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
2010c8de5b0SBaptiste Daroussin static const YYINT quote_calc_stos[] = { 0,
2020c8de5b0SBaptiste Daroussin 273, 256, 259, 269, 270, 40, 274, 275, 276, 10,
2030c8de5b0SBaptiste Daroussin 270, 275, 61, 275, 10, 257, 259, 261, 263, 265,
2040c8de5b0SBaptiste Daroussin 267, 124, 269, 275, 41, 275, 275, 275, 275, 275,
2050c8de5b0SBaptiste Daroussin 275, 275,
2060c8de5b0SBaptiste Daroussin };
2072aca18c7SJung-uk Kim #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
2080c8de5b0SBaptiste Daroussin static const YYINT quote_calc_dgoto[] = { 1,
2090c8de5b0SBaptiste Daroussin 7, 8, 9,
2100c8de5b0SBaptiste Daroussin };
2110c8de5b0SBaptiste Daroussin static const YYINT quote_calc_sindex[] = { 0,
2120c8de5b0SBaptiste Daroussin -38, 5, -36, 0, -51, -36, 7, -121, -248, 0,
2130c8de5b0SBaptiste Daroussin 0, -243, -36, -22, 0, -36, -36, -36, -36, -36,
2140c8de5b0SBaptiste Daroussin -36, -36, 0, -121, 0, -121, -121, -121, -121, -121,
2150c8de5b0SBaptiste Daroussin -121, -243,
2160c8de5b0SBaptiste Daroussin };
2170c8de5b0SBaptiste Daroussin static const YYINT quote_calc_rindex[] = { 0,
2180c8de5b0SBaptiste Daroussin 0, 0, 0, 0, -9, 0, 0, 13, -10, 0,
2190c8de5b0SBaptiste Daroussin 0, -5, 0, 0, 0, 0, 0, 0, 0, 0,
2200c8de5b0SBaptiste Daroussin 0, 0, 0, 15, 0, -3, -2, -1, 1, 2,
2210c8de5b0SBaptiste Daroussin 3, -4,
2220c8de5b0SBaptiste Daroussin };
2230c8de5b0SBaptiste Daroussin #if YYBTYACC
2240c8de5b0SBaptiste Daroussin static const YYINT quote_calc_cindex[] = { 0,
2250c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2260c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2270c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2280c8de5b0SBaptiste Daroussin 0, 0,
2290c8de5b0SBaptiste Daroussin };
2300c8de5b0SBaptiste Daroussin #endif
2310c8de5b0SBaptiste Daroussin static const YYINT quote_calc_gindex[] = { 0,
2320c8de5b0SBaptiste Daroussin 0, 42, 0,
2330c8de5b0SBaptiste Daroussin };
2340c8de5b0SBaptiste Daroussin #define YYTABLESIZE 258
2350c8de5b0SBaptiste Daroussin static const YYINT quote_calc_table[] = { 16,
2360c8de5b0SBaptiste Daroussin 15, 6, 22, 6, 14, 13, 7, 8, 9, 13,
2370c8de5b0SBaptiste Daroussin 10, 11, 12, 16, 10, 17, 15, 18, 25, 19,
2380c8de5b0SBaptiste Daroussin 23, 20, 4, 21, 5, 0, 0, 0, 0, 0,
2390c8de5b0SBaptiste Daroussin 16, 0, 0, 0, 0, 14, 13, 7, 8, 9,
2400c8de5b0SBaptiste Daroussin 0, 10, 11, 12, 12, 0, 0, 14, 0, 0,
2410c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 24, 0, 0, 26, 27, 28,
2420c8de5b0SBaptiste Daroussin 29, 30, 31, 32, 0, 0, 0, 0, 0, 0,
2430c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2440c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2450c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2460c8de5b0SBaptiste Daroussin 0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
2470c8de5b0SBaptiste Daroussin 0, 0, 0, 16, 15, 0, 0, 0, 14, 13,
2480c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2490c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 16, 0, 17, 0, 18,
2500c8de5b0SBaptiste Daroussin 0, 19, 0, 20, 0, 21, 0, 0, 0, 0,
2510c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2520c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2530c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2540c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2550c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2560c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2570c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
2580c8de5b0SBaptiste Daroussin 3, 0, 3, 0, 0, 0, 0, 0, 0, 0,
2590c8de5b0SBaptiste Daroussin 4, 5, 4, 11, 16, 0, 17, 0, 18, 0,
2600c8de5b0SBaptiste Daroussin 19, 0, 20, 0, 21, 0, 16, 15, 16, 15,
2610c8de5b0SBaptiste Daroussin 16, 15, 16, 15, 16, 15, 16, 15,
2620c8de5b0SBaptiste Daroussin };
2630c8de5b0SBaptiste Daroussin static const YYINT quote_calc_check[] = { 10,
2640c8de5b0SBaptiste Daroussin 10, 40, 124, 40, 10, 10, 10, 10, 10, 61,
2650c8de5b0SBaptiste Daroussin 10, 10, 10, 257, 10, 259, 10, 261, 41, 263,
2660c8de5b0SBaptiste Daroussin 269, 265, 10, 267, 10, -1, -1, -1, -1, -1,
2670c8de5b0SBaptiste Daroussin 41, -1, -1, -1, -1, 41, 41, 41, 41, 41,
2680c8de5b0SBaptiste Daroussin -1, 41, 41, 41, 3, -1, -1, 6, -1, -1,
2690c8de5b0SBaptiste Daroussin -1, -1, -1, -1, 13, -1, -1, 16, 17, 18,
2700c8de5b0SBaptiste Daroussin 19, 20, 21, 22, -1, -1, -1, -1, -1, -1,
2710c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2720c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2730c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2740c8de5b0SBaptiste Daroussin -1, 124, -1, -1, -1, -1, -1, -1, -1, -1,
2750c8de5b0SBaptiste Daroussin -1, -1, -1, 124, 124, -1, -1, -1, 124, 124,
2760c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2770c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 257, -1, 259, -1, 261,
2780c8de5b0SBaptiste Daroussin -1, 263, -1, 265, -1, 267, -1, -1, -1, -1,
2790c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2800c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2810c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2820c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2830c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2840c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2850c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, 256, -1, -1,
2860c8de5b0SBaptiste Daroussin 259, -1, 259, -1, -1, -1, -1, -1, -1, -1,
2870c8de5b0SBaptiste Daroussin 269, 270, 269, 270, 257, -1, 259, -1, 261, -1,
2880c8de5b0SBaptiste Daroussin 263, -1, 265, -1, 267, -1, 257, 257, 259, 259,
2890c8de5b0SBaptiste Daroussin 261, 261, 263, 263, 265, 265, 267, 267,
2900c8de5b0SBaptiste Daroussin };
29111fce282SBaptiste Daroussin #if YYBTYACC
29211fce282SBaptiste Daroussin static const YYINT quote_calc_ctable[] = { -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, -1, -1,
31311fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
31411fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
31511fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
31611fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
31711fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
31811fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1,
31911fce282SBaptiste Daroussin };
32011fce282SBaptiste Daroussin #endif
3210c8de5b0SBaptiste Daroussin #define YYFINAL 1
3220c8de5b0SBaptiste Daroussin #ifndef YYDEBUG
3230c8de5b0SBaptiste Daroussin #define YYDEBUG 0
3240c8de5b0SBaptiste Daroussin #endif
3250c8de5b0SBaptiste Daroussin #define YYMAXTOKEN 271
3260c8de5b0SBaptiste Daroussin #define YYUNDFTOKEN 277
3270c8de5b0SBaptiste Daroussin #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
3280c8de5b0SBaptiste Daroussin #if YYDEBUG
3290c8de5b0SBaptiste Daroussin static const char *const quote_calc_name[] = {
3300c8de5b0SBaptiste Daroussin
3310c8de5b0SBaptiste 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,
3320c8de5b0SBaptiste Daroussin 0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,
3330c8de5b0SBaptiste 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,
3340c8de5b0SBaptiste 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,
3350c8de5b0SBaptiste 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,
3360c8de5b0SBaptiste 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,
3370c8de5b0SBaptiste 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,
3380c8de5b0SBaptiste Daroussin 0,0,"error","OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV",
3390c8de5b0SBaptiste Daroussin "\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS",
3400c8de5b0SBaptiste Daroussin "$accept","list","stat","expr","number","illegal-symbol",
3410c8de5b0SBaptiste Daroussin };
3420c8de5b0SBaptiste Daroussin static const char *const quote_calc_rule[] = {
3430c8de5b0SBaptiste Daroussin "$accept : list",
3440c8de5b0SBaptiste Daroussin "list :",
3450c8de5b0SBaptiste Daroussin "list : list stat '\\n'",
3460c8de5b0SBaptiste Daroussin "list : list error '\\n'",
3470c8de5b0SBaptiste Daroussin "stat : expr",
3480c8de5b0SBaptiste Daroussin "stat : LETTER '=' expr",
3490c8de5b0SBaptiste Daroussin "expr : '(' expr ')'",
3500c8de5b0SBaptiste Daroussin "expr : expr OP_ADD expr",
3510c8de5b0SBaptiste Daroussin "expr : expr OP_SUB expr",
3520c8de5b0SBaptiste Daroussin "expr : expr OP_MUL expr",
3530c8de5b0SBaptiste Daroussin "expr : expr OP_DIV expr",
3540c8de5b0SBaptiste Daroussin "expr : expr OP_MOD expr",
3550c8de5b0SBaptiste Daroussin "expr : expr OP_AND expr",
3560c8de5b0SBaptiste Daroussin "expr : expr '|' expr",
3570c8de5b0SBaptiste Daroussin "expr : OP_SUB expr",
3580c8de5b0SBaptiste Daroussin "expr : LETTER",
3590c8de5b0SBaptiste Daroussin "expr : number",
3600c8de5b0SBaptiste Daroussin "number : DIGIT",
3610c8de5b0SBaptiste Daroussin "number : number DIGIT",
3620c8de5b0SBaptiste Daroussin
3630c8de5b0SBaptiste Daroussin };
3640c8de5b0SBaptiste Daroussin #endif
3650c8de5b0SBaptiste Daroussin
366b53bb29fSJung-uk Kim #if YYDEBUG
3670c8de5b0SBaptiste Daroussin int yydebug;
368b53bb29fSJung-uk Kim #endif
3690c8de5b0SBaptiste Daroussin
3700c8de5b0SBaptiste Daroussin int yyerrflag;
3710c8de5b0SBaptiste Daroussin int yychar;
3720c8de5b0SBaptiste Daroussin YYSTYPE yyval;
3730c8de5b0SBaptiste Daroussin YYSTYPE yylval;
374b53bb29fSJung-uk Kim int yynerrs;
375b53bb29fSJung-uk Kim
3760c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
3770c8de5b0SBaptiste Daroussin YYLTYPE yyloc; /* position returned by actions */
3780c8de5b0SBaptiste Daroussin YYLTYPE yylloc; /* position from the lexer */
3790c8de5b0SBaptiste Daroussin #endif
3800c8de5b0SBaptiste Daroussin
3810c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
3820c8de5b0SBaptiste Daroussin #ifndef YYLLOC_DEFAULT
3830c8de5b0SBaptiste Daroussin #define YYLLOC_DEFAULT(loc, rhs, n) \
3840c8de5b0SBaptiste Daroussin do \
3850c8de5b0SBaptiste Daroussin { \
3860c8de5b0SBaptiste Daroussin if (n == 0) \
3870c8de5b0SBaptiste Daroussin { \
388b53bb29fSJung-uk Kim (loc).first_line = YYRHSLOC(rhs, 0).last_line; \
389b53bb29fSJung-uk Kim (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
390b53bb29fSJung-uk Kim (loc).last_line = YYRHSLOC(rhs, 0).last_line; \
391b53bb29fSJung-uk Kim (loc).last_column = YYRHSLOC(rhs, 0).last_column; \
3920c8de5b0SBaptiste Daroussin } \
3930c8de5b0SBaptiste Daroussin else \
3940c8de5b0SBaptiste Daroussin { \
395b53bb29fSJung-uk Kim (loc).first_line = YYRHSLOC(rhs, 1).first_line; \
396b53bb29fSJung-uk Kim (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
397b53bb29fSJung-uk Kim (loc).last_line = YYRHSLOC(rhs, n).last_line; \
398b53bb29fSJung-uk Kim (loc).last_column = YYRHSLOC(rhs, n).last_column; \
3990c8de5b0SBaptiste Daroussin } \
4000c8de5b0SBaptiste Daroussin } while (0)
4010c8de5b0SBaptiste Daroussin #endif /* YYLLOC_DEFAULT */
4020c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
4030c8de5b0SBaptiste Daroussin #if YYBTYACC
4040c8de5b0SBaptiste Daroussin
4050c8de5b0SBaptiste Daroussin #ifndef YYLVQUEUEGROWTH
4060c8de5b0SBaptiste Daroussin #define YYLVQUEUEGROWTH 32
4070c8de5b0SBaptiste Daroussin #endif
4080c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
4090c8de5b0SBaptiste Daroussin
4100c8de5b0SBaptiste Daroussin /* define the initial stack-sizes */
4110c8de5b0SBaptiste Daroussin #ifdef YYSTACKSIZE
4120c8de5b0SBaptiste Daroussin #undef YYMAXDEPTH
4130c8de5b0SBaptiste Daroussin #define YYMAXDEPTH YYSTACKSIZE
4140c8de5b0SBaptiste Daroussin #else
4150c8de5b0SBaptiste Daroussin #ifdef YYMAXDEPTH
4160c8de5b0SBaptiste Daroussin #define YYSTACKSIZE YYMAXDEPTH
4170c8de5b0SBaptiste Daroussin #else
4180c8de5b0SBaptiste Daroussin #define YYSTACKSIZE 10000
4190c8de5b0SBaptiste Daroussin #define YYMAXDEPTH 10000
4200c8de5b0SBaptiste Daroussin #endif
4210c8de5b0SBaptiste Daroussin #endif
4220c8de5b0SBaptiste Daroussin
4230c8de5b0SBaptiste Daroussin #ifndef YYINITSTACKSIZE
4240c8de5b0SBaptiste Daroussin #define YYINITSTACKSIZE 200
4250c8de5b0SBaptiste Daroussin #endif
4260c8de5b0SBaptiste Daroussin
4270c8de5b0SBaptiste Daroussin typedef struct {
4280c8de5b0SBaptiste Daroussin unsigned stacksize;
429c5b5d71aSJung-uk Kim YYINT *s_base;
430c5b5d71aSJung-uk Kim YYINT *s_mark;
431c5b5d71aSJung-uk Kim YYINT *s_last;
4320c8de5b0SBaptiste Daroussin YYSTYPE *l_base;
4330c8de5b0SBaptiste Daroussin YYSTYPE *l_mark;
4340c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
4350c8de5b0SBaptiste Daroussin YYLTYPE *p_base;
4360c8de5b0SBaptiste Daroussin YYLTYPE *p_mark;
4370c8de5b0SBaptiste Daroussin #endif
4380c8de5b0SBaptiste Daroussin } YYSTACKDATA;
4390c8de5b0SBaptiste Daroussin #if YYBTYACC
4400c8de5b0SBaptiste Daroussin
4410c8de5b0SBaptiste Daroussin struct YYParseState_s
4420c8de5b0SBaptiste Daroussin {
4430c8de5b0SBaptiste Daroussin struct YYParseState_s *save; /* Previously saved parser state */
4440c8de5b0SBaptiste Daroussin YYSTACKDATA yystack; /* saved parser stack */
4450c8de5b0SBaptiste Daroussin int state; /* saved parser state */
4460c8de5b0SBaptiste Daroussin int errflag; /* saved error recovery status */
4470c8de5b0SBaptiste Daroussin int lexeme; /* saved index of the conflict lexeme in the lexical queue */
4480c8de5b0SBaptiste Daroussin YYINT ctry; /* saved index in yyctable[] for this conflict */
4490c8de5b0SBaptiste Daroussin };
4500c8de5b0SBaptiste Daroussin typedef struct YYParseState_s YYParseState;
4510c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
4520c8de5b0SBaptiste Daroussin /* variables for the parser stack */
4530c8de5b0SBaptiste Daroussin static YYSTACKDATA yystack;
4540c8de5b0SBaptiste Daroussin #if YYBTYACC
4550c8de5b0SBaptiste Daroussin
4560c8de5b0SBaptiste Daroussin /* Current parser state */
4570c8de5b0SBaptiste Daroussin static YYParseState *yyps = 0;
4580c8de5b0SBaptiste Daroussin
4590c8de5b0SBaptiste Daroussin /* yypath != NULL: do the full parse, starting at *yypath parser state. */
4600c8de5b0SBaptiste Daroussin static YYParseState *yypath = 0;
4610c8de5b0SBaptiste Daroussin
4620c8de5b0SBaptiste Daroussin /* Base of the lexical value queue */
4630c8de5b0SBaptiste Daroussin static YYSTYPE *yylvals = 0;
4640c8de5b0SBaptiste Daroussin
4650c8de5b0SBaptiste Daroussin /* Current position at lexical value queue */
4660c8de5b0SBaptiste Daroussin static YYSTYPE *yylvp = 0;
4670c8de5b0SBaptiste Daroussin
4680c8de5b0SBaptiste Daroussin /* End position of lexical value queue */
4690c8de5b0SBaptiste Daroussin static YYSTYPE *yylve = 0;
4700c8de5b0SBaptiste Daroussin
4710c8de5b0SBaptiste Daroussin /* The last allocated position at the lexical value queue */
4720c8de5b0SBaptiste Daroussin static YYSTYPE *yylvlim = 0;
4730c8de5b0SBaptiste Daroussin
4740c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
4750c8de5b0SBaptiste Daroussin /* Base of the lexical position queue */
4760c8de5b0SBaptiste Daroussin static YYLTYPE *yylpsns = 0;
4770c8de5b0SBaptiste Daroussin
4780c8de5b0SBaptiste Daroussin /* Current position at lexical position queue */
4790c8de5b0SBaptiste Daroussin static YYLTYPE *yylpp = 0;
4800c8de5b0SBaptiste Daroussin
4810c8de5b0SBaptiste Daroussin /* End position of lexical position queue */
4820c8de5b0SBaptiste Daroussin static YYLTYPE *yylpe = 0;
4830c8de5b0SBaptiste Daroussin
4840c8de5b0SBaptiste Daroussin /* The last allocated position at the lexical position queue */
4850c8de5b0SBaptiste Daroussin static YYLTYPE *yylplim = 0;
4860c8de5b0SBaptiste Daroussin #endif
4870c8de5b0SBaptiste Daroussin
4880c8de5b0SBaptiste Daroussin /* Current position at lexical token queue */
4892aca18c7SJung-uk Kim static YYINT *yylexp = 0;
4900c8de5b0SBaptiste Daroussin
4912aca18c7SJung-uk Kim static YYINT *yylexemes = 0;
4920c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
4930c8de5b0SBaptiste Daroussin #line 73 "quote_calc.y"
4940c8de5b0SBaptiste Daroussin /* start of programs */
4950c8de5b0SBaptiste Daroussin
4960c8de5b0SBaptiste Daroussin int
main(void)4970c8de5b0SBaptiste Daroussin main (void)
4980c8de5b0SBaptiste Daroussin {
4990c8de5b0SBaptiste Daroussin while(!feof(stdin)) {
5000c8de5b0SBaptiste Daroussin yyparse();
5010c8de5b0SBaptiste Daroussin }
5020c8de5b0SBaptiste Daroussin return 0;
5030c8de5b0SBaptiste Daroussin }
5040c8de5b0SBaptiste Daroussin
5050c8de5b0SBaptiste Daroussin static void
yyerror(const char * s)5060c8de5b0SBaptiste Daroussin yyerror(const char *s)
5070c8de5b0SBaptiste Daroussin {
5080c8de5b0SBaptiste Daroussin fprintf(stderr, "%s\n", s);
5090c8de5b0SBaptiste Daroussin }
5100c8de5b0SBaptiste Daroussin
5110c8de5b0SBaptiste Daroussin int
yylex(void)5120c8de5b0SBaptiste Daroussin yylex(void) {
5130c8de5b0SBaptiste Daroussin /* lexical analysis routine */
5140c8de5b0SBaptiste Daroussin /* returns LETTER for a lower case letter, yylval = 0 through 25 */
5150c8de5b0SBaptiste Daroussin /* return DIGIT for a digit, yylval = 0 through 9 */
5160c8de5b0SBaptiste Daroussin /* all other characters are returned immediately */
5170c8de5b0SBaptiste Daroussin
5180c8de5b0SBaptiste Daroussin int c;
5190c8de5b0SBaptiste Daroussin
5200c8de5b0SBaptiste Daroussin while( (c=getchar()) == ' ' ) { /* skip blanks */ }
5210c8de5b0SBaptiste Daroussin
5220c8de5b0SBaptiste Daroussin /* c is now nonblank */
5230c8de5b0SBaptiste Daroussin
5240c8de5b0SBaptiste Daroussin if( islower( c )) {
5250c8de5b0SBaptiste Daroussin yylval = c - 'a';
5260c8de5b0SBaptiste Daroussin return ( LETTER );
5270c8de5b0SBaptiste Daroussin }
5280c8de5b0SBaptiste Daroussin if( isdigit( c )) {
5290c8de5b0SBaptiste Daroussin yylval = c - '0';
5300c8de5b0SBaptiste Daroussin return ( DIGIT );
5310c8de5b0SBaptiste Daroussin }
5320c8de5b0SBaptiste Daroussin return( c );
5330c8de5b0SBaptiste Daroussin }
534b53bb29fSJung-uk Kim #line 535 "quote_calc.tab.c"
5350c8de5b0SBaptiste Daroussin
5360c8de5b0SBaptiste Daroussin /* For use in generated program */
5370c8de5b0SBaptiste Daroussin #define yydepth (int)(yystack.s_mark - yystack.s_base)
5380c8de5b0SBaptiste Daroussin #if YYBTYACC
5390c8de5b0SBaptiste Daroussin #define yytrial (yyps->save)
5400c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
5410c8de5b0SBaptiste Daroussin
5420c8de5b0SBaptiste Daroussin #if YYDEBUG
5430c8de5b0SBaptiste Daroussin #include <stdio.h> /* needed for printf */
5440c8de5b0SBaptiste Daroussin #endif
5450c8de5b0SBaptiste Daroussin
5460c8de5b0SBaptiste Daroussin #include <stdlib.h> /* needed for malloc, etc */
5470c8de5b0SBaptiste Daroussin #include <string.h> /* needed for memset */
5480c8de5b0SBaptiste Daroussin
5490c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */
yygrowstack(YYSTACKDATA * data)5500c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data)
5510c8de5b0SBaptiste Daroussin {
5520c8de5b0SBaptiste Daroussin int i;
5530c8de5b0SBaptiste Daroussin unsigned newsize;
554c5b5d71aSJung-uk Kim YYINT *newss;
5550c8de5b0SBaptiste Daroussin YYSTYPE *newvs;
5560c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5570c8de5b0SBaptiste Daroussin YYLTYPE *newps;
5580c8de5b0SBaptiste Daroussin #endif
5590c8de5b0SBaptiste Daroussin
5600c8de5b0SBaptiste Daroussin if ((newsize = data->stacksize) == 0)
5610c8de5b0SBaptiste Daroussin newsize = YYINITSTACKSIZE;
5620c8de5b0SBaptiste Daroussin else if (newsize >= YYMAXDEPTH)
5630c8de5b0SBaptiste Daroussin return YYENOMEM;
5640c8de5b0SBaptiste Daroussin else if ((newsize *= 2) > YYMAXDEPTH)
5650c8de5b0SBaptiste Daroussin newsize = YYMAXDEPTH;
5660c8de5b0SBaptiste Daroussin
5670c8de5b0SBaptiste Daroussin i = (int) (data->s_mark - data->s_base);
568c5b5d71aSJung-uk Kim newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
569bf80e08eSJung-uk Kim if (newss == NULL)
5700c8de5b0SBaptiste Daroussin return YYENOMEM;
5710c8de5b0SBaptiste Daroussin
5720c8de5b0SBaptiste Daroussin data->s_base = newss;
5730c8de5b0SBaptiste Daroussin data->s_mark = newss + i;
5740c8de5b0SBaptiste Daroussin
5750c8de5b0SBaptiste Daroussin newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
576bf80e08eSJung-uk Kim if (newvs == NULL)
5770c8de5b0SBaptiste Daroussin return YYENOMEM;
5780c8de5b0SBaptiste Daroussin
5790c8de5b0SBaptiste Daroussin data->l_base = newvs;
5800c8de5b0SBaptiste Daroussin data->l_mark = newvs + i;
5810c8de5b0SBaptiste Daroussin
5820c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5830c8de5b0SBaptiste Daroussin newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
584bf80e08eSJung-uk Kim if (newps == NULL)
5850c8de5b0SBaptiste Daroussin return YYENOMEM;
5860c8de5b0SBaptiste Daroussin
5870c8de5b0SBaptiste Daroussin data->p_base = newps;
5880c8de5b0SBaptiste Daroussin data->p_mark = newps + i;
5890c8de5b0SBaptiste Daroussin #endif
5900c8de5b0SBaptiste Daroussin
5910c8de5b0SBaptiste Daroussin data->stacksize = newsize;
5920c8de5b0SBaptiste Daroussin data->s_last = data->s_base + newsize - 1;
5930c8de5b0SBaptiste Daroussin
5940c8de5b0SBaptiste Daroussin #if YYDEBUG
5950c8de5b0SBaptiste Daroussin if (yydebug)
5960c8de5b0SBaptiste Daroussin fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
5970c8de5b0SBaptiste Daroussin #endif
5980c8de5b0SBaptiste Daroussin return 0;
5990c8de5b0SBaptiste Daroussin }
6000c8de5b0SBaptiste Daroussin
6010c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS)
yyfreestack(YYSTACKDATA * data)6020c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data)
6030c8de5b0SBaptiste Daroussin {
6040c8de5b0SBaptiste Daroussin free(data->s_base);
6050c8de5b0SBaptiste Daroussin free(data->l_base);
6060c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6070c8de5b0SBaptiste Daroussin free(data->p_base);
6080c8de5b0SBaptiste Daroussin #endif
6090c8de5b0SBaptiste Daroussin memset(data, 0, sizeof(*data));
6100c8de5b0SBaptiste Daroussin }
6110c8de5b0SBaptiste Daroussin #else
6120c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */
6130c8de5b0SBaptiste Daroussin #endif /* YYPURE || defined(YY_NO_LEAKS) */
6140c8de5b0SBaptiste Daroussin #if YYBTYACC
6150c8de5b0SBaptiste Daroussin
6160c8de5b0SBaptiste Daroussin static YYParseState *
yyNewState(unsigned size)6170c8de5b0SBaptiste Daroussin yyNewState(unsigned size)
6180c8de5b0SBaptiste Daroussin {
6190c8de5b0SBaptiste Daroussin YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
6200c8de5b0SBaptiste Daroussin if (p == NULL) return NULL;
6210c8de5b0SBaptiste Daroussin
6220c8de5b0SBaptiste Daroussin p->yystack.stacksize = size;
6230c8de5b0SBaptiste Daroussin if (size == 0)
6240c8de5b0SBaptiste Daroussin {
6250c8de5b0SBaptiste Daroussin p->yystack.s_base = NULL;
6260c8de5b0SBaptiste Daroussin p->yystack.l_base = NULL;
6270c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6280c8de5b0SBaptiste Daroussin p->yystack.p_base = NULL;
6290c8de5b0SBaptiste Daroussin #endif
6300c8de5b0SBaptiste Daroussin return p;
6310c8de5b0SBaptiste Daroussin }
632c5b5d71aSJung-uk Kim p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
6330c8de5b0SBaptiste Daroussin if (p->yystack.s_base == NULL) return NULL;
6340c8de5b0SBaptiste Daroussin p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
6350c8de5b0SBaptiste Daroussin if (p->yystack.l_base == NULL) return NULL;
6360c8de5b0SBaptiste Daroussin memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
6370c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6380c8de5b0SBaptiste Daroussin p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
6390c8de5b0SBaptiste Daroussin if (p->yystack.p_base == NULL) return NULL;
6400c8de5b0SBaptiste Daroussin memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
6410c8de5b0SBaptiste Daroussin #endif
6420c8de5b0SBaptiste Daroussin
6430c8de5b0SBaptiste Daroussin return p;
6440c8de5b0SBaptiste Daroussin }
6450c8de5b0SBaptiste Daroussin
6460c8de5b0SBaptiste Daroussin static void
yyFreeState(YYParseState * p)6470c8de5b0SBaptiste Daroussin yyFreeState(YYParseState *p)
6480c8de5b0SBaptiste Daroussin {
6490c8de5b0SBaptiste Daroussin yyfreestack(&p->yystack);
6500c8de5b0SBaptiste Daroussin free(p);
6510c8de5b0SBaptiste Daroussin }
6520c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6530c8de5b0SBaptiste Daroussin
6540c8de5b0SBaptiste Daroussin #define YYABORT goto yyabort
6550c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort
6560c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept
6570c8de5b0SBaptiste Daroussin #define YYERROR goto yyerrlab
6580c8de5b0SBaptiste Daroussin #if YYBTYACC
6590c8de5b0SBaptiste Daroussin #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
6600c8de5b0SBaptiste Daroussin #define YYVALID_NESTED do { if (yyps->save && \
6610c8de5b0SBaptiste Daroussin yyps->save->save == 0) goto yyvalid; } while(0)
6620c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6630c8de5b0SBaptiste Daroussin
6640c8de5b0SBaptiste Daroussin int
YYPARSE_DECL()6650c8de5b0SBaptiste Daroussin YYPARSE_DECL()
6660c8de5b0SBaptiste Daroussin {
6670c8de5b0SBaptiste Daroussin int yym, yyn, yystate, yyresult;
6680c8de5b0SBaptiste Daroussin #if YYBTYACC
6690c8de5b0SBaptiste Daroussin int yynewerrflag;
6700c8de5b0SBaptiste Daroussin YYParseState *yyerrctx = NULL;
6710c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6720c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
673b53bb29fSJung-uk Kim YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */
6740c8de5b0SBaptiste Daroussin #endif
6750c8de5b0SBaptiste Daroussin #if YYDEBUG
6760c8de5b0SBaptiste Daroussin const char *yys;
6770c8de5b0SBaptiste Daroussin
678bf80e08eSJung-uk Kim if ((yys = getenv("YYDEBUG")) != NULL)
6790c8de5b0SBaptiste Daroussin {
6800c8de5b0SBaptiste Daroussin yyn = *yys;
6810c8de5b0SBaptiste Daroussin if (yyn >= '0' && yyn <= '9')
6820c8de5b0SBaptiste Daroussin yydebug = yyn - '0';
6830c8de5b0SBaptiste Daroussin }
6840c8de5b0SBaptiste Daroussin if (yydebug)
6850c8de5b0SBaptiste Daroussin fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
6860c8de5b0SBaptiste Daroussin #endif
6876166fdceSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6886166fdceSJung-uk Kim memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
6896166fdceSJung-uk Kim #endif
6900c8de5b0SBaptiste Daroussin
6910c8de5b0SBaptiste Daroussin #if YYBTYACC
6920c8de5b0SBaptiste Daroussin yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
6930c8de5b0SBaptiste Daroussin yyps->save = 0;
6940c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
695c5b5d71aSJung-uk Kim yym = 0;
696*8e022d3cSDag-Erling Smørgrav /* yyn is set below */
6970c8de5b0SBaptiste Daroussin yynerrs = 0;
6980c8de5b0SBaptiste Daroussin yyerrflag = 0;
6990c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
7000c8de5b0SBaptiste Daroussin yystate = 0;
7010c8de5b0SBaptiste Daroussin
7020c8de5b0SBaptiste Daroussin #if YYPURE
7030c8de5b0SBaptiste Daroussin memset(&yystack, 0, sizeof(yystack));
7040c8de5b0SBaptiste Daroussin #endif
7050c8de5b0SBaptiste Daroussin
7060c8de5b0SBaptiste Daroussin if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
7070c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base;
7080c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base;
7090c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7100c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base;
7110c8de5b0SBaptiste Daroussin #endif
7120c8de5b0SBaptiste Daroussin yystate = 0;
7130c8de5b0SBaptiste Daroussin *yystack.s_mark = 0;
7140c8de5b0SBaptiste Daroussin
7150c8de5b0SBaptiste Daroussin yyloop:
7160c8de5b0SBaptiste Daroussin if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
7170c8de5b0SBaptiste Daroussin if (yychar < 0)
7180c8de5b0SBaptiste Daroussin {
7190c8de5b0SBaptiste Daroussin #if YYBTYACC
7200c8de5b0SBaptiste Daroussin do {
7210c8de5b0SBaptiste Daroussin if (yylvp < yylve)
7220c8de5b0SBaptiste Daroussin {
7230c8de5b0SBaptiste Daroussin /* we're currently re-reading tokens */
7240c8de5b0SBaptiste Daroussin yylval = *yylvp++;
7250c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7260c8de5b0SBaptiste Daroussin yylloc = *yylpp++;
7270c8de5b0SBaptiste Daroussin #endif
7280c8de5b0SBaptiste Daroussin yychar = *yylexp++;
7290c8de5b0SBaptiste Daroussin break;
7300c8de5b0SBaptiste Daroussin }
7310c8de5b0SBaptiste Daroussin if (yyps->save)
7320c8de5b0SBaptiste Daroussin {
7330c8de5b0SBaptiste Daroussin /* in trial mode; save scanner results for future parse attempts */
7340c8de5b0SBaptiste Daroussin if (yylvp == yylvlim)
7350c8de5b0SBaptiste Daroussin { /* Enlarge lexical value queue */
73611fce282SBaptiste Daroussin size_t p = (size_t) (yylvp - yylvals);
73711fce282SBaptiste Daroussin size_t s = (size_t) (yylvlim - yylvals);
7380c8de5b0SBaptiste Daroussin
7390c8de5b0SBaptiste Daroussin s += YYLVQUEUEGROWTH;
740b53bb29fSJung-uk Kim if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
741b53bb29fSJung-uk Kim if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
7420c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
743b53bb29fSJung-uk Kim if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
7440c8de5b0SBaptiste Daroussin #endif
7450c8de5b0SBaptiste Daroussin yylvp = yylve = yylvals + p;
7460c8de5b0SBaptiste Daroussin yylvlim = yylvals + s;
7470c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7480c8de5b0SBaptiste Daroussin yylpp = yylpe = yylpsns + p;
7490c8de5b0SBaptiste Daroussin yylplim = yylpsns + s;
7500c8de5b0SBaptiste Daroussin #endif
7510c8de5b0SBaptiste Daroussin yylexp = yylexemes + p;
7520c8de5b0SBaptiste Daroussin }
7532aca18c7SJung-uk Kim *yylexp = (YYINT) YYLEX;
7540c8de5b0SBaptiste Daroussin *yylvp++ = yylval;
7550c8de5b0SBaptiste Daroussin yylve++;
7560c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7570c8de5b0SBaptiste Daroussin *yylpp++ = yylloc;
7580c8de5b0SBaptiste Daroussin yylpe++;
7590c8de5b0SBaptiste Daroussin #endif
7600c8de5b0SBaptiste Daroussin yychar = *yylexp++;
7610c8de5b0SBaptiste Daroussin break;
7620c8de5b0SBaptiste Daroussin }
7630c8de5b0SBaptiste Daroussin /* normal operation, no conflict encountered */
7640c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7650c8de5b0SBaptiste Daroussin yychar = YYLEX;
7660c8de5b0SBaptiste Daroussin #if YYBTYACC
7670c8de5b0SBaptiste Daroussin } while (0);
7680c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7690c8de5b0SBaptiste Daroussin if (yychar < 0) yychar = YYEOF;
7700c8de5b0SBaptiste Daroussin #if YYDEBUG
7710c8de5b0SBaptiste Daroussin if (yydebug)
7720c8de5b0SBaptiste Daroussin {
773c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
7740c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
7750c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yychar, yys);
7760c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
7770c8de5b0SBaptiste Daroussin #if YYBTYACC
7780c8de5b0SBaptiste Daroussin if (!yytrial)
7790c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7800c8de5b0SBaptiste Daroussin fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
7810c8de5b0SBaptiste Daroussin #endif
7820c8de5b0SBaptiste Daroussin fputc('\n', stderr);
7830c8de5b0SBaptiste Daroussin }
7840c8de5b0SBaptiste Daroussin #endif
7850c8de5b0SBaptiste Daroussin }
7860c8de5b0SBaptiste Daroussin #if YYBTYACC
7870c8de5b0SBaptiste Daroussin
7880c8de5b0SBaptiste Daroussin /* Do we have a conflict? */
7890c8de5b0SBaptiste Daroussin if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
7900c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
7910c8de5b0SBaptiste Daroussin {
7920c8de5b0SBaptiste Daroussin YYINT ctry;
7930c8de5b0SBaptiste Daroussin
7940c8de5b0SBaptiste Daroussin if (yypath)
7950c8de5b0SBaptiste Daroussin {
7960c8de5b0SBaptiste Daroussin YYParseState *save;
7970c8de5b0SBaptiste Daroussin #if YYDEBUG
7980c8de5b0SBaptiste Daroussin if (yydebug)
7990c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
8000c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate);
8010c8de5b0SBaptiste Daroussin #endif
8020c8de5b0SBaptiste Daroussin /* Switch to the next conflict context */
8030c8de5b0SBaptiste Daroussin save = yypath;
8040c8de5b0SBaptiste Daroussin yypath = save->save;
8050c8de5b0SBaptiste Daroussin save->save = NULL;
8060c8de5b0SBaptiste Daroussin ctry = save->ctry;
8070c8de5b0SBaptiste Daroussin if (save->state != yystate) YYABORT;
8080c8de5b0SBaptiste Daroussin yyFreeState(save);
8090c8de5b0SBaptiste Daroussin
8100c8de5b0SBaptiste Daroussin }
8110c8de5b0SBaptiste Daroussin else
8120c8de5b0SBaptiste Daroussin {
8130c8de5b0SBaptiste Daroussin
8140c8de5b0SBaptiste Daroussin /* Unresolved conflict - start/continue trial parse */
8150c8de5b0SBaptiste Daroussin YYParseState *save;
8160c8de5b0SBaptiste Daroussin #if YYDEBUG
8170c8de5b0SBaptiste Daroussin if (yydebug)
8180c8de5b0SBaptiste Daroussin {
8190c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
8200c8de5b0SBaptiste Daroussin if (yyps->save)
8210c8de5b0SBaptiste Daroussin fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
8220c8de5b0SBaptiste Daroussin else
8230c8de5b0SBaptiste Daroussin fputs("Starting trial parse.\n", stderr);
8240c8de5b0SBaptiste Daroussin }
8250c8de5b0SBaptiste Daroussin #endif
8260c8de5b0SBaptiste Daroussin save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
8270c8de5b0SBaptiste Daroussin if (save == NULL) goto yyenomem;
8280c8de5b0SBaptiste Daroussin save->save = yyps->save;
8290c8de5b0SBaptiste Daroussin save->state = yystate;
8300c8de5b0SBaptiste Daroussin save->errflag = yyerrflag;
8310c8de5b0SBaptiste Daroussin save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
832c5b5d71aSJung-uk Kim memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
8330c8de5b0SBaptiste Daroussin save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
83411fce282SBaptiste Daroussin memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
8350c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8360c8de5b0SBaptiste Daroussin save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
83711fce282SBaptiste Daroussin memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
8380c8de5b0SBaptiste Daroussin #endif
8390c8de5b0SBaptiste Daroussin ctry = yytable[yyn];
8400c8de5b0SBaptiste Daroussin if (yyctable[ctry] == -1)
8410c8de5b0SBaptiste Daroussin {
8420c8de5b0SBaptiste Daroussin #if YYDEBUG
8430c8de5b0SBaptiste Daroussin if (yydebug && yychar >= YYEOF)
8440c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
8450c8de5b0SBaptiste Daroussin #endif
8460c8de5b0SBaptiste Daroussin ctry++;
8470c8de5b0SBaptiste Daroussin }
8480c8de5b0SBaptiste Daroussin save->ctry = ctry;
8490c8de5b0SBaptiste Daroussin if (yyps->save == NULL)
8500c8de5b0SBaptiste Daroussin {
8510c8de5b0SBaptiste Daroussin /* If this is a first conflict in the stack, start saving lexemes */
8520c8de5b0SBaptiste Daroussin if (!yylexemes)
8530c8de5b0SBaptiste Daroussin {
854b53bb29fSJung-uk Kim yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
8550c8de5b0SBaptiste Daroussin if (yylexemes == NULL) goto yyenomem;
8560c8de5b0SBaptiste Daroussin yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
8570c8de5b0SBaptiste Daroussin if (yylvals == NULL) goto yyenomem;
8580c8de5b0SBaptiste Daroussin yylvlim = yylvals + YYLVQUEUEGROWTH;
8590c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8600c8de5b0SBaptiste Daroussin yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
8610c8de5b0SBaptiste Daroussin if (yylpsns == NULL) goto yyenomem;
8620c8de5b0SBaptiste Daroussin yylplim = yylpsns + YYLVQUEUEGROWTH;
8630c8de5b0SBaptiste Daroussin #endif
8640c8de5b0SBaptiste Daroussin }
8650c8de5b0SBaptiste Daroussin if (yylvp == yylve)
8660c8de5b0SBaptiste Daroussin {
8670c8de5b0SBaptiste Daroussin yylvp = yylve = yylvals;
8680c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8690c8de5b0SBaptiste Daroussin yylpp = yylpe = yylpsns;
8700c8de5b0SBaptiste Daroussin #endif
8710c8de5b0SBaptiste Daroussin yylexp = yylexemes;
8720c8de5b0SBaptiste Daroussin if (yychar >= YYEOF)
8730c8de5b0SBaptiste Daroussin {
8740c8de5b0SBaptiste Daroussin *yylve++ = yylval;
8750c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8760c8de5b0SBaptiste Daroussin *yylpe++ = yylloc;
8770c8de5b0SBaptiste Daroussin #endif
8782aca18c7SJung-uk Kim *yylexp = (YYINT) yychar;
8790c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
8800c8de5b0SBaptiste Daroussin }
8810c8de5b0SBaptiste Daroussin }
8820c8de5b0SBaptiste Daroussin }
8830c8de5b0SBaptiste Daroussin if (yychar >= YYEOF)
8840c8de5b0SBaptiste Daroussin {
8850c8de5b0SBaptiste Daroussin yylvp--;
8860c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8870c8de5b0SBaptiste Daroussin yylpp--;
8880c8de5b0SBaptiste Daroussin #endif
8890c8de5b0SBaptiste Daroussin yylexp--;
8900c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
8910c8de5b0SBaptiste Daroussin }
89211fce282SBaptiste Daroussin save->lexeme = (int) (yylvp - yylvals);
8930c8de5b0SBaptiste Daroussin yyps->save = save;
8940c8de5b0SBaptiste Daroussin }
8950c8de5b0SBaptiste Daroussin if (yytable[yyn] == ctry)
8960c8de5b0SBaptiste Daroussin {
8970c8de5b0SBaptiste Daroussin #if YYDEBUG
8980c8de5b0SBaptiste Daroussin if (yydebug)
8990c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
9000c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
9010c8de5b0SBaptiste Daroussin #endif
9020c8de5b0SBaptiste Daroussin if (yychar < 0)
9030c8de5b0SBaptiste Daroussin {
9040c8de5b0SBaptiste Daroussin yylvp++;
9050c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9060c8de5b0SBaptiste Daroussin yylpp++;
9070c8de5b0SBaptiste Daroussin #endif
9080c8de5b0SBaptiste Daroussin yylexp++;
9090c8de5b0SBaptiste Daroussin }
9100c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
9110c8de5b0SBaptiste Daroussin goto yyoverflow;
9120c8de5b0SBaptiste Daroussin yystate = yyctable[ctry];
913c5b5d71aSJung-uk Kim *++yystack.s_mark = (YYINT) yystate;
9140c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
9150c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9160c8de5b0SBaptiste Daroussin *++yystack.p_mark = yylloc;
9170c8de5b0SBaptiste Daroussin #endif
9180c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
9190c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag;
9200c8de5b0SBaptiste Daroussin goto yyloop;
9210c8de5b0SBaptiste Daroussin }
9220c8de5b0SBaptiste Daroussin else
9230c8de5b0SBaptiste Daroussin {
9240c8de5b0SBaptiste Daroussin yyn = yyctable[ctry];
9250c8de5b0SBaptiste Daroussin goto yyreduce;
9260c8de5b0SBaptiste Daroussin }
9270c8de5b0SBaptiste Daroussin } /* End of code dealing with conflicts */
9280c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
9290c8de5b0SBaptiste Daroussin if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
9300c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
9310c8de5b0SBaptiste Daroussin {
9320c8de5b0SBaptiste Daroussin #if YYDEBUG
9330c8de5b0SBaptiste Daroussin if (yydebug)
9340c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
9350c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
9360c8de5b0SBaptiste Daroussin #endif
9370c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
9380c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
9390c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn];
9400c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
9410c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9420c8de5b0SBaptiste Daroussin *++yystack.p_mark = yylloc;
9430c8de5b0SBaptiste Daroussin #endif
9440c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
9450c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag;
9460c8de5b0SBaptiste Daroussin goto yyloop;
9470c8de5b0SBaptiste Daroussin }
9480c8de5b0SBaptiste Daroussin if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
9490c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
9500c8de5b0SBaptiste Daroussin {
9510c8de5b0SBaptiste Daroussin yyn = yytable[yyn];
9520c8de5b0SBaptiste Daroussin goto yyreduce;
9530c8de5b0SBaptiste Daroussin }
9540c8de5b0SBaptiste Daroussin if (yyerrflag != 0) goto yyinrecovery;
9550c8de5b0SBaptiste Daroussin #if YYBTYACC
9560c8de5b0SBaptiste Daroussin
9570c8de5b0SBaptiste Daroussin yynewerrflag = 1;
9580c8de5b0SBaptiste Daroussin goto yyerrhandler;
959c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */
9600c8de5b0SBaptiste Daroussin
9610c8de5b0SBaptiste Daroussin yyerrlab:
962c5b5d71aSJung-uk Kim /* explicit YYERROR from an action -- pop the rhs of the rule reduced
963c5b5d71aSJung-uk Kim * before looking for error recovery */
964c5b5d71aSJung-uk Kim yystack.s_mark -= yym;
965c5b5d71aSJung-uk Kim yystate = *yystack.s_mark;
966c5b5d71aSJung-uk Kim yystack.l_mark -= yym;
967c5b5d71aSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
968c5b5d71aSJung-uk Kim yystack.p_mark -= yym;
969c5b5d71aSJung-uk Kim #endif
970c5b5d71aSJung-uk Kim
9710c8de5b0SBaptiste Daroussin yynewerrflag = 0;
9720c8de5b0SBaptiste Daroussin yyerrhandler:
9730c8de5b0SBaptiste Daroussin while (yyps->save)
9740c8de5b0SBaptiste Daroussin {
9750c8de5b0SBaptiste Daroussin int ctry;
9760c8de5b0SBaptiste Daroussin YYParseState *save = yyps->save;
9770c8de5b0SBaptiste Daroussin #if YYDEBUG
9780c8de5b0SBaptiste Daroussin if (yydebug)
9790c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
9800c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yyps->save->state,
9810c8de5b0SBaptiste Daroussin (int)(yylvp - yylvals - yyps->save->lexeme));
9820c8de5b0SBaptiste Daroussin #endif
9830c8de5b0SBaptiste Daroussin /* Memorize most forward-looking error state in case it's really an error. */
9840c8de5b0SBaptiste Daroussin if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
9850c8de5b0SBaptiste Daroussin {
9860c8de5b0SBaptiste Daroussin /* Free old saved error context state */
9870c8de5b0SBaptiste Daroussin if (yyerrctx) yyFreeState(yyerrctx);
9880c8de5b0SBaptiste Daroussin /* Create and fill out new saved error context state */
9890c8de5b0SBaptiste Daroussin yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
9900c8de5b0SBaptiste Daroussin if (yyerrctx == NULL) goto yyenomem;
9910c8de5b0SBaptiste Daroussin yyerrctx->save = yyps->save;
9920c8de5b0SBaptiste Daroussin yyerrctx->state = yystate;
9930c8de5b0SBaptiste Daroussin yyerrctx->errflag = yyerrflag;
9940c8de5b0SBaptiste Daroussin yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
995c5b5d71aSJung-uk Kim memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
9960c8de5b0SBaptiste Daroussin yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
99711fce282SBaptiste Daroussin memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
9980c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9990c8de5b0SBaptiste Daroussin yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
100011fce282SBaptiste Daroussin memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10010c8de5b0SBaptiste Daroussin #endif
100211fce282SBaptiste Daroussin yyerrctx->lexeme = (int) (yylvp - yylvals);
10030c8de5b0SBaptiste Daroussin }
10040c8de5b0SBaptiste Daroussin yylvp = yylvals + save->lexeme;
10050c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10060c8de5b0SBaptiste Daroussin yylpp = yylpsns + save->lexeme;
10070c8de5b0SBaptiste Daroussin #endif
10080c8de5b0SBaptiste Daroussin yylexp = yylexemes + save->lexeme;
10090c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
10100c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1011c5b5d71aSJung-uk Kim memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10120c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
101311fce282SBaptiste Daroussin memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10140c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10150c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
101611fce282SBaptiste Daroussin memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10170c8de5b0SBaptiste Daroussin #endif
10180c8de5b0SBaptiste Daroussin ctry = ++save->ctry;
10190c8de5b0SBaptiste Daroussin yystate = save->state;
10200c8de5b0SBaptiste Daroussin /* We tried shift, try reduce now */
10210c8de5b0SBaptiste Daroussin if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
10220c8de5b0SBaptiste Daroussin yyps->save = save->save;
10230c8de5b0SBaptiste Daroussin save->save = NULL;
10240c8de5b0SBaptiste Daroussin yyFreeState(save);
10250c8de5b0SBaptiste Daroussin
10260c8de5b0SBaptiste Daroussin /* Nothing left on the stack -- error */
10270c8de5b0SBaptiste Daroussin if (!yyps->save)
10280c8de5b0SBaptiste Daroussin {
10290c8de5b0SBaptiste Daroussin #if YYDEBUG
10300c8de5b0SBaptiste Daroussin if (yydebug)
10310c8de5b0SBaptiste Daroussin fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
10320c8de5b0SBaptiste Daroussin YYPREFIX, yydepth);
10330c8de5b0SBaptiste Daroussin #endif
10340c8de5b0SBaptiste Daroussin /* Restore state as it was in the most forward-advanced error */
10350c8de5b0SBaptiste Daroussin yylvp = yylvals + yyerrctx->lexeme;
10360c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10370c8de5b0SBaptiste Daroussin yylpp = yylpsns + yyerrctx->lexeme;
10380c8de5b0SBaptiste Daroussin #endif
10390c8de5b0SBaptiste Daroussin yylexp = yylexemes + yyerrctx->lexeme;
10400c8de5b0SBaptiste Daroussin yychar = yylexp[-1];
10410c8de5b0SBaptiste Daroussin yylval = yylvp[-1];
10420c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10430c8de5b0SBaptiste Daroussin yylloc = yylpp[-1];
10440c8de5b0SBaptiste Daroussin #endif
10450c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1046c5b5d71aSJung-uk Kim memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10470c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
104811fce282SBaptiste Daroussin memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10490c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10500c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
105111fce282SBaptiste Daroussin memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10520c8de5b0SBaptiste Daroussin #endif
10530c8de5b0SBaptiste Daroussin yystate = yyerrctx->state;
10540c8de5b0SBaptiste Daroussin yyFreeState(yyerrctx);
10550c8de5b0SBaptiste Daroussin yyerrctx = NULL;
10560c8de5b0SBaptiste Daroussin }
10570c8de5b0SBaptiste Daroussin yynewerrflag = 1;
10580c8de5b0SBaptiste Daroussin }
10590c8de5b0SBaptiste Daroussin if (yynewerrflag == 0) goto yyinrecovery;
10600c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
10610c8de5b0SBaptiste Daroussin
10620c8de5b0SBaptiste Daroussin YYERROR_CALL("syntax error");
10630c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1064b53bb29fSJung-uk Kim yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
10650c8de5b0SBaptiste Daroussin #endif
10660c8de5b0SBaptiste Daroussin
10670c8de5b0SBaptiste Daroussin #if !YYBTYACC
1068c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */
10690c8de5b0SBaptiste Daroussin yyerrlab:
10700c8de5b0SBaptiste Daroussin #endif
10710c8de5b0SBaptiste Daroussin ++yynerrs;
10720c8de5b0SBaptiste Daroussin
10730c8de5b0SBaptiste Daroussin yyinrecovery:
10740c8de5b0SBaptiste Daroussin if (yyerrflag < 3)
10750c8de5b0SBaptiste Daroussin {
10760c8de5b0SBaptiste Daroussin yyerrflag = 3;
10770c8de5b0SBaptiste Daroussin for (;;)
10780c8de5b0SBaptiste Daroussin {
10790c8de5b0SBaptiste Daroussin if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
10800c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
10810c8de5b0SBaptiste Daroussin {
10820c8de5b0SBaptiste Daroussin #if YYDEBUG
10830c8de5b0SBaptiste Daroussin if (yydebug)
10840c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
10850c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
10860c8de5b0SBaptiste Daroussin #endif
10870c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
10880c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
10890c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn];
10900c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
10910c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10920c8de5b0SBaptiste Daroussin /* lookahead position is error end position */
1093b53bb29fSJung-uk Kim yyerror_loc_range[2] = yylloc;
10940c8de5b0SBaptiste Daroussin YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
10950c8de5b0SBaptiste Daroussin *++yystack.p_mark = yyloc;
10960c8de5b0SBaptiste Daroussin #endif
10970c8de5b0SBaptiste Daroussin goto yyloop;
10980c8de5b0SBaptiste Daroussin }
10990c8de5b0SBaptiste Daroussin else
11000c8de5b0SBaptiste Daroussin {
11010c8de5b0SBaptiste Daroussin #if YYDEBUG
11020c8de5b0SBaptiste Daroussin if (yydebug)
11030c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
11040c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, *yystack.s_mark);
11050c8de5b0SBaptiste Daroussin #endif
11060c8de5b0SBaptiste Daroussin if (yystack.s_mark <= yystack.s_base) goto yyabort;
11070c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11080c8de5b0SBaptiste Daroussin /* the current TOS position is the error start position */
1109b53bb29fSJung-uk Kim yyerror_loc_range[1] = *yystack.p_mark;
11100c8de5b0SBaptiste Daroussin #endif
11110c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
11120c8de5b0SBaptiste Daroussin #if YYBTYACC
11130c8de5b0SBaptiste Daroussin if (!yytrial)
11140c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11150c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11160c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding state",
11170c8de5b0SBaptiste Daroussin yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
11180c8de5b0SBaptiste Daroussin #else
11190c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding state",
11200c8de5b0SBaptiste Daroussin yystos[*yystack.s_mark], yystack.l_mark);
11210c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
11220c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
11230c8de5b0SBaptiste Daroussin --yystack.s_mark;
11240c8de5b0SBaptiste Daroussin --yystack.l_mark;
11250c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11260c8de5b0SBaptiste Daroussin --yystack.p_mark;
11270c8de5b0SBaptiste Daroussin #endif
11280c8de5b0SBaptiste Daroussin }
11290c8de5b0SBaptiste Daroussin }
11300c8de5b0SBaptiste Daroussin }
11310c8de5b0SBaptiste Daroussin else
11320c8de5b0SBaptiste Daroussin {
11330c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyabort;
11340c8de5b0SBaptiste Daroussin #if YYDEBUG
11350c8de5b0SBaptiste Daroussin if (yydebug)
11360c8de5b0SBaptiste Daroussin {
1137c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
11380c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
11390c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yychar, yys);
11400c8de5b0SBaptiste Daroussin }
11410c8de5b0SBaptiste Daroussin #endif
11420c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
11430c8de5b0SBaptiste Daroussin #if YYBTYACC
11440c8de5b0SBaptiste Daroussin if (!yytrial)
11450c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11460c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11470c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
11480c8de5b0SBaptiste Daroussin #else
11490c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
11500c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
11510c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
11520c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
11530c8de5b0SBaptiste Daroussin goto yyloop;
11540c8de5b0SBaptiste Daroussin }
11550c8de5b0SBaptiste Daroussin
11560c8de5b0SBaptiste Daroussin yyreduce:
11570c8de5b0SBaptiste Daroussin yym = yylen[yyn];
11580c8de5b0SBaptiste Daroussin #if YYDEBUG
11590c8de5b0SBaptiste Daroussin if (yydebug)
11600c8de5b0SBaptiste Daroussin {
11610c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
11620c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
11630c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
11640c8de5b0SBaptiste Daroussin #if YYBTYACC
11650c8de5b0SBaptiste Daroussin if (!yytrial)
11660c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11670c8de5b0SBaptiste Daroussin if (yym > 0)
11680c8de5b0SBaptiste Daroussin {
11690c8de5b0SBaptiste Daroussin int i;
11700c8de5b0SBaptiste Daroussin fputc('<', stderr);
11710c8de5b0SBaptiste Daroussin for (i = yym; i > 0; i--)
11720c8de5b0SBaptiste Daroussin {
11730c8de5b0SBaptiste Daroussin if (i != yym) fputs(", ", stderr);
11740c8de5b0SBaptiste Daroussin fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
11750c8de5b0SBaptiste Daroussin yystack.l_mark[1-i]), stderr);
11760c8de5b0SBaptiste Daroussin }
11770c8de5b0SBaptiste Daroussin fputc('>', stderr);
11780c8de5b0SBaptiste Daroussin }
11790c8de5b0SBaptiste Daroussin #endif
11800c8de5b0SBaptiste Daroussin fputc('\n', stderr);
11810c8de5b0SBaptiste Daroussin }
11820c8de5b0SBaptiste Daroussin #endif
11830c8de5b0SBaptiste Daroussin if (yym > 0)
11840c8de5b0SBaptiste Daroussin yyval = yystack.l_mark[1-yym];
11850c8de5b0SBaptiste Daroussin else
11860c8de5b0SBaptiste Daroussin memset(&yyval, 0, sizeof yyval);
11870c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11880c8de5b0SBaptiste Daroussin
11890c8de5b0SBaptiste Daroussin /* Perform position reduction */
11900c8de5b0SBaptiste Daroussin memset(&yyloc, 0, sizeof(yyloc));
11910c8de5b0SBaptiste Daroussin #if YYBTYACC
11920c8de5b0SBaptiste Daroussin if (!yytrial)
11930c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11940c8de5b0SBaptiste Daroussin {
1195b53bb29fSJung-uk Kim YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
11960c8de5b0SBaptiste Daroussin /* just in case YYERROR is invoked within the action, save
11970c8de5b0SBaptiste Daroussin the start of the rhs as the error start position */
1198b53bb29fSJung-uk Kim yyerror_loc_range[1] = yystack.p_mark[1-yym];
11990c8de5b0SBaptiste Daroussin }
12000c8de5b0SBaptiste Daroussin #endif
12010c8de5b0SBaptiste Daroussin
12020c8de5b0SBaptiste Daroussin switch (yyn)
12030c8de5b0SBaptiste Daroussin {
12040c8de5b0SBaptiste Daroussin case 3:
12050c8de5b0SBaptiste Daroussin #line 35 "quote_calc.y"
12060c8de5b0SBaptiste Daroussin { yyerrok ; }
1207*8e022d3cSDag-Erling Smørgrav #line 1208 "quote_calc.tab.c"
12080c8de5b0SBaptiste Daroussin break;
12090c8de5b0SBaptiste Daroussin case 4:
12100c8de5b0SBaptiste Daroussin #line 39 "quote_calc.y"
12110c8de5b0SBaptiste Daroussin { printf("%d\n",yystack.l_mark[0]);}
1212*8e022d3cSDag-Erling Smørgrav #line 1213 "quote_calc.tab.c"
12130c8de5b0SBaptiste Daroussin break;
12140c8de5b0SBaptiste Daroussin case 5:
12150c8de5b0SBaptiste Daroussin #line 41 "quote_calc.y"
12160c8de5b0SBaptiste Daroussin { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
1217*8e022d3cSDag-Erling Smørgrav #line 1218 "quote_calc.tab.c"
12180c8de5b0SBaptiste Daroussin break;
12190c8de5b0SBaptiste Daroussin case 6:
12200c8de5b0SBaptiste Daroussin #line 45 "quote_calc.y"
12210c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-1]; }
1222*8e022d3cSDag-Erling Smørgrav #line 1223 "quote_calc.tab.c"
12230c8de5b0SBaptiste Daroussin break;
12240c8de5b0SBaptiste Daroussin case 7:
12250c8de5b0SBaptiste Daroussin #line 47 "quote_calc.y"
12260c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
1227*8e022d3cSDag-Erling Smørgrav #line 1228 "quote_calc.tab.c"
12280c8de5b0SBaptiste Daroussin break;
12290c8de5b0SBaptiste Daroussin case 8:
12300c8de5b0SBaptiste Daroussin #line 49 "quote_calc.y"
12310c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
1232*8e022d3cSDag-Erling Smørgrav #line 1233 "quote_calc.tab.c"
12330c8de5b0SBaptiste Daroussin break;
12340c8de5b0SBaptiste Daroussin case 9:
12350c8de5b0SBaptiste Daroussin #line 51 "quote_calc.y"
12360c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
1237*8e022d3cSDag-Erling Smørgrav #line 1238 "quote_calc.tab.c"
12380c8de5b0SBaptiste Daroussin break;
12390c8de5b0SBaptiste Daroussin case 10:
12400c8de5b0SBaptiste Daroussin #line 53 "quote_calc.y"
12410c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
1242*8e022d3cSDag-Erling Smørgrav #line 1243 "quote_calc.tab.c"
12430c8de5b0SBaptiste Daroussin break;
12440c8de5b0SBaptiste Daroussin case 11:
12450c8de5b0SBaptiste Daroussin #line 55 "quote_calc.y"
12460c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
1247*8e022d3cSDag-Erling Smørgrav #line 1248 "quote_calc.tab.c"
12480c8de5b0SBaptiste Daroussin break;
12490c8de5b0SBaptiste Daroussin case 12:
12500c8de5b0SBaptiste Daroussin #line 57 "quote_calc.y"
12510c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
1252*8e022d3cSDag-Erling Smørgrav #line 1253 "quote_calc.tab.c"
12530c8de5b0SBaptiste Daroussin break;
12540c8de5b0SBaptiste Daroussin case 13:
12550c8de5b0SBaptiste Daroussin #line 59 "quote_calc.y"
12560c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
1257*8e022d3cSDag-Erling Smørgrav #line 1258 "quote_calc.tab.c"
12580c8de5b0SBaptiste Daroussin break;
12590c8de5b0SBaptiste Daroussin case 14:
12600c8de5b0SBaptiste Daroussin #line 61 "quote_calc.y"
12610c8de5b0SBaptiste Daroussin { yyval = - yystack.l_mark[0]; }
1262*8e022d3cSDag-Erling Smørgrav #line 1263 "quote_calc.tab.c"
12630c8de5b0SBaptiste Daroussin break;
12640c8de5b0SBaptiste Daroussin case 15:
12650c8de5b0SBaptiste Daroussin #line 63 "quote_calc.y"
12660c8de5b0SBaptiste Daroussin { yyval = regs[yystack.l_mark[0]]; }
1267*8e022d3cSDag-Erling Smørgrav #line 1268 "quote_calc.tab.c"
12680c8de5b0SBaptiste Daroussin break;
12690c8de5b0SBaptiste Daroussin case 17:
12700c8de5b0SBaptiste Daroussin #line 68 "quote_calc.y"
12710c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
1272*8e022d3cSDag-Erling Smørgrav #line 1273 "quote_calc.tab.c"
12730c8de5b0SBaptiste Daroussin break;
12740c8de5b0SBaptiste Daroussin case 18:
12750c8de5b0SBaptiste Daroussin #line 70 "quote_calc.y"
12760c8de5b0SBaptiste Daroussin { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
1277*8e022d3cSDag-Erling Smørgrav #line 1278 "quote_calc.tab.c"
12780c8de5b0SBaptiste Daroussin break;
1279*8e022d3cSDag-Erling Smørgrav #line 1280 "quote_calc.tab.c"
12800c8de5b0SBaptiste Daroussin default:
12810c8de5b0SBaptiste Daroussin break;
12820c8de5b0SBaptiste Daroussin }
12830c8de5b0SBaptiste Daroussin yystack.s_mark -= yym;
12840c8de5b0SBaptiste Daroussin yystate = *yystack.s_mark;
12850c8de5b0SBaptiste Daroussin yystack.l_mark -= yym;
12860c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
12870c8de5b0SBaptiste Daroussin yystack.p_mark -= yym;
12880c8de5b0SBaptiste Daroussin #endif
12890c8de5b0SBaptiste Daroussin yym = yylhs[yyn];
12900c8de5b0SBaptiste Daroussin if (yystate == 0 && yym == 0)
12910c8de5b0SBaptiste Daroussin {
12920c8de5b0SBaptiste Daroussin #if YYDEBUG
12930c8de5b0SBaptiste Daroussin if (yydebug)
12940c8de5b0SBaptiste Daroussin {
12950c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
12960c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
12970c8de5b0SBaptiste Daroussin #if YYBTYACC
12980c8de5b0SBaptiste Daroussin if (!yytrial)
12990c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13000c8de5b0SBaptiste Daroussin fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
13010c8de5b0SBaptiste Daroussin #endif
13020c8de5b0SBaptiste Daroussin fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
13030c8de5b0SBaptiste Daroussin }
13040c8de5b0SBaptiste Daroussin #endif
13050c8de5b0SBaptiste Daroussin yystate = YYFINAL;
13060c8de5b0SBaptiste Daroussin *++yystack.s_mark = YYFINAL;
13070c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval;
13080c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13090c8de5b0SBaptiste Daroussin *++yystack.p_mark = yyloc;
13100c8de5b0SBaptiste Daroussin #endif
13110c8de5b0SBaptiste Daroussin if (yychar < 0)
13120c8de5b0SBaptiste Daroussin {
13130c8de5b0SBaptiste Daroussin #if YYBTYACC
13140c8de5b0SBaptiste Daroussin do {
13150c8de5b0SBaptiste Daroussin if (yylvp < yylve)
13160c8de5b0SBaptiste Daroussin {
13170c8de5b0SBaptiste Daroussin /* we're currently re-reading tokens */
13180c8de5b0SBaptiste Daroussin yylval = *yylvp++;
13190c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13200c8de5b0SBaptiste Daroussin yylloc = *yylpp++;
13210c8de5b0SBaptiste Daroussin #endif
13220c8de5b0SBaptiste Daroussin yychar = *yylexp++;
13230c8de5b0SBaptiste Daroussin break;
13240c8de5b0SBaptiste Daroussin }
13250c8de5b0SBaptiste Daroussin if (yyps->save)
13260c8de5b0SBaptiste Daroussin {
13270c8de5b0SBaptiste Daroussin /* in trial mode; save scanner results for future parse attempts */
13280c8de5b0SBaptiste Daroussin if (yylvp == yylvlim)
13290c8de5b0SBaptiste Daroussin { /* Enlarge lexical value queue */
133011fce282SBaptiste Daroussin size_t p = (size_t) (yylvp - yylvals);
133111fce282SBaptiste Daroussin size_t s = (size_t) (yylvlim - yylvals);
13320c8de5b0SBaptiste Daroussin
13330c8de5b0SBaptiste Daroussin s += YYLVQUEUEGROWTH;
1334b53bb29fSJung-uk Kim if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
13350c8de5b0SBaptiste Daroussin goto yyenomem;
1336b53bb29fSJung-uk Kim if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
13370c8de5b0SBaptiste Daroussin goto yyenomem;
13380c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1339b53bb29fSJung-uk Kim if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
13400c8de5b0SBaptiste Daroussin goto yyenomem;
13410c8de5b0SBaptiste Daroussin #endif
13420c8de5b0SBaptiste Daroussin yylvp = yylve = yylvals + p;
13430c8de5b0SBaptiste Daroussin yylvlim = yylvals + s;
13440c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13450c8de5b0SBaptiste Daroussin yylpp = yylpe = yylpsns + p;
13460c8de5b0SBaptiste Daroussin yylplim = yylpsns + s;
13470c8de5b0SBaptiste Daroussin #endif
13480c8de5b0SBaptiste Daroussin yylexp = yylexemes + p;
13490c8de5b0SBaptiste Daroussin }
13502aca18c7SJung-uk Kim *yylexp = (YYINT) YYLEX;
13510c8de5b0SBaptiste Daroussin *yylvp++ = yylval;
13520c8de5b0SBaptiste Daroussin yylve++;
13530c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13540c8de5b0SBaptiste Daroussin *yylpp++ = yylloc;
13550c8de5b0SBaptiste Daroussin yylpe++;
13560c8de5b0SBaptiste Daroussin #endif
13570c8de5b0SBaptiste Daroussin yychar = *yylexp++;
13580c8de5b0SBaptiste Daroussin break;
13590c8de5b0SBaptiste Daroussin }
13600c8de5b0SBaptiste Daroussin /* normal operation, no conflict encountered */
13610c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13620c8de5b0SBaptiste Daroussin yychar = YYLEX;
13630c8de5b0SBaptiste Daroussin #if YYBTYACC
13640c8de5b0SBaptiste Daroussin } while (0);
13650c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13660c8de5b0SBaptiste Daroussin if (yychar < 0) yychar = YYEOF;
13670c8de5b0SBaptiste Daroussin #if YYDEBUG
13680c8de5b0SBaptiste Daroussin if (yydebug)
13690c8de5b0SBaptiste Daroussin {
1370c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1371c5b5d71aSJung-uk Kim fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
13720c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
13730c8de5b0SBaptiste Daroussin }
13740c8de5b0SBaptiste Daroussin #endif
13750c8de5b0SBaptiste Daroussin }
13760c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyaccept;
13770c8de5b0SBaptiste Daroussin goto yyloop;
13780c8de5b0SBaptiste Daroussin }
13790c8de5b0SBaptiste Daroussin if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
13800c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
13810c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
13820c8de5b0SBaptiste Daroussin else
13830c8de5b0SBaptiste Daroussin yystate = yydgoto[yym];
13840c8de5b0SBaptiste Daroussin #if YYDEBUG
13850c8de5b0SBaptiste Daroussin if (yydebug)
13860c8de5b0SBaptiste Daroussin {
13870c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
13880c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
13890c8de5b0SBaptiste Daroussin #if YYBTYACC
13900c8de5b0SBaptiste Daroussin if (!yytrial)
13910c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13920c8de5b0SBaptiste Daroussin fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
13930c8de5b0SBaptiste Daroussin #endif
13940c8de5b0SBaptiste Daroussin fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
13950c8de5b0SBaptiste Daroussin }
13960c8de5b0SBaptiste Daroussin #endif
13970c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1398c5b5d71aSJung-uk Kim *++yystack.s_mark = (YYINT) yystate;
13990c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval;
14000c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14010c8de5b0SBaptiste Daroussin *++yystack.p_mark = yyloc;
14020c8de5b0SBaptiste Daroussin #endif
14030c8de5b0SBaptiste Daroussin goto yyloop;
14040c8de5b0SBaptiste Daroussin #if YYBTYACC
14050c8de5b0SBaptiste Daroussin
14060c8de5b0SBaptiste Daroussin /* Reduction declares that this path is valid. Set yypath and do a full parse */
14070c8de5b0SBaptiste Daroussin yyvalid:
14080c8de5b0SBaptiste Daroussin if (yypath) YYABORT;
14090c8de5b0SBaptiste Daroussin while (yyps->save)
14100c8de5b0SBaptiste Daroussin {
14110c8de5b0SBaptiste Daroussin YYParseState *save = yyps->save;
14120c8de5b0SBaptiste Daroussin yyps->save = save->save;
14130c8de5b0SBaptiste Daroussin save->save = yypath;
14140c8de5b0SBaptiste Daroussin yypath = save;
14150c8de5b0SBaptiste Daroussin }
14160c8de5b0SBaptiste Daroussin #if YYDEBUG
14170c8de5b0SBaptiste Daroussin if (yydebug)
14180c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
14190c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
14200c8de5b0SBaptiste Daroussin #endif
14210c8de5b0SBaptiste Daroussin if (yyerrctx)
14220c8de5b0SBaptiste Daroussin {
14230c8de5b0SBaptiste Daroussin yyFreeState(yyerrctx);
14240c8de5b0SBaptiste Daroussin yyerrctx = NULL;
14250c8de5b0SBaptiste Daroussin }
14260c8de5b0SBaptiste Daroussin yylvp = yylvals + yypath->lexeme;
14270c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14280c8de5b0SBaptiste Daroussin yylpp = yylpsns + yypath->lexeme;
14290c8de5b0SBaptiste Daroussin #endif
14300c8de5b0SBaptiste Daroussin yylexp = yylexemes + yypath->lexeme;
14310c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
14320c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1433c5b5d71aSJung-uk Kim memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
14340c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
143511fce282SBaptiste Daroussin memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
14360c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14370c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
143811fce282SBaptiste Daroussin memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
14390c8de5b0SBaptiste Daroussin #endif
14400c8de5b0SBaptiste Daroussin yystate = yypath->state;
14410c8de5b0SBaptiste Daroussin goto yyloop;
14420c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14430c8de5b0SBaptiste Daroussin
14440c8de5b0SBaptiste Daroussin yyoverflow:
14450c8de5b0SBaptiste Daroussin YYERROR_CALL("yacc stack overflow");
14460c8de5b0SBaptiste Daroussin #if YYBTYACC
14470c8de5b0SBaptiste Daroussin goto yyabort_nomem;
14480c8de5b0SBaptiste Daroussin yyenomem:
14490c8de5b0SBaptiste Daroussin YYERROR_CALL("memory exhausted");
14500c8de5b0SBaptiste Daroussin yyabort_nomem:
14510c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14520c8de5b0SBaptiste Daroussin yyresult = 2;
14530c8de5b0SBaptiste Daroussin goto yyreturn;
14540c8de5b0SBaptiste Daroussin
14550c8de5b0SBaptiste Daroussin yyabort:
14560c8de5b0SBaptiste Daroussin yyresult = 1;
14570c8de5b0SBaptiste Daroussin goto yyreturn;
14580c8de5b0SBaptiste Daroussin
14590c8de5b0SBaptiste Daroussin yyaccept:
14600c8de5b0SBaptiste Daroussin #if YYBTYACC
14610c8de5b0SBaptiste Daroussin if (yyps->save) goto yyvalid;
14620c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14630c8de5b0SBaptiste Daroussin yyresult = 0;
14640c8de5b0SBaptiste Daroussin
14650c8de5b0SBaptiste Daroussin yyreturn:
14660c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
14670c8de5b0SBaptiste Daroussin if (yychar != YYEOF && yychar != YYEMPTY)
14680c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14690c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
14700c8de5b0SBaptiste Daroussin #else
14710c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
14720c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
14730c8de5b0SBaptiste Daroussin
14740c8de5b0SBaptiste Daroussin {
14750c8de5b0SBaptiste Daroussin YYSTYPE *pv;
14760c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14770c8de5b0SBaptiste Daroussin YYLTYPE *pp;
14780c8de5b0SBaptiste Daroussin
14790c8de5b0SBaptiste Daroussin for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
14800c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding state",
14810c8de5b0SBaptiste Daroussin yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
14820c8de5b0SBaptiste Daroussin #else
14830c8de5b0SBaptiste Daroussin for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
14840c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding state",
14850c8de5b0SBaptiste Daroussin yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
14860c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
14870c8de5b0SBaptiste Daroussin }
14880c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
14890c8de5b0SBaptiste Daroussin
14900c8de5b0SBaptiste Daroussin #if YYBTYACC
14910c8de5b0SBaptiste Daroussin if (yyerrctx)
14920c8de5b0SBaptiste Daroussin {
14930c8de5b0SBaptiste Daroussin yyFreeState(yyerrctx);
14940c8de5b0SBaptiste Daroussin yyerrctx = NULL;
14950c8de5b0SBaptiste Daroussin }
14960c8de5b0SBaptiste Daroussin while (yyps)
14970c8de5b0SBaptiste Daroussin {
14980c8de5b0SBaptiste Daroussin YYParseState *save = yyps;
14990c8de5b0SBaptiste Daroussin yyps = save->save;
15000c8de5b0SBaptiste Daroussin save->save = NULL;
15010c8de5b0SBaptiste Daroussin yyFreeState(save);
15020c8de5b0SBaptiste Daroussin }
15030c8de5b0SBaptiste Daroussin while (yypath)
15040c8de5b0SBaptiste Daroussin {
15050c8de5b0SBaptiste Daroussin YYParseState *save = yypath;
15060c8de5b0SBaptiste Daroussin yypath = save->save;
15070c8de5b0SBaptiste Daroussin save->save = NULL;
15080c8de5b0SBaptiste Daroussin yyFreeState(save);
15090c8de5b0SBaptiste Daroussin }
15100c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
15110c8de5b0SBaptiste Daroussin yyfreestack(&yystack);
15120c8de5b0SBaptiste Daroussin return (yyresult);
15130c8de5b0SBaptiste Daroussin }
1514