10c8de5b0SBaptiste Daroussin /* original parser id follows */
20c8de5b0SBaptiste Daroussin /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
30c8de5b0SBaptiste Daroussin /* (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
170c8de5b0SBaptiste Daroussin #ifndef yyparse
180c8de5b0SBaptiste Daroussin #define yyparse quote_calc3_parse
190c8de5b0SBaptiste Daroussin #endif /* yyparse */
200c8de5b0SBaptiste Daroussin
210c8de5b0SBaptiste Daroussin #ifndef yylex
220c8de5b0SBaptiste Daroussin #define yylex quote_calc3_lex
230c8de5b0SBaptiste Daroussin #endif /* yylex */
240c8de5b0SBaptiste Daroussin
250c8de5b0SBaptiste Daroussin #ifndef yyerror
260c8de5b0SBaptiste Daroussin #define yyerror quote_calc3_error
270c8de5b0SBaptiste Daroussin #endif /* yyerror */
280c8de5b0SBaptiste Daroussin
290c8de5b0SBaptiste Daroussin #ifndef yychar
300c8de5b0SBaptiste Daroussin #define yychar quote_calc3_char
310c8de5b0SBaptiste Daroussin #endif /* yychar */
320c8de5b0SBaptiste Daroussin
330c8de5b0SBaptiste Daroussin #ifndef yyval
340c8de5b0SBaptiste Daroussin #define yyval quote_calc3_val
350c8de5b0SBaptiste Daroussin #endif /* yyval */
360c8de5b0SBaptiste Daroussin
370c8de5b0SBaptiste Daroussin #ifndef yylval
380c8de5b0SBaptiste Daroussin #define yylval quote_calc3_lval
390c8de5b0SBaptiste Daroussin #endif /* yylval */
400c8de5b0SBaptiste Daroussin
410c8de5b0SBaptiste Daroussin #ifndef yydebug
420c8de5b0SBaptiste Daroussin #define yydebug quote_calc3_debug
430c8de5b0SBaptiste Daroussin #endif /* yydebug */
440c8de5b0SBaptiste Daroussin
450c8de5b0SBaptiste Daroussin #ifndef yynerrs
460c8de5b0SBaptiste Daroussin #define yynerrs quote_calc3_nerrs
470c8de5b0SBaptiste Daroussin #endif /* yynerrs */
480c8de5b0SBaptiste Daroussin
490c8de5b0SBaptiste Daroussin #ifndef yyerrflag
500c8de5b0SBaptiste Daroussin #define yyerrflag quote_calc3_errflag
510c8de5b0SBaptiste Daroussin #endif /* yyerrflag */
520c8de5b0SBaptiste Daroussin
530c8de5b0SBaptiste Daroussin #ifndef yylhs
540c8de5b0SBaptiste Daroussin #define yylhs quote_calc3_lhs
550c8de5b0SBaptiste Daroussin #endif /* yylhs */
560c8de5b0SBaptiste Daroussin
570c8de5b0SBaptiste Daroussin #ifndef yylen
580c8de5b0SBaptiste Daroussin #define yylen quote_calc3_len
590c8de5b0SBaptiste Daroussin #endif /* yylen */
600c8de5b0SBaptiste Daroussin
610c8de5b0SBaptiste Daroussin #ifndef yydefred
620c8de5b0SBaptiste Daroussin #define yydefred quote_calc3_defred
630c8de5b0SBaptiste Daroussin #endif /* yydefred */
640c8de5b0SBaptiste Daroussin
650c8de5b0SBaptiste Daroussin #ifndef yydgoto
660c8de5b0SBaptiste Daroussin #define yydgoto quote_calc3_dgoto
670c8de5b0SBaptiste Daroussin #endif /* yydgoto */
680c8de5b0SBaptiste Daroussin
690c8de5b0SBaptiste Daroussin #ifndef yysindex
700c8de5b0SBaptiste Daroussin #define yysindex quote_calc3_sindex
710c8de5b0SBaptiste Daroussin #endif /* yysindex */
720c8de5b0SBaptiste Daroussin
730c8de5b0SBaptiste Daroussin #ifndef yyrindex
740c8de5b0SBaptiste Daroussin #define yyrindex quote_calc3_rindex
750c8de5b0SBaptiste Daroussin #endif /* yyrindex */
760c8de5b0SBaptiste Daroussin
770c8de5b0SBaptiste Daroussin #ifndef yygindex
780c8de5b0SBaptiste Daroussin #define yygindex quote_calc3_gindex
790c8de5b0SBaptiste Daroussin #endif /* yygindex */
800c8de5b0SBaptiste Daroussin
810c8de5b0SBaptiste Daroussin #ifndef yytable
820c8de5b0SBaptiste Daroussin #define yytable quote_calc3_table
830c8de5b0SBaptiste Daroussin #endif /* yytable */
840c8de5b0SBaptiste Daroussin
850c8de5b0SBaptiste Daroussin #ifndef yycheck
860c8de5b0SBaptiste Daroussin #define yycheck quote_calc3_check
870c8de5b0SBaptiste Daroussin #endif /* yycheck */
880c8de5b0SBaptiste Daroussin
890c8de5b0SBaptiste Daroussin #ifndef yyname
900c8de5b0SBaptiste Daroussin #define yyname quote_calc3_name
910c8de5b0SBaptiste Daroussin #endif /* yyname */
920c8de5b0SBaptiste Daroussin
930c8de5b0SBaptiste Daroussin #ifndef yyrule
940c8de5b0SBaptiste Daroussin #define yyrule quote_calc3_rule
950c8de5b0SBaptiste Daroussin #endif /* yyrule */
960c8de5b0SBaptiste Daroussin #define YYPREFIX "quote_calc3_"
970c8de5b0SBaptiste Daroussin
980c8de5b0SBaptiste Daroussin #define YYPURE 0
990c8de5b0SBaptiste Daroussin
1000c8de5b0SBaptiste Daroussin #line 2 "quote_calc3.y"
1010c8de5b0SBaptiste Daroussin # include <stdio.h>
1020c8de5b0SBaptiste Daroussin # include <ctype.h>
1030c8de5b0SBaptiste Daroussin
1040c8de5b0SBaptiste Daroussin int regs[26];
1050c8de5b0SBaptiste Daroussin int base;
1060c8de5b0SBaptiste Daroussin
1070c8de5b0SBaptiste Daroussin int yylex(void);
1080c8de5b0SBaptiste Daroussin static void yyerror(const char *s);
1090c8de5b0SBaptiste Daroussin
1100c8de5b0SBaptiste Daroussin #line 111 "quote_calc3.tab.c"
1110c8de5b0SBaptiste Daroussin
1120c8de5b0SBaptiste Daroussin #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
1130c8de5b0SBaptiste Daroussin /* Default: YYSTYPE is the semantic value type. */
1140c8de5b0SBaptiste Daroussin typedef int YYSTYPE;
1150c8de5b0SBaptiste Daroussin # define YYSTYPE_IS_DECLARED 1
1160c8de5b0SBaptiste Daroussin #endif
1170c8de5b0SBaptiste Daroussin
1180c8de5b0SBaptiste Daroussin /* compatibility with bison */
1190c8de5b0SBaptiste Daroussin #ifdef YYPARSE_PARAM
1200c8de5b0SBaptiste Daroussin /* compatibility with FreeBSD */
1210c8de5b0SBaptiste Daroussin # ifdef YYPARSE_PARAM_TYPE
1220c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
1230c8de5b0SBaptiste Daroussin # else
1240c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
1250c8de5b0SBaptiste Daroussin # endif
1260c8de5b0SBaptiste Daroussin #else
1270c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(void)
1280c8de5b0SBaptiste Daroussin #endif
1290c8de5b0SBaptiste Daroussin
1300c8de5b0SBaptiste Daroussin /* Parameters sent to lex. */
1310c8de5b0SBaptiste Daroussin #ifdef YYLEX_PARAM
1320c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
1330c8de5b0SBaptiste Daroussin # define YYLEX yylex(YYLEX_PARAM)
1340c8de5b0SBaptiste Daroussin #else
1350c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(void)
1360c8de5b0SBaptiste Daroussin # define YYLEX yylex()
1370c8de5b0SBaptiste Daroussin #endif
1380c8de5b0SBaptiste Daroussin
1390c8de5b0SBaptiste Daroussin /* Parameters sent to yyerror. */
1400c8de5b0SBaptiste Daroussin #ifndef YYERROR_DECL
1410c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(const char *s)
1420c8de5b0SBaptiste Daroussin #endif
1430c8de5b0SBaptiste Daroussin #ifndef YYERROR_CALL
1440c8de5b0SBaptiste Daroussin #define YYERROR_CALL(msg) yyerror(msg)
1450c8de5b0SBaptiste Daroussin #endif
1460c8de5b0SBaptiste Daroussin
1470c8de5b0SBaptiste Daroussin extern int YYPARSE_DECL();
1480c8de5b0SBaptiste Daroussin
1490c8de5b0SBaptiste Daroussin #define OP_ADD 257
1500c8de5b0SBaptiste Daroussin #define OP_SUB 259
1510c8de5b0SBaptiste Daroussin #define OP_MUL 261
1520c8de5b0SBaptiste Daroussin #define OP_DIV 263
1530c8de5b0SBaptiste Daroussin #define OP_MOD 265
1540c8de5b0SBaptiste Daroussin #define OP_AND 267
1550c8de5b0SBaptiste Daroussin #define DIGIT 269
1560c8de5b0SBaptiste Daroussin #define LETTER 270
1570c8de5b0SBaptiste Daroussin #define UMINUS 271
1580c8de5b0SBaptiste Daroussin #define YYERRCODE 256
159ea2af5c8SJung-uk Kim typedef int YYINT;
1600c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_lhs[] = { -1,
1610c8de5b0SBaptiste Daroussin 0, 0, 0, 1, 1, 2, 2, 2, 2, 2,
1620c8de5b0SBaptiste Daroussin 2, 2, 2, 2, 2, 2, 3, 3,
1630c8de5b0SBaptiste Daroussin };
1640c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_len[] = { 2,
1650c8de5b0SBaptiste Daroussin 0, 3, 3, 1, 3, 3, 3, 3, 3, 3,
1660c8de5b0SBaptiste Daroussin 3, 3, 3, 2, 1, 1, 1, 2,
1670c8de5b0SBaptiste Daroussin };
1680c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_defred[] = { 1,
1690c8de5b0SBaptiste Daroussin 0, 0, 0, 17, 0, 0, 0, 0, 0, 3,
1700c8de5b0SBaptiste Daroussin 15, 0, 0, 0, 2, 0, 0, 0, 0, 0,
1710c8de5b0SBaptiste Daroussin 0, 0, 18, 0, 6, 0, 0, 0, 0, 0,
1720c8de5b0SBaptiste Daroussin 0, 0,
1730c8de5b0SBaptiste Daroussin };
1740c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_dgoto[] = { 1,
1750c8de5b0SBaptiste Daroussin 7, 8, 9,
1760c8de5b0SBaptiste Daroussin };
1770c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_sindex[] = { 0,
1780c8de5b0SBaptiste Daroussin -38, 5, -36, 0, -51, -36, 7, -121, -248, 0,
1790c8de5b0SBaptiste Daroussin 0, -243, -36, -22, 0, -36, -36, -36, -36, -36,
1800c8de5b0SBaptiste Daroussin -36, -36, 0, -121, 0, -121, -121, -121, -121, -121,
1810c8de5b0SBaptiste Daroussin -121, -243,
1820c8de5b0SBaptiste Daroussin };
1830c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_rindex[] = { 0,
1840c8de5b0SBaptiste Daroussin 0, 0, 0, 0, -9, 0, 0, 13, -10, 0,
1850c8de5b0SBaptiste Daroussin 0, -5, 0, 0, 0, 0, 0, 0, 0, 0,
1860c8de5b0SBaptiste Daroussin 0, 0, 0, 15, 0, -3, -2, -1, 1, 2,
1870c8de5b0SBaptiste Daroussin 3, -4,
1880c8de5b0SBaptiste Daroussin };
1890c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_gindex[] = { 0,
1900c8de5b0SBaptiste Daroussin 0, 42, 0,
1910c8de5b0SBaptiste Daroussin };
1920c8de5b0SBaptiste Daroussin #define YYTABLESIZE 258
1930c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_table[] = { 16,
1940c8de5b0SBaptiste Daroussin 15, 6, 22, 6, 14, 13, 7, 8, 9, 13,
1950c8de5b0SBaptiste Daroussin 10, 11, 12, 16, 10, 17, 15, 18, 25, 19,
1960c8de5b0SBaptiste Daroussin 23, 20, 4, 21, 5, 0, 0, 0, 0, 0,
1970c8de5b0SBaptiste Daroussin 16, 0, 0, 0, 0, 14, 13, 7, 8, 9,
1980c8de5b0SBaptiste Daroussin 0, 10, 11, 12, 12, 0, 0, 14, 0, 0,
1990c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 24, 0, 0, 26, 27, 28,
2000c8de5b0SBaptiste Daroussin 29, 30, 31, 32, 0, 0, 0, 0, 0, 0,
2010c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2020c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2030c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2040c8de5b0SBaptiste Daroussin 0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
2050c8de5b0SBaptiste Daroussin 0, 0, 0, 16, 15, 0, 0, 0, 14, 13,
2060c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2070c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 16, 0, 17, 0, 18,
2080c8de5b0SBaptiste Daroussin 0, 19, 0, 20, 0, 21, 0, 0, 0, 0,
2090c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2100c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2110c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2120c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2130c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2140c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2150c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
2160c8de5b0SBaptiste Daroussin 3, 0, 3, 0, 0, 0, 0, 0, 0, 0,
2170c8de5b0SBaptiste Daroussin 4, 5, 4, 11, 16, 0, 17, 0, 18, 0,
2180c8de5b0SBaptiste Daroussin 19, 0, 20, 0, 21, 0, 16, 15, 16, 15,
2190c8de5b0SBaptiste Daroussin 16, 15, 16, 15, 16, 15, 16, 15,
2200c8de5b0SBaptiste Daroussin };
2210c8de5b0SBaptiste Daroussin static const YYINT quote_calc3_check[] = { 10,
2220c8de5b0SBaptiste Daroussin 10, 40, 124, 40, 10, 10, 10, 10, 10, 61,
2230c8de5b0SBaptiste Daroussin 10, 10, 10, 257, 10, 259, 10, 261, 41, 263,
2240c8de5b0SBaptiste Daroussin 269, 265, 10, 267, 10, -1, -1, -1, -1, -1,
2250c8de5b0SBaptiste Daroussin 41, -1, -1, -1, -1, 41, 41, 41, 41, 41,
2260c8de5b0SBaptiste Daroussin -1, 41, 41, 41, 3, -1, -1, 6, -1, -1,
2270c8de5b0SBaptiste Daroussin -1, -1, -1, -1, 13, -1, -1, 16, 17, 18,
2280c8de5b0SBaptiste Daroussin 19, 20, 21, 22, -1, -1, -1, -1, -1, -1,
2290c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2300c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2310c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2320c8de5b0SBaptiste Daroussin -1, 124, -1, -1, -1, -1, -1, -1, -1, -1,
2330c8de5b0SBaptiste Daroussin -1, -1, -1, 124, 124, -1, -1, -1, 124, 124,
2340c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2350c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 257, -1, 259, -1, 261,
2360c8de5b0SBaptiste Daroussin -1, 263, -1, 265, -1, 267, -1, -1, -1, -1,
2370c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2380c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2390c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2400c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2410c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2420c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2430c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, 256, -1, -1,
2440c8de5b0SBaptiste Daroussin 259, -1, 259, -1, -1, -1, -1, -1, -1, -1,
2450c8de5b0SBaptiste Daroussin 269, 270, 269, 270, 257, -1, 259, -1, 261, -1,
2460c8de5b0SBaptiste Daroussin 263, -1, 265, -1, 267, -1, 257, 257, 259, 259,
2470c8de5b0SBaptiste Daroussin 261, 261, 263, 263, 265, 265, 267, 267,
2480c8de5b0SBaptiste Daroussin };
2490c8de5b0SBaptiste Daroussin #define YYFINAL 1
2500c8de5b0SBaptiste Daroussin #ifndef YYDEBUG
2510c8de5b0SBaptiste Daroussin #define YYDEBUG 0
2520c8de5b0SBaptiste Daroussin #endif
2530c8de5b0SBaptiste Daroussin #define YYMAXTOKEN 271
2540c8de5b0SBaptiste Daroussin #define YYUNDFTOKEN 277
2550c8de5b0SBaptiste Daroussin #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
2560c8de5b0SBaptiste Daroussin #if YYDEBUG
2570c8de5b0SBaptiste Daroussin static const char *const quote_calc3_name[] = {
2580c8de5b0SBaptiste Daroussin
2590c8de5b0SBaptiste Daroussin "end-of-file",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,
2600c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,
2610c8de5b0SBaptiste 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,
2620c8de5b0SBaptiste 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,
2630c8de5b0SBaptiste 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,
2640c8de5b0SBaptiste 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,
2650c8de5b0SBaptiste 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,
2660c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL",
2670c8de5b0SBaptiste Daroussin "\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"",
2680c8de5b0SBaptiste Daroussin "OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS",0,0,0,0,0,
2690c8de5b0SBaptiste Daroussin "illegal-symbol",
2700c8de5b0SBaptiste Daroussin };
2710c8de5b0SBaptiste Daroussin static const char *const quote_calc3_rule[] = {
2720c8de5b0SBaptiste Daroussin "$accept : list",
2730c8de5b0SBaptiste Daroussin "list :",
2740c8de5b0SBaptiste Daroussin "list : list stat '\\n'",
2750c8de5b0SBaptiste Daroussin "list : list error '\\n'",
2760c8de5b0SBaptiste Daroussin "stat : expr",
2770c8de5b0SBaptiste Daroussin "stat : LETTER '=' expr",
2780c8de5b0SBaptiste Daroussin "expr : '(' expr ')'",
2790c8de5b0SBaptiste Daroussin "expr : expr OP_ADD expr",
2800c8de5b0SBaptiste Daroussin "expr : expr OP_SUB expr",
2810c8de5b0SBaptiste Daroussin "expr : expr OP_MUL expr",
2820c8de5b0SBaptiste Daroussin "expr : expr OP_DIV expr",
2830c8de5b0SBaptiste Daroussin "expr : expr OP_MOD expr",
2840c8de5b0SBaptiste Daroussin "expr : expr OP_AND expr",
2850c8de5b0SBaptiste Daroussin "expr : expr '|' expr",
2860c8de5b0SBaptiste Daroussin "expr : OP_SUB expr",
2870c8de5b0SBaptiste Daroussin "expr : LETTER",
2880c8de5b0SBaptiste Daroussin "expr : number",
2890c8de5b0SBaptiste Daroussin "number : DIGIT",
2900c8de5b0SBaptiste Daroussin "number : number DIGIT",
2910c8de5b0SBaptiste Daroussin
2920c8de5b0SBaptiste Daroussin };
2930c8de5b0SBaptiste Daroussin #endif
2940c8de5b0SBaptiste Daroussin
295b53bb29fSJung-uk Kim #if YYDEBUG
2960c8de5b0SBaptiste Daroussin int yydebug;
297b53bb29fSJung-uk Kim #endif
2980c8de5b0SBaptiste Daroussin
2990c8de5b0SBaptiste Daroussin int yyerrflag;
3000c8de5b0SBaptiste Daroussin int yychar;
3010c8de5b0SBaptiste Daroussin YYSTYPE yyval;
3020c8de5b0SBaptiste Daroussin YYSTYPE yylval;
303b53bb29fSJung-uk Kim int yynerrs;
3040c8de5b0SBaptiste Daroussin
3050c8de5b0SBaptiste Daroussin /* define the initial stack-sizes */
3060c8de5b0SBaptiste Daroussin #ifdef YYSTACKSIZE
3070c8de5b0SBaptiste Daroussin #undef YYMAXDEPTH
3080c8de5b0SBaptiste Daroussin #define YYMAXDEPTH YYSTACKSIZE
3090c8de5b0SBaptiste Daroussin #else
3100c8de5b0SBaptiste Daroussin #ifdef YYMAXDEPTH
3110c8de5b0SBaptiste Daroussin #define YYSTACKSIZE YYMAXDEPTH
3120c8de5b0SBaptiste Daroussin #else
3130c8de5b0SBaptiste Daroussin #define YYSTACKSIZE 10000
3140c8de5b0SBaptiste Daroussin #define YYMAXDEPTH 10000
3150c8de5b0SBaptiste Daroussin #endif
3160c8de5b0SBaptiste Daroussin #endif
3170c8de5b0SBaptiste Daroussin
3180c8de5b0SBaptiste Daroussin #define YYINITSTACKSIZE 200
3190c8de5b0SBaptiste Daroussin
3200c8de5b0SBaptiste Daroussin typedef struct {
3210c8de5b0SBaptiste Daroussin unsigned stacksize;
3220c8de5b0SBaptiste Daroussin YYINT *s_base;
3230c8de5b0SBaptiste Daroussin YYINT *s_mark;
3240c8de5b0SBaptiste Daroussin YYINT *s_last;
3250c8de5b0SBaptiste Daroussin YYSTYPE *l_base;
3260c8de5b0SBaptiste Daroussin YYSTYPE *l_mark;
3270c8de5b0SBaptiste Daroussin } YYSTACKDATA;
3280c8de5b0SBaptiste Daroussin /* variables for the parser stack */
3290c8de5b0SBaptiste Daroussin static YYSTACKDATA yystack;
3300c8de5b0SBaptiste Daroussin #line 73 "quote_calc3.y"
3310c8de5b0SBaptiste Daroussin /* start of programs */
3320c8de5b0SBaptiste Daroussin
3330c8de5b0SBaptiste Daroussin int
main(void)3340c8de5b0SBaptiste Daroussin main (void)
3350c8de5b0SBaptiste Daroussin {
3360c8de5b0SBaptiste Daroussin while(!feof(stdin)) {
3370c8de5b0SBaptiste Daroussin yyparse();
3380c8de5b0SBaptiste Daroussin }
3390c8de5b0SBaptiste Daroussin return 0;
3400c8de5b0SBaptiste Daroussin }
3410c8de5b0SBaptiste Daroussin
3420c8de5b0SBaptiste Daroussin static void
yyerror(const char * s)3430c8de5b0SBaptiste Daroussin yyerror(const char *s)
3440c8de5b0SBaptiste Daroussin {
3450c8de5b0SBaptiste Daroussin fprintf(stderr, "%s\n", s);
3460c8de5b0SBaptiste Daroussin }
3470c8de5b0SBaptiste Daroussin
3480c8de5b0SBaptiste Daroussin int
yylex(void)3490c8de5b0SBaptiste Daroussin yylex(void) {
3500c8de5b0SBaptiste Daroussin /* lexical analysis routine */
3510c8de5b0SBaptiste Daroussin /* returns LETTER for a lower case letter, yylval = 0 through 25 */
3520c8de5b0SBaptiste Daroussin /* return DIGIT for a digit, yylval = 0 through 9 */
3530c8de5b0SBaptiste Daroussin /* all other characters are returned immediately */
3540c8de5b0SBaptiste Daroussin
3550c8de5b0SBaptiste Daroussin int c;
3560c8de5b0SBaptiste Daroussin
3570c8de5b0SBaptiste Daroussin while( (c=getchar()) == ' ' ) { /* skip blanks */ }
3580c8de5b0SBaptiste Daroussin
3590c8de5b0SBaptiste Daroussin /* c is now nonblank */
3600c8de5b0SBaptiste Daroussin
3610c8de5b0SBaptiste Daroussin if( islower( c )) {
3620c8de5b0SBaptiste Daroussin yylval = c - 'a';
3630c8de5b0SBaptiste Daroussin return ( LETTER );
3640c8de5b0SBaptiste Daroussin }
3650c8de5b0SBaptiste Daroussin if( isdigit( c )) {
3660c8de5b0SBaptiste Daroussin yylval = c - '0';
3670c8de5b0SBaptiste Daroussin return ( DIGIT );
3680c8de5b0SBaptiste Daroussin }
3690c8de5b0SBaptiste Daroussin return( c );
3700c8de5b0SBaptiste Daroussin }
371b53bb29fSJung-uk Kim #line 372 "quote_calc3.tab.c"
3720c8de5b0SBaptiste Daroussin
3730c8de5b0SBaptiste Daroussin #if YYDEBUG
3740c8de5b0SBaptiste Daroussin #include <stdio.h> /* needed for printf */
3750c8de5b0SBaptiste Daroussin #endif
3760c8de5b0SBaptiste Daroussin
3770c8de5b0SBaptiste Daroussin #include <stdlib.h> /* needed for malloc, etc */
3780c8de5b0SBaptiste Daroussin #include <string.h> /* needed for memset */
3790c8de5b0SBaptiste Daroussin
3800c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */
yygrowstack(YYSTACKDATA * data)3810c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data)
3820c8de5b0SBaptiste Daroussin {
3830c8de5b0SBaptiste Daroussin int i;
3840c8de5b0SBaptiste Daroussin unsigned newsize;
3850c8de5b0SBaptiste Daroussin YYINT *newss;
3860c8de5b0SBaptiste Daroussin YYSTYPE *newvs;
3870c8de5b0SBaptiste Daroussin
3880c8de5b0SBaptiste Daroussin if ((newsize = data->stacksize) == 0)
3890c8de5b0SBaptiste Daroussin newsize = YYINITSTACKSIZE;
3900c8de5b0SBaptiste Daroussin else if (newsize >= YYMAXDEPTH)
3910c8de5b0SBaptiste Daroussin return YYENOMEM;
3920c8de5b0SBaptiste Daroussin else if ((newsize *= 2) > YYMAXDEPTH)
3930c8de5b0SBaptiste Daroussin newsize = YYMAXDEPTH;
3940c8de5b0SBaptiste Daroussin
3950c8de5b0SBaptiste Daroussin i = (int) (data->s_mark - data->s_base);
3960c8de5b0SBaptiste Daroussin newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
397bf80e08eSJung-uk Kim if (newss == NULL)
3980c8de5b0SBaptiste Daroussin return YYENOMEM;
3990c8de5b0SBaptiste Daroussin
4000c8de5b0SBaptiste Daroussin data->s_base = newss;
4010c8de5b0SBaptiste Daroussin data->s_mark = newss + i;
4020c8de5b0SBaptiste Daroussin
4030c8de5b0SBaptiste Daroussin newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
404bf80e08eSJung-uk Kim if (newvs == NULL)
4050c8de5b0SBaptiste Daroussin return YYENOMEM;
4060c8de5b0SBaptiste Daroussin
4070c8de5b0SBaptiste Daroussin data->l_base = newvs;
4080c8de5b0SBaptiste Daroussin data->l_mark = newvs + i;
4090c8de5b0SBaptiste Daroussin
4100c8de5b0SBaptiste Daroussin data->stacksize = newsize;
4110c8de5b0SBaptiste Daroussin data->s_last = data->s_base + newsize - 1;
4120c8de5b0SBaptiste Daroussin return 0;
4130c8de5b0SBaptiste Daroussin }
4140c8de5b0SBaptiste Daroussin
4150c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS)
yyfreestack(YYSTACKDATA * data)4160c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data)
4170c8de5b0SBaptiste Daroussin {
4180c8de5b0SBaptiste Daroussin free(data->s_base);
4190c8de5b0SBaptiste Daroussin free(data->l_base);
4200c8de5b0SBaptiste Daroussin memset(data, 0, sizeof(*data));
4210c8de5b0SBaptiste Daroussin }
4220c8de5b0SBaptiste Daroussin #else
4230c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */
4240c8de5b0SBaptiste Daroussin #endif
4250c8de5b0SBaptiste Daroussin
4260c8de5b0SBaptiste Daroussin #define YYABORT goto yyabort
4270c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort
4280c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept
4290c8de5b0SBaptiste Daroussin #define YYERROR goto yyerrlab
4300c8de5b0SBaptiste Daroussin
4310c8de5b0SBaptiste Daroussin int
YYPARSE_DECL()4320c8de5b0SBaptiste Daroussin YYPARSE_DECL()
4330c8de5b0SBaptiste Daroussin {
4340c8de5b0SBaptiste Daroussin int yym, yyn, yystate;
4350c8de5b0SBaptiste Daroussin #if YYDEBUG
4360c8de5b0SBaptiste Daroussin const char *yys;
4370c8de5b0SBaptiste Daroussin
438bf80e08eSJung-uk Kim if ((yys = getenv("YYDEBUG")) != NULL)
4390c8de5b0SBaptiste Daroussin {
4400c8de5b0SBaptiste Daroussin yyn = *yys;
4410c8de5b0SBaptiste Daroussin if (yyn >= '0' && yyn <= '9')
4420c8de5b0SBaptiste Daroussin yydebug = yyn - '0';
4430c8de5b0SBaptiste Daroussin }
4440c8de5b0SBaptiste Daroussin #endif
4450c8de5b0SBaptiste Daroussin
446*8e022d3cSDag-Erling Smørgrav /* yym is set below */
447*8e022d3cSDag-Erling Smørgrav /* yyn is set below */
4480c8de5b0SBaptiste Daroussin yynerrs = 0;
4490c8de5b0SBaptiste Daroussin yyerrflag = 0;
4500c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
4510c8de5b0SBaptiste Daroussin yystate = 0;
4520c8de5b0SBaptiste Daroussin
4530c8de5b0SBaptiste Daroussin #if YYPURE
4540c8de5b0SBaptiste Daroussin memset(&yystack, 0, sizeof(yystack));
4550c8de5b0SBaptiste Daroussin #endif
4560c8de5b0SBaptiste Daroussin
4570c8de5b0SBaptiste Daroussin if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
4580c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base;
4590c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base;
4600c8de5b0SBaptiste Daroussin yystate = 0;
4610c8de5b0SBaptiste Daroussin *yystack.s_mark = 0;
4620c8de5b0SBaptiste Daroussin
4630c8de5b0SBaptiste Daroussin yyloop:
4640c8de5b0SBaptiste Daroussin if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
4650c8de5b0SBaptiste Daroussin if (yychar < 0)
4660c8de5b0SBaptiste Daroussin {
467c5b5d71aSJung-uk Kim yychar = YYLEX;
468c5b5d71aSJung-uk Kim if (yychar < 0) yychar = YYEOF;
4690c8de5b0SBaptiste Daroussin #if YYDEBUG
4700c8de5b0SBaptiste Daroussin if (yydebug)
4710c8de5b0SBaptiste Daroussin {
472c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
4730c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n",
4740c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys);
4750c8de5b0SBaptiste Daroussin }
4760c8de5b0SBaptiste Daroussin #endif
4770c8de5b0SBaptiste Daroussin }
478c5b5d71aSJung-uk Kim if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
479c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
4800c8de5b0SBaptiste Daroussin {
4810c8de5b0SBaptiste Daroussin #if YYDEBUG
4820c8de5b0SBaptiste Daroussin if (yydebug)
4830c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, shifting to state %d\n",
4840c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yytable[yyn]);
4850c8de5b0SBaptiste Daroussin #endif
486c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
4870c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
4880c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn];
4890c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
4900c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
4910c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag;
4920c8de5b0SBaptiste Daroussin goto yyloop;
4930c8de5b0SBaptiste Daroussin }
494c5b5d71aSJung-uk Kim if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
495c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
4960c8de5b0SBaptiste Daroussin {
4970c8de5b0SBaptiste Daroussin yyn = yytable[yyn];
4980c8de5b0SBaptiste Daroussin goto yyreduce;
4990c8de5b0SBaptiste Daroussin }
500c5b5d71aSJung-uk Kim if (yyerrflag != 0) goto yyinrecovery;
5010c8de5b0SBaptiste Daroussin
5020c8de5b0SBaptiste Daroussin YYERROR_CALL("syntax error");
5030c8de5b0SBaptiste Daroussin
504c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */
5050c8de5b0SBaptiste Daroussin yyerrlab:
5060c8de5b0SBaptiste Daroussin ++yynerrs;
5070c8de5b0SBaptiste Daroussin
5080c8de5b0SBaptiste Daroussin yyinrecovery:
5090c8de5b0SBaptiste Daroussin if (yyerrflag < 3)
5100c8de5b0SBaptiste Daroussin {
5110c8de5b0SBaptiste Daroussin yyerrflag = 3;
5120c8de5b0SBaptiste Daroussin for (;;)
5130c8de5b0SBaptiste Daroussin {
514c5b5d71aSJung-uk Kim if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
515c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
5160c8de5b0SBaptiste Daroussin {
5170c8de5b0SBaptiste Daroussin #if YYDEBUG
5180c8de5b0SBaptiste Daroussin if (yydebug)
5190c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery shifting\
5200c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
5210c8de5b0SBaptiste Daroussin #endif
522c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
5230c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
5240c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn];
5250c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval;
5260c8de5b0SBaptiste Daroussin goto yyloop;
5270c8de5b0SBaptiste Daroussin }
5280c8de5b0SBaptiste Daroussin else
5290c8de5b0SBaptiste Daroussin {
5300c8de5b0SBaptiste Daroussin #if YYDEBUG
5310c8de5b0SBaptiste Daroussin if (yydebug)
5320c8de5b0SBaptiste Daroussin printf("%sdebug: error recovery discarding state %d\n",
5330c8de5b0SBaptiste Daroussin YYPREFIX, *yystack.s_mark);
5340c8de5b0SBaptiste Daroussin #endif
5350c8de5b0SBaptiste Daroussin if (yystack.s_mark <= yystack.s_base) goto yyabort;
5360c8de5b0SBaptiste Daroussin --yystack.s_mark;
5370c8de5b0SBaptiste Daroussin --yystack.l_mark;
5380c8de5b0SBaptiste Daroussin }
5390c8de5b0SBaptiste Daroussin }
5400c8de5b0SBaptiste Daroussin }
5410c8de5b0SBaptiste Daroussin else
5420c8de5b0SBaptiste Daroussin {
5430c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyabort;
5440c8de5b0SBaptiste Daroussin #if YYDEBUG
5450c8de5b0SBaptiste Daroussin if (yydebug)
5460c8de5b0SBaptiste Daroussin {
547c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
5480c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
5490c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys);
5500c8de5b0SBaptiste Daroussin }
5510c8de5b0SBaptiste Daroussin #endif
5520c8de5b0SBaptiste Daroussin yychar = YYEMPTY;
5530c8de5b0SBaptiste Daroussin goto yyloop;
5540c8de5b0SBaptiste Daroussin }
5550c8de5b0SBaptiste Daroussin
5560c8de5b0SBaptiste Daroussin yyreduce:
5570c8de5b0SBaptiste Daroussin #if YYDEBUG
5580c8de5b0SBaptiste Daroussin if (yydebug)
5590c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reducing by rule %d (%s)\n",
5600c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yyn, yyrule[yyn]);
5610c8de5b0SBaptiste Daroussin #endif
5620c8de5b0SBaptiste Daroussin yym = yylen[yyn];
563c5b5d71aSJung-uk Kim if (yym > 0)
5640c8de5b0SBaptiste Daroussin yyval = yystack.l_mark[1-yym];
5650c8de5b0SBaptiste Daroussin else
5660c8de5b0SBaptiste Daroussin memset(&yyval, 0, sizeof yyval);
567c5b5d71aSJung-uk Kim
5680c8de5b0SBaptiste Daroussin switch (yyn)
5690c8de5b0SBaptiste Daroussin {
5700c8de5b0SBaptiste Daroussin case 3:
5710c8de5b0SBaptiste Daroussin #line 35 "quote_calc3.y"
5720c8de5b0SBaptiste Daroussin { yyerrok ; }
573*8e022d3cSDag-Erling Smørgrav #line 574 "quote_calc3.tab.c"
5740c8de5b0SBaptiste Daroussin break;
5750c8de5b0SBaptiste Daroussin case 4:
5760c8de5b0SBaptiste Daroussin #line 39 "quote_calc3.y"
5770c8de5b0SBaptiste Daroussin { printf("%d\n",yystack.l_mark[0]);}
578*8e022d3cSDag-Erling Smørgrav #line 579 "quote_calc3.tab.c"
5790c8de5b0SBaptiste Daroussin break;
5800c8de5b0SBaptiste Daroussin case 5:
5810c8de5b0SBaptiste Daroussin #line 41 "quote_calc3.y"
5820c8de5b0SBaptiste Daroussin { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; }
583*8e022d3cSDag-Erling Smørgrav #line 584 "quote_calc3.tab.c"
5840c8de5b0SBaptiste Daroussin break;
5850c8de5b0SBaptiste Daroussin case 6:
5860c8de5b0SBaptiste Daroussin #line 45 "quote_calc3.y"
5870c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-1]; }
588*8e022d3cSDag-Erling Smørgrav #line 589 "quote_calc3.tab.c"
5890c8de5b0SBaptiste Daroussin break;
5900c8de5b0SBaptiste Daroussin case 7:
5910c8de5b0SBaptiste Daroussin #line 47 "quote_calc3.y"
5920c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; }
593*8e022d3cSDag-Erling Smørgrav #line 594 "quote_calc3.tab.c"
5940c8de5b0SBaptiste Daroussin break;
5950c8de5b0SBaptiste Daroussin case 8:
5960c8de5b0SBaptiste Daroussin #line 49 "quote_calc3.y"
5970c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; }
598*8e022d3cSDag-Erling Smørgrav #line 599 "quote_calc3.tab.c"
5990c8de5b0SBaptiste Daroussin break;
6000c8de5b0SBaptiste Daroussin case 9:
6010c8de5b0SBaptiste Daroussin #line 51 "quote_calc3.y"
6020c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; }
603*8e022d3cSDag-Erling Smørgrav #line 604 "quote_calc3.tab.c"
6040c8de5b0SBaptiste Daroussin break;
6050c8de5b0SBaptiste Daroussin case 10:
6060c8de5b0SBaptiste Daroussin #line 53 "quote_calc3.y"
6070c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; }
608*8e022d3cSDag-Erling Smørgrav #line 609 "quote_calc3.tab.c"
6090c8de5b0SBaptiste Daroussin break;
6100c8de5b0SBaptiste Daroussin case 11:
6110c8de5b0SBaptiste Daroussin #line 55 "quote_calc3.y"
6120c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; }
613*8e022d3cSDag-Erling Smørgrav #line 614 "quote_calc3.tab.c"
6140c8de5b0SBaptiste Daroussin break;
6150c8de5b0SBaptiste Daroussin case 12:
6160c8de5b0SBaptiste Daroussin #line 57 "quote_calc3.y"
6170c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; }
618*8e022d3cSDag-Erling Smørgrav #line 619 "quote_calc3.tab.c"
6190c8de5b0SBaptiste Daroussin break;
6200c8de5b0SBaptiste Daroussin case 13:
6210c8de5b0SBaptiste Daroussin #line 59 "quote_calc3.y"
6220c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[-2] | yystack.l_mark[0]; }
623*8e022d3cSDag-Erling Smørgrav #line 624 "quote_calc3.tab.c"
6240c8de5b0SBaptiste Daroussin break;
6250c8de5b0SBaptiste Daroussin case 14:
6260c8de5b0SBaptiste Daroussin #line 61 "quote_calc3.y"
6270c8de5b0SBaptiste Daroussin { yyval = - yystack.l_mark[0]; }
628*8e022d3cSDag-Erling Smørgrav #line 629 "quote_calc3.tab.c"
6290c8de5b0SBaptiste Daroussin break;
6300c8de5b0SBaptiste Daroussin case 15:
6310c8de5b0SBaptiste Daroussin #line 63 "quote_calc3.y"
6320c8de5b0SBaptiste Daroussin { yyval = regs[yystack.l_mark[0]]; }
633*8e022d3cSDag-Erling Smørgrav #line 634 "quote_calc3.tab.c"
6340c8de5b0SBaptiste Daroussin break;
6350c8de5b0SBaptiste Daroussin case 17:
6360c8de5b0SBaptiste Daroussin #line 68 "quote_calc3.y"
6370c8de5b0SBaptiste Daroussin { yyval = yystack.l_mark[0]; base = (yystack.l_mark[0]==0) ? 8 : 10; }
638*8e022d3cSDag-Erling Smørgrav #line 639 "quote_calc3.tab.c"
6390c8de5b0SBaptiste Daroussin break;
6400c8de5b0SBaptiste Daroussin case 18:
6410c8de5b0SBaptiste Daroussin #line 70 "quote_calc3.y"
6420c8de5b0SBaptiste Daroussin { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
643*8e022d3cSDag-Erling Smørgrav #line 644 "quote_calc3.tab.c"
6440c8de5b0SBaptiste Daroussin break;
645*8e022d3cSDag-Erling Smørgrav #line 646 "quote_calc3.tab.c"
6460c8de5b0SBaptiste Daroussin }
6470c8de5b0SBaptiste Daroussin yystack.s_mark -= yym;
6480c8de5b0SBaptiste Daroussin yystate = *yystack.s_mark;
6490c8de5b0SBaptiste Daroussin yystack.l_mark -= yym;
6500c8de5b0SBaptiste Daroussin yym = yylhs[yyn];
6510c8de5b0SBaptiste Daroussin if (yystate == 0 && yym == 0)
6520c8de5b0SBaptiste Daroussin {
6530c8de5b0SBaptiste Daroussin #if YYDEBUG
6540c8de5b0SBaptiste Daroussin if (yydebug)
6550c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state 0 to\
6560c8de5b0SBaptiste Daroussin state %d\n", YYPREFIX, YYFINAL);
6570c8de5b0SBaptiste Daroussin #endif
6580c8de5b0SBaptiste Daroussin yystate = YYFINAL;
6590c8de5b0SBaptiste Daroussin *++yystack.s_mark = YYFINAL;
6600c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval;
6610c8de5b0SBaptiste Daroussin if (yychar < 0)
6620c8de5b0SBaptiste Daroussin {
663c5b5d71aSJung-uk Kim yychar = YYLEX;
664c5b5d71aSJung-uk Kim if (yychar < 0) yychar = YYEOF;
6650c8de5b0SBaptiste Daroussin #if YYDEBUG
6660c8de5b0SBaptiste Daroussin if (yydebug)
6670c8de5b0SBaptiste Daroussin {
668c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
6690c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n",
6700c8de5b0SBaptiste Daroussin YYPREFIX, YYFINAL, yychar, yys);
6710c8de5b0SBaptiste Daroussin }
6720c8de5b0SBaptiste Daroussin #endif
6730c8de5b0SBaptiste Daroussin }
6740c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyaccept;
6750c8de5b0SBaptiste Daroussin goto yyloop;
6760c8de5b0SBaptiste Daroussin }
677c5b5d71aSJung-uk Kim if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
678c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
6790c8de5b0SBaptiste Daroussin yystate = yytable[yyn];
6800c8de5b0SBaptiste Daroussin else
6810c8de5b0SBaptiste Daroussin yystate = yydgoto[yym];
6820c8de5b0SBaptiste Daroussin #if YYDEBUG
6830c8de5b0SBaptiste Daroussin if (yydebug)
6840c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state %d \
6850c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
6860c8de5b0SBaptiste Daroussin #endif
687c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
6880c8de5b0SBaptiste Daroussin *++yystack.s_mark = (YYINT) yystate;
6890c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval;
6900c8de5b0SBaptiste Daroussin goto yyloop;
6910c8de5b0SBaptiste Daroussin
6920c8de5b0SBaptiste Daroussin yyoverflow:
6930c8de5b0SBaptiste Daroussin YYERROR_CALL("yacc stack overflow");
6940c8de5b0SBaptiste Daroussin
6950c8de5b0SBaptiste Daroussin yyabort:
6960c8de5b0SBaptiste Daroussin yyfreestack(&yystack);
6970c8de5b0SBaptiste Daroussin return (1);
6980c8de5b0SBaptiste Daroussin
6990c8de5b0SBaptiste Daroussin yyaccept:
7000c8de5b0SBaptiste Daroussin yyfreestack(&yystack);
7010c8de5b0SBaptiste Daroussin return (0);
7020c8de5b0SBaptiste Daroussin }
703