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
68e022d3cSDag-Erling Smørgrav #define YYMAJOR 2
78e022d3cSDag-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 ok_syntax1_parse
220c8de5b0SBaptiste Daroussin #endif /* yyparse */
230c8de5b0SBaptiste Daroussin
240c8de5b0SBaptiste Daroussin #ifndef yylex
250c8de5b0SBaptiste Daroussin #define yylex ok_syntax1_lex
260c8de5b0SBaptiste Daroussin #endif /* yylex */
270c8de5b0SBaptiste Daroussin
280c8de5b0SBaptiste Daroussin #ifndef yyerror
290c8de5b0SBaptiste Daroussin #define yyerror ok_syntax1_error
300c8de5b0SBaptiste Daroussin #endif /* yyerror */
310c8de5b0SBaptiste Daroussin
320c8de5b0SBaptiste Daroussin #ifndef yychar
330c8de5b0SBaptiste Daroussin #define yychar ok_syntax1_char
340c8de5b0SBaptiste Daroussin #endif /* yychar */
350c8de5b0SBaptiste Daroussin
360c8de5b0SBaptiste Daroussin #ifndef yyval
370c8de5b0SBaptiste Daroussin #define yyval ok_syntax1_val
380c8de5b0SBaptiste Daroussin #endif /* yyval */
390c8de5b0SBaptiste Daroussin
400c8de5b0SBaptiste Daroussin #ifndef yylval
410c8de5b0SBaptiste Daroussin #define yylval ok_syntax1_lval
420c8de5b0SBaptiste Daroussin #endif /* yylval */
430c8de5b0SBaptiste Daroussin
440c8de5b0SBaptiste Daroussin #ifndef yydebug
450c8de5b0SBaptiste Daroussin #define yydebug ok_syntax1_debug
460c8de5b0SBaptiste Daroussin #endif /* yydebug */
470c8de5b0SBaptiste Daroussin
480c8de5b0SBaptiste Daroussin #ifndef yynerrs
490c8de5b0SBaptiste Daroussin #define yynerrs ok_syntax1_nerrs
500c8de5b0SBaptiste Daroussin #endif /* yynerrs */
510c8de5b0SBaptiste Daroussin
520c8de5b0SBaptiste Daroussin #ifndef yyerrflag
530c8de5b0SBaptiste Daroussin #define yyerrflag ok_syntax1_errflag
540c8de5b0SBaptiste Daroussin #endif /* yyerrflag */
550c8de5b0SBaptiste Daroussin
560c8de5b0SBaptiste Daroussin #ifndef yylhs
570c8de5b0SBaptiste Daroussin #define yylhs ok_syntax1_lhs
580c8de5b0SBaptiste Daroussin #endif /* yylhs */
590c8de5b0SBaptiste Daroussin
600c8de5b0SBaptiste Daroussin #ifndef yylen
610c8de5b0SBaptiste Daroussin #define yylen ok_syntax1_len
620c8de5b0SBaptiste Daroussin #endif /* yylen */
630c8de5b0SBaptiste Daroussin
640c8de5b0SBaptiste Daroussin #ifndef yydefred
650c8de5b0SBaptiste Daroussin #define yydefred ok_syntax1_defred
660c8de5b0SBaptiste Daroussin #endif /* yydefred */
670c8de5b0SBaptiste Daroussin
680c8de5b0SBaptiste Daroussin #ifndef yystos
690c8de5b0SBaptiste Daroussin #define yystos ok_syntax1_stos
700c8de5b0SBaptiste Daroussin #endif /* yystos */
710c8de5b0SBaptiste Daroussin
720c8de5b0SBaptiste Daroussin #ifndef yydgoto
730c8de5b0SBaptiste Daroussin #define yydgoto ok_syntax1_dgoto
740c8de5b0SBaptiste Daroussin #endif /* yydgoto */
750c8de5b0SBaptiste Daroussin
760c8de5b0SBaptiste Daroussin #ifndef yysindex
770c8de5b0SBaptiste Daroussin #define yysindex ok_syntax1_sindex
780c8de5b0SBaptiste Daroussin #endif /* yysindex */
790c8de5b0SBaptiste Daroussin
800c8de5b0SBaptiste Daroussin #ifndef yyrindex
810c8de5b0SBaptiste Daroussin #define yyrindex ok_syntax1_rindex
820c8de5b0SBaptiste Daroussin #endif /* yyrindex */
830c8de5b0SBaptiste Daroussin
840c8de5b0SBaptiste Daroussin #ifndef yygindex
850c8de5b0SBaptiste Daroussin #define yygindex ok_syntax1_gindex
860c8de5b0SBaptiste Daroussin #endif /* yygindex */
870c8de5b0SBaptiste Daroussin
880c8de5b0SBaptiste Daroussin #ifndef yytable
890c8de5b0SBaptiste Daroussin #define yytable ok_syntax1_table
900c8de5b0SBaptiste Daroussin #endif /* yytable */
910c8de5b0SBaptiste Daroussin
920c8de5b0SBaptiste Daroussin #ifndef yycheck
930c8de5b0SBaptiste Daroussin #define yycheck ok_syntax1_check
940c8de5b0SBaptiste Daroussin #endif /* yycheck */
950c8de5b0SBaptiste Daroussin
960c8de5b0SBaptiste Daroussin #ifndef yyname
970c8de5b0SBaptiste Daroussin #define yyname ok_syntax1_name
980c8de5b0SBaptiste Daroussin #endif /* yyname */
990c8de5b0SBaptiste Daroussin
1000c8de5b0SBaptiste Daroussin #ifndef yyrule
1010c8de5b0SBaptiste Daroussin #define yyrule ok_syntax1_rule
1020c8de5b0SBaptiste Daroussin #endif /* yyrule */
1030c8de5b0SBaptiste Daroussin
1040c8de5b0SBaptiste Daroussin #if YYBTYACC
1050c8de5b0SBaptiste Daroussin
1060c8de5b0SBaptiste Daroussin #ifndef yycindex
1070c8de5b0SBaptiste Daroussin #define yycindex ok_syntax1_cindex
1080c8de5b0SBaptiste Daroussin #endif /* yycindex */
1090c8de5b0SBaptiste Daroussin
1100c8de5b0SBaptiste Daroussin #ifndef yyctable
1110c8de5b0SBaptiste Daroussin #define yyctable ok_syntax1_ctable
1120c8de5b0SBaptiste Daroussin #endif /* yyctable */
1130c8de5b0SBaptiste Daroussin
1140c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
1150c8de5b0SBaptiste Daroussin
1160c8de5b0SBaptiste Daroussin #define YYPREFIX "ok_syntax1_"
1170c8de5b0SBaptiste Daroussin
1180c8de5b0SBaptiste Daroussin #define YYPURE 1
1190c8de5b0SBaptiste Daroussin
1200c8de5b0SBaptiste Daroussin #line 9 "ok_syntax1.y"
1210c8de5b0SBaptiste Daroussin # include <stdio.h>
1220c8de5b0SBaptiste Daroussin # include <ctype.h>
1230c8de5b0SBaptiste Daroussin
1240c8de5b0SBaptiste Daroussin #ifdef YYBISON
1250c8de5b0SBaptiste Daroussin #define YYSTYPE int
1260c8de5b0SBaptiste Daroussin #define YYLEX_PARAM base
1270c8de5b0SBaptiste Daroussin #define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM)
1280c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
1290c8de5b0SBaptiste Daroussin int YYLEX_DECL();
1300c8de5b0SBaptiste Daroussin static void YYERROR_DECL();
1310c8de5b0SBaptiste Daroussin #endif
1320c8de5b0SBaptiste Daroussin
1330c8de5b0SBaptiste Daroussin #ifdef YYSTYPE
1340c8de5b0SBaptiste Daroussin #undef YYSTYPE_IS_DECLARED
1350c8de5b0SBaptiste Daroussin #define YYSTYPE_IS_DECLARED 1
1360c8de5b0SBaptiste Daroussin #endif
1370c8de5b0SBaptiste Daroussin #ifndef YYSTYPE_IS_DECLARED
1380c8de5b0SBaptiste Daroussin #define YYSTYPE_IS_DECLARED 1
139c5b5d71aSJung-uk Kim #line 43 "ok_syntax1.y"
140*822ca327SBaptiste Daroussin union CalcData
1410c8de5b0SBaptiste Daroussin {
1420c8de5b0SBaptiste Daroussin char * cval;
1430c8de5b0SBaptiste Daroussin int ival;
1440c8de5b0SBaptiste Daroussin double dval;
145*822ca327SBaptiste Daroussin }; typedef union CalcData YYSTYPE;
1460c8de5b0SBaptiste Daroussin #endif /* !YYSTYPE_IS_DECLARED */
1470c8de5b0SBaptiste Daroussin #line 148 "ok_syntax1.tab.c"
1480c8de5b0SBaptiste Daroussin
1490c8de5b0SBaptiste Daroussin /* compatibility with bison */
1500c8de5b0SBaptiste Daroussin #ifdef YYPARSE_PARAM
1510c8de5b0SBaptiste Daroussin /* compatibility with FreeBSD */
1520c8de5b0SBaptiste Daroussin # ifdef YYPARSE_PARAM_TYPE
1530c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
1540c8de5b0SBaptiste Daroussin # else
1550c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
1560c8de5b0SBaptiste Daroussin # endif
1570c8de5b0SBaptiste Daroussin #else
1580c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(int regs[26], int *base)
1590c8de5b0SBaptiste Daroussin #endif
1600c8de5b0SBaptiste Daroussin
1610c8de5b0SBaptiste Daroussin /* Parameters sent to lex. */
1620c8de5b0SBaptiste Daroussin #ifdef YYLEX_PARAM
1630c8de5b0SBaptiste Daroussin # ifdef YYLEX_PARAM_TYPE
1640c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, YYLEX_PARAM_TYPE YYLEX_PARAM)
1650c8de5b0SBaptiste Daroussin # else
1660c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, void * YYLEX_PARAM)
1670c8de5b0SBaptiste Daroussin # endif
1680c8de5b0SBaptiste Daroussin # define YYLEX yylex(&yylval, YYLEX_PARAM)
1690c8de5b0SBaptiste Daroussin #else
1700c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, int *base)
1710c8de5b0SBaptiste Daroussin # define YYLEX yylex(&yylval, base)
1720c8de5b0SBaptiste Daroussin #endif
1730c8de5b0SBaptiste Daroussin
1740c8de5b0SBaptiste Daroussin /* Parameters sent to yyerror. */
1750c8de5b0SBaptiste Daroussin #ifndef YYERROR_DECL
1760c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
1770c8de5b0SBaptiste Daroussin #endif
1780c8de5b0SBaptiste Daroussin #ifndef YYERROR_CALL
1790c8de5b0SBaptiste Daroussin #define YYERROR_CALL(msg) yyerror(regs, base, msg)
1800c8de5b0SBaptiste Daroussin #endif
1810c8de5b0SBaptiste Daroussin
1820c8de5b0SBaptiste Daroussin extern int YYPARSE_DECL();
1830c8de5b0SBaptiste Daroussin
1840c8de5b0SBaptiste Daroussin #define DIGIT 257
1850c8de5b0SBaptiste Daroussin #define LETTER 258
1860c8de5b0SBaptiste Daroussin #define OCT1 259
1870c8de5b0SBaptiste Daroussin #define HEX1 260
1880c8de5b0SBaptiste Daroussin #define HEX2 261
1890c8de5b0SBaptiste Daroussin #define HEX3 262
1900c8de5b0SBaptiste Daroussin #define STR1 263
1910c8de5b0SBaptiste Daroussin #define STR2 265
1920c8de5b0SBaptiste Daroussin #define BELL 266
1930c8de5b0SBaptiste Daroussin #define BS 267
1940c8de5b0SBaptiste Daroussin #define NL 268
1950c8de5b0SBaptiste Daroussin #define LF 269
1960c8de5b0SBaptiste Daroussin #define CR 270
1970c8de5b0SBaptiste Daroussin #define TAB 271
1980c8de5b0SBaptiste Daroussin #define VT 272
1990c8de5b0SBaptiste Daroussin #define UMINUS 273
2000c8de5b0SBaptiste Daroussin #define YYERRCODE 256
201b53bb29fSJung-uk Kim typedef int YYINT;
2020c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_lhs[] = { -1,
2030c8de5b0SBaptiste Daroussin 0, 0, 0, 1, 1, 2, 2, 2, 2, 2,
2040c8de5b0SBaptiste Daroussin 2, 2, 2, 2, 2, 2, 3, 3,
2050c8de5b0SBaptiste Daroussin };
2060c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_len[] = { 2,
2070c8de5b0SBaptiste Daroussin 0, 3, 3, 1, 3, 3, 3, 3, 3, 3,
2080c8de5b0SBaptiste Daroussin 3, 3, 3, 2, 1, 1, 1, 2,
2090c8de5b0SBaptiste Daroussin };
2100c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_defred[] = { 1,
2110c8de5b0SBaptiste Daroussin 0, 0, 17, 0, 0, 0, 0, 0, 0, 3,
2120c8de5b0SBaptiste Daroussin 0, 15, 14, 0, 2, 0, 0, 0, 0, 0,
2130c8de5b0SBaptiste Daroussin 0, 0, 18, 0, 6, 0, 0, 0, 0, 9,
2140c8de5b0SBaptiste Daroussin 10, 11,
2150c8de5b0SBaptiste Daroussin };
2162aca18c7SJung-uk Kim #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING)
2170c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_stos[] = { 0,
2180c8de5b0SBaptiste Daroussin 275, 256, 257, 258, 45, 40, 276, 277, 278, 10,
2190c8de5b0SBaptiste Daroussin 61, 258, 277, 277, 10, 124, 38, 43, 45, 42,
2200c8de5b0SBaptiste Daroussin 47, 37, 257, 277, 41, 277, 277, 277, 277, 277,
2210c8de5b0SBaptiste Daroussin 277, 277,
2220c8de5b0SBaptiste Daroussin };
2232aca18c7SJung-uk Kim #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */
2240c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_dgoto[] = { 1,
2250c8de5b0SBaptiste Daroussin 7, 8, 9,
2260c8de5b0SBaptiste Daroussin };
2270c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_sindex[] = { 0,
2280c8de5b0SBaptiste Daroussin -40, -7, 0, -55, -38, -38, 1, -29, -247, 0,
2290c8de5b0SBaptiste Daroussin -38, 0, 0, 22, 0, -38, -38, -38, -38, -38,
2300c8de5b0SBaptiste Daroussin -38, -38, 0, -29, 0, 51, 60, -20, -20, 0,
2310c8de5b0SBaptiste Daroussin 0, 0,
2320c8de5b0SBaptiste Daroussin };
2330c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_rindex[] = { 0,
2340c8de5b0SBaptiste Daroussin 0, 0, 0, 2, 0, 0, 0, 9, -9, 0,
2350c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2360c8de5b0SBaptiste Daroussin 0, 0, 0, 10, 0, -6, 14, 5, 13, 0,
2370c8de5b0SBaptiste Daroussin 0, 0,
2380c8de5b0SBaptiste Daroussin };
2390c8de5b0SBaptiste Daroussin #if YYBTYACC
2400c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_cindex[] = { 0,
2410c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2420c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2430c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2440c8de5b0SBaptiste Daroussin 0, 0,
2450c8de5b0SBaptiste Daroussin };
2460c8de5b0SBaptiste Daroussin #endif
2470c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_gindex[] = { 0,
2480c8de5b0SBaptiste Daroussin 0, 65, 0,
2490c8de5b0SBaptiste Daroussin };
2500c8de5b0SBaptiste Daroussin #define YYTABLESIZE 220
2510c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_table[] = { 6,
2520c8de5b0SBaptiste Daroussin 16, 6, 10, 13, 5, 11, 5, 22, 17, 23,
2530c8de5b0SBaptiste Daroussin 15, 15, 20, 18, 7, 19, 22, 21, 4, 5,
2540c8de5b0SBaptiste Daroussin 0, 20, 8, 12, 0, 0, 21, 16, 16, 0,
2550c8de5b0SBaptiste Daroussin 0, 16, 16, 16, 13, 16, 0, 16, 15, 15,
2560c8de5b0SBaptiste Daroussin 0, 0, 7, 15, 15, 7, 15, 7, 15, 7,
2570c8de5b0SBaptiste Daroussin 8, 12, 0, 8, 12, 8, 0, 8, 22, 17,
2580c8de5b0SBaptiste Daroussin 0, 0, 25, 20, 18, 0, 19, 0, 21, 13,
2590c8de5b0SBaptiste Daroussin 14, 0, 0, 0, 0, 24, 0, 0, 0, 0,
2600c8de5b0SBaptiste Daroussin 26, 27, 28, 29, 30, 31, 32, 22, 17, 0,
2610c8de5b0SBaptiste Daroussin 0, 0, 20, 18, 16, 19, 22, 21, 0, 0,
2620c8de5b0SBaptiste Daroussin 0, 20, 18, 0, 19, 0, 21, 0, 0, 0,
2630c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 16, 0, 0, 13, 0, 0,
2640c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 15, 0, 0, 7, 0,
2650c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 8, 12, 0, 0,
2660c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
2670c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2680c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2690c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2700c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2710c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2720c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2730c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 2, 3, 4, 3, 12,
2740c8de5b0SBaptiste Daroussin };
2750c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_check[] = { 40,
2760c8de5b0SBaptiste Daroussin 10, 40, 10, 10, 45, 61, 45, 37, 38, 257,
2770c8de5b0SBaptiste Daroussin 10, 10, 42, 43, 10, 45, 37, 47, 10, 10,
2780c8de5b0SBaptiste Daroussin -1, 42, 10, 10, -1, -1, 47, 37, 38, -1,
2790c8de5b0SBaptiste Daroussin -1, 41, 42, 43, 41, 45, -1, 47, 37, 38,
2800c8de5b0SBaptiste Daroussin -1, -1, 38, 42, 43, 41, 45, 43, 47, 45,
2810c8de5b0SBaptiste Daroussin 38, 38, -1, 41, 41, 43, -1, 45, 37, 38,
2820c8de5b0SBaptiste Daroussin -1, -1, 41, 42, 43, -1, 45, -1, 47, 5,
2830c8de5b0SBaptiste Daroussin 6, -1, -1, -1, -1, 11, -1, -1, -1, -1,
2840c8de5b0SBaptiste Daroussin 16, 17, 18, 19, 20, 21, 22, 37, 38, -1,
2850c8de5b0SBaptiste Daroussin -1, -1, 42, 43, 124, 45, 37, 47, -1, -1,
2860c8de5b0SBaptiste Daroussin -1, 42, 43, -1, 45, -1, 47, -1, -1, -1,
2870c8de5b0SBaptiste Daroussin -1, -1, -1, -1, 124, -1, -1, 124, -1, -1,
2880c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 124, -1, -1, 124, -1,
2890c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, 124, 124, -1, -1,
2900c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 124, -1, -1, -1, -1,
2910c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2920c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2930c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2940c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2950c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2960c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2970c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 256, 257, 258, 257, 258,
2980c8de5b0SBaptiste Daroussin };
29911fce282SBaptiste Daroussin #if YYBTYACC
30011fce282SBaptiste Daroussin static const YYINT ok_syntax1_ctable[] = { -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, -1, -1, -1,
31911fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
32011fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
32111fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
32211fce282SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1,
32311fce282SBaptiste Daroussin };
32411fce282SBaptiste Daroussin #endif
3250c8de5b0SBaptiste Daroussin #define YYFINAL 1
3260c8de5b0SBaptiste Daroussin #ifndef YYDEBUG
3270c8de5b0SBaptiste Daroussin #define YYDEBUG 0
3280c8de5b0SBaptiste Daroussin #endif
3290c8de5b0SBaptiste Daroussin #define YYMAXTOKEN 273
3300c8de5b0SBaptiste Daroussin #define YYUNDFTOKEN 279
3310c8de5b0SBaptiste Daroussin #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
3320c8de5b0SBaptiste Daroussin #if YYDEBUG
3330c8de5b0SBaptiste Daroussin static const char *const ok_syntax1_name[] = {
3340c8de5b0SBaptiste Daroussin
3350c8de5b0SBaptiste Daroussin "$end",0,0,0,0,0,0,"'\\a'","'\\b'","'\\t'","'\\n'","'\\v'","'\\f'","'\\r'",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,"'('","')'","'*'",
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,
3380c8de5b0SBaptiste 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,
3390c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,"'~'","'\\177'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3400c8de5b0SBaptiste 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,
3410c8de5b0SBaptiste 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,
3420c8de5b0SBaptiste 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,"'\\377'",
3430c8de5b0SBaptiste Daroussin "error","DIGIT","LETTER","OCT1","HEX1","HEX2","HEX3","STR1",
3440c8de5b0SBaptiste Daroussin "\"\\177\\177\\\\\\n\"","STR2","BELL","BS","NL","LF","CR","TAB","VT","UMINUS",
3450c8de5b0SBaptiste Daroussin "$accept","list","stat","expr","number","illegal-symbol",
3460c8de5b0SBaptiste Daroussin };
3470c8de5b0SBaptiste Daroussin static const char *const ok_syntax1_rule[] = {
3480c8de5b0SBaptiste Daroussin "$accept : list",
3490c8de5b0SBaptiste Daroussin "list :",
3500c8de5b0SBaptiste Daroussin "list : list stat '\\n'",
3510c8de5b0SBaptiste Daroussin "list : list error '\\n'",
3520c8de5b0SBaptiste Daroussin "stat : expr",
3530c8de5b0SBaptiste Daroussin "stat : LETTER '=' expr",
3540c8de5b0SBaptiste Daroussin "expr : '(' expr ')'",
3550c8de5b0SBaptiste Daroussin "expr : expr '+' expr",
3560c8de5b0SBaptiste Daroussin "expr : expr '-' expr",
3570c8de5b0SBaptiste Daroussin "expr : expr '*' expr",
3580c8de5b0SBaptiste Daroussin "expr : expr '/' expr",
3590c8de5b0SBaptiste Daroussin "expr : expr '%' expr",
3600c8de5b0SBaptiste Daroussin "expr : expr '&' expr",
3610c8de5b0SBaptiste Daroussin "expr : expr '|' expr",
3620c8de5b0SBaptiste Daroussin "expr : '-' expr",
3630c8de5b0SBaptiste Daroussin "expr : LETTER",
3640c8de5b0SBaptiste Daroussin "expr : number",
3650c8de5b0SBaptiste Daroussin "number : DIGIT",
3660c8de5b0SBaptiste Daroussin "number : number DIGIT",
3670c8de5b0SBaptiste Daroussin
3680c8de5b0SBaptiste Daroussin };
3690c8de5b0SBaptiste Daroussin #endif
3700c8de5b0SBaptiste Daroussin
371b53bb29fSJung-uk Kim #if YYDEBUG
3720c8de5b0SBaptiste Daroussin int yydebug;
373b53bb29fSJung-uk Kim #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 #line 104 "ok_syntax1.y"
4470c8de5b0SBaptiste Daroussin /* start of programs */
4480c8de5b0SBaptiste Daroussin
4490c8de5b0SBaptiste Daroussin #ifdef YYBYACC
4500c8de5b0SBaptiste Daroussin extern int YYLEX_DECL();
4510c8de5b0SBaptiste Daroussin #endif
4520c8de5b0SBaptiste Daroussin
4530c8de5b0SBaptiste Daroussin int
main(void)4540c8de5b0SBaptiste Daroussin main (void)
4550c8de5b0SBaptiste Daroussin {
4560c8de5b0SBaptiste Daroussin int regs[26];
4570c8de5b0SBaptiste Daroussin int base = 10;
4580c8de5b0SBaptiste Daroussin
4590c8de5b0SBaptiste Daroussin while(!feof(stdin)) {
4600c8de5b0SBaptiste Daroussin yyparse(regs, &base);
4610c8de5b0SBaptiste Daroussin }
4620c8de5b0SBaptiste Daroussin return 0;
4630c8de5b0SBaptiste Daroussin }
4640c8de5b0SBaptiste Daroussin
4650c8de5b0SBaptiste Daroussin #define UNUSED(x) ((void)(x))
4660c8de5b0SBaptiste Daroussin
4670c8de5b0SBaptiste Daroussin static void
YYERROR_DECL()4680c8de5b0SBaptiste Daroussin YYERROR_DECL()
4690c8de5b0SBaptiste Daroussin {
4700c8de5b0SBaptiste Daroussin UNUSED(regs); /* %parse-param regs is not actually used here */
4710c8de5b0SBaptiste Daroussin UNUSED(base); /* %parse-param base is not actually used here */
4720c8de5b0SBaptiste Daroussin fprintf(stderr, "%s\n", s);
4730c8de5b0SBaptiste Daroussin }
4740c8de5b0SBaptiste Daroussin
4750c8de5b0SBaptiste Daroussin int
YYLEX_DECL()4760c8de5b0SBaptiste Daroussin YYLEX_DECL()
4770c8de5b0SBaptiste Daroussin {
4780c8de5b0SBaptiste Daroussin /* lexical analysis routine */
4790c8de5b0SBaptiste Daroussin /* returns LETTER for a lower case letter, yylval = 0 through 25 */
4800c8de5b0SBaptiste Daroussin /* return DIGIT for a digit, yylval = 0 through 9 */
4810c8de5b0SBaptiste Daroussin /* all other characters are returned immediately */
4820c8de5b0SBaptiste Daroussin
4830c8de5b0SBaptiste Daroussin int c;
4840c8de5b0SBaptiste Daroussin
4850c8de5b0SBaptiste Daroussin while( (c=getchar()) == ' ' ) { /* skip blanks */ }
4860c8de5b0SBaptiste Daroussin
4870c8de5b0SBaptiste Daroussin /* c is now nonblank */
4880c8de5b0SBaptiste Daroussin
4890c8de5b0SBaptiste Daroussin if( islower( c )) {
4900c8de5b0SBaptiste Daroussin yylval->ival = (c - 'a');
4910c8de5b0SBaptiste Daroussin return ( LETTER );
4920c8de5b0SBaptiste Daroussin }
4930c8de5b0SBaptiste Daroussin if( isdigit( c )) {
4940c8de5b0SBaptiste Daroussin yylval->ival = (c - '0') % (*base);
4950c8de5b0SBaptiste Daroussin return ( DIGIT );
4960c8de5b0SBaptiste Daroussin }
4970c8de5b0SBaptiste Daroussin return( c );
4980c8de5b0SBaptiste Daroussin }
499b53bb29fSJung-uk Kim #line 500 "ok_syntax1.tab.c"
5000c8de5b0SBaptiste Daroussin
5010c8de5b0SBaptiste Daroussin /* For use in generated program */
5020c8de5b0SBaptiste Daroussin #define yydepth (int)(yystack.s_mark - yystack.s_base)
5030c8de5b0SBaptiste Daroussin #if YYBTYACC
5040c8de5b0SBaptiste Daroussin #define yytrial (yyps->save)
5050c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
5060c8de5b0SBaptiste Daroussin
5070c8de5b0SBaptiste Daroussin #if YYDEBUG
5080c8de5b0SBaptiste Daroussin #include <stdio.h> /* needed for printf */
5090c8de5b0SBaptiste Daroussin #endif
5100c8de5b0SBaptiste Daroussin
5110c8de5b0SBaptiste Daroussin #include <stdlib.h> /* needed for malloc, etc */
5120c8de5b0SBaptiste Daroussin #include <string.h> /* needed for memset */
5130c8de5b0SBaptiste Daroussin
5140c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */
yygrowstack(YYSTACKDATA * data)5150c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data)
5160c8de5b0SBaptiste Daroussin {
5170c8de5b0SBaptiste Daroussin int i;
5180c8de5b0SBaptiste Daroussin unsigned newsize;
519c5b5d71aSJung-uk Kim YYINT *newss;
5200c8de5b0SBaptiste Daroussin YYSTYPE *newvs;
5210c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5220c8de5b0SBaptiste Daroussin YYLTYPE *newps;
5230c8de5b0SBaptiste Daroussin #endif
5240c8de5b0SBaptiste Daroussin
5250c8de5b0SBaptiste Daroussin if ((newsize = data->stacksize) == 0)
5260c8de5b0SBaptiste Daroussin newsize = YYINITSTACKSIZE;
5270c8de5b0SBaptiste Daroussin else if (newsize >= YYMAXDEPTH)
5280c8de5b0SBaptiste Daroussin return YYENOMEM;
5290c8de5b0SBaptiste Daroussin else if ((newsize *= 2) > YYMAXDEPTH)
5300c8de5b0SBaptiste Daroussin newsize = YYMAXDEPTH;
5310c8de5b0SBaptiste Daroussin
5320c8de5b0SBaptiste Daroussin i = (int) (data->s_mark - data->s_base);
533c5b5d71aSJung-uk Kim newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
534bf80e08eSJung-uk Kim if (newss == NULL)
5350c8de5b0SBaptiste Daroussin return YYENOMEM;
5360c8de5b0SBaptiste Daroussin
5370c8de5b0SBaptiste Daroussin data->s_base = newss;
5380c8de5b0SBaptiste Daroussin data->s_mark = newss + i;
5390c8de5b0SBaptiste Daroussin
5400c8de5b0SBaptiste Daroussin newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
541bf80e08eSJung-uk Kim if (newvs == NULL)
5420c8de5b0SBaptiste Daroussin return YYENOMEM;
5430c8de5b0SBaptiste Daroussin
5440c8de5b0SBaptiste Daroussin data->l_base = newvs;
5450c8de5b0SBaptiste Daroussin data->l_mark = newvs + i;
5460c8de5b0SBaptiste Daroussin
5470c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5480c8de5b0SBaptiste Daroussin newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps));
549bf80e08eSJung-uk Kim if (newps == NULL)
5500c8de5b0SBaptiste Daroussin return YYENOMEM;
5510c8de5b0SBaptiste Daroussin
5520c8de5b0SBaptiste Daroussin data->p_base = newps;
5530c8de5b0SBaptiste Daroussin data->p_mark = newps + i;
5540c8de5b0SBaptiste Daroussin #endif
5550c8de5b0SBaptiste Daroussin
5560c8de5b0SBaptiste Daroussin data->stacksize = newsize;
5570c8de5b0SBaptiste Daroussin data->s_last = data->s_base + newsize - 1;
5580c8de5b0SBaptiste Daroussin
5590c8de5b0SBaptiste Daroussin #if YYDEBUG
5600c8de5b0SBaptiste Daroussin if (yydebug)
5610c8de5b0SBaptiste Daroussin fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize);
5620c8de5b0SBaptiste Daroussin #endif
5630c8de5b0SBaptiste Daroussin return 0;
5640c8de5b0SBaptiste Daroussin }
5650c8de5b0SBaptiste Daroussin
5660c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS)
yyfreestack(YYSTACKDATA * data)5670c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data)
5680c8de5b0SBaptiste Daroussin {
5690c8de5b0SBaptiste Daroussin free(data->s_base);
5700c8de5b0SBaptiste Daroussin free(data->l_base);
5710c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5720c8de5b0SBaptiste Daroussin free(data->p_base);
5730c8de5b0SBaptiste Daroussin #endif
5740c8de5b0SBaptiste Daroussin memset(data, 0, sizeof(*data));
5750c8de5b0SBaptiste Daroussin }
5760c8de5b0SBaptiste Daroussin #else
5770c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */
5780c8de5b0SBaptiste Daroussin #endif /* YYPURE || defined(YY_NO_LEAKS) */
5790c8de5b0SBaptiste Daroussin #if YYBTYACC
5800c8de5b0SBaptiste Daroussin
5810c8de5b0SBaptiste Daroussin static YYParseState *
yyNewState(unsigned size)5820c8de5b0SBaptiste Daroussin yyNewState(unsigned size)
5830c8de5b0SBaptiste Daroussin {
5840c8de5b0SBaptiste Daroussin YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState));
5850c8de5b0SBaptiste Daroussin if (p == NULL) return NULL;
5860c8de5b0SBaptiste Daroussin
5870c8de5b0SBaptiste Daroussin p->yystack.stacksize = size;
5880c8de5b0SBaptiste Daroussin if (size == 0)
5890c8de5b0SBaptiste Daroussin {
5900c8de5b0SBaptiste Daroussin p->yystack.s_base = NULL;
5910c8de5b0SBaptiste Daroussin p->yystack.l_base = NULL;
5920c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
5930c8de5b0SBaptiste Daroussin p->yystack.p_base = NULL;
5940c8de5b0SBaptiste Daroussin #endif
5950c8de5b0SBaptiste Daroussin return p;
5960c8de5b0SBaptiste Daroussin }
597c5b5d71aSJung-uk Kim p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
5980c8de5b0SBaptiste Daroussin if (p->yystack.s_base == NULL) return NULL;
5990c8de5b0SBaptiste Daroussin p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
6000c8de5b0SBaptiste Daroussin if (p->yystack.l_base == NULL) return NULL;
6010c8de5b0SBaptiste Daroussin memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));
6020c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6030c8de5b0SBaptiste Daroussin p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));
6040c8de5b0SBaptiste Daroussin if (p->yystack.p_base == NULL) return NULL;
6050c8de5b0SBaptiste Daroussin memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));
6060c8de5b0SBaptiste Daroussin #endif
6070c8de5b0SBaptiste Daroussin
6080c8de5b0SBaptiste Daroussin return p;
6090c8de5b0SBaptiste Daroussin }
6100c8de5b0SBaptiste Daroussin
6110c8de5b0SBaptiste Daroussin static void
yyFreeState(YYParseState * p)6120c8de5b0SBaptiste Daroussin yyFreeState(YYParseState *p)
6130c8de5b0SBaptiste Daroussin {
6140c8de5b0SBaptiste Daroussin yyfreestack(&p->yystack);
6150c8de5b0SBaptiste Daroussin free(p);
6160c8de5b0SBaptiste Daroussin }
6170c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6180c8de5b0SBaptiste Daroussin
6190c8de5b0SBaptiste Daroussin #define YYABORT goto yyabort
6200c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort
6210c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept
6220c8de5b0SBaptiste Daroussin #define YYERROR goto yyerrlab
6230c8de5b0SBaptiste Daroussin #if YYBTYACC
6240c8de5b0SBaptiste Daroussin #define YYVALID do { if (yyps->save) goto yyvalid; } while(0)
6250c8de5b0SBaptiste Daroussin #define YYVALID_NESTED do { if (yyps->save && \
6260c8de5b0SBaptiste Daroussin yyps->save->save == 0) goto yyvalid; } while(0)
6270c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6280c8de5b0SBaptiste Daroussin
6290c8de5b0SBaptiste Daroussin int
YYPARSE_DECL()6300c8de5b0SBaptiste Daroussin YYPARSE_DECL()
6310c8de5b0SBaptiste Daroussin {
6320c8de5b0SBaptiste Daroussin int yyerrflag;
6330c8de5b0SBaptiste Daroussin int yychar;
6340c8de5b0SBaptiste Daroussin YYSTYPE yyval;
6350c8de5b0SBaptiste Daroussin YYSTYPE yylval;
636b53bb29fSJung-uk Kim int yynerrs;
637b53bb29fSJung-uk Kim
6380c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6390c8de5b0SBaptiste Daroussin YYLTYPE yyloc; /* position returned by actions */
6400c8de5b0SBaptiste Daroussin YYLTYPE yylloc; /* position from the lexer */
6410c8de5b0SBaptiste Daroussin #endif
6420c8de5b0SBaptiste Daroussin
6430c8de5b0SBaptiste Daroussin /* variables for the parser stack */
6440c8de5b0SBaptiste Daroussin YYSTACKDATA yystack;
6450c8de5b0SBaptiste Daroussin #if YYBTYACC
6460c8de5b0SBaptiste Daroussin
6470c8de5b0SBaptiste Daroussin /* Current parser state */
6480c8de5b0SBaptiste Daroussin static YYParseState *yyps = 0;
6490c8de5b0SBaptiste Daroussin
6500c8de5b0SBaptiste Daroussin /* yypath != NULL: do the full parse, starting at *yypath parser state. */
6510c8de5b0SBaptiste Daroussin static YYParseState *yypath = 0;
6520c8de5b0SBaptiste Daroussin
6530c8de5b0SBaptiste Daroussin /* Base of the lexical value queue */
6540c8de5b0SBaptiste Daroussin static YYSTYPE *yylvals = 0;
6550c8de5b0SBaptiste Daroussin
6560c8de5b0SBaptiste Daroussin /* Current position at lexical value queue */
6570c8de5b0SBaptiste Daroussin static YYSTYPE *yylvp = 0;
6580c8de5b0SBaptiste Daroussin
6590c8de5b0SBaptiste Daroussin /* End position of lexical value queue */
6600c8de5b0SBaptiste Daroussin static YYSTYPE *yylve = 0;
6610c8de5b0SBaptiste Daroussin
6620c8de5b0SBaptiste Daroussin /* The last allocated position at the lexical value queue */
6630c8de5b0SBaptiste Daroussin static YYSTYPE *yylvlim = 0;
6640c8de5b0SBaptiste Daroussin
6650c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
6660c8de5b0SBaptiste Daroussin /* Base of the lexical position queue */
6670c8de5b0SBaptiste Daroussin static YYLTYPE *yylpsns = 0;
6680c8de5b0SBaptiste Daroussin
6690c8de5b0SBaptiste Daroussin /* Current position at lexical position queue */
6700c8de5b0SBaptiste Daroussin static YYLTYPE *yylpp = 0;
6710c8de5b0SBaptiste Daroussin
6720c8de5b0SBaptiste Daroussin /* End position of lexical position queue */
6730c8de5b0SBaptiste Daroussin static YYLTYPE *yylpe = 0;
6740c8de5b0SBaptiste Daroussin
6750c8de5b0SBaptiste Daroussin /* The last allocated position at the lexical position queue */
6760c8de5b0SBaptiste Daroussin static YYLTYPE *yylplim = 0;
6770c8de5b0SBaptiste Daroussin #endif
6780c8de5b0SBaptiste Daroussin
6790c8de5b0SBaptiste Daroussin /* Current position at lexical token queue */
6802aca18c7SJung-uk Kim static YYINT *yylexp = 0;
6810c8de5b0SBaptiste Daroussin
6822aca18c7SJung-uk Kim static YYINT *yylexemes = 0;
6830c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6840c8de5b0SBaptiste Daroussin int yym, yyn, yystate, yyresult;
6850c8de5b0SBaptiste Daroussin #if YYBTYACC
6860c8de5b0SBaptiste Daroussin int yynewerrflag;
6870c8de5b0SBaptiste Daroussin YYParseState *yyerrctx = NULL;
6880c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
6890c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
690b53bb29fSJung-uk Kim YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */
6910c8de5b0SBaptiste Daroussin #endif
6920c8de5b0SBaptiste Daroussin #if YYDEBUG
6930c8de5b0SBaptiste Daroussin const char *yys;
6940c8de5b0SBaptiste Daroussin
695bf80e08eSJung-uk Kim if ((yys = getenv("YYDEBUG")) != NULL)
6960c8de5b0SBaptiste Daroussin {
6970c8de5b0SBaptiste Daroussin yyn = *yys;
6980c8de5b0SBaptiste Daroussin if (yyn >= '0' && yyn <= '9')
6990c8de5b0SBaptiste Daroussin yydebug = yyn - '0';
7000c8de5b0SBaptiste Daroussin }
7010c8de5b0SBaptiste Daroussin if (yydebug)
7020c8de5b0SBaptiste Daroussin fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX);
7030c8de5b0SBaptiste Daroussin #endif
7046166fdceSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7056166fdceSJung-uk Kim memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range));
7066166fdceSJung-uk Kim #endif
7076166fdceSJung-uk Kim
7086166fdceSJung-uk Kim yyerrflag = 0;
7096166fdceSJung-uk Kim yychar = 0;
7106166fdceSJung-uk Kim memset(&yyval, 0, sizeof(yyval));
7116166fdceSJung-uk Kim memset(&yylval, 0, sizeof(yylval));
7126166fdceSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7136166fdceSJung-uk Kim memset(&yyloc, 0, sizeof(yyloc));
7146166fdceSJung-uk Kim memset(&yylloc, 0, sizeof(yylloc));
7156166fdceSJung-uk Kim #endif
7160c8de5b0SBaptiste Daroussin
7170c8de5b0SBaptiste Daroussin #if YYBTYACC
7180c8de5b0SBaptiste Daroussin yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
7190c8de5b0SBaptiste Daroussin yyps->save = 0;
7200c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
721c5b5d71aSJung-uk Kim yym = 0;
7228e022d3cSDag-Erling Smørgrav /* yyn is set below */
7230c8de5b0SBaptiste Daroussin yynerrs = 0;
7240c8de5b0SBaptiste Daroussin yyerrflag = 0;
7250c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
7260c8de5b0SBaptiste Daroussin yystate = 0;
7270c8de5b0SBaptiste Daroussin
7280c8de5b0SBaptiste Daroussin #if YYPURE
7290c8de5b0SBaptiste Daroussin memset(&yystack, 0, sizeof(yystack));
7300c8de5b0SBaptiste Daroussin #endif
7310c8de5b0SBaptiste Daroussin
7320c8de5b0SBaptiste Daroussin if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
7330c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base;
7340c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base;
7350c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7360c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base;
7370c8de5b0SBaptiste Daroussin #endif
7380c8de5b0SBaptiste Daroussin yystate = 0;
7390c8de5b0SBaptiste Daroussin *yystack.s_mark = 0;
7400c8de5b0SBaptiste Daroussin
7410c8de5b0SBaptiste Daroussin yyloop:
7420c8de5b0SBaptiste Daroussin if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
7430c8de5b0SBaptiste Daroussin if (yychar < 0)
7440c8de5b0SBaptiste Daroussin {
7450c8de5b0SBaptiste Daroussin #if YYBTYACC
7460c8de5b0SBaptiste Daroussin do {
7470c8de5b0SBaptiste Daroussin if (yylvp < yylve)
7480c8de5b0SBaptiste Daroussin {
7490c8de5b0SBaptiste Daroussin /* we're currently re-reading tokens */
7500c8de5b0SBaptiste Daroussin yylval = *yylvp++;
7510c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7520c8de5b0SBaptiste Daroussin yylloc = *yylpp++;
7530c8de5b0SBaptiste Daroussin #endif
7540c8de5b0SBaptiste Daroussin yychar = *yylexp++;
7550c8de5b0SBaptiste Daroussin break;
7560c8de5b0SBaptiste Daroussin }
7570c8de5b0SBaptiste Daroussin if (yyps->save)
7580c8de5b0SBaptiste Daroussin {
7590c8de5b0SBaptiste Daroussin /* in trial mode; save scanner results for future parse attempts */
7600c8de5b0SBaptiste Daroussin if (yylvp == yylvlim)
7610c8de5b0SBaptiste Daroussin { /* Enlarge lexical value queue */
76211fce282SBaptiste Daroussin size_t p = (size_t) (yylvp - yylvals);
76311fce282SBaptiste Daroussin size_t s = (size_t) (yylvlim - yylvals);
7640c8de5b0SBaptiste Daroussin
7650c8de5b0SBaptiste Daroussin s += YYLVQUEUEGROWTH;
766b53bb29fSJung-uk Kim if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;
767b53bb29fSJung-uk Kim if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;
7680c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
769b53bb29fSJung-uk Kim if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;
7700c8de5b0SBaptiste Daroussin #endif
7710c8de5b0SBaptiste Daroussin yylvp = yylve = yylvals + p;
7720c8de5b0SBaptiste Daroussin yylvlim = yylvals + s;
7730c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7740c8de5b0SBaptiste Daroussin yylpp = yylpe = yylpsns + p;
7750c8de5b0SBaptiste Daroussin yylplim = yylpsns + s;
7760c8de5b0SBaptiste Daroussin #endif
7770c8de5b0SBaptiste Daroussin yylexp = yylexemes + p;
7780c8de5b0SBaptiste Daroussin }
7792aca18c7SJung-uk Kim *yylexp = (YYINT) YYLEX;
7800c8de5b0SBaptiste Daroussin *yylvp++ = yylval;
7810c8de5b0SBaptiste Daroussin yylve++;
7820c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
7830c8de5b0SBaptiste Daroussin *yylpp++ = yylloc;
7840c8de5b0SBaptiste Daroussin yylpe++;
7850c8de5b0SBaptiste Daroussin #endif
7860c8de5b0SBaptiste Daroussin yychar = *yylexp++;
7870c8de5b0SBaptiste Daroussin break;
7880c8de5b0SBaptiste Daroussin }
7890c8de5b0SBaptiste Daroussin /* normal operation, no conflict encountered */
7900c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7910c8de5b0SBaptiste Daroussin yychar = YYLEX;
7920c8de5b0SBaptiste Daroussin #if YYBTYACC
7930c8de5b0SBaptiste Daroussin } while (0);
7940c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
7950c8de5b0SBaptiste Daroussin if (yychar < 0) yychar = YYEOF;
7960c8de5b0SBaptiste Daroussin #if YYDEBUG
7970c8de5b0SBaptiste Daroussin if (yydebug)
7980c8de5b0SBaptiste Daroussin {
799c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
8000c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
8010c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yychar, yys);
8020c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
8030c8de5b0SBaptiste Daroussin #if YYBTYACC
8040c8de5b0SBaptiste Daroussin if (!yytrial)
8050c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
8060c8de5b0SBaptiste Daroussin fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval));
8070c8de5b0SBaptiste Daroussin #endif
8080c8de5b0SBaptiste Daroussin fputc('\n', stderr);
8090c8de5b0SBaptiste Daroussin }
8100c8de5b0SBaptiste Daroussin #endif
8110c8de5b0SBaptiste Daroussin }
8120c8de5b0SBaptiste Daroussin #if YYBTYACC
8130c8de5b0SBaptiste Daroussin
8140c8de5b0SBaptiste Daroussin /* Do we have a conflict? */
8150c8de5b0SBaptiste Daroussin if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
8160c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
8170c8de5b0SBaptiste Daroussin {
8180c8de5b0SBaptiste Daroussin YYINT ctry;
8190c8de5b0SBaptiste Daroussin
8200c8de5b0SBaptiste Daroussin if (yypath)
8210c8de5b0SBaptiste Daroussin {
8220c8de5b0SBaptiste Daroussin YYParseState *save;
8230c8de5b0SBaptiste Daroussin #if YYDEBUG
8240c8de5b0SBaptiste Daroussin if (yydebug)
8250c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n",
8260c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate);
8270c8de5b0SBaptiste Daroussin #endif
8280c8de5b0SBaptiste Daroussin /* Switch to the next conflict context */
8290c8de5b0SBaptiste Daroussin save = yypath;
8300c8de5b0SBaptiste Daroussin yypath = save->save;
8310c8de5b0SBaptiste Daroussin save->save = NULL;
8320c8de5b0SBaptiste Daroussin ctry = save->ctry;
8330c8de5b0SBaptiste Daroussin if (save->state != yystate) YYABORT;
8340c8de5b0SBaptiste Daroussin yyFreeState(save);
8350c8de5b0SBaptiste Daroussin
8360c8de5b0SBaptiste Daroussin }
8370c8de5b0SBaptiste Daroussin else
8380c8de5b0SBaptiste Daroussin {
8390c8de5b0SBaptiste Daroussin
8400c8de5b0SBaptiste Daroussin /* Unresolved conflict - start/continue trial parse */
8410c8de5b0SBaptiste Daroussin YYParseState *save;
8420c8de5b0SBaptiste Daroussin #if YYDEBUG
8430c8de5b0SBaptiste Daroussin if (yydebug)
8440c8de5b0SBaptiste Daroussin {
8450c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate);
8460c8de5b0SBaptiste Daroussin if (yyps->save)
8470c8de5b0SBaptiste Daroussin fputs("ALREADY in conflict, continuing trial parse.\n", stderr);
8480c8de5b0SBaptiste Daroussin else
8490c8de5b0SBaptiste Daroussin fputs("Starting trial parse.\n", stderr);
8500c8de5b0SBaptiste Daroussin }
8510c8de5b0SBaptiste Daroussin #endif
8520c8de5b0SBaptiste Daroussin save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
8530c8de5b0SBaptiste Daroussin if (save == NULL) goto yyenomem;
8540c8de5b0SBaptiste Daroussin save->save = yyps->save;
8550c8de5b0SBaptiste Daroussin save->state = yystate;
8560c8de5b0SBaptiste Daroussin save->errflag = yyerrflag;
8570c8de5b0SBaptiste Daroussin save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
858c5b5d71aSJung-uk Kim memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
8590c8de5b0SBaptiste Daroussin save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
86011fce282SBaptiste Daroussin memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
8610c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8620c8de5b0SBaptiste Daroussin save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base);
86311fce282SBaptiste Daroussin memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
8640c8de5b0SBaptiste Daroussin #endif
8650c8de5b0SBaptiste Daroussin ctry = yytable[yyn];
8660c8de5b0SBaptiste Daroussin if (yyctable[ctry] == -1)
8670c8de5b0SBaptiste Daroussin {
8680c8de5b0SBaptiste Daroussin #if YYDEBUG
8690c8de5b0SBaptiste Daroussin if (yydebug && yychar >= YYEOF)
8700c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth);
8710c8de5b0SBaptiste Daroussin #endif
8720c8de5b0SBaptiste Daroussin ctry++;
8730c8de5b0SBaptiste Daroussin }
8740c8de5b0SBaptiste Daroussin save->ctry = ctry;
8750c8de5b0SBaptiste Daroussin if (yyps->save == NULL)
8760c8de5b0SBaptiste Daroussin {
8770c8de5b0SBaptiste Daroussin /* If this is a first conflict in the stack, start saving lexemes */
8780c8de5b0SBaptiste Daroussin if (!yylexemes)
8790c8de5b0SBaptiste Daroussin {
880b53bb29fSJung-uk Kim yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));
8810c8de5b0SBaptiste Daroussin if (yylexemes == NULL) goto yyenomem;
8820c8de5b0SBaptiste Daroussin yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));
8830c8de5b0SBaptiste Daroussin if (yylvals == NULL) goto yyenomem;
8840c8de5b0SBaptiste Daroussin yylvlim = yylvals + YYLVQUEUEGROWTH;
8850c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8860c8de5b0SBaptiste Daroussin yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE));
8870c8de5b0SBaptiste Daroussin if (yylpsns == NULL) goto yyenomem;
8880c8de5b0SBaptiste Daroussin yylplim = yylpsns + YYLVQUEUEGROWTH;
8890c8de5b0SBaptiste Daroussin #endif
8900c8de5b0SBaptiste Daroussin }
8910c8de5b0SBaptiste Daroussin if (yylvp == yylve)
8920c8de5b0SBaptiste Daroussin {
8930c8de5b0SBaptiste Daroussin yylvp = yylve = yylvals;
8940c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
8950c8de5b0SBaptiste Daroussin yylpp = yylpe = yylpsns;
8960c8de5b0SBaptiste Daroussin #endif
8970c8de5b0SBaptiste Daroussin yylexp = yylexemes;
8980c8de5b0SBaptiste Daroussin if (yychar >= YYEOF)
8990c8de5b0SBaptiste Daroussin {
9000c8de5b0SBaptiste Daroussin *yylve++ = yylval;
9010c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9020c8de5b0SBaptiste Daroussin *yylpe++ = yylloc;
9030c8de5b0SBaptiste Daroussin #endif
9042aca18c7SJung-uk Kim *yylexp = (YYINT) yychar;
9050c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
9060c8de5b0SBaptiste Daroussin }
9070c8de5b0SBaptiste Daroussin }
9080c8de5b0SBaptiste Daroussin }
9090c8de5b0SBaptiste Daroussin if (yychar >= YYEOF)
9100c8de5b0SBaptiste Daroussin {
9110c8de5b0SBaptiste Daroussin yylvp--;
9120c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9130c8de5b0SBaptiste Daroussin yylpp--;
9140c8de5b0SBaptiste Daroussin #endif
9150c8de5b0SBaptiste Daroussin yylexp--;
9160c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
9170c8de5b0SBaptiste Daroussin }
91811fce282SBaptiste Daroussin save->lexeme = (int) (yylvp - yylvals);
9190c8de5b0SBaptiste Daroussin yyps->save = save;
9200c8de5b0SBaptiste Daroussin }
9210c8de5b0SBaptiste Daroussin if (yytable[yyn] == ctry)
9220c8de5b0SBaptiste Daroussin {
9230c8de5b0SBaptiste Daroussin #if YYDEBUG
9240c8de5b0SBaptiste Daroussin if (yydebug)
9250c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
9260c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yyctable[ctry]);
9270c8de5b0SBaptiste Daroussin #endif
9280c8de5b0SBaptiste Daroussin if (yychar < 0)
9290c8de5b0SBaptiste Daroussin {
9300c8de5b0SBaptiste Daroussin yylvp++;
9310c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9320c8de5b0SBaptiste Daroussin yylpp++;
9330c8de5b0SBaptiste Daroussin #endif
9340c8de5b0SBaptiste Daroussin yylexp++;
9350c8de5b0SBaptiste Daroussin }
9360c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
9370c8de5b0SBaptiste Daroussin goto yyoverflow;
9380c8de5b0SBaptiste Daroussin yystate = yyctable[ctry];
939c5b5d71aSJung-uk Kim *++yystack.s_mark = (YYINT) yystate;
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 else
9490c8de5b0SBaptiste Daroussin {
9500c8de5b0SBaptiste Daroussin yyn = yyctable[ctry];
9510c8de5b0SBaptiste Daroussin goto yyreduce;
9520c8de5b0SBaptiste Daroussin }
9530c8de5b0SBaptiste Daroussin } /* End of code dealing with conflicts */
9540c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
9550c8de5b0SBaptiste Daroussin if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
9560c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
9570c8de5b0SBaptiste Daroussin {
9580c8de5b0SBaptiste Daroussin #if YYDEBUG
9590c8de5b0SBaptiste Daroussin if (yydebug)
9600c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n",
9610c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yytable[yyn]);
9620c8de5b0SBaptiste Daroussin #endif
9630c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
9640c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
9650c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn];
9660c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
9670c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
9680c8de5b0SBaptiste Daroussin *++yystack.p_mark = yylloc;
9690c8de5b0SBaptiste Daroussin #endif
9700c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
9710c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag;
9720c8de5b0SBaptiste Daroussin goto yyloop;
9730c8de5b0SBaptiste Daroussin }
9740c8de5b0SBaptiste Daroussin if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
9750c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
9760c8de5b0SBaptiste Daroussin {
9770c8de5b0SBaptiste Daroussin yyn = yytable[yyn];
9780c8de5b0SBaptiste Daroussin goto yyreduce;
9790c8de5b0SBaptiste Daroussin }
9800c8de5b0SBaptiste Daroussin if (yyerrflag != 0) goto yyinrecovery;
9810c8de5b0SBaptiste Daroussin #if YYBTYACC
9820c8de5b0SBaptiste Daroussin
9830c8de5b0SBaptiste Daroussin yynewerrflag = 1;
9840c8de5b0SBaptiste Daroussin goto yyerrhandler;
985c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */
9860c8de5b0SBaptiste Daroussin
9870c8de5b0SBaptiste Daroussin yyerrlab:
988c5b5d71aSJung-uk Kim /* explicit YYERROR from an action -- pop the rhs of the rule reduced
989c5b5d71aSJung-uk Kim * before looking for error recovery */
990c5b5d71aSJung-uk Kim yystack.s_mark -= yym;
991c5b5d71aSJung-uk Kim yystate = *yystack.s_mark;
992c5b5d71aSJung-uk Kim yystack.l_mark -= yym;
993c5b5d71aSJung-uk Kim #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
994c5b5d71aSJung-uk Kim yystack.p_mark -= yym;
995c5b5d71aSJung-uk Kim #endif
996c5b5d71aSJung-uk Kim
9970c8de5b0SBaptiste Daroussin yynewerrflag = 0;
9980c8de5b0SBaptiste Daroussin yyerrhandler:
9990c8de5b0SBaptiste Daroussin while (yyps->save)
10000c8de5b0SBaptiste Daroussin {
10010c8de5b0SBaptiste Daroussin int ctry;
10020c8de5b0SBaptiste Daroussin YYParseState *save = yyps->save;
10030c8de5b0SBaptiste Daroussin #if YYDEBUG
10040c8de5b0SBaptiste Daroussin if (yydebug)
10050c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n",
10060c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yyps->save->state,
10070c8de5b0SBaptiste Daroussin (int)(yylvp - yylvals - yyps->save->lexeme));
10080c8de5b0SBaptiste Daroussin #endif
10090c8de5b0SBaptiste Daroussin /* Memorize most forward-looking error state in case it's really an error. */
10100c8de5b0SBaptiste Daroussin if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals)
10110c8de5b0SBaptiste Daroussin {
10120c8de5b0SBaptiste Daroussin /* Free old saved error context state */
10130c8de5b0SBaptiste Daroussin if (yyerrctx) yyFreeState(yyerrctx);
10140c8de5b0SBaptiste Daroussin /* Create and fill out new saved error context state */
10150c8de5b0SBaptiste Daroussin yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1));
10160c8de5b0SBaptiste Daroussin if (yyerrctx == NULL) goto yyenomem;
10170c8de5b0SBaptiste Daroussin yyerrctx->save = yyps->save;
10180c8de5b0SBaptiste Daroussin yyerrctx->state = yystate;
10190c8de5b0SBaptiste Daroussin yyerrctx->errflag = yyerrflag;
10200c8de5b0SBaptiste Daroussin yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
1021c5b5d71aSJung-uk Kim memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10220c8de5b0SBaptiste Daroussin yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
102311fce282SBaptiste Daroussin memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10240c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10250c8de5b0SBaptiste Daroussin yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base);
102611fce282SBaptiste Daroussin memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10270c8de5b0SBaptiste Daroussin #endif
102811fce282SBaptiste Daroussin yyerrctx->lexeme = (int) (yylvp - yylvals);
10290c8de5b0SBaptiste Daroussin }
10300c8de5b0SBaptiste Daroussin yylvp = yylvals + save->lexeme;
10310c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10320c8de5b0SBaptiste Daroussin yylpp = yylpsns + save->lexeme;
10330c8de5b0SBaptiste Daroussin #endif
10340c8de5b0SBaptiste Daroussin yylexp = yylexemes + save->lexeme;
10350c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
10360c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
1037c5b5d71aSJung-uk Kim memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10380c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
103911fce282SBaptiste Daroussin memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10400c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10410c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base);
104211fce282SBaptiste Daroussin memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10430c8de5b0SBaptiste Daroussin #endif
10440c8de5b0SBaptiste Daroussin ctry = ++save->ctry;
10450c8de5b0SBaptiste Daroussin yystate = save->state;
10460c8de5b0SBaptiste Daroussin /* We tried shift, try reduce now */
10470c8de5b0SBaptiste Daroussin if ((yyn = yyctable[ctry]) >= 0) goto yyreduce;
10480c8de5b0SBaptiste Daroussin yyps->save = save->save;
10490c8de5b0SBaptiste Daroussin save->save = NULL;
10500c8de5b0SBaptiste Daroussin yyFreeState(save);
10510c8de5b0SBaptiste Daroussin
10520c8de5b0SBaptiste Daroussin /* Nothing left on the stack -- error */
10530c8de5b0SBaptiste Daroussin if (!yyps->save)
10540c8de5b0SBaptiste Daroussin {
10550c8de5b0SBaptiste Daroussin #if YYDEBUG
10560c8de5b0SBaptiste Daroussin if (yydebug)
10570c8de5b0SBaptiste Daroussin fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n",
10580c8de5b0SBaptiste Daroussin YYPREFIX, yydepth);
10590c8de5b0SBaptiste Daroussin #endif
10600c8de5b0SBaptiste Daroussin /* Restore state as it was in the most forward-advanced error */
10610c8de5b0SBaptiste Daroussin yylvp = yylvals + yyerrctx->lexeme;
10620c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10630c8de5b0SBaptiste Daroussin yylpp = yylpsns + yyerrctx->lexeme;
10640c8de5b0SBaptiste Daroussin #endif
10650c8de5b0SBaptiste Daroussin yylexp = yylexemes + yyerrctx->lexeme;
10660c8de5b0SBaptiste Daroussin yychar = yylexp[-1];
10670c8de5b0SBaptiste Daroussin yylval = yylvp[-1];
10680c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10690c8de5b0SBaptiste Daroussin yylloc = yylpp[-1];
10700c8de5b0SBaptiste Daroussin #endif
10710c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
1072c5b5d71aSJung-uk Kim memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
10730c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
107411fce282SBaptiste Daroussin memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
10750c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
10760c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base);
107711fce282SBaptiste Daroussin memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
10780c8de5b0SBaptiste Daroussin #endif
10790c8de5b0SBaptiste Daroussin yystate = yyerrctx->state;
10800c8de5b0SBaptiste Daroussin yyFreeState(yyerrctx);
10810c8de5b0SBaptiste Daroussin yyerrctx = NULL;
10820c8de5b0SBaptiste Daroussin }
10830c8de5b0SBaptiste Daroussin yynewerrflag = 1;
10840c8de5b0SBaptiste Daroussin }
10850c8de5b0SBaptiste Daroussin if (yynewerrflag == 0) goto yyinrecovery;
10860c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
10870c8de5b0SBaptiste Daroussin
10880c8de5b0SBaptiste Daroussin YYERROR_CALL("syntax error");
10890c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1090b53bb29fSJung-uk Kim yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
10910c8de5b0SBaptiste Daroussin #endif
10920c8de5b0SBaptiste Daroussin
10930c8de5b0SBaptiste Daroussin #if !YYBTYACC
1094c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */
10950c8de5b0SBaptiste Daroussin yyerrlab:
10960c8de5b0SBaptiste Daroussin #endif
10970c8de5b0SBaptiste Daroussin ++yynerrs;
10980c8de5b0SBaptiste Daroussin
10990c8de5b0SBaptiste Daroussin yyinrecovery:
11000c8de5b0SBaptiste Daroussin if (yyerrflag < 3)
11010c8de5b0SBaptiste Daroussin {
11020c8de5b0SBaptiste Daroussin yyerrflag = 3;
11030c8de5b0SBaptiste Daroussin for (;;)
11040c8de5b0SBaptiste Daroussin {
11050c8de5b0SBaptiste Daroussin if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
11060c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
11070c8de5b0SBaptiste Daroussin {
11080c8de5b0SBaptiste Daroussin #if YYDEBUG
11090c8de5b0SBaptiste Daroussin if (yydebug)
11100c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n",
11110c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]);
11120c8de5b0SBaptiste Daroussin #endif
11130c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
11140c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
11150c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn];
11160c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
11170c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11180c8de5b0SBaptiste Daroussin /* lookahead position is error end position */
1119b53bb29fSJung-uk Kim yyerror_loc_range[2] = yylloc;
11200c8de5b0SBaptiste Daroussin YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
11210c8de5b0SBaptiste Daroussin *++yystack.p_mark = yyloc;
11220c8de5b0SBaptiste Daroussin #endif
11230c8de5b0SBaptiste Daroussin goto yyloop;
11240c8de5b0SBaptiste Daroussin }
11250c8de5b0SBaptiste Daroussin else
11260c8de5b0SBaptiste Daroussin {
11270c8de5b0SBaptiste Daroussin #if YYDEBUG
11280c8de5b0SBaptiste Daroussin if (yydebug)
11290c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: error recovery discarding state %d\n",
11300c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, *yystack.s_mark);
11310c8de5b0SBaptiste Daroussin #endif
11320c8de5b0SBaptiste Daroussin if (yystack.s_mark <= yystack.s_base) goto yyabort;
11330c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11340c8de5b0SBaptiste Daroussin /* the current TOS position is the error start position */
1135b53bb29fSJung-uk Kim yyerror_loc_range[1] = *yystack.p_mark;
11360c8de5b0SBaptiste Daroussin #endif
11370c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
11380c8de5b0SBaptiste Daroussin #if YYBTYACC
11390c8de5b0SBaptiste Daroussin if (!yytrial)
11400c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11410c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11420c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding state",
11430c8de5b0SBaptiste Daroussin yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark);
11440c8de5b0SBaptiste Daroussin #else
11450c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding state",
11460c8de5b0SBaptiste Daroussin yystos[*yystack.s_mark], yystack.l_mark);
11470c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
11480c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
11490c8de5b0SBaptiste Daroussin --yystack.s_mark;
11500c8de5b0SBaptiste Daroussin --yystack.l_mark;
11510c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11520c8de5b0SBaptiste Daroussin --yystack.p_mark;
11530c8de5b0SBaptiste Daroussin #endif
11540c8de5b0SBaptiste Daroussin }
11550c8de5b0SBaptiste Daroussin }
11560c8de5b0SBaptiste Daroussin }
11570c8de5b0SBaptiste Daroussin else
11580c8de5b0SBaptiste Daroussin {
11590c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyabort;
11600c8de5b0SBaptiste Daroussin #if YYDEBUG
11610c8de5b0SBaptiste Daroussin if (yydebug)
11620c8de5b0SBaptiste Daroussin {
1163c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
11640c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
11650c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yychar, yys);
11660c8de5b0SBaptiste Daroussin }
11670c8de5b0SBaptiste Daroussin #endif
11680c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
11690c8de5b0SBaptiste Daroussin #if YYBTYACC
11700c8de5b0SBaptiste Daroussin if (!yytrial)
11710c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11720c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
11730c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc);
11740c8de5b0SBaptiste Daroussin #else
11750c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("error: discarding token", yychar, &yylval);
11760c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
11770c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
11780c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
11790c8de5b0SBaptiste Daroussin goto yyloop;
11800c8de5b0SBaptiste Daroussin }
11810c8de5b0SBaptiste Daroussin
11820c8de5b0SBaptiste Daroussin yyreduce:
11830c8de5b0SBaptiste Daroussin yym = yylen[yyn];
11840c8de5b0SBaptiste Daroussin #if YYDEBUG
11850c8de5b0SBaptiste Daroussin if (yydebug)
11860c8de5b0SBaptiste Daroussin {
11870c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)",
11880c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]);
11890c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
11900c8de5b0SBaptiste Daroussin #if YYBTYACC
11910c8de5b0SBaptiste Daroussin if (!yytrial)
11920c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
11930c8de5b0SBaptiste Daroussin if (yym > 0)
11940c8de5b0SBaptiste Daroussin {
11950c8de5b0SBaptiste Daroussin int i;
11960c8de5b0SBaptiste Daroussin fputc('<', stderr);
11970c8de5b0SBaptiste Daroussin for (i = yym; i > 0; i--)
11980c8de5b0SBaptiste Daroussin {
11990c8de5b0SBaptiste Daroussin if (i != yym) fputs(", ", stderr);
12000c8de5b0SBaptiste Daroussin fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]],
12010c8de5b0SBaptiste Daroussin yystack.l_mark[1-i]), stderr);
12020c8de5b0SBaptiste Daroussin }
12030c8de5b0SBaptiste Daroussin fputc('>', stderr);
12040c8de5b0SBaptiste Daroussin }
12050c8de5b0SBaptiste Daroussin #endif
12060c8de5b0SBaptiste Daroussin fputc('\n', stderr);
12070c8de5b0SBaptiste Daroussin }
12080c8de5b0SBaptiste Daroussin #endif
12090c8de5b0SBaptiste Daroussin if (yym > 0)
12100c8de5b0SBaptiste Daroussin yyval = yystack.l_mark[1-yym];
12110c8de5b0SBaptiste Daroussin else
12120c8de5b0SBaptiste Daroussin memset(&yyval, 0, sizeof yyval);
12130c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
12140c8de5b0SBaptiste Daroussin
12150c8de5b0SBaptiste Daroussin /* Perform position reduction */
12160c8de5b0SBaptiste Daroussin memset(&yyloc, 0, sizeof(yyloc));
12170c8de5b0SBaptiste Daroussin #if YYBTYACC
12180c8de5b0SBaptiste Daroussin if (!yytrial)
12190c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
12200c8de5b0SBaptiste Daroussin {
1221b53bb29fSJung-uk Kim YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
12220c8de5b0SBaptiste Daroussin /* just in case YYERROR is invoked within the action, save
12230c8de5b0SBaptiste Daroussin the start of the rhs as the error start position */
1224b53bb29fSJung-uk Kim yyerror_loc_range[1] = yystack.p_mark[1-yym];
12250c8de5b0SBaptiste Daroussin }
12260c8de5b0SBaptiste Daroussin #endif
12270c8de5b0SBaptiste Daroussin
12280c8de5b0SBaptiste Daroussin switch (yyn)
12290c8de5b0SBaptiste Daroussin {
12300c8de5b0SBaptiste Daroussin case 3:
12310c8de5b0SBaptiste Daroussin #line 66 "ok_syntax1.y"
12320c8de5b0SBaptiste Daroussin { yyerrok ; }
12338e022d3cSDag-Erling Smørgrav #line 1234 "ok_syntax1.tab.c"
12340c8de5b0SBaptiste Daroussin break;
12350c8de5b0SBaptiste Daroussin case 4:
12360c8de5b0SBaptiste Daroussin #line 70 "ok_syntax1.y"
12370c8de5b0SBaptiste Daroussin { printf("%d\n",yystack.l_mark[0].ival);}
12388e022d3cSDag-Erling Smørgrav #line 1239 "ok_syntax1.tab.c"
12390c8de5b0SBaptiste Daroussin break;
12400c8de5b0SBaptiste Daroussin case 5:
12410c8de5b0SBaptiste Daroussin #line 72 "ok_syntax1.y"
12420c8de5b0SBaptiste Daroussin { regs[yystack.l_mark[-2].ival] = yystack.l_mark[0].ival; }
12438e022d3cSDag-Erling Smørgrav #line 1244 "ok_syntax1.tab.c"
12440c8de5b0SBaptiste Daroussin break;
12450c8de5b0SBaptiste Daroussin case 6:
12460c8de5b0SBaptiste Daroussin #line 76 "ok_syntax1.y"
12470c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-1].ival; }
12488e022d3cSDag-Erling Smørgrav #line 1249 "ok_syntax1.tab.c"
12490c8de5b0SBaptiste Daroussin break;
12500c8de5b0SBaptiste Daroussin case 7:
12510c8de5b0SBaptiste Daroussin #line 78 "ok_syntax1.y"
12520c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival + yystack.l_mark[0].ival; }
12538e022d3cSDag-Erling Smørgrav #line 1254 "ok_syntax1.tab.c"
12540c8de5b0SBaptiste Daroussin break;
12550c8de5b0SBaptiste Daroussin case 8:
12560c8de5b0SBaptiste Daroussin #line 80 "ok_syntax1.y"
12570c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival - yystack.l_mark[0].ival; }
12588e022d3cSDag-Erling Smørgrav #line 1259 "ok_syntax1.tab.c"
12590c8de5b0SBaptiste Daroussin break;
12600c8de5b0SBaptiste Daroussin case 9:
12610c8de5b0SBaptiste Daroussin #line 82 "ok_syntax1.y"
12620c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival * yystack.l_mark[0].ival; }
12638e022d3cSDag-Erling Smørgrav #line 1264 "ok_syntax1.tab.c"
12640c8de5b0SBaptiste Daroussin break;
12650c8de5b0SBaptiste Daroussin case 10:
12660c8de5b0SBaptiste Daroussin #line 84 "ok_syntax1.y"
12670c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival / yystack.l_mark[0].ival; }
12688e022d3cSDag-Erling Smørgrav #line 1269 "ok_syntax1.tab.c"
12690c8de5b0SBaptiste Daroussin break;
12700c8de5b0SBaptiste Daroussin case 11:
12710c8de5b0SBaptiste Daroussin #line 86 "ok_syntax1.y"
12720c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival % yystack.l_mark[0].ival; }
12738e022d3cSDag-Erling Smørgrav #line 1274 "ok_syntax1.tab.c"
12740c8de5b0SBaptiste Daroussin break;
12750c8de5b0SBaptiste Daroussin case 12:
12760c8de5b0SBaptiste Daroussin #line 88 "ok_syntax1.y"
12770c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival & yystack.l_mark[0].ival; }
12788e022d3cSDag-Erling Smørgrav #line 1279 "ok_syntax1.tab.c"
12790c8de5b0SBaptiste Daroussin break;
12800c8de5b0SBaptiste Daroussin case 13:
12810c8de5b0SBaptiste Daroussin #line 90 "ok_syntax1.y"
12820c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival | yystack.l_mark[0].ival; }
12838e022d3cSDag-Erling Smørgrav #line 1284 "ok_syntax1.tab.c"
12840c8de5b0SBaptiste Daroussin break;
12850c8de5b0SBaptiste Daroussin case 14:
12860c8de5b0SBaptiste Daroussin #line 92 "ok_syntax1.y"
12870c8de5b0SBaptiste Daroussin { yyval.ival = - yystack.l_mark[0].ival; }
12888e022d3cSDag-Erling Smørgrav #line 1289 "ok_syntax1.tab.c"
12890c8de5b0SBaptiste Daroussin break;
12900c8de5b0SBaptiste Daroussin case 15:
12910c8de5b0SBaptiste Daroussin #line 94 "ok_syntax1.y"
12920c8de5b0SBaptiste Daroussin { yyval.ival = regs[yystack.l_mark[0].ival]; }
12938e022d3cSDag-Erling Smørgrav #line 1294 "ok_syntax1.tab.c"
12940c8de5b0SBaptiste Daroussin break;
12950c8de5b0SBaptiste Daroussin case 17:
12960c8de5b0SBaptiste Daroussin #line 99 "ok_syntax1.y"
12970c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[0].ival; (*base) = (yystack.l_mark[0].ival==0) ? 8 : 10; }
12988e022d3cSDag-Erling Smørgrav #line 1299 "ok_syntax1.tab.c"
12990c8de5b0SBaptiste Daroussin break;
13000c8de5b0SBaptiste Daroussin case 18:
13010c8de5b0SBaptiste Daroussin #line 101 "ok_syntax1.y"
13020c8de5b0SBaptiste Daroussin { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; }
13038e022d3cSDag-Erling Smørgrav #line 1304 "ok_syntax1.tab.c"
13040c8de5b0SBaptiste Daroussin break;
13058e022d3cSDag-Erling Smørgrav #line 1306 "ok_syntax1.tab.c"
13060c8de5b0SBaptiste Daroussin default:
13070c8de5b0SBaptiste Daroussin break;
13080c8de5b0SBaptiste Daroussin }
13090c8de5b0SBaptiste Daroussin yystack.s_mark -= yym;
13100c8de5b0SBaptiste Daroussin yystate = *yystack.s_mark;
13110c8de5b0SBaptiste Daroussin yystack.l_mark -= yym;
13120c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13130c8de5b0SBaptiste Daroussin yystack.p_mark -= yym;
13140c8de5b0SBaptiste Daroussin #endif
13150c8de5b0SBaptiste Daroussin yym = yylhs[yyn];
13160c8de5b0SBaptiste Daroussin if (yystate == 0 && yym == 0)
13170c8de5b0SBaptiste Daroussin {
13180c8de5b0SBaptiste Daroussin #if YYDEBUG
13190c8de5b0SBaptiste Daroussin if (yydebug)
13200c8de5b0SBaptiste Daroussin {
13210c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
13220c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
13230c8de5b0SBaptiste Daroussin #if YYBTYACC
13240c8de5b0SBaptiste Daroussin if (!yytrial)
13250c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13260c8de5b0SBaptiste Daroussin fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval));
13270c8de5b0SBaptiste Daroussin #endif
13280c8de5b0SBaptiste Daroussin fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL);
13290c8de5b0SBaptiste Daroussin }
13300c8de5b0SBaptiste Daroussin #endif
13310c8de5b0SBaptiste Daroussin yystate = YYFINAL;
13320c8de5b0SBaptiste Daroussin *++yystack.s_mark = YYFINAL;
13330c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval;
13340c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13350c8de5b0SBaptiste Daroussin *++yystack.p_mark = yyloc;
13360c8de5b0SBaptiste Daroussin #endif
13370c8de5b0SBaptiste Daroussin if (yychar < 0)
13380c8de5b0SBaptiste Daroussin {
13390c8de5b0SBaptiste Daroussin #if YYBTYACC
13400c8de5b0SBaptiste Daroussin do {
13410c8de5b0SBaptiste Daroussin if (yylvp < yylve)
13420c8de5b0SBaptiste Daroussin {
13430c8de5b0SBaptiste Daroussin /* we're currently re-reading tokens */
13440c8de5b0SBaptiste Daroussin yylval = *yylvp++;
13450c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13460c8de5b0SBaptiste Daroussin yylloc = *yylpp++;
13470c8de5b0SBaptiste Daroussin #endif
13480c8de5b0SBaptiste Daroussin yychar = *yylexp++;
13490c8de5b0SBaptiste Daroussin break;
13500c8de5b0SBaptiste Daroussin }
13510c8de5b0SBaptiste Daroussin if (yyps->save)
13520c8de5b0SBaptiste Daroussin {
13530c8de5b0SBaptiste Daroussin /* in trial mode; save scanner results for future parse attempts */
13540c8de5b0SBaptiste Daroussin if (yylvp == yylvlim)
13550c8de5b0SBaptiste Daroussin { /* Enlarge lexical value queue */
135611fce282SBaptiste Daroussin size_t p = (size_t) (yylvp - yylvals);
135711fce282SBaptiste Daroussin size_t s = (size_t) (yylvlim - yylvals);
13580c8de5b0SBaptiste Daroussin
13590c8de5b0SBaptiste Daroussin s += YYLVQUEUEGROWTH;
1360b53bb29fSJung-uk Kim if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)
13610c8de5b0SBaptiste Daroussin goto yyenomem;
1362b53bb29fSJung-uk Kim if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)
13630c8de5b0SBaptiste Daroussin goto yyenomem;
13640c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
1365b53bb29fSJung-uk Kim if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)
13660c8de5b0SBaptiste Daroussin goto yyenomem;
13670c8de5b0SBaptiste Daroussin #endif
13680c8de5b0SBaptiste Daroussin yylvp = yylve = yylvals + p;
13690c8de5b0SBaptiste Daroussin yylvlim = yylvals + s;
13700c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13710c8de5b0SBaptiste Daroussin yylpp = yylpe = yylpsns + p;
13720c8de5b0SBaptiste Daroussin yylplim = yylpsns + s;
13730c8de5b0SBaptiste Daroussin #endif
13740c8de5b0SBaptiste Daroussin yylexp = yylexemes + p;
13750c8de5b0SBaptiste Daroussin }
13762aca18c7SJung-uk Kim *yylexp = (YYINT) YYLEX;
13770c8de5b0SBaptiste Daroussin *yylvp++ = yylval;
13780c8de5b0SBaptiste Daroussin yylve++;
13790c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
13800c8de5b0SBaptiste Daroussin *yylpp++ = yylloc;
13810c8de5b0SBaptiste Daroussin yylpe++;
13820c8de5b0SBaptiste Daroussin #endif
13830c8de5b0SBaptiste Daroussin yychar = *yylexp++;
13840c8de5b0SBaptiste Daroussin break;
13850c8de5b0SBaptiste Daroussin }
13860c8de5b0SBaptiste Daroussin /* normal operation, no conflict encountered */
13870c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13880c8de5b0SBaptiste Daroussin yychar = YYLEX;
13890c8de5b0SBaptiste Daroussin #if YYBTYACC
13900c8de5b0SBaptiste Daroussin } while (0);
13910c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
13920c8de5b0SBaptiste Daroussin if (yychar < 0) yychar = YYEOF;
13930c8de5b0SBaptiste Daroussin #if YYDEBUG
13940c8de5b0SBaptiste Daroussin if (yydebug)
13950c8de5b0SBaptiste Daroussin {
1396c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
1397c5b5d71aSJung-uk Kim fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
13980c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
13990c8de5b0SBaptiste Daroussin }
14000c8de5b0SBaptiste Daroussin #endif
14010c8de5b0SBaptiste Daroussin }
14020c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyaccept;
14030c8de5b0SBaptiste Daroussin goto yyloop;
14040c8de5b0SBaptiste Daroussin }
14050c8de5b0SBaptiste Daroussin if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
14060c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
14070c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
14080c8de5b0SBaptiste Daroussin else
14090c8de5b0SBaptiste Daroussin yystate = yydgoto[yym];
14100c8de5b0SBaptiste Daroussin #if YYDEBUG
14110c8de5b0SBaptiste Daroussin if (yydebug)
14120c8de5b0SBaptiste Daroussin {
14130c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth);
14140c8de5b0SBaptiste Daroussin #ifdef YYSTYPE_TOSTRING
14150c8de5b0SBaptiste Daroussin #if YYBTYACC
14160c8de5b0SBaptiste Daroussin if (!yytrial)
14170c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14180c8de5b0SBaptiste Daroussin fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval));
14190c8de5b0SBaptiste Daroussin #endif
14200c8de5b0SBaptiste Daroussin fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate);
14210c8de5b0SBaptiste Daroussin }
14220c8de5b0SBaptiste Daroussin #endif
14230c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
1424c5b5d71aSJung-uk Kim *++yystack.s_mark = (YYINT) yystate;
14250c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval;
14260c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14270c8de5b0SBaptiste Daroussin *++yystack.p_mark = yyloc;
14280c8de5b0SBaptiste Daroussin #endif
14290c8de5b0SBaptiste Daroussin goto yyloop;
14300c8de5b0SBaptiste Daroussin #if YYBTYACC
14310c8de5b0SBaptiste Daroussin
14320c8de5b0SBaptiste Daroussin /* Reduction declares that this path is valid. Set yypath and do a full parse */
14330c8de5b0SBaptiste Daroussin yyvalid:
14340c8de5b0SBaptiste Daroussin if (yypath) YYABORT;
14350c8de5b0SBaptiste Daroussin while (yyps->save)
14360c8de5b0SBaptiste Daroussin {
14370c8de5b0SBaptiste Daroussin YYParseState *save = yyps->save;
14380c8de5b0SBaptiste Daroussin yyps->save = save->save;
14390c8de5b0SBaptiste Daroussin save->save = yypath;
14400c8de5b0SBaptiste Daroussin yypath = save;
14410c8de5b0SBaptiste Daroussin }
14420c8de5b0SBaptiste Daroussin #if YYDEBUG
14430c8de5b0SBaptiste Daroussin if (yydebug)
14440c8de5b0SBaptiste Daroussin fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n",
14450c8de5b0SBaptiste Daroussin YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme));
14460c8de5b0SBaptiste Daroussin #endif
14470c8de5b0SBaptiste Daroussin if (yyerrctx)
14480c8de5b0SBaptiste Daroussin {
14490c8de5b0SBaptiste Daroussin yyFreeState(yyerrctx);
14500c8de5b0SBaptiste Daroussin yyerrctx = NULL;
14510c8de5b0SBaptiste Daroussin }
14520c8de5b0SBaptiste Daroussin yylvp = yylvals + yypath->lexeme;
14530c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14540c8de5b0SBaptiste Daroussin yylpp = yylpsns + yypath->lexeme;
14550c8de5b0SBaptiste Daroussin #endif
14560c8de5b0SBaptiste Daroussin yylexp = yylexemes + yypath->lexeme;
14570c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
14580c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
1459c5b5d71aSJung-uk Kim memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
14600c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
146111fce282SBaptiste Daroussin memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
14620c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14630c8de5b0SBaptiste Daroussin yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base);
146411fce282SBaptiste Daroussin memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE));
14650c8de5b0SBaptiste Daroussin #endif
14660c8de5b0SBaptiste Daroussin yystate = yypath->state;
14670c8de5b0SBaptiste Daroussin goto yyloop;
14680c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14690c8de5b0SBaptiste Daroussin
14700c8de5b0SBaptiste Daroussin yyoverflow:
14710c8de5b0SBaptiste Daroussin YYERROR_CALL("yacc stack overflow");
14720c8de5b0SBaptiste Daroussin #if YYBTYACC
14730c8de5b0SBaptiste Daroussin goto yyabort_nomem;
14740c8de5b0SBaptiste Daroussin yyenomem:
14750c8de5b0SBaptiste Daroussin YYERROR_CALL("memory exhausted");
14760c8de5b0SBaptiste Daroussin yyabort_nomem:
14770c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14780c8de5b0SBaptiste Daroussin yyresult = 2;
14790c8de5b0SBaptiste Daroussin goto yyreturn;
14800c8de5b0SBaptiste Daroussin
14810c8de5b0SBaptiste Daroussin yyabort:
14820c8de5b0SBaptiste Daroussin yyresult = 1;
14830c8de5b0SBaptiste Daroussin goto yyreturn;
14840c8de5b0SBaptiste Daroussin
14850c8de5b0SBaptiste Daroussin yyaccept:
14860c8de5b0SBaptiste Daroussin #if YYBTYACC
14870c8de5b0SBaptiste Daroussin if (yyps->save) goto yyvalid;
14880c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
14890c8de5b0SBaptiste Daroussin yyresult = 0;
14900c8de5b0SBaptiste Daroussin
14910c8de5b0SBaptiste Daroussin yyreturn:
14920c8de5b0SBaptiste Daroussin #if defined(YYDESTRUCT_CALL)
14930c8de5b0SBaptiste Daroussin if (yychar != YYEOF && yychar != YYEMPTY)
14940c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
14950c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc);
14960c8de5b0SBaptiste Daroussin #else
14970c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval);
14980c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
14990c8de5b0SBaptiste Daroussin
15000c8de5b0SBaptiste Daroussin {
15010c8de5b0SBaptiste Daroussin YYSTYPE *pv;
15020c8de5b0SBaptiste Daroussin #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
15030c8de5b0SBaptiste Daroussin YYLTYPE *pp;
15040c8de5b0SBaptiste Daroussin
15050c8de5b0SBaptiste Daroussin for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp)
15060c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding state",
15070c8de5b0SBaptiste Daroussin yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp);
15080c8de5b0SBaptiste Daroussin #else
15090c8de5b0SBaptiste Daroussin for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv)
15100c8de5b0SBaptiste Daroussin YYDESTRUCT_CALL("cleanup: discarding state",
15110c8de5b0SBaptiste Daroussin yystos[*(yystack.s_base + (pv - yystack.l_base))], pv);
15120c8de5b0SBaptiste Daroussin #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */
15130c8de5b0SBaptiste Daroussin }
15140c8de5b0SBaptiste Daroussin #endif /* defined(YYDESTRUCT_CALL) */
15150c8de5b0SBaptiste Daroussin
15160c8de5b0SBaptiste Daroussin #if YYBTYACC
15170c8de5b0SBaptiste Daroussin if (yyerrctx)
15180c8de5b0SBaptiste Daroussin {
15190c8de5b0SBaptiste Daroussin yyFreeState(yyerrctx);
15200c8de5b0SBaptiste Daroussin yyerrctx = NULL;
15210c8de5b0SBaptiste Daroussin }
15220c8de5b0SBaptiste Daroussin while (yyps)
15230c8de5b0SBaptiste Daroussin {
15240c8de5b0SBaptiste Daroussin YYParseState *save = yyps;
15250c8de5b0SBaptiste Daroussin yyps = save->save;
15260c8de5b0SBaptiste Daroussin save->save = NULL;
15270c8de5b0SBaptiste Daroussin yyFreeState(save);
15280c8de5b0SBaptiste Daroussin }
15290c8de5b0SBaptiste Daroussin while (yypath)
15300c8de5b0SBaptiste Daroussin {
15310c8de5b0SBaptiste Daroussin YYParseState *save = yypath;
15320c8de5b0SBaptiste Daroussin yypath = save->save;
15330c8de5b0SBaptiste Daroussin save->save = NULL;
15340c8de5b0SBaptiste Daroussin yyFreeState(save);
15350c8de5b0SBaptiste Daroussin }
15360c8de5b0SBaptiste Daroussin #endif /* YYBTYACC */
15370c8de5b0SBaptiste Daroussin yyfreestack(&yystack);
15380c8de5b0SBaptiste Daroussin return (yyresult);
15390c8de5b0SBaptiste Daroussin }
1540