1*0c8de5b0SBaptiste Daroussin /* original parser id follows */ 2*0c8de5b0SBaptiste Daroussin /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3*0c8de5b0SBaptiste Daroussin /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4*0c8de5b0SBaptiste Daroussin 5*0c8de5b0SBaptiste Daroussin #define YYBYACC 1 6*0c8de5b0SBaptiste Daroussin #define YYMAJOR 1 7*0c8de5b0SBaptiste Daroussin #define YYMINOR 9 8*0c8de5b0SBaptiste Daroussin #define YYCHECK "yyyymmdd" 9*0c8de5b0SBaptiste Daroussin 10*0c8de5b0SBaptiste Daroussin #define YYEMPTY (-1) 11*0c8de5b0SBaptiste Daroussin #define yyclearin (yychar = YYEMPTY) 12*0c8de5b0SBaptiste Daroussin #define yyerrok (yyerrflag = 0) 13*0c8de5b0SBaptiste Daroussin #define YYRECOVERING() (yyerrflag != 0) 14*0c8de5b0SBaptiste Daroussin #define YYENOMEM (-2) 15*0c8de5b0SBaptiste Daroussin #define YYEOF 0 16*0c8de5b0SBaptiste Daroussin 17*0c8de5b0SBaptiste Daroussin #ifndef yyparse 18*0c8de5b0SBaptiste Daroussin #define yyparse ok_syntax1_parse 19*0c8de5b0SBaptiste Daroussin #endif /* yyparse */ 20*0c8de5b0SBaptiste Daroussin 21*0c8de5b0SBaptiste Daroussin #ifndef yylex 22*0c8de5b0SBaptiste Daroussin #define yylex ok_syntax1_lex 23*0c8de5b0SBaptiste Daroussin #endif /* yylex */ 24*0c8de5b0SBaptiste Daroussin 25*0c8de5b0SBaptiste Daroussin #ifndef yyerror 26*0c8de5b0SBaptiste Daroussin #define yyerror ok_syntax1_error 27*0c8de5b0SBaptiste Daroussin #endif /* yyerror */ 28*0c8de5b0SBaptiste Daroussin 29*0c8de5b0SBaptiste Daroussin #ifndef yychar 30*0c8de5b0SBaptiste Daroussin #define yychar ok_syntax1_char 31*0c8de5b0SBaptiste Daroussin #endif /* yychar */ 32*0c8de5b0SBaptiste Daroussin 33*0c8de5b0SBaptiste Daroussin #ifndef yyval 34*0c8de5b0SBaptiste Daroussin #define yyval ok_syntax1_val 35*0c8de5b0SBaptiste Daroussin #endif /* yyval */ 36*0c8de5b0SBaptiste Daroussin 37*0c8de5b0SBaptiste Daroussin #ifndef yylval 38*0c8de5b0SBaptiste Daroussin #define yylval ok_syntax1_lval 39*0c8de5b0SBaptiste Daroussin #endif /* yylval */ 40*0c8de5b0SBaptiste Daroussin 41*0c8de5b0SBaptiste Daroussin #ifndef yydebug 42*0c8de5b0SBaptiste Daroussin #define yydebug ok_syntax1_debug 43*0c8de5b0SBaptiste Daroussin #endif /* yydebug */ 44*0c8de5b0SBaptiste Daroussin 45*0c8de5b0SBaptiste Daroussin #ifndef yynerrs 46*0c8de5b0SBaptiste Daroussin #define yynerrs ok_syntax1_nerrs 47*0c8de5b0SBaptiste Daroussin #endif /* yynerrs */ 48*0c8de5b0SBaptiste Daroussin 49*0c8de5b0SBaptiste Daroussin #ifndef yyerrflag 50*0c8de5b0SBaptiste Daroussin #define yyerrflag ok_syntax1_errflag 51*0c8de5b0SBaptiste Daroussin #endif /* yyerrflag */ 52*0c8de5b0SBaptiste Daroussin 53*0c8de5b0SBaptiste Daroussin #ifndef yylhs 54*0c8de5b0SBaptiste Daroussin #define yylhs ok_syntax1_lhs 55*0c8de5b0SBaptiste Daroussin #endif /* yylhs */ 56*0c8de5b0SBaptiste Daroussin 57*0c8de5b0SBaptiste Daroussin #ifndef yylen 58*0c8de5b0SBaptiste Daroussin #define yylen ok_syntax1_len 59*0c8de5b0SBaptiste Daroussin #endif /* yylen */ 60*0c8de5b0SBaptiste Daroussin 61*0c8de5b0SBaptiste Daroussin #ifndef yydefred 62*0c8de5b0SBaptiste Daroussin #define yydefred ok_syntax1_defred 63*0c8de5b0SBaptiste Daroussin #endif /* yydefred */ 64*0c8de5b0SBaptiste Daroussin 65*0c8de5b0SBaptiste Daroussin #ifndef yydgoto 66*0c8de5b0SBaptiste Daroussin #define yydgoto ok_syntax1_dgoto 67*0c8de5b0SBaptiste Daroussin #endif /* yydgoto */ 68*0c8de5b0SBaptiste Daroussin 69*0c8de5b0SBaptiste Daroussin #ifndef yysindex 70*0c8de5b0SBaptiste Daroussin #define yysindex ok_syntax1_sindex 71*0c8de5b0SBaptiste Daroussin #endif /* yysindex */ 72*0c8de5b0SBaptiste Daroussin 73*0c8de5b0SBaptiste Daroussin #ifndef yyrindex 74*0c8de5b0SBaptiste Daroussin #define yyrindex ok_syntax1_rindex 75*0c8de5b0SBaptiste Daroussin #endif /* yyrindex */ 76*0c8de5b0SBaptiste Daroussin 77*0c8de5b0SBaptiste Daroussin #ifndef yygindex 78*0c8de5b0SBaptiste Daroussin #define yygindex ok_syntax1_gindex 79*0c8de5b0SBaptiste Daroussin #endif /* yygindex */ 80*0c8de5b0SBaptiste Daroussin 81*0c8de5b0SBaptiste Daroussin #ifndef yytable 82*0c8de5b0SBaptiste Daroussin #define yytable ok_syntax1_table 83*0c8de5b0SBaptiste Daroussin #endif /* yytable */ 84*0c8de5b0SBaptiste Daroussin 85*0c8de5b0SBaptiste Daroussin #ifndef yycheck 86*0c8de5b0SBaptiste Daroussin #define yycheck ok_syntax1_check 87*0c8de5b0SBaptiste Daroussin #endif /* yycheck */ 88*0c8de5b0SBaptiste Daroussin 89*0c8de5b0SBaptiste Daroussin #ifndef yyname 90*0c8de5b0SBaptiste Daroussin #define yyname ok_syntax1_name 91*0c8de5b0SBaptiste Daroussin #endif /* yyname */ 92*0c8de5b0SBaptiste Daroussin 93*0c8de5b0SBaptiste Daroussin #ifndef yyrule 94*0c8de5b0SBaptiste Daroussin #define yyrule ok_syntax1_rule 95*0c8de5b0SBaptiste Daroussin #endif /* yyrule */ 96*0c8de5b0SBaptiste Daroussin #define YYPREFIX "ok_syntax1_" 97*0c8de5b0SBaptiste Daroussin 98*0c8de5b0SBaptiste Daroussin #define YYPURE 1 99*0c8de5b0SBaptiste Daroussin 100*0c8de5b0SBaptiste Daroussin #line 9 "ok_syntax1.y" 101*0c8de5b0SBaptiste Daroussin # include <stdio.h> 102*0c8de5b0SBaptiste Daroussin # include <ctype.h> 103*0c8de5b0SBaptiste Daroussin 104*0c8de5b0SBaptiste Daroussin #ifdef YYBISON 105*0c8de5b0SBaptiste Daroussin #define YYSTYPE int 106*0c8de5b0SBaptiste Daroussin #define YYLEX_PARAM base 107*0c8de5b0SBaptiste Daroussin #define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM) 108*0c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s) 109*0c8de5b0SBaptiste Daroussin int YYLEX_DECL(); 110*0c8de5b0SBaptiste Daroussin static void YYERROR_DECL(); 111*0c8de5b0SBaptiste Daroussin #endif 112*0c8de5b0SBaptiste Daroussin 113*0c8de5b0SBaptiste Daroussin #line 43 "ok_syntax1.y" 114*0c8de5b0SBaptiste Daroussin #ifdef YYSTYPE 115*0c8de5b0SBaptiste Daroussin #undef YYSTYPE_IS_DECLARED 116*0c8de5b0SBaptiste Daroussin #define YYSTYPE_IS_DECLARED 1 117*0c8de5b0SBaptiste Daroussin #endif 118*0c8de5b0SBaptiste Daroussin #ifndef YYSTYPE_IS_DECLARED 119*0c8de5b0SBaptiste Daroussin #define YYSTYPE_IS_DECLARED 1 120*0c8de5b0SBaptiste Daroussin typedef union 121*0c8de5b0SBaptiste Daroussin { 122*0c8de5b0SBaptiste Daroussin char * cval; 123*0c8de5b0SBaptiste Daroussin int ival; 124*0c8de5b0SBaptiste Daroussin double dval; 125*0c8de5b0SBaptiste Daroussin } YYSTYPE; 126*0c8de5b0SBaptiste Daroussin #endif /* !YYSTYPE_IS_DECLARED */ 127*0c8de5b0SBaptiste Daroussin #line 128 "ok_syntax1.tab.c" 128*0c8de5b0SBaptiste Daroussin 129*0c8de5b0SBaptiste Daroussin /* compatibility with bison */ 130*0c8de5b0SBaptiste Daroussin #ifdef YYPARSE_PARAM 131*0c8de5b0SBaptiste Daroussin /* compatibility with FreeBSD */ 132*0c8de5b0SBaptiste Daroussin # ifdef YYPARSE_PARAM_TYPE 133*0c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 134*0c8de5b0SBaptiste Daroussin # else 135*0c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 136*0c8de5b0SBaptiste Daroussin # endif 137*0c8de5b0SBaptiste Daroussin #else 138*0c8de5b0SBaptiste Daroussin # define YYPARSE_DECL() yyparse(int regs[26], int * base) 139*0c8de5b0SBaptiste Daroussin #endif 140*0c8de5b0SBaptiste Daroussin 141*0c8de5b0SBaptiste Daroussin /* Parameters sent to lex. */ 142*0c8de5b0SBaptiste Daroussin #ifdef YYLEX_PARAM 143*0c8de5b0SBaptiste Daroussin # ifdef YYLEX_PARAM_TYPE 144*0c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, YYLEX_PARAM_TYPE YYLEX_PARAM) 145*0c8de5b0SBaptiste Daroussin # else 146*0c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, void * YYLEX_PARAM) 147*0c8de5b0SBaptiste Daroussin # endif 148*0c8de5b0SBaptiste Daroussin # define YYLEX yylex(&yylval, YYLEX_PARAM) 149*0c8de5b0SBaptiste Daroussin #else 150*0c8de5b0SBaptiste Daroussin # define YYLEX_DECL() yylex(YYSTYPE *yylval, int * base) 151*0c8de5b0SBaptiste Daroussin # define YYLEX yylex(&yylval, base) 152*0c8de5b0SBaptiste Daroussin #endif 153*0c8de5b0SBaptiste Daroussin 154*0c8de5b0SBaptiste Daroussin /* Parameters sent to yyerror. */ 155*0c8de5b0SBaptiste Daroussin #ifndef YYERROR_DECL 156*0c8de5b0SBaptiste Daroussin #define YYERROR_DECL() yyerror(int regs[26], int * base, const char *s) 157*0c8de5b0SBaptiste Daroussin #endif 158*0c8de5b0SBaptiste Daroussin #ifndef YYERROR_CALL 159*0c8de5b0SBaptiste Daroussin #define YYERROR_CALL(msg) yyerror(regs, base, msg) 160*0c8de5b0SBaptiste Daroussin #endif 161*0c8de5b0SBaptiste Daroussin 162*0c8de5b0SBaptiste Daroussin extern int YYPARSE_DECL(); 163*0c8de5b0SBaptiste Daroussin 164*0c8de5b0SBaptiste Daroussin #define DIGIT 257 165*0c8de5b0SBaptiste Daroussin #define LETTER 258 166*0c8de5b0SBaptiste Daroussin #define OCT1 259 167*0c8de5b0SBaptiste Daroussin #define HEX1 260 168*0c8de5b0SBaptiste Daroussin #define HEX2 261 169*0c8de5b0SBaptiste Daroussin #define HEX3 262 170*0c8de5b0SBaptiste Daroussin #define STR1 263 171*0c8de5b0SBaptiste Daroussin #define STR2 265 172*0c8de5b0SBaptiste Daroussin #define BELL 266 173*0c8de5b0SBaptiste Daroussin #define BS 267 174*0c8de5b0SBaptiste Daroussin #define NL 268 175*0c8de5b0SBaptiste Daroussin #define LF 269 176*0c8de5b0SBaptiste Daroussin #define CR 270 177*0c8de5b0SBaptiste Daroussin #define TAB 271 178*0c8de5b0SBaptiste Daroussin #define VT 272 179*0c8de5b0SBaptiste Daroussin #define UMINUS 273 180*0c8de5b0SBaptiste Daroussin #define YYERRCODE 256 181*0c8de5b0SBaptiste Daroussin typedef short YYINT; 182*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_lhs[] = { -1, 183*0c8de5b0SBaptiste Daroussin 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 184*0c8de5b0SBaptiste Daroussin 2, 2, 2, 2, 2, 2, 3, 3, 185*0c8de5b0SBaptiste Daroussin }; 186*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_len[] = { 2, 187*0c8de5b0SBaptiste Daroussin 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, 188*0c8de5b0SBaptiste Daroussin 3, 3, 3, 2, 1, 1, 1, 2, 189*0c8de5b0SBaptiste Daroussin }; 190*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_defred[] = { 1, 191*0c8de5b0SBaptiste Daroussin 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, 192*0c8de5b0SBaptiste Daroussin 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, 193*0c8de5b0SBaptiste Daroussin 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 194*0c8de5b0SBaptiste Daroussin 10, 11, 195*0c8de5b0SBaptiste Daroussin }; 196*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_dgoto[] = { 1, 197*0c8de5b0SBaptiste Daroussin 7, 8, 9, 198*0c8de5b0SBaptiste Daroussin }; 199*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_sindex[] = { 0, 200*0c8de5b0SBaptiste Daroussin -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, 201*0c8de5b0SBaptiste Daroussin -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, 202*0c8de5b0SBaptiste Daroussin -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, 203*0c8de5b0SBaptiste Daroussin 0, 0, 204*0c8de5b0SBaptiste Daroussin }; 205*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_rindex[] = { 0, 206*0c8de5b0SBaptiste Daroussin 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, 207*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 208*0c8de5b0SBaptiste Daroussin 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, 209*0c8de5b0SBaptiste Daroussin 0, 0, 210*0c8de5b0SBaptiste Daroussin }; 211*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_gindex[] = { 0, 212*0c8de5b0SBaptiste Daroussin 0, 65, 0, 213*0c8de5b0SBaptiste Daroussin }; 214*0c8de5b0SBaptiste Daroussin #define YYTABLESIZE 220 215*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_table[] = { 6, 216*0c8de5b0SBaptiste Daroussin 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, 217*0c8de5b0SBaptiste Daroussin 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, 218*0c8de5b0SBaptiste Daroussin 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, 219*0c8de5b0SBaptiste Daroussin 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, 220*0c8de5b0SBaptiste Daroussin 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, 221*0c8de5b0SBaptiste Daroussin 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, 222*0c8de5b0SBaptiste Daroussin 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, 223*0c8de5b0SBaptiste Daroussin 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, 224*0c8de5b0SBaptiste Daroussin 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, 225*0c8de5b0SBaptiste Daroussin 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, 226*0c8de5b0SBaptiste Daroussin 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, 227*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, 228*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, 229*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, 230*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 231*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 234*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237*0c8de5b0SBaptiste Daroussin 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, 238*0c8de5b0SBaptiste Daroussin }; 239*0c8de5b0SBaptiste Daroussin static const YYINT ok_syntax1_check[] = { 40, 240*0c8de5b0SBaptiste Daroussin 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, 241*0c8de5b0SBaptiste Daroussin 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, 242*0c8de5b0SBaptiste Daroussin -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, 243*0c8de5b0SBaptiste Daroussin -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, 244*0c8de5b0SBaptiste Daroussin -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, 245*0c8de5b0SBaptiste Daroussin 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, 246*0c8de5b0SBaptiste Daroussin -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, 247*0c8de5b0SBaptiste Daroussin 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, 248*0c8de5b0SBaptiste Daroussin 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, 249*0c8de5b0SBaptiste Daroussin -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, 250*0c8de5b0SBaptiste Daroussin -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, 251*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, 252*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, 253*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, 254*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, 255*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 258*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 259*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 260*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 261*0c8de5b0SBaptiste Daroussin -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, 262*0c8de5b0SBaptiste Daroussin }; 263*0c8de5b0SBaptiste Daroussin #define YYFINAL 1 264*0c8de5b0SBaptiste Daroussin #ifndef YYDEBUG 265*0c8de5b0SBaptiste Daroussin #define YYDEBUG 0 266*0c8de5b0SBaptiste Daroussin #endif 267*0c8de5b0SBaptiste Daroussin #define YYMAXTOKEN 273 268*0c8de5b0SBaptiste Daroussin #define YYUNDFTOKEN 279 269*0c8de5b0SBaptiste Daroussin #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 270*0c8de5b0SBaptiste Daroussin #if YYDEBUG 271*0c8de5b0SBaptiste Daroussin static const char *const ok_syntax1_name[] = { 272*0c8de5b0SBaptiste Daroussin 273*0c8de5b0SBaptiste Daroussin "end-of-file",0,0,0,0,0,0,"'\\a'","'\\b'","'\\t'","'\\n'","'\\v'","'\\f'", 274*0c8de5b0SBaptiste 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,"'('", 275*0c8de5b0SBaptiste Daroussin "')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,"'='",0,0,"'@'",0,0, 276*0c8de5b0SBaptiste 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, 277*0c8de5b0SBaptiste 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, 278*0c8de5b0SBaptiste 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, 279*0c8de5b0SBaptiste 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, 280*0c8de5b0SBaptiste 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, 281*0c8de5b0SBaptiste Daroussin "'\\377'",0,"DIGIT","LETTER","OCT1","HEX1","HEX2","HEX3","STR1", 282*0c8de5b0SBaptiste Daroussin "\"\\177\\177\\\\\\n\"","STR2","BELL","BS","NL","LF","CR","TAB","VT","UMINUS",0, 283*0c8de5b0SBaptiste Daroussin 0,0,0,0,"illegal-symbol", 284*0c8de5b0SBaptiste Daroussin }; 285*0c8de5b0SBaptiste Daroussin static const char *const ok_syntax1_rule[] = { 286*0c8de5b0SBaptiste Daroussin "$accept : list", 287*0c8de5b0SBaptiste Daroussin "list :", 288*0c8de5b0SBaptiste Daroussin "list : list stat '\\n'", 289*0c8de5b0SBaptiste Daroussin "list : list error '\\n'", 290*0c8de5b0SBaptiste Daroussin "stat : expr", 291*0c8de5b0SBaptiste Daroussin "stat : LETTER '=' expr", 292*0c8de5b0SBaptiste Daroussin "expr : '(' expr ')'", 293*0c8de5b0SBaptiste Daroussin "expr : expr '+' expr", 294*0c8de5b0SBaptiste Daroussin "expr : expr '-' expr", 295*0c8de5b0SBaptiste Daroussin "expr : expr '*' expr", 296*0c8de5b0SBaptiste Daroussin "expr : expr '/' expr", 297*0c8de5b0SBaptiste Daroussin "expr : expr '%' expr", 298*0c8de5b0SBaptiste Daroussin "expr : expr '&' expr", 299*0c8de5b0SBaptiste Daroussin "expr : expr '|' expr", 300*0c8de5b0SBaptiste Daroussin "expr : '-' expr", 301*0c8de5b0SBaptiste Daroussin "expr : LETTER", 302*0c8de5b0SBaptiste Daroussin "expr : number", 303*0c8de5b0SBaptiste Daroussin "number : DIGIT", 304*0c8de5b0SBaptiste Daroussin "number : number DIGIT", 305*0c8de5b0SBaptiste Daroussin 306*0c8de5b0SBaptiste Daroussin }; 307*0c8de5b0SBaptiste Daroussin #endif 308*0c8de5b0SBaptiste Daroussin 309*0c8de5b0SBaptiste Daroussin int yydebug; 310*0c8de5b0SBaptiste Daroussin int yynerrs; 311*0c8de5b0SBaptiste Daroussin 312*0c8de5b0SBaptiste Daroussin /* define the initial stack-sizes */ 313*0c8de5b0SBaptiste Daroussin #ifdef YYSTACKSIZE 314*0c8de5b0SBaptiste Daroussin #undef YYMAXDEPTH 315*0c8de5b0SBaptiste Daroussin #define YYMAXDEPTH YYSTACKSIZE 316*0c8de5b0SBaptiste Daroussin #else 317*0c8de5b0SBaptiste Daroussin #ifdef YYMAXDEPTH 318*0c8de5b0SBaptiste Daroussin #define YYSTACKSIZE YYMAXDEPTH 319*0c8de5b0SBaptiste Daroussin #else 320*0c8de5b0SBaptiste Daroussin #define YYSTACKSIZE 10000 321*0c8de5b0SBaptiste Daroussin #define YYMAXDEPTH 10000 322*0c8de5b0SBaptiste Daroussin #endif 323*0c8de5b0SBaptiste Daroussin #endif 324*0c8de5b0SBaptiste Daroussin 325*0c8de5b0SBaptiste Daroussin #define YYINITSTACKSIZE 200 326*0c8de5b0SBaptiste Daroussin 327*0c8de5b0SBaptiste Daroussin typedef struct { 328*0c8de5b0SBaptiste Daroussin unsigned stacksize; 329*0c8de5b0SBaptiste Daroussin YYINT *s_base; 330*0c8de5b0SBaptiste Daroussin YYINT *s_mark; 331*0c8de5b0SBaptiste Daroussin YYINT *s_last; 332*0c8de5b0SBaptiste Daroussin YYSTYPE *l_base; 333*0c8de5b0SBaptiste Daroussin YYSTYPE *l_mark; 334*0c8de5b0SBaptiste Daroussin } YYSTACKDATA; 335*0c8de5b0SBaptiste Daroussin #line 104 "ok_syntax1.y" 336*0c8de5b0SBaptiste Daroussin /* start of programs */ 337*0c8de5b0SBaptiste Daroussin 338*0c8de5b0SBaptiste Daroussin #ifdef YYBYACC 339*0c8de5b0SBaptiste Daroussin extern int YYLEX_DECL(); 340*0c8de5b0SBaptiste Daroussin #endif 341*0c8de5b0SBaptiste Daroussin 342*0c8de5b0SBaptiste Daroussin int 343*0c8de5b0SBaptiste Daroussin main (void) 344*0c8de5b0SBaptiste Daroussin { 345*0c8de5b0SBaptiste Daroussin int regs[26]; 346*0c8de5b0SBaptiste Daroussin int base = 10; 347*0c8de5b0SBaptiste Daroussin 348*0c8de5b0SBaptiste Daroussin while(!feof(stdin)) { 349*0c8de5b0SBaptiste Daroussin yyparse(regs, &base); 350*0c8de5b0SBaptiste Daroussin } 351*0c8de5b0SBaptiste Daroussin return 0; 352*0c8de5b0SBaptiste Daroussin } 353*0c8de5b0SBaptiste Daroussin 354*0c8de5b0SBaptiste Daroussin #define UNUSED(x) ((void)(x)) 355*0c8de5b0SBaptiste Daroussin 356*0c8de5b0SBaptiste Daroussin static void 357*0c8de5b0SBaptiste Daroussin YYERROR_DECL() 358*0c8de5b0SBaptiste Daroussin { 359*0c8de5b0SBaptiste Daroussin UNUSED(regs); /* %parse-param regs is not actually used here */ 360*0c8de5b0SBaptiste Daroussin UNUSED(base); /* %parse-param base is not actually used here */ 361*0c8de5b0SBaptiste Daroussin fprintf(stderr, "%s\n", s); 362*0c8de5b0SBaptiste Daroussin } 363*0c8de5b0SBaptiste Daroussin 364*0c8de5b0SBaptiste Daroussin int 365*0c8de5b0SBaptiste Daroussin YYLEX_DECL() 366*0c8de5b0SBaptiste Daroussin { 367*0c8de5b0SBaptiste Daroussin /* lexical analysis routine */ 368*0c8de5b0SBaptiste Daroussin /* returns LETTER for a lower case letter, yylval = 0 through 25 */ 369*0c8de5b0SBaptiste Daroussin /* return DIGIT for a digit, yylval = 0 through 9 */ 370*0c8de5b0SBaptiste Daroussin /* all other characters are returned immediately */ 371*0c8de5b0SBaptiste Daroussin 372*0c8de5b0SBaptiste Daroussin int c; 373*0c8de5b0SBaptiste Daroussin 374*0c8de5b0SBaptiste Daroussin while( (c=getchar()) == ' ' ) { /* skip blanks */ } 375*0c8de5b0SBaptiste Daroussin 376*0c8de5b0SBaptiste Daroussin /* c is now nonblank */ 377*0c8de5b0SBaptiste Daroussin 378*0c8de5b0SBaptiste Daroussin if( islower( c )) { 379*0c8de5b0SBaptiste Daroussin yylval->ival = (c - 'a'); 380*0c8de5b0SBaptiste Daroussin return ( LETTER ); 381*0c8de5b0SBaptiste Daroussin } 382*0c8de5b0SBaptiste Daroussin if( isdigit( c )) { 383*0c8de5b0SBaptiste Daroussin yylval->ival = (c - '0') % (*base); 384*0c8de5b0SBaptiste Daroussin return ( DIGIT ); 385*0c8de5b0SBaptiste Daroussin } 386*0c8de5b0SBaptiste Daroussin return( c ); 387*0c8de5b0SBaptiste Daroussin } 388*0c8de5b0SBaptiste Daroussin #line 389 "ok_syntax1.tab.c" 389*0c8de5b0SBaptiste Daroussin 390*0c8de5b0SBaptiste Daroussin #if YYDEBUG 391*0c8de5b0SBaptiste Daroussin #include <stdio.h> /* needed for printf */ 392*0c8de5b0SBaptiste Daroussin #endif 393*0c8de5b0SBaptiste Daroussin 394*0c8de5b0SBaptiste Daroussin #include <stdlib.h> /* needed for malloc, etc */ 395*0c8de5b0SBaptiste Daroussin #include <string.h> /* needed for memset */ 396*0c8de5b0SBaptiste Daroussin 397*0c8de5b0SBaptiste Daroussin /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 398*0c8de5b0SBaptiste Daroussin static int yygrowstack(YYSTACKDATA *data) 399*0c8de5b0SBaptiste Daroussin { 400*0c8de5b0SBaptiste Daroussin int i; 401*0c8de5b0SBaptiste Daroussin unsigned newsize; 402*0c8de5b0SBaptiste Daroussin YYINT *newss; 403*0c8de5b0SBaptiste Daroussin YYSTYPE *newvs; 404*0c8de5b0SBaptiste Daroussin 405*0c8de5b0SBaptiste Daroussin if ((newsize = data->stacksize) == 0) 406*0c8de5b0SBaptiste Daroussin newsize = YYINITSTACKSIZE; 407*0c8de5b0SBaptiste Daroussin else if (newsize >= YYMAXDEPTH) 408*0c8de5b0SBaptiste Daroussin return YYENOMEM; 409*0c8de5b0SBaptiste Daroussin else if ((newsize *= 2) > YYMAXDEPTH) 410*0c8de5b0SBaptiste Daroussin newsize = YYMAXDEPTH; 411*0c8de5b0SBaptiste Daroussin 412*0c8de5b0SBaptiste Daroussin i = (int) (data->s_mark - data->s_base); 413*0c8de5b0SBaptiste Daroussin newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 414*0c8de5b0SBaptiste Daroussin if (newss == 0) 415*0c8de5b0SBaptiste Daroussin return YYENOMEM; 416*0c8de5b0SBaptiste Daroussin 417*0c8de5b0SBaptiste Daroussin data->s_base = newss; 418*0c8de5b0SBaptiste Daroussin data->s_mark = newss + i; 419*0c8de5b0SBaptiste Daroussin 420*0c8de5b0SBaptiste Daroussin newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 421*0c8de5b0SBaptiste Daroussin if (newvs == 0) 422*0c8de5b0SBaptiste Daroussin return YYENOMEM; 423*0c8de5b0SBaptiste Daroussin 424*0c8de5b0SBaptiste Daroussin data->l_base = newvs; 425*0c8de5b0SBaptiste Daroussin data->l_mark = newvs + i; 426*0c8de5b0SBaptiste Daroussin 427*0c8de5b0SBaptiste Daroussin data->stacksize = newsize; 428*0c8de5b0SBaptiste Daroussin data->s_last = data->s_base + newsize - 1; 429*0c8de5b0SBaptiste Daroussin return 0; 430*0c8de5b0SBaptiste Daroussin } 431*0c8de5b0SBaptiste Daroussin 432*0c8de5b0SBaptiste Daroussin #if YYPURE || defined(YY_NO_LEAKS) 433*0c8de5b0SBaptiste Daroussin static void yyfreestack(YYSTACKDATA *data) 434*0c8de5b0SBaptiste Daroussin { 435*0c8de5b0SBaptiste Daroussin free(data->s_base); 436*0c8de5b0SBaptiste Daroussin free(data->l_base); 437*0c8de5b0SBaptiste Daroussin memset(data, 0, sizeof(*data)); 438*0c8de5b0SBaptiste Daroussin } 439*0c8de5b0SBaptiste Daroussin #else 440*0c8de5b0SBaptiste Daroussin #define yyfreestack(data) /* nothing */ 441*0c8de5b0SBaptiste Daroussin #endif 442*0c8de5b0SBaptiste Daroussin 443*0c8de5b0SBaptiste Daroussin #define YYABORT goto yyabort 444*0c8de5b0SBaptiste Daroussin #define YYREJECT goto yyabort 445*0c8de5b0SBaptiste Daroussin #define YYACCEPT goto yyaccept 446*0c8de5b0SBaptiste Daroussin #define YYERROR goto yyerrlab 447*0c8de5b0SBaptiste Daroussin 448*0c8de5b0SBaptiste Daroussin int 449*0c8de5b0SBaptiste Daroussin YYPARSE_DECL() 450*0c8de5b0SBaptiste Daroussin { 451*0c8de5b0SBaptiste Daroussin int yyerrflag; 452*0c8de5b0SBaptiste Daroussin int yychar; 453*0c8de5b0SBaptiste Daroussin YYSTYPE yyval; 454*0c8de5b0SBaptiste Daroussin YYSTYPE yylval; 455*0c8de5b0SBaptiste Daroussin 456*0c8de5b0SBaptiste Daroussin /* variables for the parser stack */ 457*0c8de5b0SBaptiste Daroussin YYSTACKDATA yystack; 458*0c8de5b0SBaptiste Daroussin int yym, yyn, yystate; 459*0c8de5b0SBaptiste Daroussin #if YYDEBUG 460*0c8de5b0SBaptiste Daroussin const char *yys; 461*0c8de5b0SBaptiste Daroussin 462*0c8de5b0SBaptiste Daroussin if ((yys = getenv("YYDEBUG")) != 0) 463*0c8de5b0SBaptiste Daroussin { 464*0c8de5b0SBaptiste Daroussin yyn = *yys; 465*0c8de5b0SBaptiste Daroussin if (yyn >= '0' && yyn <= '9') 466*0c8de5b0SBaptiste Daroussin yydebug = yyn - '0'; 467*0c8de5b0SBaptiste Daroussin } 468*0c8de5b0SBaptiste Daroussin #endif 469*0c8de5b0SBaptiste Daroussin 470*0c8de5b0SBaptiste Daroussin yynerrs = 0; 471*0c8de5b0SBaptiste Daroussin yyerrflag = 0; 472*0c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 473*0c8de5b0SBaptiste Daroussin yystate = 0; 474*0c8de5b0SBaptiste Daroussin 475*0c8de5b0SBaptiste Daroussin #if YYPURE 476*0c8de5b0SBaptiste Daroussin memset(&yystack, 0, sizeof(yystack)); 477*0c8de5b0SBaptiste Daroussin #endif 478*0c8de5b0SBaptiste Daroussin 479*0c8de5b0SBaptiste Daroussin if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 480*0c8de5b0SBaptiste Daroussin yystack.s_mark = yystack.s_base; 481*0c8de5b0SBaptiste Daroussin yystack.l_mark = yystack.l_base; 482*0c8de5b0SBaptiste Daroussin yystate = 0; 483*0c8de5b0SBaptiste Daroussin *yystack.s_mark = 0; 484*0c8de5b0SBaptiste Daroussin 485*0c8de5b0SBaptiste Daroussin yyloop: 486*0c8de5b0SBaptiste Daroussin if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 487*0c8de5b0SBaptiste Daroussin if (yychar < 0) 488*0c8de5b0SBaptiste Daroussin { 489*0c8de5b0SBaptiste Daroussin if ((yychar = YYLEX) < 0) yychar = YYEOF; 490*0c8de5b0SBaptiste Daroussin #if YYDEBUG 491*0c8de5b0SBaptiste Daroussin if (yydebug) 492*0c8de5b0SBaptiste Daroussin { 493*0c8de5b0SBaptiste Daroussin yys = yyname[YYTRANSLATE(yychar)]; 494*0c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n", 495*0c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys); 496*0c8de5b0SBaptiste Daroussin } 497*0c8de5b0SBaptiste Daroussin #endif 498*0c8de5b0SBaptiste Daroussin } 499*0c8de5b0SBaptiste Daroussin if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && 500*0c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 501*0c8de5b0SBaptiste Daroussin { 502*0c8de5b0SBaptiste Daroussin #if YYDEBUG 503*0c8de5b0SBaptiste Daroussin if (yydebug) 504*0c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, shifting to state %d\n", 505*0c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yytable[yyn]); 506*0c8de5b0SBaptiste Daroussin #endif 507*0c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 508*0c8de5b0SBaptiste Daroussin { 509*0c8de5b0SBaptiste Daroussin goto yyoverflow; 510*0c8de5b0SBaptiste Daroussin } 511*0c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 512*0c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn]; 513*0c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval; 514*0c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 515*0c8de5b0SBaptiste Daroussin if (yyerrflag > 0) --yyerrflag; 516*0c8de5b0SBaptiste Daroussin goto yyloop; 517*0c8de5b0SBaptiste Daroussin } 518*0c8de5b0SBaptiste Daroussin if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && 519*0c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 520*0c8de5b0SBaptiste Daroussin { 521*0c8de5b0SBaptiste Daroussin yyn = yytable[yyn]; 522*0c8de5b0SBaptiste Daroussin goto yyreduce; 523*0c8de5b0SBaptiste Daroussin } 524*0c8de5b0SBaptiste Daroussin if (yyerrflag) goto yyinrecovery; 525*0c8de5b0SBaptiste Daroussin 526*0c8de5b0SBaptiste Daroussin YYERROR_CALL("syntax error"); 527*0c8de5b0SBaptiste Daroussin 528*0c8de5b0SBaptiste Daroussin goto yyerrlab; 529*0c8de5b0SBaptiste Daroussin 530*0c8de5b0SBaptiste Daroussin yyerrlab: 531*0c8de5b0SBaptiste Daroussin ++yynerrs; 532*0c8de5b0SBaptiste Daroussin 533*0c8de5b0SBaptiste Daroussin yyinrecovery: 534*0c8de5b0SBaptiste Daroussin if (yyerrflag < 3) 535*0c8de5b0SBaptiste Daroussin { 536*0c8de5b0SBaptiste Daroussin yyerrflag = 3; 537*0c8de5b0SBaptiste Daroussin for (;;) 538*0c8de5b0SBaptiste Daroussin { 539*0c8de5b0SBaptiste Daroussin if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && 540*0c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) 541*0c8de5b0SBaptiste Daroussin { 542*0c8de5b0SBaptiste Daroussin #if YYDEBUG 543*0c8de5b0SBaptiste Daroussin if (yydebug) 544*0c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery shifting\ 545*0c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 546*0c8de5b0SBaptiste Daroussin #endif 547*0c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 548*0c8de5b0SBaptiste Daroussin { 549*0c8de5b0SBaptiste Daroussin goto yyoverflow; 550*0c8de5b0SBaptiste Daroussin } 551*0c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 552*0c8de5b0SBaptiste Daroussin *++yystack.s_mark = yytable[yyn]; 553*0c8de5b0SBaptiste Daroussin *++yystack.l_mark = yylval; 554*0c8de5b0SBaptiste Daroussin goto yyloop; 555*0c8de5b0SBaptiste Daroussin } 556*0c8de5b0SBaptiste Daroussin else 557*0c8de5b0SBaptiste Daroussin { 558*0c8de5b0SBaptiste Daroussin #if YYDEBUG 559*0c8de5b0SBaptiste Daroussin if (yydebug) 560*0c8de5b0SBaptiste Daroussin printf("%sdebug: error recovery discarding state %d\n", 561*0c8de5b0SBaptiste Daroussin YYPREFIX, *yystack.s_mark); 562*0c8de5b0SBaptiste Daroussin #endif 563*0c8de5b0SBaptiste Daroussin if (yystack.s_mark <= yystack.s_base) goto yyabort; 564*0c8de5b0SBaptiste Daroussin --yystack.s_mark; 565*0c8de5b0SBaptiste Daroussin --yystack.l_mark; 566*0c8de5b0SBaptiste Daroussin } 567*0c8de5b0SBaptiste Daroussin } 568*0c8de5b0SBaptiste Daroussin } 569*0c8de5b0SBaptiste Daroussin else 570*0c8de5b0SBaptiste Daroussin { 571*0c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyabort; 572*0c8de5b0SBaptiste Daroussin #if YYDEBUG 573*0c8de5b0SBaptiste Daroussin if (yydebug) 574*0c8de5b0SBaptiste Daroussin { 575*0c8de5b0SBaptiste Daroussin yys = yyname[YYTRANSLATE(yychar)]; 576*0c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 577*0c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yychar, yys); 578*0c8de5b0SBaptiste Daroussin } 579*0c8de5b0SBaptiste Daroussin #endif 580*0c8de5b0SBaptiste Daroussin yychar = YYEMPTY; 581*0c8de5b0SBaptiste Daroussin goto yyloop; 582*0c8de5b0SBaptiste Daroussin } 583*0c8de5b0SBaptiste Daroussin 584*0c8de5b0SBaptiste Daroussin yyreduce: 585*0c8de5b0SBaptiste Daroussin #if YYDEBUG 586*0c8de5b0SBaptiste Daroussin if (yydebug) 587*0c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reducing by rule %d (%s)\n", 588*0c8de5b0SBaptiste Daroussin YYPREFIX, yystate, yyn, yyrule[yyn]); 589*0c8de5b0SBaptiste Daroussin #endif 590*0c8de5b0SBaptiste Daroussin yym = yylen[yyn]; 591*0c8de5b0SBaptiste Daroussin if (yym) 592*0c8de5b0SBaptiste Daroussin yyval = yystack.l_mark[1-yym]; 593*0c8de5b0SBaptiste Daroussin else 594*0c8de5b0SBaptiste Daroussin memset(&yyval, 0, sizeof yyval); 595*0c8de5b0SBaptiste Daroussin switch (yyn) 596*0c8de5b0SBaptiste Daroussin { 597*0c8de5b0SBaptiste Daroussin case 3: 598*0c8de5b0SBaptiste Daroussin #line 66 "ok_syntax1.y" 599*0c8de5b0SBaptiste Daroussin { yyerrok ; } 600*0c8de5b0SBaptiste Daroussin break; 601*0c8de5b0SBaptiste Daroussin case 4: 602*0c8de5b0SBaptiste Daroussin #line 70 "ok_syntax1.y" 603*0c8de5b0SBaptiste Daroussin { printf("%d\n",yystack.l_mark[0].ival);} 604*0c8de5b0SBaptiste Daroussin break; 605*0c8de5b0SBaptiste Daroussin case 5: 606*0c8de5b0SBaptiste Daroussin #line 72 "ok_syntax1.y" 607*0c8de5b0SBaptiste Daroussin { regs[yystack.l_mark[-2].ival] = yystack.l_mark[0].ival; } 608*0c8de5b0SBaptiste Daroussin break; 609*0c8de5b0SBaptiste Daroussin case 6: 610*0c8de5b0SBaptiste Daroussin #line 76 "ok_syntax1.y" 611*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-1].ival; } 612*0c8de5b0SBaptiste Daroussin break; 613*0c8de5b0SBaptiste Daroussin case 7: 614*0c8de5b0SBaptiste Daroussin #line 78 "ok_syntax1.y" 615*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival + yystack.l_mark[0].ival; } 616*0c8de5b0SBaptiste Daroussin break; 617*0c8de5b0SBaptiste Daroussin case 8: 618*0c8de5b0SBaptiste Daroussin #line 80 "ok_syntax1.y" 619*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival - yystack.l_mark[0].ival; } 620*0c8de5b0SBaptiste Daroussin break; 621*0c8de5b0SBaptiste Daroussin case 9: 622*0c8de5b0SBaptiste Daroussin #line 82 "ok_syntax1.y" 623*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival * yystack.l_mark[0].ival; } 624*0c8de5b0SBaptiste Daroussin break; 625*0c8de5b0SBaptiste Daroussin case 10: 626*0c8de5b0SBaptiste Daroussin #line 84 "ok_syntax1.y" 627*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival / yystack.l_mark[0].ival; } 628*0c8de5b0SBaptiste Daroussin break; 629*0c8de5b0SBaptiste Daroussin case 11: 630*0c8de5b0SBaptiste Daroussin #line 86 "ok_syntax1.y" 631*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival % yystack.l_mark[0].ival; } 632*0c8de5b0SBaptiste Daroussin break; 633*0c8de5b0SBaptiste Daroussin case 12: 634*0c8de5b0SBaptiste Daroussin #line 88 "ok_syntax1.y" 635*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival & yystack.l_mark[0].ival; } 636*0c8de5b0SBaptiste Daroussin break; 637*0c8de5b0SBaptiste Daroussin case 13: 638*0c8de5b0SBaptiste Daroussin #line 90 "ok_syntax1.y" 639*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[-2].ival | yystack.l_mark[0].ival; } 640*0c8de5b0SBaptiste Daroussin break; 641*0c8de5b0SBaptiste Daroussin case 14: 642*0c8de5b0SBaptiste Daroussin #line 92 "ok_syntax1.y" 643*0c8de5b0SBaptiste Daroussin { yyval.ival = - yystack.l_mark[0].ival; } 644*0c8de5b0SBaptiste Daroussin break; 645*0c8de5b0SBaptiste Daroussin case 15: 646*0c8de5b0SBaptiste Daroussin #line 94 "ok_syntax1.y" 647*0c8de5b0SBaptiste Daroussin { yyval.ival = regs[yystack.l_mark[0].ival]; } 648*0c8de5b0SBaptiste Daroussin break; 649*0c8de5b0SBaptiste Daroussin case 17: 650*0c8de5b0SBaptiste Daroussin #line 99 "ok_syntax1.y" 651*0c8de5b0SBaptiste Daroussin { yyval.ival = yystack.l_mark[0].ival; (*base) = (yystack.l_mark[0].ival==0) ? 8 : 10; } 652*0c8de5b0SBaptiste Daroussin break; 653*0c8de5b0SBaptiste Daroussin case 18: 654*0c8de5b0SBaptiste Daroussin #line 101 "ok_syntax1.y" 655*0c8de5b0SBaptiste Daroussin { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; } 656*0c8de5b0SBaptiste Daroussin break; 657*0c8de5b0SBaptiste Daroussin #line 658 "ok_syntax1.tab.c" 658*0c8de5b0SBaptiste Daroussin } 659*0c8de5b0SBaptiste Daroussin yystack.s_mark -= yym; 660*0c8de5b0SBaptiste Daroussin yystate = *yystack.s_mark; 661*0c8de5b0SBaptiste Daroussin yystack.l_mark -= yym; 662*0c8de5b0SBaptiste Daroussin yym = yylhs[yyn]; 663*0c8de5b0SBaptiste Daroussin if (yystate == 0 && yym == 0) 664*0c8de5b0SBaptiste Daroussin { 665*0c8de5b0SBaptiste Daroussin #if YYDEBUG 666*0c8de5b0SBaptiste Daroussin if (yydebug) 667*0c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state 0 to\ 668*0c8de5b0SBaptiste Daroussin state %d\n", YYPREFIX, YYFINAL); 669*0c8de5b0SBaptiste Daroussin #endif 670*0c8de5b0SBaptiste Daroussin yystate = YYFINAL; 671*0c8de5b0SBaptiste Daroussin *++yystack.s_mark = YYFINAL; 672*0c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval; 673*0c8de5b0SBaptiste Daroussin if (yychar < 0) 674*0c8de5b0SBaptiste Daroussin { 675*0c8de5b0SBaptiste Daroussin if ((yychar = YYLEX) < 0) yychar = YYEOF; 676*0c8de5b0SBaptiste Daroussin #if YYDEBUG 677*0c8de5b0SBaptiste Daroussin if (yydebug) 678*0c8de5b0SBaptiste Daroussin { 679*0c8de5b0SBaptiste Daroussin yys = yyname[YYTRANSLATE(yychar)]; 680*0c8de5b0SBaptiste Daroussin printf("%sdebug: state %d, reading %d (%s)\n", 681*0c8de5b0SBaptiste Daroussin YYPREFIX, YYFINAL, yychar, yys); 682*0c8de5b0SBaptiste Daroussin } 683*0c8de5b0SBaptiste Daroussin #endif 684*0c8de5b0SBaptiste Daroussin } 685*0c8de5b0SBaptiste Daroussin if (yychar == YYEOF) goto yyaccept; 686*0c8de5b0SBaptiste Daroussin goto yyloop; 687*0c8de5b0SBaptiste Daroussin } 688*0c8de5b0SBaptiste Daroussin if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && 689*0c8de5b0SBaptiste Daroussin yyn <= YYTABLESIZE && yycheck[yyn] == yystate) 690*0c8de5b0SBaptiste Daroussin yystate = yytable[yyn]; 691*0c8de5b0SBaptiste Daroussin else 692*0c8de5b0SBaptiste Daroussin yystate = yydgoto[yym]; 693*0c8de5b0SBaptiste Daroussin #if YYDEBUG 694*0c8de5b0SBaptiste Daroussin if (yydebug) 695*0c8de5b0SBaptiste Daroussin printf("%sdebug: after reduction, shifting from state %d \ 696*0c8de5b0SBaptiste Daroussin to state %d\n", YYPREFIX, *yystack.s_mark, yystate); 697*0c8de5b0SBaptiste Daroussin #endif 698*0c8de5b0SBaptiste Daroussin if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 699*0c8de5b0SBaptiste Daroussin { 700*0c8de5b0SBaptiste Daroussin goto yyoverflow; 701*0c8de5b0SBaptiste Daroussin } 702*0c8de5b0SBaptiste Daroussin *++yystack.s_mark = (YYINT) yystate; 703*0c8de5b0SBaptiste Daroussin *++yystack.l_mark = yyval; 704*0c8de5b0SBaptiste Daroussin goto yyloop; 705*0c8de5b0SBaptiste Daroussin 706*0c8de5b0SBaptiste Daroussin yyoverflow: 707*0c8de5b0SBaptiste Daroussin YYERROR_CALL("yacc stack overflow"); 708*0c8de5b0SBaptiste Daroussin 709*0c8de5b0SBaptiste Daroussin yyabort: 710*0c8de5b0SBaptiste Daroussin yyfreestack(&yystack); 711*0c8de5b0SBaptiste Daroussin return (1); 712*0c8de5b0SBaptiste Daroussin 713*0c8de5b0SBaptiste Daroussin yyaccept: 714*0c8de5b0SBaptiste Daroussin yyfreestack(&yystack); 715*0c8de5b0SBaptiste Daroussin return (0); 716*0c8de5b0SBaptiste Daroussin } 717