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 60c8de5b0SBaptiste Daroussin #define YYMAJOR 1 70c8de5b0SBaptiste Daroussin #define YYMINOR 9 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 ok_syntax1_parse 190c8de5b0SBaptiste Daroussin #endif /* yyparse */ 200c8de5b0SBaptiste Daroussin 210c8de5b0SBaptiste Daroussin #ifndef yylex 220c8de5b0SBaptiste Daroussin #define yylex ok_syntax1_lex 230c8de5b0SBaptiste Daroussin #endif /* yylex */ 240c8de5b0SBaptiste Daroussin 250c8de5b0SBaptiste Daroussin #ifndef yyerror 260c8de5b0SBaptiste Daroussin #define yyerror ok_syntax1_error 270c8de5b0SBaptiste Daroussin #endif /* yyerror */ 280c8de5b0SBaptiste Daroussin 290c8de5b0SBaptiste Daroussin #ifndef yychar 300c8de5b0SBaptiste Daroussin #define yychar ok_syntax1_char 310c8de5b0SBaptiste Daroussin #endif /* yychar */ 320c8de5b0SBaptiste Daroussin 330c8de5b0SBaptiste Daroussin #ifndef yyval 340c8de5b0SBaptiste Daroussin #define yyval ok_syntax1_val 350c8de5b0SBaptiste Daroussin #endif /* yyval */ 360c8de5b0SBaptiste Daroussin 370c8de5b0SBaptiste Daroussin #ifndef yylval 380c8de5b0SBaptiste Daroussin #define yylval ok_syntax1_lval 390c8de5b0SBaptiste Daroussin #endif /* yylval */ 400c8de5b0SBaptiste Daroussin 410c8de5b0SBaptiste Daroussin #ifndef yydebug 420c8de5b0SBaptiste Daroussin #define yydebug ok_syntax1_debug 430c8de5b0SBaptiste Daroussin #endif /* yydebug */ 440c8de5b0SBaptiste Daroussin 450c8de5b0SBaptiste Daroussin #ifndef yynerrs 460c8de5b0SBaptiste Daroussin #define yynerrs ok_syntax1_nerrs 470c8de5b0SBaptiste Daroussin #endif /* yynerrs */ 480c8de5b0SBaptiste Daroussin 490c8de5b0SBaptiste Daroussin #ifndef yyerrflag 500c8de5b0SBaptiste Daroussin #define yyerrflag ok_syntax1_errflag 510c8de5b0SBaptiste Daroussin #endif /* yyerrflag */ 520c8de5b0SBaptiste Daroussin 530c8de5b0SBaptiste Daroussin #ifndef yylhs 540c8de5b0SBaptiste Daroussin #define yylhs ok_syntax1_lhs 550c8de5b0SBaptiste Daroussin #endif /* yylhs */ 560c8de5b0SBaptiste Daroussin 570c8de5b0SBaptiste Daroussin #ifndef yylen 580c8de5b0SBaptiste Daroussin #define yylen ok_syntax1_len 590c8de5b0SBaptiste Daroussin #endif /* yylen */ 600c8de5b0SBaptiste Daroussin 610c8de5b0SBaptiste Daroussin #ifndef yydefred 620c8de5b0SBaptiste Daroussin #define yydefred ok_syntax1_defred 630c8de5b0SBaptiste Daroussin #endif /* yydefred */ 640c8de5b0SBaptiste Daroussin 650c8de5b0SBaptiste Daroussin #ifndef yydgoto 660c8de5b0SBaptiste Daroussin #define yydgoto ok_syntax1_dgoto 670c8de5b0SBaptiste Daroussin #endif /* yydgoto */ 680c8de5b0SBaptiste Daroussin 690c8de5b0SBaptiste Daroussin #ifndef yysindex 700c8de5b0SBaptiste Daroussin #define yysindex ok_syntax1_sindex 710c8de5b0SBaptiste Daroussin #endif /* yysindex */ 720c8de5b0SBaptiste Daroussin 730c8de5b0SBaptiste Daroussin #ifndef yyrindex 740c8de5b0SBaptiste Daroussin #define yyrindex ok_syntax1_rindex 750c8de5b0SBaptiste Daroussin #endif /* yyrindex */ 760c8de5b0SBaptiste Daroussin 770c8de5b0SBaptiste Daroussin #ifndef yygindex 780c8de5b0SBaptiste Daroussin #define yygindex ok_syntax1_gindex 790c8de5b0SBaptiste Daroussin #endif /* yygindex */ 800c8de5b0SBaptiste Daroussin 810c8de5b0SBaptiste Daroussin #ifndef yytable 820c8de5b0SBaptiste Daroussin #define yytable ok_syntax1_table 830c8de5b0SBaptiste Daroussin #endif /* yytable */ 840c8de5b0SBaptiste Daroussin 850c8de5b0SBaptiste Daroussin #ifndef yycheck 860c8de5b0SBaptiste Daroussin #define yycheck ok_syntax1_check 870c8de5b0SBaptiste Daroussin #endif /* yycheck */ 880c8de5b0SBaptiste Daroussin 890c8de5b0SBaptiste Daroussin #ifndef yyname 900c8de5b0SBaptiste Daroussin #define yyname ok_syntax1_name 910c8de5b0SBaptiste Daroussin #endif /* yyname */ 920c8de5b0SBaptiste Daroussin 930c8de5b0SBaptiste Daroussin #ifndef yyrule 940c8de5b0SBaptiste Daroussin #define yyrule ok_syntax1_rule 950c8de5b0SBaptiste Daroussin #endif /* yyrule */ 960c8de5b0SBaptiste Daroussin #define YYPREFIX "ok_syntax1_" 970c8de5b0SBaptiste Daroussin 980c8de5b0SBaptiste Daroussin #define YYPURE 1 990c8de5b0SBaptiste Daroussin 1000c8de5b0SBaptiste Daroussin #line 9 "ok_syntax1.y" 1010c8de5b0SBaptiste Daroussin # include <stdio.h> 1020c8de5b0SBaptiste Daroussin # include <ctype.h> 1030c8de5b0SBaptiste Daroussin 1040c8de5b0SBaptiste Daroussin #ifdef YYBISON 1050c8de5b0SBaptiste Daroussin #define YYSTYPE int 1060c8de5b0SBaptiste Daroussin #define YYLEX_PARAM base 1070c8de5b0SBaptiste Daroussin #define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM) 1080c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) 1090c8de5b0SBaptiste Daroussin int YYLEX_DECL(); 1100c8de5b0SBaptiste Daroussin static void YYERROR_DECL(); 1110c8de5b0SBaptiste Daroussin #endif 1120c8de5b0SBaptiste Daroussin 1130c8de5b0SBaptiste Daroussin #ifdef YYSTYPE 1140c8de5b0SBaptiste Daroussin #undef YYSTYPE_IS_DECLARED 1150c8de5b0SBaptiste Daroussin #define YYSTYPE_IS_DECLARED 1 1160c8de5b0SBaptiste Daroussin #endif 1170c8de5b0SBaptiste Daroussin #ifndef YYSTYPE_IS_DECLARED 1180c8de5b0SBaptiste Daroussin #define YYSTYPE_IS_DECLARED 1 119c5b5d71aSJung-uk Kim #line 43 "ok_syntax1.y" 1200c8de5b0SBaptiste Daroussin typedef union 1210c8de5b0SBaptiste Daroussin { 1220c8de5b0SBaptiste Daroussin char * cval; 1230c8de5b0SBaptiste Daroussin int ival; 1240c8de5b0SBaptiste Daroussin double dval; 1250c8de5b0SBaptiste Daroussin } YYSTYPE; 1260c8de5b0SBaptiste Daroussin #endif /* !YYSTYPE_IS_DECLARED */ 1270c8de5b0SBaptiste Daroussin #line 128 "ok_syntax1.tab.c" 1280c8de5b0SBaptiste Daroussin 1290c8de5b0SBaptiste Daroussin /* compatibility with bison */ 1300c8de5b0SBaptiste Daroussin #ifdef YYPARSE_PARAM 1310c8de5b0SBaptiste Daroussin /* compatibility with FreeBSD */ 1320c8de5b0SBaptiste Daroussin # ifdef YYPARSE_PARAM_TYPE 1330c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 1340c8de5b0SBaptiste Daroussin # else 1350c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 1360c8de5b0SBaptiste Daroussin # endif 1370c8de5b0SBaptiste Daroussin #else 1380c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(int regs[26], int *base) 1390c8de5b0SBaptiste Daroussin #endif 1400c8de5b0SBaptiste Daroussin 1410c8de5b0SBaptiste Daroussin /* Parameters sent to lex. */ 1420c8de5b0SBaptiste Daroussin #ifdef YYLEX_PARAM 1430c8de5b0SBaptiste Daroussin # ifdef YYLEX_PARAM_TYPE 1440c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, YYLEX_PARAM_TYPE YYLEX_PARAM) 1450c8de5b0SBaptiste Daroussin # else 1460c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, void * YYLEX_PARAM) 1470c8de5b0SBaptiste Daroussin # endif 1480c8de5b0SBaptiste Daroussin # define YYLEX yylex(&yylval, YYLEX_PARAM) 1490c8de5b0SBaptiste Daroussin #else 1500c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, int *base) 1510c8de5b0SBaptiste Daroussin # define YYLEX yylex(&yylval, base) 1520c8de5b0SBaptiste Daroussin #endif 1530c8de5b0SBaptiste Daroussin 1540c8de5b0SBaptiste Daroussin /* Parameters sent to yyerror. */ 1550c8de5b0SBaptiste Daroussin #ifndef YYERROR_DECL 1560c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) 1570c8de5b0SBaptiste Daroussin #endif 1580c8de5b0SBaptiste Daroussin #ifndef YYERROR_CALL 1590c8de5b0SBaptiste Daroussin #define YYERROR_CALL(msg) yyerror(regs, base, msg) 1600c8de5b0SBaptiste Daroussin #endif 1610c8de5b0SBaptiste Daroussin 1620c8de5b0SBaptiste Daroussin extern int YYPARSE_DECL(); 1630c8de5b0SBaptiste Daroussin 1640c8de5b0SBaptiste Daroussin #define DIGIT 257 1650c8de5b0SBaptiste Daroussin #define LETTER 258 1660c8de5b0SBaptiste Daroussin #define OCT1 259 1670c8de5b0SBaptiste Daroussin #define HEX1 260 1680c8de5b0SBaptiste Daroussin #define HEX2 261 1690c8de5b0SBaptiste Daroussin #define HEX3 262 1700c8de5b0SBaptiste Daroussin #define STR1 263 1710c8de5b0SBaptiste Daroussin #define STR2 265 1720c8de5b0SBaptiste Daroussin #define BELL 266 1730c8de5b0SBaptiste Daroussin #define BS 267 1740c8de5b0SBaptiste Daroussin #define NL 268 1750c8de5b0SBaptiste Daroussin #define LF 269 1760c8de5b0SBaptiste Daroussin #define CR 270 1770c8de5b0SBaptiste Daroussin #define TAB 271 1780c8de5b0SBaptiste Daroussin #define VT 272 1790c8de5b0SBaptiste Daroussin #define UMINUS 273 1800c8de5b0SBaptiste Daroussin #define YYERRCODE 256 181ea2af5c8SJung-uk Kim typedef int YYINT; 1820c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_lhs[] = { -1, 1830c8de5b0SBaptiste Daroussin 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 1840c8de5b0SBaptiste Daroussin 2, 2, 2, 2, 2, 2, 3, 3, 1850c8de5b0SBaptiste Daroussin }; 1860c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_len[] = { 2, 1870c8de5b0SBaptiste Daroussin 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, 1880c8de5b0SBaptiste Daroussin 3, 3, 3, 2, 1, 1, 1, 2, 1890c8de5b0SBaptiste Daroussin }; 1900c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_defred[] = { 1, 1910c8de5b0SBaptiste Daroussin 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, 1920c8de5b0SBaptiste Daroussin 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, 1930c8de5b0SBaptiste Daroussin 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 1940c8de5b0SBaptiste Daroussin 10, 11, 1950c8de5b0SBaptiste Daroussin }; 1960c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_dgoto[] = { 1, 1970c8de5b0SBaptiste Daroussin 7, 8, 9, 1980c8de5b0SBaptiste Daroussin }; 1990c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_sindex[] = { 0, 2000c8de5b0SBaptiste Daroussin -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, 2010c8de5b0SBaptiste Daroussin -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, 2020c8de5b0SBaptiste Daroussin -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, 2030c8de5b0SBaptiste Daroussin 0, 0, 2040c8de5b0SBaptiste Daroussin }; 2050c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_rindex[] = { 0, 2060c8de5b0SBaptiste Daroussin 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, 2070c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2080c8de5b0SBaptiste Daroussin 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, 2090c8de5b0SBaptiste Daroussin 0, 0, 2100c8de5b0SBaptiste Daroussin }; 2110c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_gindex[] = { 0, 2120c8de5b0SBaptiste Daroussin 0, 65, 0, 2130c8de5b0SBaptiste Daroussin }; 2140c8de5b0SBaptiste Daroussin #define YYTABLESIZE 220 2150c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_table[] = { 6, 2160c8de5b0SBaptiste Daroussin 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, 2170c8de5b0SBaptiste Daroussin 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, 2180c8de5b0SBaptiste Daroussin 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, 2190c8de5b0SBaptiste Daroussin 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, 2200c8de5b0SBaptiste Daroussin 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, 2210c8de5b0SBaptiste Daroussin 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, 2220c8de5b0SBaptiste Daroussin 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, 2230c8de5b0SBaptiste Daroussin 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, 2240c8de5b0SBaptiste Daroussin 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, 2250c8de5b0SBaptiste Daroussin 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, 2260c8de5b0SBaptiste Daroussin 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, 2270c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, 2280c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, 2290c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, 2300c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 2310c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2320c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2330c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2340c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2350c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2360c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2370c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, 2380c8de5b0SBaptiste Daroussin }; 2390c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_check[] = { 40, 2400c8de5b0SBaptiste Daroussin 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, 2410c8de5b0SBaptiste Daroussin 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, 2420c8de5b0SBaptiste Daroussin -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, 2430c8de5b0SBaptiste Daroussin -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, 2440c8de5b0SBaptiste Daroussin -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, 2450c8de5b0SBaptiste Daroussin 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, 2460c8de5b0SBaptiste Daroussin -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, 2470c8de5b0SBaptiste Daroussin 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 2480c8de5b0SBaptiste Daroussin 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, 2490c8de5b0SBaptiste Daroussin -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, 2500c8de5b0SBaptiste Daroussin -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, 2510c8de5b0SBaptiste Daroussin -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, 2520c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, 2530c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, 2540c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, 2550c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2560c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2570c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2580c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2590c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2600c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2610c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, 2620c8de5b0SBaptiste Daroussin }; 2630c8de5b0SBaptiste Daroussin #define YYFINAL 1 2640c8de5b0SBaptiste Daroussin #ifndef YYDEBUG 2650c8de5b0SBaptiste Daroussin #define YYDEBUG 0 2660c8de5b0SBaptiste Daroussin #endif 2670c8de5b0SBaptiste Daroussin #define YYMAXTOKEN 273 2680c8de5b0SBaptiste Daroussin #define YYUNDFTOKEN 279 2690c8de5b0SBaptiste Daroussin #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 2700c8de5b0SBaptiste Daroussin #if YYDEBUG 2710c8de5b0SBaptiste Daroussin static const char *const ok_syntax1_name[] = { 2720c8de5b0SBaptiste Daroussin 2730c8de5b0SBaptiste Daroussin "end-of-file",0,0,0,0,0,0,"'\\a'","'\\b'","'\\t'","'\\n'","'\\v'","'\\f'", 2740c8de5b0SBaptiste Daroussin "'\\r'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'#'",0,"'%'","'&'",0,"'('", 2750c8de5b0SBaptiste Daroussin "')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,"'='",0,0,"'@'",0,0, 2760c8de5b0SBaptiste 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, 2770c8de5b0SBaptiste Daroussin 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,"'~'","'\\177'",0,0,0,0,0,0,0,0,0, 2780c8de5b0SBaptiste 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, 2790c8de5b0SBaptiste 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, 2800c8de5b0SBaptiste 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, 2810c8de5b0SBaptiste Daroussin "'\\377'",0,"DIGIT","LETTER","OCT1","HEX1","HEX2","HEX3","STR1", 2820c8de5b0SBaptiste Daroussin "\"\\177\\177\\\\\\n\"","STR2","BELL","BS","NL","LF","CR","TAB","VT","UMINUS",0, 2830c8de5b0SBaptiste Daroussin 0,0,0,0,"illegal-symbol", 2840c8de5b0SBaptiste Daroussin }; 2850c8de5b0SBaptiste Daroussin static const char *const ok_syntax1_rule[] = { 2860c8de5b0SBaptiste Daroussin "$accept : list", 2870c8de5b0SBaptiste Daroussin "list :", 2880c8de5b0SBaptiste Daroussin "list : list stat '\\n'", 2890c8de5b0SBaptiste Daroussin "list : list error '\\n'", 2900c8de5b0SBaptiste Daroussin "stat : expr", 2910c8de5b0SBaptiste Daroussin "stat : LETTER '=' expr", 2920c8de5b0SBaptiste Daroussin "expr : '(' expr ')'", 2930c8de5b0SBaptiste Daroussin "expr : expr '+' expr", 2940c8de5b0SBaptiste Daroussin "expr : expr '-' expr", 2950c8de5b0SBaptiste Daroussin "expr : expr '*' expr", 2960c8de5b0SBaptiste Daroussin "expr : expr '/' expr", 2970c8de5b0SBaptiste Daroussin "expr : expr '%' expr", 2980c8de5b0SBaptiste Daroussin "expr : expr '&' expr", 2990c8de5b0SBaptiste Daroussin "expr : expr '|' expr", 3000c8de5b0SBaptiste Daroussin "expr : '-' expr", 3010c8de5b0SBaptiste Daroussin "expr : LETTER", 3020c8de5b0SBaptiste Daroussin "expr : number", 3030c8de5b0SBaptiste Daroussin "number : DIGIT", 3040c8de5b0SBaptiste Daroussin "number : number DIGIT", 3050c8de5b0SBaptiste Daroussin 3060c8de5b0SBaptiste Daroussin }; 3070c8de5b0SBaptiste Daroussin #endif 3080c8de5b0SBaptiste Daroussin 309b53bb29fSJung-uk Kim #if YYDEBUG 3100c8de5b0SBaptiste Daroussin int yydebug; 311b53bb29fSJung-uk Kim #endif 3120c8de5b0SBaptiste Daroussin 3130c8de5b0SBaptiste Daroussin /* define the initial stack-sizes */ 3140c8de5b0SBaptiste Daroussin #ifdef YYSTACKSIZE 3150c8de5b0SBaptiste Daroussin #undef YYMAXDEPTH 3160c8de5b0SBaptiste Daroussin #define YYMAXDEPTH YYSTACKSIZE 3170c8de5b0SBaptiste Daroussin #else 3180c8de5b0SBaptiste Daroussin #ifdef YYMAXDEPTH 3190c8de5b0SBaptiste Daroussin #define YYSTACKSIZE YYMAXDEPTH 3200c8de5b0SBaptiste Daroussin #else 3210c8de5b0SBaptiste Daroussin #define YYSTACKSIZE 10000 3220c8de5b0SBaptiste Daroussin #define YYMAXDEPTH 10000 3230c8de5b0SBaptiste Daroussin #endif 3240c8de5b0SBaptiste Daroussin #endif 3250c8de5b0SBaptiste Daroussin 3260c8de5b0SBaptiste Daroussin #define YYINITSTACKSIZE 200 3270c8de5b0SBaptiste Daroussin 3280c8de5b0SBaptiste Daroussin typedef struct { 3290c8de5b0SBaptiste Daroussin unsigned stacksize; 3300c8de5b0SBaptiste Daroussin YYINT *s_base; 3310c8de5b0SBaptiste Daroussin YYINT *s_mark; 3320c8de5b0SBaptiste Daroussin YYINT *s_last; 3330c8de5b0SBaptiste Daroussin YYSTYPE *l_base; 3340c8de5b0SBaptiste Daroussin YYSTYPE *l_mark; 3350c8de5b0SBaptiste Daroussin } YYSTACKDATA; 3360c8de5b0SBaptiste Daroussin #line 104 "ok_syntax1.y" 3370c8de5b0SBaptiste Daroussin /* start of programs */ 3380c8de5b0SBaptiste Daroussin 3390c8de5b0SBaptiste Daroussin #ifdef YYBYACC 3400c8de5b0SBaptiste Daroussin extern int YYLEX_DECL(); 3410c8de5b0SBaptiste Daroussin #endif 3420c8de5b0SBaptiste Daroussin 3430c8de5b0SBaptiste Daroussin int 3440c8de5b0SBaptiste Daroussin main (void) 3450c8de5b0SBaptiste Daroussin { 3460c8de5b0SBaptiste Daroussin int regs[26]; 3470c8de5b0SBaptiste Daroussin int base = 10; 3480c8de5b0SBaptiste Daroussin 3490c8de5b0SBaptiste Daroussin while(!feof(stdin)) { 3500c8de5b0SBaptiste Daroussin yyparse(regs, &base); 3510c8de5b0SBaptiste Daroussin } 3520c8de5b0SBaptiste Daroussin return 0; 3530c8de5b0SBaptiste Daroussin } 3540c8de5b0SBaptiste Daroussin 3550c8de5b0SBaptiste Daroussin #define UNUSED(x) ((void)(x)) 3560c8de5b0SBaptiste Daroussin 3570c8de5b0SBaptiste Daroussin static void 3580c8de5b0SBaptiste Daroussin YYERROR_DECL() 3590c8de5b0SBaptiste Daroussin { 3600c8de5b0SBaptiste Daroussin UNUSED(regs); /* %parse-param regs is not actually used here */ 3610c8de5b0SBaptiste Daroussin UNUSED(base); /* %parse-param base is not actually used here */ 3620c8de5b0SBaptiste Daroussin fprintf(stderr, "%s\n", s); 3630c8de5b0SBaptiste Daroussin } 3640c8de5b0SBaptiste Daroussin 3650c8de5b0SBaptiste Daroussin int 3660c8de5b0SBaptiste Daroussin YYLEX_DECL() 3670c8de5b0SBaptiste Daroussin { 3680c8de5b0SBaptiste Daroussin /* lexical analysis routine */ 3690c8de5b0SBaptiste Daroussin /* returns LETTER for a lower case letter, yylval = 0 through 25 */ 3700c8de5b0SBaptiste Daroussin /* return DIGIT for a digit, yylval = 0 through 9 */ 3710c8de5b0SBaptiste Daroussin /* all other characters are returned immediately */ 3720c8de5b0SBaptiste Daroussin 3730c8de5b0SBaptiste Daroussin int c; 3740c8de5b0SBaptiste Daroussin 3750c8de5b0SBaptiste Daroussin while( (c=getchar()) == ' ' ) { /* skip blanks */ } 3760c8de5b0SBaptiste Daroussin 3770c8de5b0SBaptiste Daroussin /* c is now nonblank */ 3780c8de5b0SBaptiste Daroussin 3790c8de5b0SBaptiste Daroussin if( islower( c )) { 3800c8de5b0SBaptiste Daroussin yylval->ival = (c - 'a'); 3810c8de5b0SBaptiste Daroussin return ( LETTER ); 3820c8de5b0SBaptiste Daroussin } 3830c8de5b0SBaptiste Daroussin if( isdigit( c )) { 3840c8de5b0SBaptiste Daroussin yylval->ival = (c - '0') % (*base); 3850c8de5b0SBaptiste Daroussin return ( DIGIT ); 3860c8de5b0SBaptiste Daroussin } 3870c8de5b0SBaptiste Daroussin return( c ); 3880c8de5b0SBaptiste Daroussin } 389b53bb29fSJung-uk Kim #line 390 "ok_syntax1.tab.c" 3900c8de5b0SBaptiste Daroussin 3910c8de5b0SBaptiste Daroussin #if YYDEBUG 3920c8de5b0SBaptiste Daroussin #include <stdio.h> /* needed for printf */ 3930c8de5b0SBaptiste Daroussin #endif 3940c8de5b0SBaptiste Daroussin 3950c8de5b0SBaptiste Daroussin #include <stdlib.h> /* needed for malloc, etc */ 3960c8de5b0SBaptiste Daroussin #include <string.h> /* needed for memset */ 3970c8de5b0SBaptiste Daroussin 3980c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 3990c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data) 4000c8de5b0SBaptiste Daroussin { 4010c8de5b0SBaptiste Daroussin int i; 4020c8de5b0SBaptiste Daroussin unsigned newsize; 4030c8de5b0SBaptiste Daroussin YYINT *newss; 4040c8de5b0SBaptiste Daroussin YYSTYPE *newvs; 4050c8de5b0SBaptiste Daroussin 4060c8de5b0SBaptiste Daroussin if ((newsize = data->stacksize) == 0) 4070c8de5b0SBaptiste Daroussin newsize = YYINITSTACKSIZE; 4080c8de5b0SBaptiste Daroussin else if (newsize >= YYMAXDEPTH) 4090c8de5b0SBaptiste Daroussin return YYENOMEM; 4100c8de5b0SBaptiste Daroussin else if ((newsize *= 2) > YYMAXDEPTH) 4110c8de5b0SBaptiste Daroussin newsize = YYMAXDEPTH; 4120c8de5b0SBaptiste Daroussin 4130c8de5b0SBaptiste Daroussin i = (int) (data->s_mark - data->s_base); 4140c8de5b0SBaptiste Daroussin newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 415*bf80e08eSJung-uk Kim if (newss == NULL) 4160c8de5b0SBaptiste Daroussin return YYENOMEM; 4170c8de5b0SBaptiste Daroussin 4180c8de5b0SBaptiste Daroussin data->s_base = newss; 4190c8de5b0SBaptiste Daroussin data->s_mark = newss + i; 4200c8de5b0SBaptiste Daroussin 4210c8de5b0SBaptiste Daroussin newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 422*bf80e08eSJung-uk Kim if (newvs == NULL) 4230c8de5b0SBaptiste Daroussin return YYENOMEM; 4240c8de5b0SBaptiste Daroussin 4250c8de5b0SBaptiste Daroussin data->l_base = newvs; 4260c8de5b0SBaptiste Daroussin data->l_mark = newvs + i; 4270c8de5b0SBaptiste Daroussin 4280c8de5b0SBaptiste Daroussin data->stacksize = newsize; 4290c8de5b0SBaptiste Daroussin data->s_last = data->s_base + newsize - 1; 4300c8de5b0SBaptiste Daroussin return 0; 4310c8de5b0SBaptiste Daroussin } 4320c8de5b0SBaptiste Daroussin 4330c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS) 4340c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data) 4350c8de5b0SBaptiste Daroussin { 4360c8de5b0SBaptiste Daroussin free(data->s_base); 4370c8de5b0SBaptiste Daroussin free(data->l_base); 4380c8de5b0SBaptiste Daroussin memset(data, 0, sizeof(*data)); 4390c8de5b0SBaptiste Daroussin } 4400c8de5b0SBaptiste Daroussin #else 4410c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */ 4420c8de5b0SBaptiste Daroussin #endif 4430c8de5b0SBaptiste Daroussin 4440c8de5b0SBaptiste Daroussin #define YYABORT goto yyabort 4450c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort 4460c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept 4470c8de5b0SBaptiste Daroussin #define YYERROR goto yyerrlab 4480c8de5b0SBaptiste Daroussin 4490c8de5b0SBaptiste Daroussin int 4500c8de5b0SBaptiste Daroussin YYPARSE_DECL() 4510c8de5b0SBaptiste Daroussin { 4520c8de5b0SBaptiste Daroussin int yyerrflag; 4530c8de5b0SBaptiste Daroussin int yychar; 4540c8de5b0SBaptiste Daroussin YYSTYPE yyval; 4550c8de5b0SBaptiste Daroussin YYSTYPE yylval; 456b53bb29fSJung-uk Kim int yynerrs; 4570c8de5b0SBaptiste Daroussin 4580c8de5b0SBaptiste Daroussin /* variables for the parser stack */ 4590c8de5b0SBaptiste Daroussin YYSTACKDATA yystack; 4600c8de5b0SBaptiste Daroussin int yym, yyn, yystate; 4610c8de5b0SBaptiste Daroussin #if YYDEBUG 4620c8de5b0SBaptiste Daroussin const char *yys; 4630c8de5b0SBaptiste Daroussin 464*bf80e08eSJung-uk Kim if ((yys = getenv("YYDEBUG")) != NULL) 4650c8de5b0SBaptiste Daroussin { 4660c8de5b0SBaptiste Daroussin yyn = *yys; 4670c8de5b0SBaptiste Daroussin if (yyn >= '0' && yyn <= '9') 4680c8de5b0SBaptiste Daroussin yydebug = yyn - '0'; 4690c8de5b0SBaptiste Daroussin } 4700c8de5b0SBaptiste Daroussin #endif 4710c8de5b0SBaptiste Daroussin 4726166fdceSJung-uk Kim memset(&yyval, 0, sizeof(yyval)); 4736166fdceSJung-uk Kim memset(&yylval, 0, sizeof(yylval)); 4746166fdceSJung-uk Kim 475c5b5d71aSJung-uk Kim yym = 0; 476c5b5d71aSJung-uk Kim yyn = 0; 4770c8de5b0SBaptiste Daroussin yynerrs = 0; 4780c8de5b0SBaptiste Daroussin yyerrflag = 0; 4790c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 4800c8de5b0SBaptiste Daroussin yystate = 0; 4810c8de5b0SBaptiste Daroussin 4820c8de5b0SBaptiste Daroussin #if YYPURE 4830c8de5b0SBaptiste Daroussin memset(&yystack, 0, sizeof(yystack)); 4840c8de5b0SBaptiste Daroussin #endif 4850c8de5b0SBaptiste Daroussin 4860c8de5b0SBaptiste Daroussin if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 4870c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base; 4880c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base; 4890c8de5b0SBaptiste Daroussin yystate = 0; 4900c8de5b0SBaptiste Daroussin *yystack.s_mark = 0; 4910c8de5b0SBaptiste Daroussin 4920c8de5b0SBaptiste Daroussin yyloop: 4930c8de5b0SBaptiste Daroussin if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 4940c8de5b0SBaptiste Daroussin if (yychar < 0) 4950c8de5b0SBaptiste Daroussin { 496c5b5d71aSJung-uk Kim yychar = YYLEX; 497c5b5d71aSJung-uk Kim if (yychar < 0) yychar = YYEOF; 4980c8de5b0SBaptiste Daroussin #if YYDEBUG 4990c8de5b0SBaptiste Daroussin if (yydebug) 5000c8de5b0SBaptiste Daroussin { 501c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 5020c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n", 5030c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys); 5040c8de5b0SBaptiste Daroussin } 5050c8de5b0SBaptiste Daroussin #endif 5060c8de5b0SBaptiste Daroussin } 507c5b5d71aSJung-uk Kim if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 508c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 5090c8de5b0SBaptiste Daroussin { 5100c8de5b0SBaptiste Daroussin #if YYDEBUG 5110c8de5b0SBaptiste Daroussin if (yydebug) 5120c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, shifting to state %d\n", 5130c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yytable[yyn]); 5140c8de5b0SBaptiste Daroussin #endif 515c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 5160c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 5170c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn]; 5180c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval; 5190c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 5200c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag; 5210c8de5b0SBaptiste Daroussin goto yyloop; 5220c8de5b0SBaptiste Daroussin } 523c5b5d71aSJung-uk Kim if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 524c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 5250c8de5b0SBaptiste Daroussin { 5260c8de5b0SBaptiste Daroussin yyn = yytable[yyn]; 5270c8de5b0SBaptiste Daroussin goto yyreduce; 5280c8de5b0SBaptiste Daroussin } 529c5b5d71aSJung-uk Kim if (yyerrflag != 0) goto yyinrecovery; 5300c8de5b0SBaptiste Daroussin 5310c8de5b0SBaptiste Daroussin YYERROR_CALL("syntax error"); 5320c8de5b0SBaptiste Daroussin 533c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 5340c8de5b0SBaptiste Daroussin yyerrlab: 5350c8de5b0SBaptiste Daroussin ++yynerrs; 5360c8de5b0SBaptiste Daroussin 5370c8de5b0SBaptiste Daroussin yyinrecovery: 5380c8de5b0SBaptiste Daroussin if (yyerrflag < 3) 5390c8de5b0SBaptiste Daroussin { 5400c8de5b0SBaptiste Daroussin yyerrflag = 3; 5410c8de5b0SBaptiste Daroussin for (;;) 5420c8de5b0SBaptiste Daroussin { 543c5b5d71aSJung-uk Kim if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 544c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 5450c8de5b0SBaptiste Daroussin { 5460c8de5b0SBaptiste Daroussin #if YYDEBUG 5470c8de5b0SBaptiste Daroussin if (yydebug) 5480c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery shifting\ 5490c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 5500c8de5b0SBaptiste Daroussin #endif 551c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 5520c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 5530c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn]; 5540c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval; 5550c8de5b0SBaptiste Daroussin goto yyloop; 5560c8de5b0SBaptiste Daroussin } 5570c8de5b0SBaptiste Daroussin else 5580c8de5b0SBaptiste Daroussin { 5590c8de5b0SBaptiste Daroussin #if YYDEBUG 5600c8de5b0SBaptiste Daroussin if (yydebug) 5610c8de5b0SBaptiste Daroussin printf("%sdebug: error recovery discarding state %d\n", 5620c8de5b0SBaptiste Daroussin YYPREFIX, *yystack.s_mark); 5630c8de5b0SBaptiste Daroussin #endif 5640c8de5b0SBaptiste Daroussin if (yystack.s_mark <= yystack.s_base) goto yyabort; 5650c8de5b0SBaptiste Daroussin --yystack.s_mark; 5660c8de5b0SBaptiste Daroussin --yystack.l_mark; 5670c8de5b0SBaptiste Daroussin } 5680c8de5b0SBaptiste Daroussin } 5690c8de5b0SBaptiste Daroussin } 5700c8de5b0SBaptiste Daroussin else 5710c8de5b0SBaptiste Daroussin { 5720c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyabort; 5730c8de5b0SBaptiste Daroussin #if YYDEBUG 5740c8de5b0SBaptiste Daroussin if (yydebug) 5750c8de5b0SBaptiste Daroussin { 576c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 5770c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 5780c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys); 5790c8de5b0SBaptiste Daroussin } 5800c8de5b0SBaptiste Daroussin #endif 5810c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 5820c8de5b0SBaptiste Daroussin goto yyloop; 5830c8de5b0SBaptiste Daroussin } 5840c8de5b0SBaptiste Daroussin 5850c8de5b0SBaptiste Daroussin yyreduce: 5860c8de5b0SBaptiste Daroussin #if YYDEBUG 5870c8de5b0SBaptiste Daroussin if (yydebug) 5880c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reducing by rule %d (%s)\n", 5890c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yyn, yyrule[yyn]); 5900c8de5b0SBaptiste Daroussin #endif 5910c8de5b0SBaptiste Daroussin yym = yylen[yyn]; 592c5b5d71aSJung-uk Kim if (yym > 0) 5930c8de5b0SBaptiste Daroussin yyval = yystack.l_mark[1-yym]; 5940c8de5b0SBaptiste Daroussin else 5950c8de5b0SBaptiste Daroussin memset(&yyval, 0, sizeof yyval); 596c5b5d71aSJung-uk Kim 5970c8de5b0SBaptiste Daroussin switch (yyn) 5980c8de5b0SBaptiste Daroussin { 5990c8de5b0SBaptiste Daroussin case 3: 6000c8de5b0SBaptiste Daroussin #line 66 "ok_syntax1.y" 6010c8de5b0SBaptiste Daroussin { yyerrok ; } 6020c8de5b0SBaptiste Daroussin break; 6030c8de5b0SBaptiste Daroussin case 4: 6040c8de5b0SBaptiste Daroussin #line 70 "ok_syntax1.y" 6050c8de5b0SBaptiste Daroussin { printf("%d\n",yystack.l_mark[0].ival);} 6060c8de5b0SBaptiste Daroussin break; 6070c8de5b0SBaptiste Daroussin case 5: 6080c8de5b0SBaptiste Daroussin #line 72 "ok_syntax1.y" 6090c8de5b0SBaptiste Daroussin { regs[yystack.l_mark[-2].ival] = yystack.l_mark[0].ival; } 6100c8de5b0SBaptiste Daroussin break; 6110c8de5b0SBaptiste Daroussin case 6: 6120c8de5b0SBaptiste Daroussin #line 76 "ok_syntax1.y" 6130c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-1].ival; } 6140c8de5b0SBaptiste Daroussin break; 6150c8de5b0SBaptiste Daroussin case 7: 6160c8de5b0SBaptiste Daroussin #line 78 "ok_syntax1.y" 6170c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival + yystack.l_mark[0].ival; } 6180c8de5b0SBaptiste Daroussin break; 6190c8de5b0SBaptiste Daroussin case 8: 6200c8de5b0SBaptiste Daroussin #line 80 "ok_syntax1.y" 6210c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival - yystack.l_mark[0].ival; } 6220c8de5b0SBaptiste Daroussin break; 6230c8de5b0SBaptiste Daroussin case 9: 6240c8de5b0SBaptiste Daroussin #line 82 "ok_syntax1.y" 6250c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival * yystack.l_mark[0].ival; } 6260c8de5b0SBaptiste Daroussin break; 6270c8de5b0SBaptiste Daroussin case 10: 6280c8de5b0SBaptiste Daroussin #line 84 "ok_syntax1.y" 6290c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival / yystack.l_mark[0].ival; } 6300c8de5b0SBaptiste Daroussin break; 6310c8de5b0SBaptiste Daroussin case 11: 6320c8de5b0SBaptiste Daroussin #line 86 "ok_syntax1.y" 6330c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival % yystack.l_mark[0].ival; } 6340c8de5b0SBaptiste Daroussin break; 6350c8de5b0SBaptiste Daroussin case 12: 6360c8de5b0SBaptiste Daroussin #line 88 "ok_syntax1.y" 6370c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival & yystack.l_mark[0].ival; } 6380c8de5b0SBaptiste Daroussin break; 6390c8de5b0SBaptiste Daroussin case 13: 6400c8de5b0SBaptiste Daroussin #line 90 "ok_syntax1.y" 6410c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival | yystack.l_mark[0].ival; } 6420c8de5b0SBaptiste Daroussin break; 6430c8de5b0SBaptiste Daroussin case 14: 6440c8de5b0SBaptiste Daroussin #line 92 "ok_syntax1.y" 6450c8de5b0SBaptiste Daroussin { yyval.ival = - yystack.l_mark[0].ival; } 6460c8de5b0SBaptiste Daroussin break; 6470c8de5b0SBaptiste Daroussin case 15: 6480c8de5b0SBaptiste Daroussin #line 94 "ok_syntax1.y" 6490c8de5b0SBaptiste Daroussin { yyval.ival = regs[yystack.l_mark[0].ival]; } 6500c8de5b0SBaptiste Daroussin break; 6510c8de5b0SBaptiste Daroussin case 17: 6520c8de5b0SBaptiste Daroussin #line 99 "ok_syntax1.y" 6530c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[0].ival; (*base) = (yystack.l_mark[0].ival==0) ? 8 : 10; } 6540c8de5b0SBaptiste Daroussin break; 6550c8de5b0SBaptiste Daroussin case 18: 6560c8de5b0SBaptiste Daroussin #line 101 "ok_syntax1.y" 6570c8de5b0SBaptiste Daroussin { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; } 6580c8de5b0SBaptiste Daroussin break; 659b53bb29fSJung-uk Kim #line 660 "ok_syntax1.tab.c" 6600c8de5b0SBaptiste Daroussin } 6610c8de5b0SBaptiste Daroussin yystack.s_mark -= yym; 6620c8de5b0SBaptiste Daroussin yystate = *yystack.s_mark; 6630c8de5b0SBaptiste Daroussin yystack.l_mark -= yym; 6640c8de5b0SBaptiste Daroussin yym = yylhs[yyn]; 6650c8de5b0SBaptiste Daroussin if (yystate == 0 && yym == 0) 6660c8de5b0SBaptiste Daroussin { 6670c8de5b0SBaptiste Daroussin #if YYDEBUG 6680c8de5b0SBaptiste Daroussin if (yydebug) 6690c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state 0 to\ 6700c8de5b0SBaptiste Daroussin state %d\n", YYPREFIX, YYFINAL); 6710c8de5b0SBaptiste Daroussin #endif 6720c8de5b0SBaptiste Daroussin yystate = YYFINAL; 6730c8de5b0SBaptiste Daroussin *++yystack.s_mark = YYFINAL; 6740c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval; 6750c8de5b0SBaptiste Daroussin if (yychar < 0) 6760c8de5b0SBaptiste Daroussin { 677c5b5d71aSJung-uk Kim yychar = YYLEX; 678c5b5d71aSJung-uk Kim if (yychar < 0) yychar = YYEOF; 6790c8de5b0SBaptiste Daroussin #if YYDEBUG 6800c8de5b0SBaptiste Daroussin if (yydebug) 6810c8de5b0SBaptiste Daroussin { 682c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 6830c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n", 6840c8de5b0SBaptiste Daroussin YYPREFIX, YYFINAL, yychar, yys); 6850c8de5b0SBaptiste Daroussin } 6860c8de5b0SBaptiste Daroussin #endif 6870c8de5b0SBaptiste Daroussin } 6880c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyaccept; 6890c8de5b0SBaptiste Daroussin goto yyloop; 6900c8de5b0SBaptiste Daroussin } 691c5b5d71aSJung-uk Kim if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 692c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 6930c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 6940c8de5b0SBaptiste Daroussin else 6950c8de5b0SBaptiste Daroussin yystate = yydgoto[yym]; 6960c8de5b0SBaptiste Daroussin #if YYDEBUG 6970c8de5b0SBaptiste Daroussin if (yydebug) 6980c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state %d \ 6990c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yystate); 7000c8de5b0SBaptiste Daroussin #endif 701c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 7020c8de5b0SBaptiste Daroussin *++yystack.s_mark = (YYINT) yystate; 7030c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval; 7040c8de5b0SBaptiste Daroussin goto yyloop; 7050c8de5b0SBaptiste Daroussin 7060c8de5b0SBaptiste Daroussin yyoverflow: 7070c8de5b0SBaptiste Daroussin YYERROR_CALL("yacc stack overflow"); 7080c8de5b0SBaptiste Daroussin 7090c8de5b0SBaptiste Daroussin yyabort: 7100c8de5b0SBaptiste Daroussin yyfreestack(&yystack); 7110c8de5b0SBaptiste Daroussin return (1); 7120c8de5b0SBaptiste Daroussin 7130c8de5b0SBaptiste Daroussin yyaccept: 7140c8de5b0SBaptiste Daroussin yyfreestack(&yystack); 7150c8de5b0SBaptiste Daroussin return (0); 7160c8de5b0SBaptiste Daroussin } 717