1 1.5 christos /* $NetBSD: err_inherit3.tab.c,v 1.7 2026/01/18 16:41:30 christos Exp $ */ 2 1.1 christos 3 1.1 christos /* original parser id follows */ 4 1.1 christos /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 5 1.2 christos /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 6 1.1 christos 7 1.1 christos #define YYBYACC 1 8 1.5 christos #define YYMAJOR 2 9 1.5 christos #define YYMINOR 0 10 1.1 christos #define YYCHECK "yyyymmdd" 11 1.1 christos 12 1.1 christos #define YYEMPTY (-1) 13 1.1 christos #define yyclearin (yychar = YYEMPTY) 14 1.1 christos #define yyerrok (yyerrflag = 0) 15 1.1 christos #define YYRECOVERING() (yyerrflag != 0) 16 1.1 christos #define YYENOMEM (-2) 17 1.1 christos #define YYEOF 0 18 1.1 christos #undef YYBTYACC 19 1.1 christos #define YYBTYACC 0 20 1.1 christos #define YYDEBUGSTR YYPREFIX "debug" 21 1.1 christos 22 1.1 christos #ifndef yyparse 23 1.1 christos #define yyparse err_inherit3_parse 24 1.1 christos #endif /* yyparse */ 25 1.1 christos 26 1.1 christos #ifndef yylex 27 1.1 christos #define yylex err_inherit3_lex 28 1.1 christos #endif /* yylex */ 29 1.1 christos 30 1.1 christos #ifndef yyerror 31 1.1 christos #define yyerror err_inherit3_error 32 1.1 christos #endif /* yyerror */ 33 1.1 christos 34 1.1 christos #ifndef yychar 35 1.1 christos #define yychar err_inherit3_char 36 1.1 christos #endif /* yychar */ 37 1.1 christos 38 1.1 christos #ifndef yyval 39 1.1 christos #define yyval err_inherit3_val 40 1.1 christos #endif /* yyval */ 41 1.1 christos 42 1.1 christos #ifndef yylval 43 1.1 christos #define yylval err_inherit3_lval 44 1.1 christos #endif /* yylval */ 45 1.1 christos 46 1.1 christos #ifndef yydebug 47 1.1 christos #define yydebug err_inherit3_debug 48 1.1 christos #endif /* yydebug */ 49 1.1 christos 50 1.1 christos #ifndef yynerrs 51 1.1 christos #define yynerrs err_inherit3_nerrs 52 1.1 christos #endif /* yynerrs */ 53 1.1 christos 54 1.1 christos #ifndef yyerrflag 55 1.1 christos #define yyerrflag err_inherit3_errflag 56 1.1 christos #endif /* yyerrflag */ 57 1.1 christos 58 1.1 christos #ifndef yylhs 59 1.1 christos #define yylhs err_inherit3_lhs 60 1.1 christos #endif /* yylhs */ 61 1.1 christos 62 1.1 christos #ifndef yylen 63 1.1 christos #define yylen err_inherit3_len 64 1.1 christos #endif /* yylen */ 65 1.1 christos 66 1.1 christos #ifndef yydefred 67 1.1 christos #define yydefred err_inherit3_defred 68 1.1 christos #endif /* yydefred */ 69 1.1 christos 70 1.1 christos #ifndef yystos 71 1.1 christos #define yystos err_inherit3_stos 72 1.1 christos #endif /* yystos */ 73 1.1 christos 74 1.1 christos #ifndef yydgoto 75 1.1 christos #define yydgoto err_inherit3_dgoto 76 1.1 christos #endif /* yydgoto */ 77 1.1 christos 78 1.1 christos #ifndef yysindex 79 1.1 christos #define yysindex err_inherit3_sindex 80 1.1 christos #endif /* yysindex */ 81 1.1 christos 82 1.1 christos #ifndef yyrindex 83 1.1 christos #define yyrindex err_inherit3_rindex 84 1.1 christos #endif /* yyrindex */ 85 1.1 christos 86 1.1 christos #ifndef yygindex 87 1.1 christos #define yygindex err_inherit3_gindex 88 1.1 christos #endif /* yygindex */ 89 1.1 christos 90 1.1 christos #ifndef yytable 91 1.1 christos #define yytable err_inherit3_table 92 1.1 christos #endif /* yytable */ 93 1.1 christos 94 1.1 christos #ifndef yycheck 95 1.1 christos #define yycheck err_inherit3_check 96 1.1 christos #endif /* yycheck */ 97 1.1 christos 98 1.1 christos #ifndef yyname 99 1.1 christos #define yyname err_inherit3_name 100 1.1 christos #endif /* yyname */ 101 1.1 christos 102 1.1 christos #ifndef yyrule 103 1.1 christos #define yyrule err_inherit3_rule 104 1.1 christos #endif /* yyrule */ 105 1.1 christos 106 1.1 christos #if YYBTYACC 107 1.1 christos 108 1.1 christos #ifndef yycindex 109 1.1 christos #define yycindex err_inherit3_cindex 110 1.1 christos #endif /* yycindex */ 111 1.1 christos 112 1.1 christos #ifndef yyctable 113 1.1 christos #define yyctable err_inherit3_ctable 114 1.1 christos #endif /* yyctable */ 115 1.1 christos 116 1.1 christos #endif /* YYBTYACC */ 117 1.1 christos 118 1.1 christos #define YYPREFIX "err_inherit3_" 119 1.1 christos 120 1.1 christos #define YYPURE 0 121 1.1 christos 122 1.1 christos #line 2 "err_inherit3.y" 123 1.1 christos #include <stdlib.h> 124 1.1 christos 125 1.1 christos typedef enum {cGLOBAL, cLOCAL} class; 126 1.1 christos typedef enum {tREAL, tINTEGER} type; 127 1.1 christos typedef char * name; 128 1.1 christos 129 1.1 christos struct symbol { class c; type t; name id; }; 130 1.1 christos typedef struct symbol symbol; 131 1.1 christos 132 1.1 christos struct namelist { symbol *s; struct namelist *next; }; 133 1.1 christos typedef struct namelist namelist; 134 1.1 christos 135 1.1 christos extern symbol *mksymbol(type t, class c, name id); 136 1.1 christos 137 1.1 christos #ifdef YYBISON 138 1.1 christos #define YYLEX_DECL() yylex(void) 139 1.1 christos #define YYERROR_DECL() yyerror(const char *s) 140 1.1 christos #endif 141 1.1 christos #ifdef YYSTYPE 142 1.1 christos #undef YYSTYPE_IS_DECLARED 143 1.1 christos #define YYSTYPE_IS_DECLARED 1 144 1.1 christos #endif 145 1.1 christos #ifndef YYSTYPE_IS_DECLARED 146 1.1 christos #define YYSTYPE_IS_DECLARED 1 147 1.2 christos #line 39 "err_inherit3.y" 148 1.6 christos typedef union YYSTYPE 149 1.1 christos { 150 1.1 christos class cval; 151 1.1 christos type tval; 152 1.1 christos namelist * nlist; 153 1.1 christos name id; 154 1.1 christos } YYSTYPE; 155 1.1 christos #endif /* !YYSTYPE_IS_DECLARED */ 156 1.1 christos #line 155 "err_inherit3.tab.c" 157 1.1 christos 158 1.1 christos /* compatibility with bison */ 159 1.1 christos #ifdef YYPARSE_PARAM 160 1.1 christos /* compatibility with FreeBSD */ 161 1.1 christos # ifdef YYPARSE_PARAM_TYPE 162 1.1 christos # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 163 1.1 christos # else 164 1.1 christos # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 165 1.1 christos # endif 166 1.1 christos #else 167 1.1 christos # define YYPARSE_DECL() yyparse(void) 168 1.1 christos #endif 169 1.1 christos 170 1.1 christos /* Parameters sent to lex. */ 171 1.1 christos #ifdef YYLEX_PARAM 172 1.1 christos # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 173 1.1 christos # define YYLEX yylex(YYLEX_PARAM) 174 1.1 christos #else 175 1.1 christos # define YYLEX_DECL() yylex(void) 176 1.1 christos # define YYLEX yylex() 177 1.1 christos #endif 178 1.1 christos 179 1.1 christos /* Parameters sent to yyerror. */ 180 1.1 christos #ifndef YYERROR_DECL 181 1.1 christos #define YYERROR_DECL() yyerror(const char *s) 182 1.1 christos #endif 183 1.1 christos #ifndef YYERROR_CALL 184 1.1 christos #define YYERROR_CALL(msg) yyerror(msg) 185 1.1 christos #endif 186 1.1 christos 187 1.1 christos #ifndef YYDESTRUCT_DECL 188 1.1 christos #define YYDESTRUCT_DECL() yydestruct(const char *msg, int psymb, YYSTYPE *val) 189 1.1 christos #endif 190 1.1 christos #ifndef YYDESTRUCT_CALL 191 1.1 christos #define YYDESTRUCT_CALL(msg, psymb, val) yydestruct(msg, psymb, val) 192 1.1 christos #endif 193 1.1 christos 194 1.1 christos extern int YYPARSE_DECL(); 195 1.1 christos 196 1.1 christos #define GLOBAL 257 197 1.1 christos #define LOCAL 258 198 1.1 christos #define REAL 259 199 1.1 christos #define INTEGER 260 200 1.1 christos #define NAME 261 201 1.1 christos #define YYERRCODE 256 202 1.6 christos typedef int YYINT; 203 1.1 christos static const YYINT err_inherit3_lhs[] = { -1, 204 1.2 christos 5, 6, 0, 0, 3, 3, 4, 4, 7, 1, 205 1.2 christos 1, 8, 2, 206 1.1 christos }; 207 1.1 christos static const YYINT err_inherit3_len[] = { 2, 208 1.2 christos 0, 0, 5, 2, 1, 1, 1, 1, 0, 3, 209 1.2 christos 1, 0, 3, 210 1.1 christos }; 211 1.1 christos static const YYINT err_inherit3_defred[] = { 0, 212 1.2 christos 5, 6, 7, 8, 0, 0, 12, 1, 4, 2, 213 1.2 christos 2, 0, 0, 11, 13, 0, 3, 0, 10, 214 1.1 christos }; 215 1.2 christos #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) 216 1.1 christos static const YYINT err_inherit3_stos[] = { 0, 217 1.2 christos 257, 258, 259, 260, 263, 266, 267, 267, 265, 271, 218 1.2 christos 268, 269, 269, 261, 264, 270, 264, 264, 261, 219 1.1 christos }; 220 1.2 christos #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ 221 1.1 christos static const YYINT err_inherit3_dgoto[] = { 5, 222 1.2 christos 15, 9, 6, 7, 11, 12, 16, 10, 223 1.1 christos }; 224 1.1 christos static const YYINT err_inherit3_sindex[] = { -257, 225 1.1 christos 0, 0, 0, 0, 0, -254, 0, 0, 0, 0, 226 1.2 christos 0, -253, -253, 0, 0, -253, 0, -252, 0, 227 1.1 christos }; 228 1.1 christos static const YYINT err_inherit3_rindex[] = { 0, 229 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230 1.2 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 231 1.1 christos }; 232 1.1 christos #if YYBTYACC 233 1.1 christos static const YYINT err_inherit3_cindex[] = { 0, 234 1.1 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235 1.2 christos 0, 0, 0, 0, 0, 0, 0, 0, 0, 236 1.1 christos }; 237 1.1 christos #endif 238 1.1 christos static const YYINT err_inherit3_gindex[] = { 0, 239 1.2 christos -9, 0, 0, 4, 0, 1, 0, 0, 240 1.1 christos }; 241 1.2 christos #define YYTABLESIZE 12 242 1.1 christos static const YYINT err_inherit3_table[] = { 1, 243 1.2 christos 2, 3, 4, 17, 3, 4, 18, 14, 19, 8, 244 1.2 christos 0, 13, 245 1.1 christos }; 246 1.1 christos static const YYINT err_inherit3_check[] = { 257, 247 1.2 christos 258, 259, 260, 13, 259, 260, 16, 261, 261, 6, 248 1.2 christos -1, 11, 249 1.1 christos }; 250 1.1 christos #if YYBTYACC 251 1.1 christos static const YYINT err_inherit3_ctable[] = { -1, 252 1.1 christos -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 253 1.2 christos -1, 254 1.1 christos }; 255 1.1 christos #endif 256 1.1 christos #define YYFINAL 5 257 1.1 christos #ifndef YYDEBUG 258 1.1 christos #define YYDEBUG 0 259 1.1 christos #endif 260 1.1 christos #define YYMAXTOKEN 261 261 1.2 christos #define YYUNDFTOKEN 272 262 1.1 christos #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 263 1.1 christos #if YYDEBUG 264 1.7 christos #ifndef NULL 265 1.7 christos #define NULL (void*)0 266 1.7 christos #endif 267 1.1 christos static const char *const err_inherit3_name[] = { 268 1.1 christos 269 1.7 christos "$end",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 270 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 271 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 272 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 273 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 274 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 275 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 276 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 277 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 278 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 279 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 280 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 281 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 282 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 283 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 284 1.7 christos NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 285 1.7 christos NULL,"error","GLOBAL","LOCAL","REAL","INTEGER","NAME","$accept","declaration", 286 1.7 christos "namelist","locnamelist","class","type","$$1","$$2","$$3","$$4", 287 1.7 christos "illegal-symbol", 288 1.1 christos }; 289 1.1 christos static const char *const err_inherit3_rule[] = { 290 1.1 christos "$accept : declaration", 291 1.1 christos "$$1 :", 292 1.1 christos "$$2 :", 293 1.1 christos "declaration : class type $$1 $$2 namelist", 294 1.2 christos "declaration : type locnamelist", 295 1.1 christos "class : GLOBAL", 296 1.1 christos "class : LOCAL", 297 1.1 christos "type : REAL", 298 1.1 christos "type : INTEGER", 299 1.2 christos "$$3 :", 300 1.2 christos "namelist : $$3 namelist NAME", 301 1.2 christos "namelist : NAME", 302 1.1 christos "$$4 :", 303 1.2 christos "locnamelist : $$4 $$2 namelist", 304 1.1 christos 305 1.1 christos }; 306 1.1 christos #endif 307 1.1 christos 308 1.4 christos #if YYDEBUG 309 1.1 christos int yydebug; 310 1.4 christos #endif 311 1.1 christos 312 1.1 christos int yyerrflag; 313 1.1 christos int yychar; 314 1.1 christos YYSTYPE yyval; 315 1.1 christos YYSTYPE yylval; 316 1.4 christos int yynerrs; 317 1.4 christos 318 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 319 1.1 christos YYLTYPE yyloc; /* position returned by actions */ 320 1.1 christos YYLTYPE yylloc; /* position from the lexer */ 321 1.1 christos #endif 322 1.1 christos 323 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 324 1.1 christos #ifndef YYLLOC_DEFAULT 325 1.1 christos #define YYLLOC_DEFAULT(loc, rhs, n) \ 326 1.1 christos do \ 327 1.1 christos { \ 328 1.1 christos if (n == 0) \ 329 1.1 christos { \ 330 1.4 christos (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ 331 1.4 christos (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ 332 1.4 christos (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ 333 1.4 christos (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ 334 1.1 christos } \ 335 1.1 christos else \ 336 1.1 christos { \ 337 1.4 christos (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ 338 1.4 christos (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ 339 1.4 christos (loc).last_line = YYRHSLOC(rhs, n).last_line; \ 340 1.4 christos (loc).last_column = YYRHSLOC(rhs, n).last_column; \ 341 1.1 christos } \ 342 1.1 christos } while (0) 343 1.1 christos #endif /* YYLLOC_DEFAULT */ 344 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 345 1.1 christos #if YYBTYACC 346 1.1 christos 347 1.1 christos #ifndef YYLVQUEUEGROWTH 348 1.1 christos #define YYLVQUEUEGROWTH 32 349 1.1 christos #endif 350 1.1 christos #endif /* YYBTYACC */ 351 1.1 christos 352 1.1 christos /* define the initial stack-sizes */ 353 1.1 christos #ifdef YYSTACKSIZE 354 1.1 christos #undef YYMAXDEPTH 355 1.1 christos #define YYMAXDEPTH YYSTACKSIZE 356 1.1 christos #else 357 1.1 christos #ifdef YYMAXDEPTH 358 1.1 christos #define YYSTACKSIZE YYMAXDEPTH 359 1.1 christos #else 360 1.1 christos #define YYSTACKSIZE 10000 361 1.1 christos #define YYMAXDEPTH 10000 362 1.1 christos #endif 363 1.1 christos #endif 364 1.1 christos 365 1.1 christos #ifndef YYINITSTACKSIZE 366 1.1 christos #define YYINITSTACKSIZE 200 367 1.1 christos #endif 368 1.1 christos 369 1.1 christos typedef struct { 370 1.1 christos unsigned stacksize; 371 1.2 christos YYINT *s_base; 372 1.2 christos YYINT *s_mark; 373 1.2 christos YYINT *s_last; 374 1.1 christos YYSTYPE *l_base; 375 1.1 christos YYSTYPE *l_mark; 376 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 377 1.1 christos YYLTYPE *p_base; 378 1.1 christos YYLTYPE *p_mark; 379 1.1 christos #endif 380 1.1 christos } YYSTACKDATA; 381 1.1 christos #if YYBTYACC 382 1.1 christos 383 1.1 christos struct YYParseState_s 384 1.1 christos { 385 1.1 christos struct YYParseState_s *save; /* Previously saved parser state */ 386 1.1 christos YYSTACKDATA yystack; /* saved parser stack */ 387 1.1 christos int state; /* saved parser state */ 388 1.1 christos int errflag; /* saved error recovery status */ 389 1.1 christos int lexeme; /* saved index of the conflict lexeme in the lexical queue */ 390 1.1 christos YYINT ctry; /* saved index in yyctable[] for this conflict */ 391 1.1 christos }; 392 1.1 christos typedef struct YYParseState_s YYParseState; 393 1.1 christos #endif /* YYBTYACC */ 394 1.1 christos /* variables for the parser stack */ 395 1.1 christos static YYSTACKDATA yystack; 396 1.1 christos #if YYBTYACC 397 1.1 christos 398 1.1 christos /* Current parser state */ 399 1.7 christos static YYParseState *yyps = NULL; 400 1.1 christos 401 1.1 christos /* yypath != NULL: do the full parse, starting at *yypath parser state. */ 402 1.7 christos static YYParseState *yypath = NULL; 403 1.1 christos 404 1.1 christos /* Base of the lexical value queue */ 405 1.7 christos static YYSTYPE *yylvals = NULL; 406 1.1 christos 407 1.1 christos /* Current position at lexical value queue */ 408 1.7 christos static YYSTYPE *yylvp = NULL; 409 1.1 christos 410 1.1 christos /* End position of lexical value queue */ 411 1.7 christos static YYSTYPE *yylve = NULL; 412 1.1 christos 413 1.1 christos /* The last allocated position at the lexical value queue */ 414 1.7 christos static YYSTYPE *yylvlim = NULL; 415 1.1 christos 416 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 417 1.1 christos /* Base of the lexical position queue */ 418 1.7 christos static YYLTYPE *yylpsns = NULL; 419 1.1 christos 420 1.1 christos /* Current position at lexical position queue */ 421 1.7 christos static YYLTYPE *yylpp = NULL; 422 1.1 christos 423 1.1 christos /* End position of lexical position queue */ 424 1.7 christos static YYLTYPE *yylpe = NULL; 425 1.1 christos 426 1.1 christos /* The last allocated position at the lexical position queue */ 427 1.7 christos static YYLTYPE *yylplim = NULL; 428 1.1 christos #endif 429 1.1 christos 430 1.1 christos /* Current position at lexical token queue */ 431 1.7 christos static YYINT *yylexp = NULL; 432 1.1 christos 433 1.7 christos static YYINT *yylexemes = NULL; 434 1.1 christos #endif /* YYBTYACC */ 435 1.1 christos #line 78 "err_inherit3.y" 436 1.1 christos 437 1.1 christos extern int YYLEX_DECL(); 438 1.1 christos extern void YYERROR_DECL(); 439 1.7 christos #line 438 "err_inherit3.tab.c" 440 1.1 christos 441 1.1 christos /* Release memory associated with symbol. */ 442 1.1 christos #if ! defined YYDESTRUCT_IS_DECLARED 443 1.1 christos static void 444 1.1 christos YYDESTRUCT_DECL() 445 1.1 christos { 446 1.1 christos switch (psymb) 447 1.1 christos { 448 1.1 christos case 263: 449 1.1 christos #line 30 "err_inherit3.y" 450 1.1 christos { 451 1.1 christos namelist *p = (*val).nlist; 452 1.1 christos while (p != NULL) 453 1.1 christos { namelist *pp = p; 454 1.1 christos p = p->next; 455 1.1 christos free(pp->s); free(pp); 456 1.1 christos } 457 1.1 christos } 458 1.7 christos #line 457 "err_inherit3.tab.c" 459 1.1 christos break; 460 1.1 christos case 264: 461 1.1 christos #line 30 "err_inherit3.y" 462 1.1 christos { 463 1.1 christos namelist *p = (*val).nlist; 464 1.1 christos while (p != NULL) 465 1.1 christos { namelist *pp = p; 466 1.1 christos p = p->next; 467 1.1 christos free(pp->s); free(pp); 468 1.1 christos } 469 1.1 christos } 470 1.7 christos #line 469 "err_inherit3.tab.c" 471 1.1 christos break; 472 1.1 christos case 265: 473 1.1 christos #line 30 "err_inherit3.y" 474 1.1 christos { 475 1.1 christos namelist *p = (*val).nlist; 476 1.1 christos while (p != NULL) 477 1.1 christos { namelist *pp = p; 478 1.1 christos p = p->next; 479 1.1 christos free(pp->s); free(pp); 480 1.1 christos } 481 1.1 christos } 482 1.7 christos #line 481 "err_inherit3.tab.c" 483 1.1 christos break; 484 1.1 christos } 485 1.1 christos } 486 1.1 christos #define YYDESTRUCT_IS_DECLARED 1 487 1.1 christos #endif 488 1.1 christos 489 1.1 christos /* For use in generated program */ 490 1.1 christos #define yydepth (int)(yystack.s_mark - yystack.s_base) 491 1.1 christos #if YYBTYACC 492 1.1 christos #define yytrial (yyps->save) 493 1.1 christos #endif /* YYBTYACC */ 494 1.1 christos 495 1.1 christos #if YYDEBUG 496 1.2 christos #include <stdio.h> /* needed for printf */ 497 1.1 christos #endif 498 1.1 christos 499 1.2 christos #include <stdlib.h> /* needed for malloc, etc */ 500 1.2 christos #include <string.h> /* needed for memset */ 501 1.1 christos 502 1.1 christos /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 503 1.1 christos static int yygrowstack(YYSTACKDATA *data) 504 1.1 christos { 505 1.1 christos int i; 506 1.1 christos unsigned newsize; 507 1.2 christos YYINT *newss; 508 1.1 christos YYSTYPE *newvs; 509 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 510 1.1 christos YYLTYPE *newps; 511 1.1 christos #endif 512 1.1 christos 513 1.1 christos if ((newsize = data->stacksize) == 0) 514 1.1 christos newsize = YYINITSTACKSIZE; 515 1.1 christos else if (newsize >= YYMAXDEPTH) 516 1.1 christos return YYENOMEM; 517 1.1 christos else if ((newsize *= 2) > YYMAXDEPTH) 518 1.1 christos newsize = YYMAXDEPTH; 519 1.1 christos 520 1.1 christos i = (int) (data->s_mark - data->s_base); 521 1.2 christos newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 522 1.7 christos if (newss == NULL) 523 1.1 christos return YYENOMEM; 524 1.1 christos 525 1.1 christos data->s_base = newss; 526 1.1 christos data->s_mark = newss + i; 527 1.1 christos 528 1.1 christos newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 529 1.7 christos if (newvs == NULL) 530 1.1 christos return YYENOMEM; 531 1.1 christos 532 1.1 christos data->l_base = newvs; 533 1.1 christos data->l_mark = newvs + i; 534 1.1 christos 535 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 536 1.1 christos newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); 537 1.7 christos if (newps == NULL) 538 1.1 christos return YYENOMEM; 539 1.1 christos 540 1.1 christos data->p_base = newps; 541 1.1 christos data->p_mark = newps + i; 542 1.1 christos #endif 543 1.1 christos 544 1.1 christos data->stacksize = newsize; 545 1.1 christos data->s_last = data->s_base + newsize - 1; 546 1.1 christos 547 1.1 christos #if YYDEBUG 548 1.1 christos if (yydebug) 549 1.1 christos fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); 550 1.1 christos #endif 551 1.1 christos return 0; 552 1.1 christos } 553 1.1 christos 554 1.1 christos #if YYPURE || defined(YY_NO_LEAKS) 555 1.1 christos static void yyfreestack(YYSTACKDATA *data) 556 1.1 christos { 557 1.1 christos free(data->s_base); 558 1.1 christos free(data->l_base); 559 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 560 1.1 christos free(data->p_base); 561 1.1 christos #endif 562 1.1 christos memset(data, 0, sizeof(*data)); 563 1.1 christos } 564 1.1 christos #else 565 1.1 christos #define yyfreestack(data) /* nothing */ 566 1.1 christos #endif /* YYPURE || defined(YY_NO_LEAKS) */ 567 1.1 christos #if YYBTYACC 568 1.1 christos 569 1.1 christos static YYParseState * 570 1.1 christos yyNewState(unsigned size) 571 1.1 christos { 572 1.1 christos YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); 573 1.1 christos if (p == NULL) return NULL; 574 1.1 christos 575 1.1 christos p->yystack.stacksize = size; 576 1.1 christos if (size == 0) 577 1.1 christos { 578 1.1 christos p->yystack.s_base = NULL; 579 1.1 christos p->yystack.l_base = NULL; 580 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 581 1.1 christos p->yystack.p_base = NULL; 582 1.1 christos #endif 583 1.1 christos return p; 584 1.1 christos } 585 1.2 christos p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT)); 586 1.1 christos if (p->yystack.s_base == NULL) return NULL; 587 1.1 christos p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); 588 1.1 christos if (p->yystack.l_base == NULL) return NULL; 589 1.1 christos memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); 590 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 591 1.1 christos p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); 592 1.1 christos if (p->yystack.p_base == NULL) return NULL; 593 1.1 christos memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); 594 1.1 christos #endif 595 1.1 christos 596 1.1 christos return p; 597 1.1 christos } 598 1.1 christos 599 1.1 christos static void 600 1.1 christos yyFreeState(YYParseState *p) 601 1.1 christos { 602 1.1 christos yyfreestack(&p->yystack); 603 1.1 christos free(p); 604 1.1 christos } 605 1.1 christos #endif /* YYBTYACC */ 606 1.1 christos 607 1.1 christos #define YYABORT goto yyabort 608 1.1 christos #define YYREJECT goto yyabort 609 1.1 christos #define YYACCEPT goto yyaccept 610 1.1 christos #define YYERROR goto yyerrlab 611 1.1 christos #if YYBTYACC 612 1.1 christos #define YYVALID do { if (yyps->save) goto yyvalid; } while(0) 613 1.1 christos #define YYVALID_NESTED do { if (yyps->save && \ 614 1.1 christos yyps->save->save == 0) goto yyvalid; } while(0) 615 1.1 christos #endif /* YYBTYACC */ 616 1.1 christos 617 1.1 christos int 618 1.1 christos YYPARSE_DECL() 619 1.1 christos { 620 1.1 christos int yym, yyn, yystate, yyresult; 621 1.1 christos #if YYBTYACC 622 1.1 christos int yynewerrflag; 623 1.1 christos YYParseState *yyerrctx = NULL; 624 1.1 christos #endif /* YYBTYACC */ 625 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 626 1.4 christos YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ 627 1.1 christos #endif 628 1.1 christos #if YYDEBUG 629 1.1 christos const char *yys; 630 1.1 christos 631 1.7 christos if ((yys = getenv("YYDEBUG")) != NULL) 632 1.1 christos { 633 1.1 christos yyn = *yys; 634 1.1 christos if (yyn >= '0' && yyn <= '9') 635 1.1 christos yydebug = yyn - '0'; 636 1.1 christos } 637 1.1 christos if (yydebug) 638 1.1 christos fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); 639 1.1 christos #endif 640 1.3 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 641 1.3 christos memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); 642 1.3 christos #endif 643 1.1 christos 644 1.1 christos #if YYBTYACC 645 1.7 christos yyps = yyNewState(0); if (yyps == NULL) goto yyenomem; 646 1.7 christos yyps->save = NULL; 647 1.1 christos #endif /* YYBTYACC */ 648 1.2 christos yym = 0; 649 1.6 christos /* yyn is set below */ 650 1.1 christos yynerrs = 0; 651 1.1 christos yyerrflag = 0; 652 1.1 christos yychar = YYEMPTY; 653 1.1 christos yystate = 0; 654 1.1 christos 655 1.1 christos #if YYPURE 656 1.1 christos memset(&yystack, 0, sizeof(yystack)); 657 1.1 christos #endif 658 1.1 christos 659 1.1 christos if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 660 1.1 christos yystack.s_mark = yystack.s_base; 661 1.1 christos yystack.l_mark = yystack.l_base; 662 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 663 1.1 christos yystack.p_mark = yystack.p_base; 664 1.1 christos #endif 665 1.1 christos yystate = 0; 666 1.1 christos *yystack.s_mark = 0; 667 1.1 christos 668 1.1 christos yyloop: 669 1.1 christos if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 670 1.1 christos if (yychar < 0) 671 1.1 christos { 672 1.1 christos #if YYBTYACC 673 1.1 christos do { 674 1.1 christos if (yylvp < yylve) 675 1.1 christos { 676 1.1 christos /* we're currently re-reading tokens */ 677 1.1 christos yylval = *yylvp++; 678 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 679 1.1 christos yylloc = *yylpp++; 680 1.1 christos #endif 681 1.1 christos yychar = *yylexp++; 682 1.1 christos break; 683 1.1 christos } 684 1.1 christos if (yyps->save) 685 1.1 christos { 686 1.1 christos /* in trial mode; save scanner results for future parse attempts */ 687 1.1 christos if (yylvp == yylvlim) 688 1.1 christos { /* Enlarge lexical value queue */ 689 1.1 christos size_t p = (size_t) (yylvp - yylvals); 690 1.1 christos size_t s = (size_t) (yylvlim - yylvals); 691 1.1 christos 692 1.1 christos s += YYLVQUEUEGROWTH; 693 1.4 christos if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; 694 1.4 christos if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 695 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 696 1.4 christos if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 697 1.1 christos #endif 698 1.1 christos yylvp = yylve = yylvals + p; 699 1.1 christos yylvlim = yylvals + s; 700 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 701 1.1 christos yylpp = yylpe = yylpsns + p; 702 1.1 christos yylplim = yylpsns + s; 703 1.1 christos #endif 704 1.1 christos yylexp = yylexemes + p; 705 1.1 christos } 706 1.2 christos *yylexp = (YYINT) YYLEX; 707 1.1 christos *yylvp++ = yylval; 708 1.1 christos yylve++; 709 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 710 1.1 christos *yylpp++ = yylloc; 711 1.1 christos yylpe++; 712 1.1 christos #endif 713 1.1 christos yychar = *yylexp++; 714 1.1 christos break; 715 1.1 christos } 716 1.1 christos /* normal operation, no conflict encountered */ 717 1.1 christos #endif /* YYBTYACC */ 718 1.1 christos yychar = YYLEX; 719 1.1 christos #if YYBTYACC 720 1.1 christos } while (0); 721 1.1 christos #endif /* YYBTYACC */ 722 1.1 christos if (yychar < 0) yychar = YYEOF; 723 1.1 christos #if YYDEBUG 724 1.1 christos if (yydebug) 725 1.1 christos { 726 1.2 christos if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 727 1.1 christos fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", 728 1.1 christos YYDEBUGSTR, yydepth, yystate, yychar, yys); 729 1.1 christos #ifdef YYSTYPE_TOSTRING 730 1.1 christos #if YYBTYACC 731 1.1 christos if (!yytrial) 732 1.1 christos #endif /* YYBTYACC */ 733 1.1 christos fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); 734 1.1 christos #endif 735 1.1 christos fputc('\n', stderr); 736 1.1 christos } 737 1.1 christos #endif 738 1.1 christos } 739 1.1 christos #if YYBTYACC 740 1.1 christos 741 1.1 christos /* Do we have a conflict? */ 742 1.1 christos if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && 743 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 744 1.1 christos { 745 1.1 christos YYINT ctry; 746 1.1 christos 747 1.1 christos if (yypath) 748 1.1 christos { 749 1.1 christos YYParseState *save; 750 1.1 christos #if YYDEBUG 751 1.1 christos if (yydebug) 752 1.1 christos fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", 753 1.1 christos YYDEBUGSTR, yydepth, yystate); 754 1.1 christos #endif 755 1.1 christos /* Switch to the next conflict context */ 756 1.1 christos save = yypath; 757 1.1 christos yypath = save->save; 758 1.1 christos save->save = NULL; 759 1.1 christos ctry = save->ctry; 760 1.1 christos if (save->state != yystate) YYABORT; 761 1.1 christos yyFreeState(save); 762 1.1 christos 763 1.1 christos } 764 1.1 christos else 765 1.1 christos { 766 1.1 christos 767 1.1 christos /* Unresolved conflict - start/continue trial parse */ 768 1.1 christos YYParseState *save; 769 1.1 christos #if YYDEBUG 770 1.1 christos if (yydebug) 771 1.1 christos { 772 1.1 christos fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); 773 1.1 christos if (yyps->save) 774 1.1 christos fputs("ALREADY in conflict, continuing trial parse.\n", stderr); 775 1.1 christos else 776 1.1 christos fputs("Starting trial parse.\n", stderr); 777 1.1 christos } 778 1.1 christos #endif 779 1.1 christos save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 780 1.1 christos if (save == NULL) goto yyenomem; 781 1.1 christos save->save = yyps->save; 782 1.1 christos save->state = yystate; 783 1.1 christos save->errflag = yyerrflag; 784 1.1 christos save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); 785 1.2 christos memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 786 1.1 christos save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); 787 1.1 christos memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 788 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 789 1.1 christos save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); 790 1.1 christos memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 791 1.1 christos #endif 792 1.1 christos ctry = yytable[yyn]; 793 1.1 christos if (yyctable[ctry] == -1) 794 1.1 christos { 795 1.1 christos #if YYDEBUG 796 1.1 christos if (yydebug && yychar >= YYEOF) 797 1.1 christos fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 798 1.1 christos #endif 799 1.1 christos ctry++; 800 1.1 christos } 801 1.1 christos save->ctry = ctry; 802 1.1 christos if (yyps->save == NULL) 803 1.1 christos { 804 1.1 christos /* If this is a first conflict in the stack, start saving lexemes */ 805 1.1 christos if (!yylexemes) 806 1.1 christos { 807 1.4 christos yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); 808 1.1 christos if (yylexemes == NULL) goto yyenomem; 809 1.1 christos yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); 810 1.1 christos if (yylvals == NULL) goto yyenomem; 811 1.1 christos yylvlim = yylvals + YYLVQUEUEGROWTH; 812 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 813 1.1 christos yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); 814 1.1 christos if (yylpsns == NULL) goto yyenomem; 815 1.1 christos yylplim = yylpsns + YYLVQUEUEGROWTH; 816 1.1 christos #endif 817 1.1 christos } 818 1.1 christos if (yylvp == yylve) 819 1.1 christos { 820 1.1 christos yylvp = yylve = yylvals; 821 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 822 1.1 christos yylpp = yylpe = yylpsns; 823 1.1 christos #endif 824 1.1 christos yylexp = yylexemes; 825 1.1 christos if (yychar >= YYEOF) 826 1.1 christos { 827 1.1 christos *yylve++ = yylval; 828 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 829 1.1 christos *yylpe++ = yylloc; 830 1.1 christos #endif 831 1.2 christos *yylexp = (YYINT) yychar; 832 1.1 christos yychar = YYEMPTY; 833 1.1 christos } 834 1.1 christos } 835 1.1 christos } 836 1.1 christos if (yychar >= YYEOF) 837 1.1 christos { 838 1.1 christos yylvp--; 839 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 840 1.1 christos yylpp--; 841 1.1 christos #endif 842 1.1 christos yylexp--; 843 1.1 christos yychar = YYEMPTY; 844 1.1 christos } 845 1.1 christos save->lexeme = (int) (yylvp - yylvals); 846 1.1 christos yyps->save = save; 847 1.1 christos } 848 1.1 christos if (yytable[yyn] == ctry) 849 1.1 christos { 850 1.1 christos #if YYDEBUG 851 1.1 christos if (yydebug) 852 1.1 christos fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 853 1.1 christos YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); 854 1.1 christos #endif 855 1.1 christos if (yychar < 0) 856 1.1 christos { 857 1.1 christos yylvp++; 858 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 859 1.1 christos yylpp++; 860 1.1 christos #endif 861 1.1 christos yylexp++; 862 1.1 christos } 863 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 864 1.1 christos goto yyoverflow; 865 1.1 christos yystate = yyctable[ctry]; 866 1.2 christos *++yystack.s_mark = (YYINT) yystate; 867 1.1 christos *++yystack.l_mark = yylval; 868 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 869 1.1 christos *++yystack.p_mark = yylloc; 870 1.1 christos #endif 871 1.1 christos yychar = YYEMPTY; 872 1.1 christos if (yyerrflag > 0) --yyerrflag; 873 1.1 christos goto yyloop; 874 1.1 christos } 875 1.1 christos else 876 1.1 christos { 877 1.1 christos yyn = yyctable[ctry]; 878 1.1 christos goto yyreduce; 879 1.1 christos } 880 1.1 christos } /* End of code dealing with conflicts */ 881 1.1 christos #endif /* YYBTYACC */ 882 1.1 christos if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 883 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 884 1.1 christos { 885 1.1 christos #if YYDEBUG 886 1.1 christos if (yydebug) 887 1.1 christos fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 888 1.1 christos YYDEBUGSTR, yydepth, yystate, yytable[yyn]); 889 1.1 christos #endif 890 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 891 1.1 christos yystate = yytable[yyn]; 892 1.1 christos *++yystack.s_mark = yytable[yyn]; 893 1.1 christos *++yystack.l_mark = yylval; 894 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 895 1.1 christos *++yystack.p_mark = yylloc; 896 1.1 christos #endif 897 1.1 christos yychar = YYEMPTY; 898 1.1 christos if (yyerrflag > 0) --yyerrflag; 899 1.1 christos goto yyloop; 900 1.1 christos } 901 1.1 christos if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 902 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 903 1.1 christos { 904 1.1 christos yyn = yytable[yyn]; 905 1.1 christos goto yyreduce; 906 1.1 christos } 907 1.1 christos if (yyerrflag != 0) goto yyinrecovery; 908 1.1 christos #if YYBTYACC 909 1.1 christos 910 1.1 christos yynewerrflag = 1; 911 1.1 christos goto yyerrhandler; 912 1.2 christos goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 913 1.1 christos 914 1.1 christos yyerrlab: 915 1.2 christos /* explicit YYERROR from an action -- pop the rhs of the rule reduced 916 1.2 christos * before looking for error recovery */ 917 1.2 christos yystack.s_mark -= yym; 918 1.2 christos yystate = *yystack.s_mark; 919 1.2 christos yystack.l_mark -= yym; 920 1.2 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 921 1.2 christos yystack.p_mark -= yym; 922 1.2 christos #endif 923 1.2 christos 924 1.1 christos yynewerrflag = 0; 925 1.1 christos yyerrhandler: 926 1.1 christos while (yyps->save) 927 1.1 christos { 928 1.1 christos int ctry; 929 1.1 christos YYParseState *save = yyps->save; 930 1.1 christos #if YYDEBUG 931 1.1 christos if (yydebug) 932 1.1 christos fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", 933 1.1 christos YYDEBUGSTR, yydepth, yystate, yyps->save->state, 934 1.1 christos (int)(yylvp - yylvals - yyps->save->lexeme)); 935 1.1 christos #endif 936 1.1 christos /* Memorize most forward-looking error state in case it's really an error. */ 937 1.1 christos if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) 938 1.1 christos { 939 1.1 christos /* Free old saved error context state */ 940 1.1 christos if (yyerrctx) yyFreeState(yyerrctx); 941 1.1 christos /* Create and fill out new saved error context state */ 942 1.1 christos yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 943 1.1 christos if (yyerrctx == NULL) goto yyenomem; 944 1.1 christos yyerrctx->save = yyps->save; 945 1.1 christos yyerrctx->state = yystate; 946 1.1 christos yyerrctx->errflag = yyerrflag; 947 1.1 christos yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); 948 1.2 christos memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 949 1.1 christos yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); 950 1.1 christos memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 951 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 952 1.1 christos yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); 953 1.1 christos memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 954 1.1 christos #endif 955 1.1 christos yyerrctx->lexeme = (int) (yylvp - yylvals); 956 1.1 christos } 957 1.1 christos yylvp = yylvals + save->lexeme; 958 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 959 1.1 christos yylpp = yylpsns + save->lexeme; 960 1.1 christos #endif 961 1.1 christos yylexp = yylexemes + save->lexeme; 962 1.1 christos yychar = YYEMPTY; 963 1.1 christos yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); 964 1.2 christos memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 965 1.1 christos yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); 966 1.1 christos memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 967 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 968 1.1 christos yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); 969 1.1 christos memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 970 1.1 christos #endif 971 1.1 christos ctry = ++save->ctry; 972 1.1 christos yystate = save->state; 973 1.1 christos /* We tried shift, try reduce now */ 974 1.1 christos if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 975 1.1 christos yyps->save = save->save; 976 1.1 christos save->save = NULL; 977 1.1 christos yyFreeState(save); 978 1.1 christos 979 1.1 christos /* Nothing left on the stack -- error */ 980 1.1 christos if (!yyps->save) 981 1.1 christos { 982 1.1 christos #if YYDEBUG 983 1.1 christos if (yydebug) 984 1.1 christos fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", 985 1.1 christos YYPREFIX, yydepth); 986 1.1 christos #endif 987 1.1 christos /* Restore state as it was in the most forward-advanced error */ 988 1.1 christos yylvp = yylvals + yyerrctx->lexeme; 989 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 990 1.1 christos yylpp = yylpsns + yyerrctx->lexeme; 991 1.1 christos #endif 992 1.1 christos yylexp = yylexemes + yyerrctx->lexeme; 993 1.1 christos yychar = yylexp[-1]; 994 1.1 christos yylval = yylvp[-1]; 995 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 996 1.1 christos yylloc = yylpp[-1]; 997 1.1 christos #endif 998 1.1 christos yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); 999 1.2 christos memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1000 1.1 christos yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); 1001 1.1 christos memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1002 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1003 1.1 christos yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); 1004 1.1 christos memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1005 1.1 christos #endif 1006 1.1 christos yystate = yyerrctx->state; 1007 1.1 christos yyFreeState(yyerrctx); 1008 1.1 christos yyerrctx = NULL; 1009 1.1 christos } 1010 1.1 christos yynewerrflag = 1; 1011 1.1 christos } 1012 1.1 christos if (yynewerrflag == 0) goto yyinrecovery; 1013 1.1 christos #endif /* YYBTYACC */ 1014 1.1 christos 1015 1.1 christos YYERROR_CALL("syntax error"); 1016 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1017 1.4 christos yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ 1018 1.1 christos #endif 1019 1.1 christos 1020 1.1 christos #if !YYBTYACC 1021 1.2 christos goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 1022 1.1 christos yyerrlab: 1023 1.1 christos #endif 1024 1.1 christos ++yynerrs; 1025 1.1 christos 1026 1.1 christos yyinrecovery: 1027 1.1 christos if (yyerrflag < 3) 1028 1.1 christos { 1029 1.1 christos yyerrflag = 3; 1030 1.1 christos for (;;) 1031 1.1 christos { 1032 1.1 christos if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 1033 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 1034 1.1 christos { 1035 1.1 christos #if YYDEBUG 1036 1.1 christos if (yydebug) 1037 1.1 christos fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", 1038 1.1 christos YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); 1039 1.1 christos #endif 1040 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1041 1.1 christos yystate = yytable[yyn]; 1042 1.1 christos *++yystack.s_mark = yytable[yyn]; 1043 1.1 christos *++yystack.l_mark = yylval; 1044 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1045 1.1 christos /* lookahead position is error end position */ 1046 1.4 christos yyerror_loc_range[2] = yylloc; 1047 1.1 christos YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ 1048 1.1 christos *++yystack.p_mark = yyloc; 1049 1.1 christos #endif 1050 1.1 christos goto yyloop; 1051 1.1 christos } 1052 1.1 christos else 1053 1.1 christos { 1054 1.1 christos #if YYDEBUG 1055 1.1 christos if (yydebug) 1056 1.1 christos fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", 1057 1.1 christos YYDEBUGSTR, yydepth, *yystack.s_mark); 1058 1.1 christos #endif 1059 1.1 christos if (yystack.s_mark <= yystack.s_base) goto yyabort; 1060 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1061 1.1 christos /* the current TOS position is the error start position */ 1062 1.4 christos yyerror_loc_range[1] = *yystack.p_mark; 1063 1.1 christos #endif 1064 1.1 christos #if defined(YYDESTRUCT_CALL) 1065 1.1 christos #if YYBTYACC 1066 1.1 christos if (!yytrial) 1067 1.1 christos #endif /* YYBTYACC */ 1068 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1069 1.1 christos YYDESTRUCT_CALL("error: discarding state", 1070 1.1 christos yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); 1071 1.1 christos #else 1072 1.1 christos YYDESTRUCT_CALL("error: discarding state", 1073 1.1 christos yystos[*yystack.s_mark], yystack.l_mark); 1074 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1075 1.1 christos #endif /* defined(YYDESTRUCT_CALL) */ 1076 1.1 christos --yystack.s_mark; 1077 1.1 christos --yystack.l_mark; 1078 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1079 1.1 christos --yystack.p_mark; 1080 1.1 christos #endif 1081 1.1 christos } 1082 1.1 christos } 1083 1.1 christos } 1084 1.1 christos else 1085 1.1 christos { 1086 1.1 christos if (yychar == YYEOF) goto yyabort; 1087 1.1 christos #if YYDEBUG 1088 1.1 christos if (yydebug) 1089 1.1 christos { 1090 1.2 christos if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1091 1.1 christos fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", 1092 1.1 christos YYDEBUGSTR, yydepth, yystate, yychar, yys); 1093 1.1 christos } 1094 1.1 christos #endif 1095 1.1 christos #if defined(YYDESTRUCT_CALL) 1096 1.1 christos #if YYBTYACC 1097 1.1 christos if (!yytrial) 1098 1.1 christos #endif /* YYBTYACC */ 1099 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1100 1.1 christos YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); 1101 1.1 christos #else 1102 1.1 christos YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); 1103 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1104 1.1 christos #endif /* defined(YYDESTRUCT_CALL) */ 1105 1.1 christos yychar = YYEMPTY; 1106 1.1 christos goto yyloop; 1107 1.1 christos } 1108 1.1 christos 1109 1.1 christos yyreduce: 1110 1.1 christos yym = yylen[yyn]; 1111 1.1 christos #if YYDEBUG 1112 1.1 christos if (yydebug) 1113 1.1 christos { 1114 1.1 christos fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", 1115 1.1 christos YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); 1116 1.1 christos #ifdef YYSTYPE_TOSTRING 1117 1.1 christos #if YYBTYACC 1118 1.1 christos if (!yytrial) 1119 1.1 christos #endif /* YYBTYACC */ 1120 1.1 christos if (yym > 0) 1121 1.1 christos { 1122 1.1 christos int i; 1123 1.1 christos fputc('<', stderr); 1124 1.1 christos for (i = yym; i > 0; i--) 1125 1.1 christos { 1126 1.1 christos if (i != yym) fputs(", ", stderr); 1127 1.1 christos fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], 1128 1.1 christos yystack.l_mark[1-i]), stderr); 1129 1.1 christos } 1130 1.1 christos fputc('>', stderr); 1131 1.1 christos } 1132 1.1 christos #endif 1133 1.1 christos fputc('\n', stderr); 1134 1.1 christos } 1135 1.1 christos #endif 1136 1.1 christos if (yym > 0) 1137 1.1 christos yyval = yystack.l_mark[1-yym]; 1138 1.1 christos else 1139 1.1 christos memset(&yyval, 0, sizeof yyval); 1140 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1141 1.1 christos 1142 1.1 christos /* Perform position reduction */ 1143 1.1 christos memset(&yyloc, 0, sizeof(yyloc)); 1144 1.1 christos #if YYBTYACC 1145 1.1 christos if (!yytrial) 1146 1.1 christos #endif /* YYBTYACC */ 1147 1.1 christos { 1148 1.4 christos YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); 1149 1.1 christos /* just in case YYERROR is invoked within the action, save 1150 1.1 christos the start of the rhs as the error start position */ 1151 1.4 christos yyerror_loc_range[1] = yystack.p_mark[1-yym]; 1152 1.1 christos } 1153 1.1 christos #endif 1154 1.1 christos 1155 1.1 christos switch (yyn) 1156 1.1 christos { 1157 1.1 christos case 1: 1158 1.1 christos #line 50 "err_inherit3.y" 1159 1.1 christos yyval.cval = yystack.l_mark[-1].cval; 1160 1.7 christos #line 1159 "err_inherit3.tab.c" 1161 1.1 christos break; 1162 1.1 christos case 2: 1163 1.1 christos #line 50 "err_inherit3.y" 1164 1.1 christos yyval.tval = yystack.l_mark[-1].tval; 1165 1.7 christos #line 1164 "err_inherit3.tab.c" 1166 1.1 christos break; 1167 1.1 christos case 3: 1168 1.1 christos #line 51 "err_inherit3.y" 1169 1.1 christos { yyval.nlist = yystack.l_mark[0].nlist; } 1170 1.7 christos #line 1169 "err_inherit3.tab.c" 1171 1.1 christos break; 1172 1.1 christos case 4: 1173 1.1 christos #line 53 "err_inherit3.y" 1174 1.1 christos { yyval.nlist = yystack.l_mark[0].nlist; } 1175 1.7 christos #line 1174 "err_inherit3.tab.c" 1176 1.1 christos break; 1177 1.2 christos case 5: 1178 1.1 christos #line 56 "err_inherit3.y" 1179 1.1 christos { yyval.cval = cGLOBAL; } 1180 1.7 christos #line 1179 "err_inherit3.tab.c" 1181 1.1 christos break; 1182 1.2 christos case 6: 1183 1.1 christos #line 57 "err_inherit3.y" 1184 1.1 christos { yyval.cval = cLOCAL; } 1185 1.7 christos #line 1184 "err_inherit3.tab.c" 1186 1.1 christos break; 1187 1.2 christos case 7: 1188 1.1 christos #line 60 "err_inherit3.y" 1189 1.1 christos { yyval.tval = tREAL; } 1190 1.7 christos #line 1189 "err_inherit3.tab.c" 1191 1.1 christos break; 1192 1.2 christos case 8: 1193 1.1 christos #line 61 "err_inherit3.y" 1194 1.1 christos { yyval.tval = tINTEGER; } 1195 1.7 christos #line 1194 "err_inherit3.tab.c" 1196 1.1 christos break; 1197 1.2 christos case 9: 1198 1.1 christos #line 64 "err_inherit3.y" 1199 1.1 christos yyval.cval = yystack.l_mark[-2]; 1200 1.7 christos #line 1199 "err_inherit3.tab.c" 1201 1.1 christos break; 1202 1.2 christos case 10: 1203 1.1 christos #line 65 "err_inherit3.y" 1204 1.1 christos { yyval.nlist->s = mksymbol(yystack.l_mark[-5].tval, yystack.l_mark[-5].cval, yystack.l_mark[0].id); 1205 1.1 christos yyval.nlist->next = yystack.l_mark[-1].nlist; 1206 1.1 christos } 1207 1.7 christos #line 1206 "err_inherit3.tab.c" 1208 1.1 christos break; 1209 1.2 christos case 11: 1210 1.1 christos #line 69 "err_inherit3.y" 1211 1.1 christos { yyval.nlist->s = mksymbol(yystack.l_mark[-3], yystack.l_mark[-3], yystack.l_mark[0].id); 1212 1.1 christos yyval.nlist->next = NULL; 1213 1.1 christos } 1214 1.7 christos #line 1213 "err_inherit3.tab.c" 1215 1.1 christos break; 1216 1.2 christos case 12: 1217 1.1 christos #line 74 "err_inherit3.y" 1218 1.1 christos yyval.cval = cLOCAL; 1219 1.7 christos #line 1218 "err_inherit3.tab.c" 1220 1.1 christos break; 1221 1.2 christos case 13: 1222 1.1 christos #line 75 "err_inherit3.y" 1223 1.1 christos { yyval.nlist = yystack.l_mark[0].nlist; } 1224 1.7 christos #line 1223 "err_inherit3.tab.c" 1225 1.1 christos break; 1226 1.7 christos #line 1225 "err_inherit3.tab.c" 1227 1.1 christos default: 1228 1.1 christos break; 1229 1.1 christos } 1230 1.1 christos yystack.s_mark -= yym; 1231 1.1 christos yystate = *yystack.s_mark; 1232 1.1 christos yystack.l_mark -= yym; 1233 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1234 1.1 christos yystack.p_mark -= yym; 1235 1.1 christos #endif 1236 1.1 christos yym = yylhs[yyn]; 1237 1.1 christos if (yystate == 0 && yym == 0) 1238 1.1 christos { 1239 1.1 christos #if YYDEBUG 1240 1.1 christos if (yydebug) 1241 1.1 christos { 1242 1.1 christos fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1243 1.1 christos #ifdef YYSTYPE_TOSTRING 1244 1.1 christos #if YYBTYACC 1245 1.1 christos if (!yytrial) 1246 1.1 christos #endif /* YYBTYACC */ 1247 1.1 christos fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); 1248 1.1 christos #endif 1249 1.1 christos fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); 1250 1.1 christos } 1251 1.1 christos #endif 1252 1.1 christos yystate = YYFINAL; 1253 1.1 christos *++yystack.s_mark = YYFINAL; 1254 1.1 christos *++yystack.l_mark = yyval; 1255 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1256 1.1 christos *++yystack.p_mark = yyloc; 1257 1.1 christos #endif 1258 1.1 christos if (yychar < 0) 1259 1.1 christos { 1260 1.1 christos #if YYBTYACC 1261 1.1 christos do { 1262 1.1 christos if (yylvp < yylve) 1263 1.1 christos { 1264 1.1 christos /* we're currently re-reading tokens */ 1265 1.1 christos yylval = *yylvp++; 1266 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1267 1.1 christos yylloc = *yylpp++; 1268 1.1 christos #endif 1269 1.1 christos yychar = *yylexp++; 1270 1.1 christos break; 1271 1.1 christos } 1272 1.1 christos if (yyps->save) 1273 1.1 christos { 1274 1.1 christos /* in trial mode; save scanner results for future parse attempts */ 1275 1.1 christos if (yylvp == yylvlim) 1276 1.1 christos { /* Enlarge lexical value queue */ 1277 1.1 christos size_t p = (size_t) (yylvp - yylvals); 1278 1.1 christos size_t s = (size_t) (yylvlim - yylvals); 1279 1.1 christos 1280 1.1 christos s += YYLVQUEUEGROWTH; 1281 1.4 christos if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) 1282 1.1 christos goto yyenomem; 1283 1.4 christos if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 1284 1.1 christos goto yyenomem; 1285 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1286 1.4 christos if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 1287 1.1 christos goto yyenomem; 1288 1.1 christos #endif 1289 1.1 christos yylvp = yylve = yylvals + p; 1290 1.1 christos yylvlim = yylvals + s; 1291 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1292 1.1 christos yylpp = yylpe = yylpsns + p; 1293 1.1 christos yylplim = yylpsns + s; 1294 1.1 christos #endif 1295 1.1 christos yylexp = yylexemes + p; 1296 1.1 christos } 1297 1.2 christos *yylexp = (YYINT) YYLEX; 1298 1.1 christos *yylvp++ = yylval; 1299 1.1 christos yylve++; 1300 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1301 1.1 christos *yylpp++ = yylloc; 1302 1.1 christos yylpe++; 1303 1.1 christos #endif 1304 1.1 christos yychar = *yylexp++; 1305 1.1 christos break; 1306 1.1 christos } 1307 1.1 christos /* normal operation, no conflict encountered */ 1308 1.1 christos #endif /* YYBTYACC */ 1309 1.1 christos yychar = YYLEX; 1310 1.1 christos #if YYBTYACC 1311 1.1 christos } while (0); 1312 1.1 christos #endif /* YYBTYACC */ 1313 1.1 christos if (yychar < 0) yychar = YYEOF; 1314 1.1 christos #if YYDEBUG 1315 1.1 christos if (yydebug) 1316 1.1 christos { 1317 1.2 christos if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1318 1.2 christos fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n", 1319 1.1 christos YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); 1320 1.1 christos } 1321 1.1 christos #endif 1322 1.1 christos } 1323 1.1 christos if (yychar == YYEOF) goto yyaccept; 1324 1.1 christos goto yyloop; 1325 1.1 christos } 1326 1.1 christos if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 1327 1.1 christos yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 1328 1.1 christos yystate = yytable[yyn]; 1329 1.1 christos else 1330 1.1 christos yystate = yydgoto[yym]; 1331 1.1 christos #if YYDEBUG 1332 1.1 christos if (yydebug) 1333 1.1 christos { 1334 1.1 christos fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 1335 1.1 christos #ifdef YYSTYPE_TOSTRING 1336 1.1 christos #if YYBTYACC 1337 1.1 christos if (!yytrial) 1338 1.1 christos #endif /* YYBTYACC */ 1339 1.1 christos fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 1340 1.1 christos #endif 1341 1.1 christos fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 1342 1.1 christos } 1343 1.1 christos #endif 1344 1.1 christos if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1345 1.2 christos *++yystack.s_mark = (YYINT) yystate; 1346 1.1 christos *++yystack.l_mark = yyval; 1347 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1348 1.1 christos *++yystack.p_mark = yyloc; 1349 1.1 christos #endif 1350 1.1 christos goto yyloop; 1351 1.1 christos #if YYBTYACC 1352 1.1 christos 1353 1.1 christos /* Reduction declares that this path is valid. Set yypath and do a full parse */ 1354 1.1 christos yyvalid: 1355 1.1 christos if (yypath) YYABORT; 1356 1.1 christos while (yyps->save) 1357 1.1 christos { 1358 1.1 christos YYParseState *save = yyps->save; 1359 1.1 christos yyps->save = save->save; 1360 1.1 christos save->save = yypath; 1361 1.1 christos yypath = save; 1362 1.1 christos } 1363 1.1 christos #if YYDEBUG 1364 1.1 christos if (yydebug) 1365 1.1 christos fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", 1366 1.1 christos YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); 1367 1.1 christos #endif 1368 1.1 christos if (yyerrctx) 1369 1.1 christos { 1370 1.1 christos yyFreeState(yyerrctx); 1371 1.1 christos yyerrctx = NULL; 1372 1.1 christos } 1373 1.1 christos yylvp = yylvals + yypath->lexeme; 1374 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1375 1.1 christos yylpp = yylpsns + yypath->lexeme; 1376 1.1 christos #endif 1377 1.1 christos yylexp = yylexemes + yypath->lexeme; 1378 1.1 christos yychar = YYEMPTY; 1379 1.1 christos yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 1380 1.2 christos memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1381 1.1 christos yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 1382 1.1 christos memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1383 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1384 1.1 christos yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 1385 1.1 christos memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1386 1.1 christos #endif 1387 1.1 christos yystate = yypath->state; 1388 1.1 christos goto yyloop; 1389 1.1 christos #endif /* YYBTYACC */ 1390 1.1 christos 1391 1.1 christos yyoverflow: 1392 1.1 christos YYERROR_CALL("yacc stack overflow"); 1393 1.1 christos #if YYBTYACC 1394 1.1 christos goto yyabort_nomem; 1395 1.1 christos yyenomem: 1396 1.1 christos YYERROR_CALL("memory exhausted"); 1397 1.1 christos yyabort_nomem: 1398 1.1 christos #endif /* YYBTYACC */ 1399 1.1 christos yyresult = 2; 1400 1.1 christos goto yyreturn; 1401 1.1 christos 1402 1.1 christos yyabort: 1403 1.1 christos yyresult = 1; 1404 1.1 christos goto yyreturn; 1405 1.1 christos 1406 1.1 christos yyaccept: 1407 1.1 christos #if YYBTYACC 1408 1.1 christos if (yyps->save) goto yyvalid; 1409 1.1 christos #endif /* YYBTYACC */ 1410 1.1 christos yyresult = 0; 1411 1.1 christos 1412 1.1 christos yyreturn: 1413 1.1 christos #if defined(YYDESTRUCT_CALL) 1414 1.1 christos if (yychar != YYEOF && yychar != YYEMPTY) 1415 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1416 1.1 christos YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); 1417 1.1 christos #else 1418 1.1 christos YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); 1419 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1420 1.1 christos 1421 1.1 christos { 1422 1.1 christos YYSTYPE *pv; 1423 1.1 christos #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1424 1.1 christos YYLTYPE *pp; 1425 1.1 christos 1426 1.1 christos for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) 1427 1.1 christos YYDESTRUCT_CALL("cleanup: discarding state", 1428 1.1 christos yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); 1429 1.1 christos #else 1430 1.1 christos for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) 1431 1.1 christos YYDESTRUCT_CALL("cleanup: discarding state", 1432 1.1 christos yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); 1433 1.1 christos #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1434 1.1 christos } 1435 1.1 christos #endif /* defined(YYDESTRUCT_CALL) */ 1436 1.1 christos 1437 1.1 christos #if YYBTYACC 1438 1.1 christos if (yyerrctx) 1439 1.1 christos { 1440 1.1 christos yyFreeState(yyerrctx); 1441 1.1 christos yyerrctx = NULL; 1442 1.1 christos } 1443 1.1 christos while (yyps) 1444 1.1 christos { 1445 1.1 christos YYParseState *save = yyps; 1446 1.1 christos yyps = save->save; 1447 1.1 christos save->save = NULL; 1448 1.1 christos yyFreeState(save); 1449 1.1 christos } 1450 1.1 christos while (yypath) 1451 1.1 christos { 1452 1.1 christos YYParseState *save = yypath; 1453 1.1 christos yypath = save->save; 1454 1.1 christos save->save = NULL; 1455 1.1 christos yyFreeState(save); 1456 1.1 christos } 1457 1.1 christos #endif /* YYBTYACC */ 1458 1.1 christos yyfreestack(&yystack); 1459 1.1 christos return (yyresult); 1460 1.1 christos } 1461