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 119*c5b5d71aSJung-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 3090c8de5b0SBaptiste Daroussin int yydebug; 3100c8de5b0SBaptiste Daroussin int yynerrs; 3110c8de5b0SBaptiste Daroussin 3120c8de5b0SBaptiste Daroussin /* define the initial stack-sizes */ 3130c8de5b0SBaptiste Daroussin #ifdef YYSTACKSIZE 3140c8de5b0SBaptiste Daroussin #undef YYMAXDEPTH 3150c8de5b0SBaptiste Daroussin #define YYMAXDEPTH YYSTACKSIZE 3160c8de5b0SBaptiste Daroussin #else 3170c8de5b0SBaptiste Daroussin #ifdef YYMAXDEPTH 3180c8de5b0SBaptiste Daroussin #define YYSTACKSIZE YYMAXDEPTH 3190c8de5b0SBaptiste Daroussin #else 3200c8de5b0SBaptiste Daroussin #define YYSTACKSIZE 10000 3210c8de5b0SBaptiste Daroussin #define YYMAXDEPTH 10000 3220c8de5b0SBaptiste Daroussin #endif 3230c8de5b0SBaptiste Daroussin #endif 3240c8de5b0SBaptiste Daroussin 3250c8de5b0SBaptiste Daroussin #define YYINITSTACKSIZE 200 3260c8de5b0SBaptiste Daroussin 3270c8de5b0SBaptiste Daroussin typedef struct { 3280c8de5b0SBaptiste Daroussin unsigned stacksize; 3290c8de5b0SBaptiste Daroussin YYINT *s_base; 3300c8de5b0SBaptiste Daroussin YYINT *s_mark; 3310c8de5b0SBaptiste Daroussin YYINT *s_last; 3320c8de5b0SBaptiste Daroussin YYSTYPE *l_base; 3330c8de5b0SBaptiste Daroussin YYSTYPE *l_mark; 3340c8de5b0SBaptiste Daroussin } YYSTACKDATA; 3350c8de5b0SBaptiste Daroussin #line 104 "ok_syntax1.y" 3360c8de5b0SBaptiste Daroussin /* start of programs */ 3370c8de5b0SBaptiste Daroussin 3380c8de5b0SBaptiste Daroussin #ifdef YYBYACC 3390c8de5b0SBaptiste Daroussin extern int YYLEX_DECL(); 3400c8de5b0SBaptiste Daroussin #endif 3410c8de5b0SBaptiste Daroussin 3420c8de5b0SBaptiste Daroussin int 3430c8de5b0SBaptiste Daroussin main (void) 3440c8de5b0SBaptiste Daroussin { 3450c8de5b0SBaptiste Daroussin int regs[26]; 3460c8de5b0SBaptiste Daroussin int base = 10; 3470c8de5b0SBaptiste Daroussin 3480c8de5b0SBaptiste Daroussin while(!feof(stdin)) { 3490c8de5b0SBaptiste Daroussin yyparse(regs, &base); 3500c8de5b0SBaptiste Daroussin } 3510c8de5b0SBaptiste Daroussin return 0; 3520c8de5b0SBaptiste Daroussin } 3530c8de5b0SBaptiste Daroussin 3540c8de5b0SBaptiste Daroussin #define UNUSED(x) ((void)(x)) 3550c8de5b0SBaptiste Daroussin 3560c8de5b0SBaptiste Daroussin static void 3570c8de5b0SBaptiste Daroussin YYERROR_DECL() 3580c8de5b0SBaptiste Daroussin { 3590c8de5b0SBaptiste Daroussin UNUSED(regs); /* %parse-param regs is not actually used here */ 3600c8de5b0SBaptiste Daroussin UNUSED(base); /* %parse-param base is not actually used here */ 3610c8de5b0SBaptiste Daroussin fprintf(stderr, "%s\n", s); 3620c8de5b0SBaptiste Daroussin } 3630c8de5b0SBaptiste Daroussin 3640c8de5b0SBaptiste Daroussin int 3650c8de5b0SBaptiste Daroussin YYLEX_DECL() 3660c8de5b0SBaptiste Daroussin { 3670c8de5b0SBaptiste Daroussin /* lexical analysis routine */ 3680c8de5b0SBaptiste Daroussin /* returns LETTER for a lower case letter, yylval = 0 through 25 */ 3690c8de5b0SBaptiste Daroussin /* return DIGIT for a digit, yylval = 0 through 9 */ 3700c8de5b0SBaptiste Daroussin /* all other characters are returned immediately */ 3710c8de5b0SBaptiste Daroussin 3720c8de5b0SBaptiste Daroussin int c; 3730c8de5b0SBaptiste Daroussin 3740c8de5b0SBaptiste Daroussin while( (c=getchar()) == ' ' ) { /* skip blanks */ } 3750c8de5b0SBaptiste Daroussin 3760c8de5b0SBaptiste Daroussin /* c is now nonblank */ 3770c8de5b0SBaptiste Daroussin 3780c8de5b0SBaptiste Daroussin if( islower( c )) { 3790c8de5b0SBaptiste Daroussin yylval->ival = (c - 'a'); 3800c8de5b0SBaptiste Daroussin return ( LETTER ); 3810c8de5b0SBaptiste Daroussin } 3820c8de5b0SBaptiste Daroussin if( isdigit( c )) { 3830c8de5b0SBaptiste Daroussin yylval->ival = (c - '0') % (*base); 3840c8de5b0SBaptiste Daroussin return ( DIGIT ); 3850c8de5b0SBaptiste Daroussin } 3860c8de5b0SBaptiste Daroussin return( c ); 3870c8de5b0SBaptiste Daroussin } 3880c8de5b0SBaptiste Daroussin #line 389 "ok_syntax1.tab.c" 3890c8de5b0SBaptiste Daroussin 3900c8de5b0SBaptiste Daroussin #if YYDEBUG 3910c8de5b0SBaptiste Daroussin #include <stdio.h> /* needed for printf */ 3920c8de5b0SBaptiste Daroussin #endif 3930c8de5b0SBaptiste Daroussin 3940c8de5b0SBaptiste Daroussin #include <stdlib.h> /* needed for malloc, etc */ 3950c8de5b0SBaptiste Daroussin #include <string.h> /* needed for memset */ 3960c8de5b0SBaptiste Daroussin 3970c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 3980c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data) 3990c8de5b0SBaptiste Daroussin { 4000c8de5b0SBaptiste Daroussin int i; 4010c8de5b0SBaptiste Daroussin unsigned newsize; 4020c8de5b0SBaptiste Daroussin YYINT *newss; 4030c8de5b0SBaptiste Daroussin YYSTYPE *newvs; 4040c8de5b0SBaptiste Daroussin 4050c8de5b0SBaptiste Daroussin if ((newsize = data->stacksize) == 0) 4060c8de5b0SBaptiste Daroussin newsize = YYINITSTACKSIZE; 4070c8de5b0SBaptiste Daroussin else if (newsize >= YYMAXDEPTH) 4080c8de5b0SBaptiste Daroussin return YYENOMEM; 4090c8de5b0SBaptiste Daroussin else if ((newsize *= 2) > YYMAXDEPTH) 4100c8de5b0SBaptiste Daroussin newsize = YYMAXDEPTH; 4110c8de5b0SBaptiste Daroussin 4120c8de5b0SBaptiste Daroussin i = (int) (data->s_mark - data->s_base); 4130c8de5b0SBaptiste Daroussin newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 4140c8de5b0SBaptiste Daroussin if (newss == 0) 4150c8de5b0SBaptiste Daroussin return YYENOMEM; 4160c8de5b0SBaptiste Daroussin 4170c8de5b0SBaptiste Daroussin data->s_base = newss; 4180c8de5b0SBaptiste Daroussin data->s_mark = newss + i; 4190c8de5b0SBaptiste Daroussin 4200c8de5b0SBaptiste Daroussin newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 4210c8de5b0SBaptiste Daroussin if (newvs == 0) 4220c8de5b0SBaptiste Daroussin return YYENOMEM; 4230c8de5b0SBaptiste Daroussin 4240c8de5b0SBaptiste Daroussin data->l_base = newvs; 4250c8de5b0SBaptiste Daroussin data->l_mark = newvs + i; 4260c8de5b0SBaptiste Daroussin 4270c8de5b0SBaptiste Daroussin data->stacksize = newsize; 4280c8de5b0SBaptiste Daroussin data->s_last = data->s_base + newsize - 1; 4290c8de5b0SBaptiste Daroussin return 0; 4300c8de5b0SBaptiste Daroussin } 4310c8de5b0SBaptiste Daroussin 4320c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS) 4330c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data) 4340c8de5b0SBaptiste Daroussin { 4350c8de5b0SBaptiste Daroussin free(data->s_base); 4360c8de5b0SBaptiste Daroussin free(data->l_base); 4370c8de5b0SBaptiste Daroussin memset(data, 0, sizeof(*data)); 4380c8de5b0SBaptiste Daroussin } 4390c8de5b0SBaptiste Daroussin #else 4400c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */ 4410c8de5b0SBaptiste Daroussin #endif 4420c8de5b0SBaptiste Daroussin 4430c8de5b0SBaptiste Daroussin #define YYABORT goto yyabort 4440c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort 4450c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept 4460c8de5b0SBaptiste Daroussin #define YYERROR goto yyerrlab 4470c8de5b0SBaptiste Daroussin 4480c8de5b0SBaptiste Daroussin int 4490c8de5b0SBaptiste Daroussin YYPARSE_DECL() 4500c8de5b0SBaptiste Daroussin { 4510c8de5b0SBaptiste Daroussin int yyerrflag; 4520c8de5b0SBaptiste Daroussin int yychar; 4530c8de5b0SBaptiste Daroussin YYSTYPE yyval; 4540c8de5b0SBaptiste Daroussin YYSTYPE yylval; 4550c8de5b0SBaptiste Daroussin 4560c8de5b0SBaptiste Daroussin /* variables for the parser stack */ 4570c8de5b0SBaptiste Daroussin YYSTACKDATA yystack; 4580c8de5b0SBaptiste Daroussin int yym, yyn, yystate; 4590c8de5b0SBaptiste Daroussin #if YYDEBUG 4600c8de5b0SBaptiste Daroussin const char *yys; 4610c8de5b0SBaptiste Daroussin 4620c8de5b0SBaptiste Daroussin if ((yys = getenv("YYDEBUG")) != 0) 4630c8de5b0SBaptiste Daroussin { 4640c8de5b0SBaptiste Daroussin yyn = *yys; 4650c8de5b0SBaptiste Daroussin if (yyn >= '0' && yyn <= '9') 4660c8de5b0SBaptiste Daroussin yydebug = yyn - '0'; 4670c8de5b0SBaptiste Daroussin } 4680c8de5b0SBaptiste Daroussin #endif 4690c8de5b0SBaptiste Daroussin 470*c5b5d71aSJung-uk Kim yym = 0; 471*c5b5d71aSJung-uk Kim yyn = 0; 4720c8de5b0SBaptiste Daroussin yynerrs = 0; 4730c8de5b0SBaptiste Daroussin yyerrflag = 0; 4740c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 4750c8de5b0SBaptiste Daroussin yystate = 0; 4760c8de5b0SBaptiste Daroussin 4770c8de5b0SBaptiste Daroussin #if YYPURE 4780c8de5b0SBaptiste Daroussin memset(&yystack, 0, sizeof(yystack)); 4790c8de5b0SBaptiste Daroussin #endif 4800c8de5b0SBaptiste Daroussin 4810c8de5b0SBaptiste Daroussin if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 4820c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base; 4830c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base; 4840c8de5b0SBaptiste Daroussin yystate = 0; 4850c8de5b0SBaptiste Daroussin *yystack.s_mark = 0; 4860c8de5b0SBaptiste Daroussin 4870c8de5b0SBaptiste Daroussin yyloop: 4880c8de5b0SBaptiste Daroussin if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 4890c8de5b0SBaptiste Daroussin if (yychar < 0) 4900c8de5b0SBaptiste Daroussin { 491*c5b5d71aSJung-uk Kim yychar = YYLEX; 492*c5b5d71aSJung-uk Kim if (yychar < 0) yychar = YYEOF; 4930c8de5b0SBaptiste Daroussin #if YYDEBUG 4940c8de5b0SBaptiste Daroussin if (yydebug) 4950c8de5b0SBaptiste Daroussin { 496*c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 4970c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n", 4980c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys); 4990c8de5b0SBaptiste Daroussin } 5000c8de5b0SBaptiste Daroussin #endif 5010c8de5b0SBaptiste Daroussin } 502*c5b5d71aSJung-uk Kim if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 503*c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 5040c8de5b0SBaptiste Daroussin { 5050c8de5b0SBaptiste Daroussin #if YYDEBUG 5060c8de5b0SBaptiste Daroussin if (yydebug) 5070c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, shifting to state %d\n", 5080c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yytable[yyn]); 5090c8de5b0SBaptiste Daroussin #endif 510*c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 5110c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 5120c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn]; 5130c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval; 5140c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 5150c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag; 5160c8de5b0SBaptiste Daroussin goto yyloop; 5170c8de5b0SBaptiste Daroussin } 518*c5b5d71aSJung-uk Kim if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 519*c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 5200c8de5b0SBaptiste Daroussin { 5210c8de5b0SBaptiste Daroussin yyn = yytable[yyn]; 5220c8de5b0SBaptiste Daroussin goto yyreduce; 5230c8de5b0SBaptiste Daroussin } 524*c5b5d71aSJung-uk Kim if (yyerrflag != 0) goto yyinrecovery; 5250c8de5b0SBaptiste Daroussin 5260c8de5b0SBaptiste Daroussin YYERROR_CALL("syntax error"); 5270c8de5b0SBaptiste Daroussin 528*c5b5d71aSJung-uk Kim goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 5290c8de5b0SBaptiste Daroussin yyerrlab: 5300c8de5b0SBaptiste Daroussin ++yynerrs; 5310c8de5b0SBaptiste Daroussin 5320c8de5b0SBaptiste Daroussin yyinrecovery: 5330c8de5b0SBaptiste Daroussin if (yyerrflag < 3) 5340c8de5b0SBaptiste Daroussin { 5350c8de5b0SBaptiste Daroussin yyerrflag = 3; 5360c8de5b0SBaptiste Daroussin for (;;) 5370c8de5b0SBaptiste Daroussin { 538*c5b5d71aSJung-uk Kim if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 539*c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 5400c8de5b0SBaptiste Daroussin { 5410c8de5b0SBaptiste Daroussin #if YYDEBUG 5420c8de5b0SBaptiste Daroussin if (yydebug) 5430c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery shifting\ 5440c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 5450c8de5b0SBaptiste Daroussin #endif 546*c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 5470c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 5480c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn]; 5490c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval; 5500c8de5b0SBaptiste Daroussin goto yyloop; 5510c8de5b0SBaptiste Daroussin } 5520c8de5b0SBaptiste Daroussin else 5530c8de5b0SBaptiste Daroussin { 5540c8de5b0SBaptiste Daroussin #if YYDEBUG 5550c8de5b0SBaptiste Daroussin if (yydebug) 5560c8de5b0SBaptiste Daroussin printf("%sdebug: error recovery discarding state %d\n", 5570c8de5b0SBaptiste Daroussin YYPREFIX, *yystack.s_mark); 5580c8de5b0SBaptiste Daroussin #endif 5590c8de5b0SBaptiste Daroussin if (yystack.s_mark <= yystack.s_base) goto yyabort; 5600c8de5b0SBaptiste Daroussin --yystack.s_mark; 5610c8de5b0SBaptiste Daroussin --yystack.l_mark; 5620c8de5b0SBaptiste Daroussin } 5630c8de5b0SBaptiste Daroussin } 5640c8de5b0SBaptiste Daroussin } 5650c8de5b0SBaptiste Daroussin else 5660c8de5b0SBaptiste Daroussin { 5670c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyabort; 5680c8de5b0SBaptiste Daroussin #if YYDEBUG 5690c8de5b0SBaptiste Daroussin if (yydebug) 5700c8de5b0SBaptiste Daroussin { 571*c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 5720c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 5730c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys); 5740c8de5b0SBaptiste Daroussin } 5750c8de5b0SBaptiste Daroussin #endif 5760c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 5770c8de5b0SBaptiste Daroussin goto yyloop; 5780c8de5b0SBaptiste Daroussin } 5790c8de5b0SBaptiste Daroussin 5800c8de5b0SBaptiste Daroussin yyreduce: 5810c8de5b0SBaptiste Daroussin #if YYDEBUG 5820c8de5b0SBaptiste Daroussin if (yydebug) 5830c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reducing by rule %d (%s)\n", 5840c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yyn, yyrule[yyn]); 5850c8de5b0SBaptiste Daroussin #endif 5860c8de5b0SBaptiste Daroussin yym = yylen[yyn]; 587*c5b5d71aSJung-uk Kim if (yym > 0) 5880c8de5b0SBaptiste Daroussin yyval = yystack.l_mark[1-yym]; 5890c8de5b0SBaptiste Daroussin else 5900c8de5b0SBaptiste Daroussin memset(&yyval, 0, sizeof yyval); 591*c5b5d71aSJung-uk Kim 5920c8de5b0SBaptiste Daroussin switch (yyn) 5930c8de5b0SBaptiste Daroussin { 5940c8de5b0SBaptiste Daroussin case 3: 5950c8de5b0SBaptiste Daroussin #line 66 "ok_syntax1.y" 5960c8de5b0SBaptiste Daroussin { yyerrok ; } 5970c8de5b0SBaptiste Daroussin break; 5980c8de5b0SBaptiste Daroussin case 4: 5990c8de5b0SBaptiste Daroussin #line 70 "ok_syntax1.y" 6000c8de5b0SBaptiste Daroussin { printf("%d\n",yystack.l_mark[0].ival);} 6010c8de5b0SBaptiste Daroussin break; 6020c8de5b0SBaptiste Daroussin case 5: 6030c8de5b0SBaptiste Daroussin #line 72 "ok_syntax1.y" 6040c8de5b0SBaptiste Daroussin { regs[yystack.l_mark[-2].ival] = yystack.l_mark[0].ival; } 6050c8de5b0SBaptiste Daroussin break; 6060c8de5b0SBaptiste Daroussin case 6: 6070c8de5b0SBaptiste Daroussin #line 76 "ok_syntax1.y" 6080c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-1].ival; } 6090c8de5b0SBaptiste Daroussin break; 6100c8de5b0SBaptiste Daroussin case 7: 6110c8de5b0SBaptiste Daroussin #line 78 "ok_syntax1.y" 6120c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival + yystack.l_mark[0].ival; } 6130c8de5b0SBaptiste Daroussin break; 6140c8de5b0SBaptiste Daroussin case 8: 6150c8de5b0SBaptiste Daroussin #line 80 "ok_syntax1.y" 6160c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival - yystack.l_mark[0].ival; } 6170c8de5b0SBaptiste Daroussin break; 6180c8de5b0SBaptiste Daroussin case 9: 6190c8de5b0SBaptiste Daroussin #line 82 "ok_syntax1.y" 6200c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival * yystack.l_mark[0].ival; } 6210c8de5b0SBaptiste Daroussin break; 6220c8de5b0SBaptiste Daroussin case 10: 6230c8de5b0SBaptiste Daroussin #line 84 "ok_syntax1.y" 6240c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival / yystack.l_mark[0].ival; } 6250c8de5b0SBaptiste Daroussin break; 6260c8de5b0SBaptiste Daroussin case 11: 6270c8de5b0SBaptiste Daroussin #line 86 "ok_syntax1.y" 6280c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival % yystack.l_mark[0].ival; } 6290c8de5b0SBaptiste Daroussin break; 6300c8de5b0SBaptiste Daroussin case 12: 6310c8de5b0SBaptiste Daroussin #line 88 "ok_syntax1.y" 6320c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival & yystack.l_mark[0].ival; } 6330c8de5b0SBaptiste Daroussin break; 6340c8de5b0SBaptiste Daroussin case 13: 6350c8de5b0SBaptiste Daroussin #line 90 "ok_syntax1.y" 6360c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival | yystack.l_mark[0].ival; } 6370c8de5b0SBaptiste Daroussin break; 6380c8de5b0SBaptiste Daroussin case 14: 6390c8de5b0SBaptiste Daroussin #line 92 "ok_syntax1.y" 6400c8de5b0SBaptiste Daroussin { yyval.ival = - yystack.l_mark[0].ival; } 6410c8de5b0SBaptiste Daroussin break; 6420c8de5b0SBaptiste Daroussin case 15: 6430c8de5b0SBaptiste Daroussin #line 94 "ok_syntax1.y" 6440c8de5b0SBaptiste Daroussin { yyval.ival = regs[yystack.l_mark[0].ival]; } 6450c8de5b0SBaptiste Daroussin break; 6460c8de5b0SBaptiste Daroussin case 17: 6470c8de5b0SBaptiste Daroussin #line 99 "ok_syntax1.y" 6480c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[0].ival; (*base) = (yystack.l_mark[0].ival==0) ? 8 : 10; } 6490c8de5b0SBaptiste Daroussin break; 6500c8de5b0SBaptiste Daroussin case 18: 6510c8de5b0SBaptiste Daroussin #line 101 "ok_syntax1.y" 6520c8de5b0SBaptiste Daroussin { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; } 6530c8de5b0SBaptiste Daroussin break; 654*c5b5d71aSJung-uk Kim #line 655 "ok_syntax1.tab.c" 6550c8de5b0SBaptiste Daroussin } 6560c8de5b0SBaptiste Daroussin yystack.s_mark -= yym; 6570c8de5b0SBaptiste Daroussin yystate = *yystack.s_mark; 6580c8de5b0SBaptiste Daroussin yystack.l_mark -= yym; 6590c8de5b0SBaptiste Daroussin yym = yylhs[yyn]; 6600c8de5b0SBaptiste Daroussin if (yystate == 0 && yym == 0) 6610c8de5b0SBaptiste Daroussin { 6620c8de5b0SBaptiste Daroussin #if YYDEBUG 6630c8de5b0SBaptiste Daroussin if (yydebug) 6640c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state 0 to\ 6650c8de5b0SBaptiste Daroussin state %d\n", YYPREFIX, YYFINAL); 6660c8de5b0SBaptiste Daroussin #endif 6670c8de5b0SBaptiste Daroussin yystate = YYFINAL; 6680c8de5b0SBaptiste Daroussin *++yystack.s_mark = YYFINAL; 6690c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval; 6700c8de5b0SBaptiste Daroussin if (yychar < 0) 6710c8de5b0SBaptiste Daroussin { 672*c5b5d71aSJung-uk Kim yychar = YYLEX; 673*c5b5d71aSJung-uk Kim if (yychar < 0) yychar = YYEOF; 6740c8de5b0SBaptiste Daroussin #if YYDEBUG 6750c8de5b0SBaptiste Daroussin if (yydebug) 6760c8de5b0SBaptiste Daroussin { 677*c5b5d71aSJung-uk Kim if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 6780c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n", 6790c8de5b0SBaptiste Daroussin YYPREFIX, YYFINAL, yychar, yys); 6800c8de5b0SBaptiste Daroussin } 6810c8de5b0SBaptiste Daroussin #endif 6820c8de5b0SBaptiste Daroussin } 6830c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyaccept; 6840c8de5b0SBaptiste Daroussin goto yyloop; 6850c8de5b0SBaptiste Daroussin } 686*c5b5d71aSJung-uk Kim if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 687*c5b5d71aSJung-uk Kim yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 6880c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 6890c8de5b0SBaptiste Daroussin else 6900c8de5b0SBaptiste Daroussin yystate = yydgoto[yym]; 6910c8de5b0SBaptiste Daroussin #if YYDEBUG 6920c8de5b0SBaptiste Daroussin if (yydebug) 6930c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state %d \ 6940c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yystate); 6950c8de5b0SBaptiste Daroussin #endif 696*c5b5d71aSJung-uk Kim if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 6970c8de5b0SBaptiste Daroussin *++yystack.s_mark = (YYINT) yystate; 6980c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval; 6990c8de5b0SBaptiste Daroussin goto yyloop; 7000c8de5b0SBaptiste Daroussin 7010c8de5b0SBaptiste Daroussin yyoverflow: 7020c8de5b0SBaptiste Daroussin YYERROR_CALL("yacc stack overflow"); 7030c8de5b0SBaptiste Daroussin 7040c8de5b0SBaptiste Daroussin yyabort: 7050c8de5b0SBaptiste Daroussin yyfreestack(&yystack); 7060c8de5b0SBaptiste Daroussin return (1); 7070c8de5b0SBaptiste Daroussin 7080c8de5b0SBaptiste Daroussin yyaccept: 7090c8de5b0SBaptiste Daroussin yyfreestack(&yystack); 7100c8de5b0SBaptiste Daroussin return (0); 7110c8de5b0SBaptiste Daroussin } 712