1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 2 7 #define YYMINOR 0 8 #define YYCHECK "yyyymmdd" 9 10 #define YYEMPTY (-1) 11 #define yyclearin (yychar = YYEMPTY) 12 #define yyerrok (yyerrflag = 0) 13 #define YYRECOVERING() (yyerrflag != 0) 14 #define YYENOMEM (-2) 15 #define YYEOF 0 16 #undef YYBTYACC 17 #define YYBTYACC 0 18 #define YYDEBUGSTR YYPREFIX "debug" 19 20 #ifndef yyparse 21 #define yyparse grammar_parse 22 #endif /* yyparse */ 23 24 #ifndef yylex 25 #define yylex grammar_lex 26 #endif /* yylex */ 27 28 #ifndef yyerror 29 #define yyerror grammar_error 30 #endif /* yyerror */ 31 32 #ifndef yychar 33 #define yychar grammar_char 34 #endif /* yychar */ 35 36 #ifndef yyval 37 #define yyval grammar_val 38 #endif /* yyval */ 39 40 #ifndef yylval 41 #define yylval grammar_lval 42 #endif /* yylval */ 43 44 #ifndef yydebug 45 #define yydebug grammar_debug 46 #endif /* yydebug */ 47 48 #ifndef yynerrs 49 #define yynerrs grammar_nerrs 50 #endif /* yynerrs */ 51 52 #ifndef yyerrflag 53 #define yyerrflag grammar_errflag 54 #endif /* yyerrflag */ 55 56 #ifndef yylhs 57 #define yylhs grammar_lhs 58 #endif /* yylhs */ 59 60 #ifndef yylen 61 #define yylen grammar_len 62 #endif /* yylen */ 63 64 #ifndef yydefred 65 #define yydefred grammar_defred 66 #endif /* yydefred */ 67 68 #ifndef yystos 69 #define yystos grammar_stos 70 #endif /* yystos */ 71 72 #ifndef yydgoto 73 #define yydgoto grammar_dgoto 74 #endif /* yydgoto */ 75 76 #ifndef yysindex 77 #define yysindex grammar_sindex 78 #endif /* yysindex */ 79 80 #ifndef yyrindex 81 #define yyrindex grammar_rindex 82 #endif /* yyrindex */ 83 84 #ifndef yygindex 85 #define yygindex grammar_gindex 86 #endif /* yygindex */ 87 88 #ifndef yytable 89 #define yytable grammar_table 90 #endif /* yytable */ 91 92 #ifndef yycheck 93 #define yycheck grammar_check 94 #endif /* yycheck */ 95 96 #ifndef yyname 97 #define yyname grammar_name 98 #endif /* yyname */ 99 100 #ifndef yyrule 101 #define yyrule grammar_rule 102 #endif /* yyrule */ 103 104 #if YYBTYACC 105 106 #ifndef yycindex 107 #define yycindex grammar_cindex 108 #endif /* yycindex */ 109 110 #ifndef yyctable 111 #define yyctable grammar_ctable 112 #endif /* yyctable */ 113 114 #endif /* YYBTYACC */ 115 116 #define YYPREFIX "grammar_" 117 118 #define YYPURE 0 119 120 #line 9 "grammar.y" 121 #ifdef YYBISON 122 #include <stdlib.h> 123 #define YYSTYPE_IS_DECLARED 124 #define yyerror yaccError 125 #endif 126 127 #if defined(YYBISON) || !defined(YYBYACC) 128 static void yyerror(const char *s); 129 #endif 130 #line 81 "grammar.y" 131 #include <stdio.h> 132 #include <ctype.h> 133 #include <string.h> 134 135 #define OPT_LINTLIBRARY 1 136 137 #ifndef TRUE 138 #define TRUE (1) 139 #endif 140 141 #ifndef FALSE 142 #define FALSE (0) 143 #endif 144 145 /* #include "cproto.h" */ 146 #define MAX_TEXT_SIZE 1024 147 #define TEXT_LEN (MAX_TEXT_SIZE / 2 - 3) 148 149 /* Prototype styles */ 150 #if OPT_LINTLIBRARY 151 #define PROTO_ANSI_LLIB -2 /* form ANSI lint-library source */ 152 #define PROTO_LINTLIBRARY -1 /* form lint-library source */ 153 #endif 154 #define PROTO_NONE 0 /* do not output any prototypes */ 155 #define PROTO_TRADITIONAL 1 /* comment out parameters */ 156 #define PROTO_ABSTRACT 2 /* comment out parameter names */ 157 #define PROTO_ANSI 3 /* ANSI C prototype */ 158 159 typedef int PrototypeStyle; 160 161 typedef char boolean; 162 163 extern boolean types_out; 164 extern PrototypeStyle proto_style; 165 166 #define ansiLintLibrary() (proto_style == PROTO_ANSI_LLIB) 167 #define knrLintLibrary() (proto_style == PROTO_LINTLIBRARY) 168 #define lintLibrary() (knrLintLibrary() || ansiLintLibrary()) 169 170 #if OPT_LINTLIBRARY 171 #define FUNC_UNKNOWN -1 /* unspecified */ 172 #else 173 #define FUNC_UNKNOWN 0 /* unspecified (same as FUNC_NONE) */ 174 #endif 175 #define FUNC_NONE 0 /* not a function definition */ 176 #define FUNC_TRADITIONAL 1 /* traditional style */ 177 #define FUNC_ANSI 2 /* ANSI style */ 178 #define FUNC_BOTH 3 /* both styles */ 179 180 typedef int FuncDefStyle; 181 182 /* Source file text */ 183 typedef struct text { 184 char text[MAX_TEXT_SIZE]; /* source text */ 185 long begin; /* offset in temporary file */ 186 } Text; 187 188 /* Declaration specifier flags */ 189 #define DS_NONE 0 /* default */ 190 #define DS_EXTERN 1 /* contains "extern" specifier */ 191 #define DS_STATIC 2 /* contains "static" specifier */ 192 #define DS_CHAR 4 /* contains "char" type specifier */ 193 #define DS_SHORT 8 /* contains "short" type specifier */ 194 #define DS_FLOAT 16 /* contains "float" type specifier */ 195 #define DS_INLINE 32 /* contains "inline" specifier */ 196 #define DS_JUNK 64 /* we're not interested in this declaration */ 197 198 /* This structure stores information about a declaration specifier. */ 199 typedef struct decl_spec { 200 unsigned short flags; /* flags defined above */ 201 char *text; /* source text */ 202 long begin; /* offset in temporary file */ 203 } DeclSpec; 204 205 /* This is a list of function parameters. */ 206 typedef struct _ParameterList { 207 struct parameter *first; /* pointer to first parameter in list */ 208 struct parameter *last; /* pointer to last parameter in list */ 209 long begin_comment; /* begin offset of comment */ 210 long end_comment; /* end offset of comment */ 211 char *comment; /* comment at start of parameter list */ 212 } ParameterList; 213 214 /* This structure stores information about a declarator. */ 215 typedef struct _Declarator { 216 char *name; /* name of variable or function */ 217 char *text; /* source text */ 218 long begin; /* offset in temporary file */ 219 long begin_comment; /* begin offset of comment */ 220 long end_comment; /* end offset of comment */ 221 FuncDefStyle func_def; /* style of function definition */ 222 ParameterList params; /* function parameters */ 223 boolean pointer; /* TRUE if it declares a pointer */ 224 struct _Declarator *head; /* head function declarator */ 225 struct _Declarator *func_stack; /* stack of function declarators */ 226 struct _Declarator *next; /* next declarator in list */ 227 } Declarator; 228 229 /* This structure stores information about a function parameter. */ 230 typedef struct parameter { 231 struct parameter *next; /* next parameter in list */ 232 DeclSpec decl_spec; 233 Declarator *declarator; 234 char *comment; /* comment following the parameter */ 235 } Parameter; 236 237 /* This is a list of declarators. */ 238 typedef struct declarator_list { 239 Declarator *first; /* pointer to first declarator in list */ 240 Declarator *last; /* pointer to last declarator in list */ 241 } DeclaratorList; 242 243 /* #include "symbol.h" */ 244 typedef struct symbol { 245 struct symbol *next; /* next symbol in list */ 246 char *name; /* name of symbol */ 247 char *value; /* value of symbol (for defines) */ 248 short flags; /* symbol attributes */ 249 } Symbol; 250 251 /* parser stack entry type */ 252 typedef union { 253 Text text; 254 DeclSpec decl_spec; 255 Parameter *parameter; 256 ParameterList param_list; 257 Declarator *declarator; 258 DeclaratorList decl_list; 259 } YYSTYPE; 260 261 /* The hash table length should be a prime number. */ 262 #define SYM_MAX_HASH 251 263 264 typedef struct symbol_table { 265 Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */ 266 } SymbolTable; 267 268 extern SymbolTable *new_symbol_table /* Create symbol table */ 269 (void); 270 extern void free_symbol_table /* Destroy symbol table */ 271 (SymbolTable *s); 272 extern Symbol *find_symbol /* Lookup symbol name */ 273 (SymbolTable *s, const char *n); 274 extern Symbol *new_symbol /* Define new symbol */ 275 (SymbolTable *s, const char *n, const char *v, int f); 276 277 /* #include "semantic.h" */ 278 extern void new_decl_spec (DeclSpec *, const char *, long, int); 279 extern void free_decl_spec (DeclSpec *); 280 extern void join_decl_specs (DeclSpec *, DeclSpec *, DeclSpec *); 281 extern void check_untagged (DeclSpec *); 282 extern Declarator *new_declarator (const char *, const char *, long); 283 extern void free_declarator (Declarator *); 284 extern void new_decl_list (DeclaratorList *, Declarator *); 285 extern void free_decl_list (DeclaratorList *); 286 extern void add_decl_list (DeclaratorList *, DeclaratorList *, Declarator *); 287 extern Parameter *new_parameter (DeclSpec *, Declarator *); 288 extern void free_parameter (Parameter *); 289 extern void new_param_list (ParameterList *, Parameter *); 290 extern void free_param_list (ParameterList *); 291 extern void add_param_list (ParameterList *, ParameterList *, Parameter *); 292 extern void new_ident_list (ParameterList *); 293 extern void add_ident_list (ParameterList *, ParameterList *, const char *); 294 extern void set_param_types (ParameterList *, DeclSpec *, DeclaratorList *); 295 extern void gen_declarations (DeclSpec *, DeclaratorList *); 296 extern void gen_prototype (DeclSpec *, Declarator *); 297 extern void gen_func_declarator (Declarator *); 298 extern void gen_func_definition (DeclSpec *, Declarator *); 299 300 extern void init_parser (void); 301 extern void process_file (FILE *infile, char *name); 302 extern char *cur_text (void); 303 extern char *cur_file_name (void); 304 extern char *implied_typedef (void); 305 extern void include_file (char *name, int convert); 306 extern char *supply_parm (int count); 307 extern char *xstrdup (const char *); 308 extern int already_declared (char *name); 309 extern int is_actual_func (Declarator *d); 310 extern int lint_ellipsis (Parameter *p); 311 extern int want_typedef (void); 312 extern void begin_tracking (void); 313 extern void begin_typedef (void); 314 extern void copy_typedef (char *s); 315 extern void ellipsis_varargs (Declarator *d); 316 extern void end_typedef (void); 317 extern void flush_varargs (void); 318 extern void fmt_library (int code); 319 extern void imply_typedef (const char *s); 320 extern void indent (FILE *outf); 321 extern void put_blankline (FILE *outf); 322 extern void put_body (FILE *outf, DeclSpec *decl_spec, Declarator *declarator); 323 extern void put_char (FILE *outf, int c); 324 extern void put_error (void); 325 extern void put_newline (FILE *outf); 326 extern void put_padded (FILE *outf, const char *s); 327 extern void put_string (FILE *outf, const char *s); 328 extern void track_in (void); 329 330 extern boolean file_comments; 331 extern FuncDefStyle func_style; 332 extern char base_file[]; 333 334 extern int yylex (void); 335 336 /* declaration specifier attributes for the typedef statement currently being 337 * scanned 338 */ 339 static int cur_decl_spec_flags; 340 341 /* pointer to parameter list for the current function definition */ 342 static ParameterList *func_params; 343 344 /* A parser semantic action sets this pointer to the current declarator in 345 * a function parameter declaration in order to catch any comments following 346 * the parameter declaration on the same line. If the lexer scans a comment 347 * and <cur_declarator> is not NULL, then the comment is attached to the 348 * declarator. To ignore subsequent comments, the lexer sets this to NULL 349 * after scanning a comment or end of line. 350 */ 351 static Declarator *cur_declarator; 352 353 /* temporary string buffer */ 354 static char buf[MAX_TEXT_SIZE]; 355 356 /* table of typedef names */ 357 static SymbolTable *typedef_names; 358 359 /* table of define names */ 360 static SymbolTable *define_names; 361 362 /* table of type qualifiers */ 363 static SymbolTable *type_qualifiers; 364 365 /* information about the current input file */ 366 typedef struct { 367 char *base_name; /* base input file name */ 368 char *file_name; /* current file name */ 369 FILE *file; /* input file */ 370 unsigned line_num; /* current line number in input file */ 371 FILE *tmp_file; /* temporary file */ 372 long begin_comment; /* tmp file offset after last written ) or ; */ 373 long end_comment; /* tmp file offset after last comment */ 374 boolean convert; /* if TRUE, convert function definitions */ 375 boolean changed; /* TRUE if conversion done in this file */ 376 } IncludeStack; 377 378 static IncludeStack *cur_file; /* current input file */ 379 380 /* #include "yyerror.c" */ 381 382 static int haveAnsiParam (void); 383 384 385 /* Flags to enable us to find if a procedure returns a value. 386 */ 387 static int return_val; /* nonzero on BRACES iff return-expression found */ 388 389 static const char * 390 dft_decl_spec (void) 391 { 392 return (lintLibrary() && !return_val) ? "void" : "int"; 393 } 394 395 static int 396 haveAnsiParam (void) 397 { 398 Parameter *p; 399 if (func_params != 0) { 400 for (p = func_params->first; p != 0; p = p->next) { 401 if (p->declarator->func_def == FUNC_ANSI) { 402 return TRUE; 403 } 404 } 405 } 406 return FALSE; 407 } 408 #line 409 "grammar.tab.c" 409 410 /* compatibility with bison */ 411 #ifdef YYPARSE_PARAM 412 /* compatibility with FreeBSD */ 413 # ifdef YYPARSE_PARAM_TYPE 414 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 415 # else 416 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 417 # endif 418 #else 419 # define YYPARSE_DECL() yyparse(void) 420 #endif 421 422 /* Parameters sent to lex. */ 423 #ifdef YYLEX_PARAM 424 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 425 # define YYLEX yylex(YYLEX_PARAM) 426 #else 427 # define YYLEX_DECL() yylex(void) 428 # define YYLEX yylex() 429 #endif 430 431 /* Parameters sent to yyerror. */ 432 #ifndef YYERROR_DECL 433 #define YYERROR_DECL() yyerror(const char *s) 434 #endif 435 #ifndef YYERROR_CALL 436 #define YYERROR_CALL(msg) yyerror(msg) 437 #endif 438 439 extern int YYPARSE_DECL(); 440 441 #define T_IDENTIFIER 257 442 #define T_TYPEDEF_NAME 258 443 #define T_DEFINE_NAME 259 444 #define T_AUTO 260 445 #define T_EXTERN 261 446 #define T_REGISTER 262 447 #define T_STATIC 263 448 #define T_TYPEDEF 264 449 #define T_INLINE 265 450 #define T_EXTENSION 266 451 #define T_CHAR 267 452 #define T_DOUBLE 268 453 #define T_FLOAT 269 454 #define T_INT 270 455 #define T_VOID 271 456 #define T_LONG 272 457 #define T_SHORT 273 458 #define T_SIGNED 274 459 #define T_UNSIGNED 275 460 #define T_ENUM 276 461 #define T_STRUCT 277 462 #define T_UNION 278 463 #define T_Bool 279 464 #define T_Complex 280 465 #define T_Imaginary 281 466 #define T_TYPE_QUALIFIER 282 467 #define T_BRACKETS 283 468 #define T_LBRACE 284 469 #define T_MATCHRBRACE 285 470 #define T_ELLIPSIS 286 471 #define T_INITIALIZER 287 472 #define T_STRING_LITERAL 288 473 #define T_ASM 289 474 #define T_ASMARG 290 475 #define T_VA_DCL 291 476 #define YYERRCODE 256 477 typedef int YYINT; 478 static const YYINT grammar_lhs[] = { -1, 479 0, 0, 26, 26, 27, 27, 27, 27, 27, 27, 480 27, 31, 30, 30, 28, 28, 34, 28, 32, 32, 481 33, 33, 35, 35, 37, 38, 29, 39, 29, 36, 482 36, 36, 40, 40, 1, 1, 2, 2, 2, 3, 483 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 484 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 485 5, 5, 6, 6, 6, 19, 19, 8, 8, 9, 486 41, 9, 7, 7, 7, 25, 23, 23, 10, 10, 487 11, 11, 11, 11, 11, 20, 20, 21, 21, 22, 488 22, 14, 14, 15, 15, 16, 16, 16, 17, 17, 489 18, 18, 24, 24, 12, 12, 12, 13, 13, 13, 490 13, 13, 13, 13, 491 }; 492 static const YYINT grammar_len[] = { 2, 493 0, 1, 1, 2, 1, 1, 1, 1, 3, 2, 494 2, 2, 3, 3, 2, 3, 0, 5, 2, 1, 495 0, 1, 1, 3, 0, 0, 7, 0, 5, 0, 496 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 497 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 499 1, 1, 3, 2, 2, 1, 1, 1, 3, 1, 500 0, 4, 3, 2, 2, 1, 1, 1, 2, 1, 501 1, 3, 2, 4, 4, 2, 3, 0, 1, 1, 502 2, 1, 3, 1, 3, 2, 2, 1, 0, 1, 503 1, 3, 1, 2, 1, 2, 1, 3, 2, 1, 504 4, 3, 3, 2, 505 }; 506 static const YYINT grammar_defred[] = { 0, 507 0, 0, 0, 0, 77, 0, 62, 40, 0, 42, 508 43, 20, 44, 0, 46, 47, 48, 49, 54, 50, 509 51, 52, 53, 76, 66, 67, 55, 56, 57, 61, 510 0, 7, 0, 0, 35, 37, 38, 39, 59, 60, 511 28, 0, 0, 0, 103, 81, 0, 0, 3, 5, 512 6, 8, 0, 10, 11, 78, 0, 90, 0, 0, 513 104, 0, 19, 0, 41, 45, 15, 36, 0, 68, 514 0, 0, 0, 83, 0, 0, 64, 0, 0, 74, 515 4, 58, 0, 82, 87, 91, 0, 14, 13, 9, 516 16, 0, 71, 0, 31, 33, 0, 0, 0, 0, 517 0, 94, 0, 0, 101, 12, 63, 73, 0, 0, 518 69, 0, 0, 0, 34, 0, 110, 96, 97, 0, 519 0, 84, 0, 85, 0, 23, 0, 0, 72, 26, 520 29, 114, 0, 0, 0, 109, 0, 93, 95, 102, 521 18, 0, 0, 108, 113, 112, 0, 24, 27, 111, 522 }; 523 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) 524 static const YYINT grammar_stos[] = { 0, 525 256, 40, 42, 38, 257, 258, 259, 260, 261, 262, 526 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 527 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 528 289, 59, 293, 294, 295, 296, 297, 298, 299, 300, 529 303, 304, 312, 313, 316, 317, 318, 319, 320, 321, 530 322, 323, 325, 285, 59, 258, 303, 298, 314, 315, 531 316, 288, 264, 290, 261, 266, 59, 295, 301, 302, 532 303, 332, 40, 283, 284, 316, 324, 304, 316, 324, 533 320, 258, 294, 41, 313, 298, 294, 321, 324, 59, 534 59, 44, 61, 330, 291, 321, 329, 333, 294, 307, 535 308, 309, 310, 311, 316, 285, 324, 324, 327, 303, 536 302, 334, 329, 284, 321, 40, 283, 303, 305, 306, 537 313, 41, 44, 41, 44, 303, 326, 328, 287, 284, 538 285, 41, 305, 307, 40, 283, 306, 286, 309, 316, 539 59, 44, 331, 41, 41, 41, 307, 303, 285, 41, 540 }; 541 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ 542 static const YYINT grammar_dgoto[] = { 33, 543 87, 35, 36, 37, 38, 39, 40, 69, 70, 41, 544 42, 119, 120, 100, 101, 102, 103, 104, 43, 44, 545 59, 60, 45, 46, 47, 48, 49, 50, 51, 52, 546 77, 53, 127, 109, 128, 97, 94, 143, 72, 98, 547 112, 548 }; 549 static const YYINT grammar_sindex[] = { -2, 550 -3, 27, -239, -177, 0, 0, 0, 0, -274, 0, 551 0, 0, 0, -246, 0, 0, 0, 0, 0, 0, 552 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 553 -266, 0, 0, 455, 0, 0, 0, 0, 0, 0, 554 0, -35, -245, 128, 0, 0, -245, -2, 0, 0, 555 0, 0, 642, 0, 0, 0, -15, 0, -12, -239, 556 0, 590, 0, -27, 0, 0, 0, 0, -10, 0, 557 -11, 534, -72, 0, -237, -232, 0, -35, -232, 0, 558 0, 0, 642, 0, 0, 0, 455, 0, 0, 0, 559 0, 27, 0, 534, 0, 0, -222, 617, 209, 34, 560 39, 0, 44, 42, 0, 0, 0, 0, 27, -11, 561 0, -200, -196, -195, 0, 174, 0, 0, 0, -33, 562 243, 0, 561, 0, -177, 0, 33, 49, 0, 0, 563 0, 0, 53, 55, 417, 0, -33, 0, 0, 0, 564 0, 27, -188, 0, 0, 0, 57, 0, 0, 0, 565 }; 566 static const YYINT grammar_rindex[] = { 99, 567 0, 0, 275, 0, 0, -38, 0, 0, 481, 0, 568 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, 569 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 570 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 571 0, 30, 0, 0, 0, 0, 0, 101, 0, 0, 572 0, 0, 0, 0, 0, 0, 0, 0, 343, 309, 573 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 574 98, -182, 62, 0, 0, 133, 0, 64, 379, 0, 575 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 576 0, 0, 0, -182, 0, 0, 0, -180, -19, 0, 577 65, 0, 0, 68, 0, 0, 0, 0, 51, 9, 578 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, 579 19, 0, 0, 0, 0, 0, 0, 52, 0, 0, 580 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 581 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 582 }; 583 #if YYBTYACC 584 static const YYINT grammar_cindex[] = { 0, 585 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 587 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 588 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 589 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 591 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 592 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 593 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 595 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 598 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 599 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600 }; 601 #endif 602 static const YYINT grammar_gindex[] = { 0, 603 11, -17, 0, 0, 13, 0, 0, 0, 20, 8, 604 -43, -1, -8, -89, 0, -9, 0, 0, 0, -44, 605 0, 0, 4, 0, 0, 0, 70, -53, 0, 0, 606 -18, 0, 0, 0, 0, 22, 0, 0, 0, 0, 607 0, 608 }; 609 #define YYTABLESIZE 924 610 static const YYINT grammar_table[] = { 58, 611 78, 58, 58, 58, 73, 58, 135, 61, 88, 57, 612 34, 5, 56, 62, 85, 58, 68, 63, 96, 7, 613 58, 98, 78, 64, 98, 84, 134, 107, 80, 3, 614 107, 90, 17, 92, 17, 4, 17, 2, 75, 3, 615 96, 71, 30, 89, 115, 147, 76, 106, 91, 93, 616 79, 75, 70, 17, 121, 55, 32, 107, 34, 105, 617 108, 114, 105, 83, 4, 68, 2, 70, 3, 68, 618 80, 121, 86, 80, 122, 106, 105, 78, 106, 5, 619 56, 68, 123, 99, 124, 125, 129, 130, 80, 131, 620 80, 141, 142, 144, 110, 145, 149, 150, 1, 110, 621 2, 30, 99, 32, 79, 92, 118, 79, 100, 21, 622 22, 111, 137, 139, 133, 113, 126, 81, 0, 0, 623 0, 0, 79, 57, 79, 0, 99, 0, 140, 0, 624 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 625 0, 70, 0, 0, 0, 99, 0, 0, 0, 148, 626 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 627 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 628 65, 0, 65, 65, 65, 0, 65, 0, 0, 0, 629 0, 0, 0, 0, 5, 6, 7, 8, 65, 10, 630 11, 65, 13, 66, 15, 16, 17, 18, 19, 20, 631 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 632 0, 4, 0, 116, 132, 3, 0, 0, 58, 58, 633 58, 58, 58, 58, 58, 78, 58, 58, 58, 58, 634 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 635 58, 58, 58, 58, 58, 78, 4, 74, 116, 136, 636 3, 17, 78, 1, 5, 6, 7, 8, 9, 10, 637 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 638 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 639 4, 54, 116, 5, 56, 0, 31, 80, 80, 80, 640 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 641 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 642 80, 80, 88, 80, 88, 88, 88, 0, 88, 0, 643 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 644 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 645 79, 79, 79, 79, 79, 79, 89, 79, 89, 89, 646 89, 0, 89, 0, 79, 25, 25, 25, 25, 25, 647 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 648 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 649 86, 25, 86, 86, 5, 56, 86, 0, 25, 65, 650 65, 65, 65, 65, 65, 65, 0, 65, 65, 65, 651 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 652 65, 65, 65, 65, 65, 65, 75, 0, 75, 75, 653 75, 0, 75, 0, 0, 0, 0, 0, 0, 0, 654 5, 6, 7, 8, 65, 10, 11, 75, 13, 66, 655 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 656 25, 26, 27, 28, 29, 30, 117, 146, 0, 0, 657 0, 0, 0, 0, 0, 5, 6, 7, 8, 65, 658 10, 11, 0, 13, 66, 15, 16, 17, 18, 19, 659 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 660 30, 117, 4, 0, 2, 0, 3, 0, 0, 5, 661 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 662 0, 0, 0, 67, 0, 0, 0, 0, 41, 0, 663 41, 0, 41, 0, 0, 117, 0, 0, 0, 0, 664 0, 88, 88, 0, 0, 0, 0, 0, 0, 41, 665 0, 0, 0, 0, 0, 0, 45, 0, 45, 0, 666 45, 0, 0, 0, 0, 0, 0, 88, 0, 0, 667 0, 0, 0, 0, 0, 89, 89, 45, 0, 0, 668 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 669 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 670 0, 89, 0, 0, 0, 0, 0, 0, 0, 86, 671 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 673 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 674 0, 0, 0, 0, 0, 75, 75, 75, 75, 75, 675 75, 75, 0, 75, 75, 75, 75, 75, 75, 75, 676 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 677 75, 75, 0, 0, 0, 0, 0, 0, 0, 0, 678 0, 0, 0, 0, 82, 7, 8, 65, 10, 11, 679 0, 13, 66, 15, 16, 17, 18, 19, 20, 21, 680 22, 23, 24, 25, 26, 27, 28, 29, 30, 0, 681 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 682 0, 5, 6, 7, 8, 65, 10, 11, 0, 13, 683 66, 15, 16, 17, 18, 19, 20, 21, 22, 23, 684 24, 25, 26, 27, 28, 29, 30, 41, 41, 41, 685 41, 41, 41, 41, 0, 41, 41, 41, 41, 41, 686 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 687 41, 41, 41, 0, 0, 45, 45, 45, 45, 45, 688 45, 45, 0, 45, 45, 45, 45, 45, 45, 45, 689 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 690 45, 82, 7, 8, 65, 10, 11, 12, 13, 14, 691 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 692 25, 26, 27, 28, 29, 30, 0, 0, 82, 7, 693 8, 65, 10, 11, 95, 13, 66, 15, 16, 17, 694 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 695 28, 29, 30, 0, 0, 0, 138, 82, 7, 8, 696 65, 10, 11, 12, 13, 14, 15, 16, 17, 18, 697 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 698 29, 30, 0, 75, 82, 7, 8, 65, 10, 11, 699 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 700 22, 23, 24, 25, 26, 27, 28, 29, 30, 82, 701 7, 8, 65, 10, 11, 0, 13, 66, 15, 16, 702 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 703 27, 28, 29, 30, 704 }; 705 static const YYINT grammar_check[] = { 38, 706 44, 40, 41, 42, 40, 44, 40, 4, 62, 2, 707 0, 257, 258, 288, 59, 3, 34, 264, 72, 259, 708 59, 41, 61, 290, 44, 41, 116, 41, 47, 42, 709 44, 59, 38, 44, 40, 38, 42, 40, 284, 42, 710 94, 34, 282, 62, 98, 135, 43, 285, 59, 61, 711 47, 284, 44, 59, 99, 59, 59, 76, 48, 41, 712 79, 284, 44, 53, 38, 83, 40, 59, 42, 87, 713 41, 116, 60, 44, 41, 41, 73, 121, 44, 257, 714 258, 99, 44, 73, 41, 44, 287, 284, 59, 285, 715 61, 59, 44, 41, 87, 41, 285, 41, 0, 92, 716 0, 284, 41, 284, 41, 41, 99, 44, 41, 59, 717 59, 92, 121, 123, 116, 94, 109, 48, -1, -1, 718 -1, -1, 59, 116, 61, -1, 116, -1, 125, -1, 719 -1, -1, -1, 123, -1, -1, -1, -1, -1, -1, 720 -1, 44, -1, -1, -1, 135, -1, -1, -1, 142, 721 -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, 722 -1, -1, -1, -1, -1, 38, -1, 40, -1, -1, 723 38, -1, 40, 41, 42, -1, 44, -1, -1, -1, 724 -1, -1, -1, -1, 257, 258, 259, 260, 261, 262, 725 263, 59, 265, 266, 267, 268, 269, 270, 271, 272, 726 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 727 -1, 38, -1, 40, 41, 42, -1, -1, 257, 258, 728 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 729 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 730 279, 280, 281, 282, 283, 284, 38, 283, 40, 283, 731 42, 257, 291, 256, 257, 258, 259, 260, 261, 262, 732 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 733 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 734 38, 285, 40, 257, 258, -1, 289, 258, 259, 260, 735 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 736 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 737 281, 282, 38, 284, 40, 41, 42, -1, 44, -1, 738 291, 258, 259, 260, 261, 262, 263, 264, 265, 266, 739 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 740 277, 278, 279, 280, 281, 282, 38, 284, 40, 41, 741 42, -1, 44, -1, 291, 258, 259, 260, 261, 262, 742 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 743 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 744 38, 284, 40, 41, 257, 258, 44, -1, 291, 257, 745 258, 259, 260, 261, 262, 263, -1, 265, 266, 267, 746 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 747 278, 279, 280, 281, 282, 283, 38, -1, 40, 41, 748 42, -1, 44, -1, -1, -1, -1, -1, -1, -1, 749 257, 258, 259, 260, 261, 262, 263, 59, 265, 266, 750 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 751 277, 278, 279, 280, 281, 282, 283, 41, -1, -1, 752 -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, 753 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, 754 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 755 282, 283, 38, -1, 40, -1, 42, -1, -1, 257, 756 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, 757 -1, -1, -1, 59, -1, -1, -1, -1, 38, -1, 758 40, -1, 42, -1, -1, 283, -1, -1, -1, -1, 759 -1, 257, 258, -1, -1, -1, -1, -1, -1, 59, 760 -1, -1, -1, -1, -1, -1, 38, -1, 40, -1, 761 42, -1, -1, -1, -1, -1, -1, 283, -1, -1, 762 -1, -1, -1, -1, -1, 257, 258, 59, -1, -1, 763 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 764 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 765 -1, 283, -1, -1, -1, -1, -1, -1, -1, 257, 766 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, 767 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 768 -1, -1, -1, -1, -1, 283, -1, -1, -1, -1, 769 -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, 770 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, 771 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 772 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, 773 -1, -1, -1, -1, 258, 259, 260, 261, 262, 263, 774 -1, 265, 266, 267, 268, 269, 270, 271, 272, 273, 775 274, 275, 276, 277, 278, 279, 280, 281, 282, -1, 776 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 777 -1, 257, 258, 259, 260, 261, 262, 263, -1, 265, 778 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 779 276, 277, 278, 279, 280, 281, 282, 257, 258, 259, 780 260, 261, 262, 263, -1, 265, 266, 267, 268, 269, 781 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 782 280, 281, 282, -1, -1, 257, 258, 259, 260, 261, 783 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, 784 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 785 282, 258, 259, 260, 261, 262, 263, 264, 265, 266, 786 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 787 277, 278, 279, 280, 281, 282, -1, -1, 258, 259, 788 260, 261, 262, 263, 291, 265, 266, 267, 268, 269, 789 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 790 280, 281, 282, -1, -1, -1, 286, 258, 259, 260, 791 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 792 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 793 281, 282, -1, 284, 258, 259, 260, 261, 262, 263, 794 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 795 274, 275, 276, 277, 278, 279, 280, 281, 282, 258, 796 259, 260, 261, 262, 263, -1, 265, 266, 267, 268, 797 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 798 279, 280, 281, 282, 799 }; 800 #if YYBTYACC 801 static const YYINT grammar_ctable[] = { -1, 802 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 803 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 804 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 805 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 806 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 807 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 808 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 809 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 811 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 812 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 813 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 814 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 815 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 816 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 817 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 818 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 819 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 820 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 821 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 822 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 823 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 824 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 825 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 826 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 827 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 828 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 829 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 830 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 831 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 832 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 833 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 834 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 835 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 836 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 837 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 838 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 839 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 840 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 841 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 842 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 843 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 844 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 845 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 846 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 847 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 848 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 849 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 850 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 851 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 852 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 853 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 854 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 855 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 856 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 857 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 858 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 859 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 860 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 861 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 862 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 863 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 864 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 865 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 866 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 867 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 868 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 869 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 870 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 871 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 872 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 873 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 874 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 875 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 876 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 877 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 878 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 879 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 880 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 881 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 882 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 883 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 884 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 885 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 886 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 887 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 888 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 889 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 890 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 892 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 893 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 894 -1, -1, -1, 895 }; 896 #endif 897 #define YYFINAL 33 898 #ifndef YYDEBUG 899 #define YYDEBUG 0 900 #endif 901 #define YYMAXTOKEN 291 902 #define YYUNDFTOKEN 335 903 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 904 #if YYDEBUG 905 static const char *const grammar_name[] = { 906 907 "$end",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, 908 0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,"'='",0, 909 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, 910 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, 911 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, 912 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, 913 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,"error", 914 "T_IDENTIFIER","T_TYPEDEF_NAME","T_DEFINE_NAME","T_AUTO","T_EXTERN", 915 "T_REGISTER","T_STATIC","T_TYPEDEF","T_INLINE","T_EXTENSION","T_CHAR", 916 "T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED", 917 "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary", 918 "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS", 919 "T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL","$accept", 920 "program","decl_specifiers","decl_specifier","storage_class","type_specifier", 921 "type_qualifier","struct_or_union_specifier","enum_specifier", 922 "init_declarator_list","init_declarator","declarator","direct_declarator", 923 "abs_declarator","direct_abs_declarator","parameter_type_list","parameter_list", 924 "parameter_declaration","opt_identifier_list","identifier_list", 925 "struct_or_union","pointer","opt_type_qualifiers","type_qualifier_list", 926 "any_id","identifier_or_ref","enumeration","translation_unit", 927 "external_declaration","declaration","function_definition", 928 "linkage_specification","braces","any_typedef","opt_declarator_list","$$1", 929 "declarator_list","opt_declaration_list","$$2","$$3","$$4","declaration_list", 930 "$$5","illegal-symbol", 931 }; 932 static const char *const grammar_rule[] = { 933 "$accept : program", 934 "program :", 935 "program : translation_unit", 936 "translation_unit : external_declaration", 937 "translation_unit : translation_unit external_declaration", 938 "external_declaration : declaration", 939 "external_declaration : function_definition", 940 "external_declaration : ';'", 941 "external_declaration : linkage_specification", 942 "external_declaration : T_ASM T_ASMARG ';'", 943 "external_declaration : error T_MATCHRBRACE", 944 "external_declaration : error ';'", 945 "braces : T_LBRACE T_MATCHRBRACE", 946 "linkage_specification : T_EXTERN T_STRING_LITERAL braces", 947 "linkage_specification : T_EXTERN T_STRING_LITERAL declaration", 948 "declaration : decl_specifiers ';'", 949 "declaration : decl_specifiers init_declarator_list ';'", 950 "$$1 :", 951 "declaration : any_typedef decl_specifiers $$1 opt_declarator_list ';'", 952 "any_typedef : T_EXTENSION T_TYPEDEF", 953 "any_typedef : T_TYPEDEF", 954 "opt_declarator_list :", 955 "opt_declarator_list : declarator_list", 956 "declarator_list : declarator", 957 "declarator_list : declarator_list ',' declarator", 958 "$$2 :", 959 "$$3 :", 960 "function_definition : decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE", 961 "$$4 :", 962 "function_definition : declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE", 963 "opt_declaration_list :", 964 "opt_declaration_list : T_VA_DCL", 965 "opt_declaration_list : declaration_list", 966 "declaration_list : declaration", 967 "declaration_list : declaration_list declaration", 968 "decl_specifiers : decl_specifier", 969 "decl_specifiers : decl_specifiers decl_specifier", 970 "decl_specifier : storage_class", 971 "decl_specifier : type_specifier", 972 "decl_specifier : type_qualifier", 973 "storage_class : T_AUTO", 974 "storage_class : T_EXTERN", 975 "storage_class : T_REGISTER", 976 "storage_class : T_STATIC", 977 "storage_class : T_INLINE", 978 "storage_class : T_EXTENSION", 979 "type_specifier : T_CHAR", 980 "type_specifier : T_DOUBLE", 981 "type_specifier : T_FLOAT", 982 "type_specifier : T_INT", 983 "type_specifier : T_LONG", 984 "type_specifier : T_SHORT", 985 "type_specifier : T_SIGNED", 986 "type_specifier : T_UNSIGNED", 987 "type_specifier : T_VOID", 988 "type_specifier : T_Bool", 989 "type_specifier : T_Complex", 990 "type_specifier : T_Imaginary", 991 "type_specifier : T_TYPEDEF_NAME", 992 "type_specifier : struct_or_union_specifier", 993 "type_specifier : enum_specifier", 994 "type_qualifier : T_TYPE_QUALIFIER", 995 "type_qualifier : T_DEFINE_NAME", 996 "struct_or_union_specifier : struct_or_union any_id braces", 997 "struct_or_union_specifier : struct_or_union braces", 998 "struct_or_union_specifier : struct_or_union any_id", 999 "struct_or_union : T_STRUCT", 1000 "struct_or_union : T_UNION", 1001 "init_declarator_list : init_declarator", 1002 "init_declarator_list : init_declarator_list ',' init_declarator", 1003 "init_declarator : declarator", 1004 "$$5 :", 1005 "init_declarator : declarator '=' $$5 T_INITIALIZER", 1006 "enum_specifier : enumeration any_id braces", 1007 "enum_specifier : enumeration braces", 1008 "enum_specifier : enumeration any_id", 1009 "enumeration : T_ENUM", 1010 "any_id : T_IDENTIFIER", 1011 "any_id : T_TYPEDEF_NAME", 1012 "declarator : pointer direct_declarator", 1013 "declarator : direct_declarator", 1014 "direct_declarator : identifier_or_ref", 1015 "direct_declarator : '(' declarator ')'", 1016 "direct_declarator : direct_declarator T_BRACKETS", 1017 "direct_declarator : direct_declarator '(' parameter_type_list ')'", 1018 "direct_declarator : direct_declarator '(' opt_identifier_list ')'", 1019 "pointer : '*' opt_type_qualifiers", 1020 "pointer : '*' opt_type_qualifiers pointer", 1021 "opt_type_qualifiers :", 1022 "opt_type_qualifiers : type_qualifier_list", 1023 "type_qualifier_list : type_qualifier", 1024 "type_qualifier_list : type_qualifier_list type_qualifier", 1025 "parameter_type_list : parameter_list", 1026 "parameter_type_list : parameter_list ',' T_ELLIPSIS", 1027 "parameter_list : parameter_declaration", 1028 "parameter_list : parameter_list ',' parameter_declaration", 1029 "parameter_declaration : decl_specifiers declarator", 1030 "parameter_declaration : decl_specifiers abs_declarator", 1031 "parameter_declaration : decl_specifiers", 1032 "opt_identifier_list :", 1033 "opt_identifier_list : identifier_list", 1034 "identifier_list : any_id", 1035 "identifier_list : identifier_list ',' any_id", 1036 "identifier_or_ref : any_id", 1037 "identifier_or_ref : '&' any_id", 1038 "abs_declarator : pointer", 1039 "abs_declarator : pointer direct_abs_declarator", 1040 "abs_declarator : direct_abs_declarator", 1041 "direct_abs_declarator : '(' abs_declarator ')'", 1042 "direct_abs_declarator : direct_abs_declarator T_BRACKETS", 1043 "direct_abs_declarator : T_BRACKETS", 1044 "direct_abs_declarator : direct_abs_declarator '(' parameter_type_list ')'", 1045 "direct_abs_declarator : direct_abs_declarator '(' ')'", 1046 "direct_abs_declarator : '(' parameter_type_list ')'", 1047 "direct_abs_declarator : '(' ')'", 1048 1049 }; 1050 #endif 1051 1052 #if YYDEBUG 1053 int yydebug; 1054 #endif 1055 1056 int yyerrflag; 1057 int yychar; 1058 YYSTYPE yyval; 1059 YYSTYPE yylval; 1060 int yynerrs; 1061 1062 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1063 YYLTYPE yyloc; /* position returned by actions */ 1064 YYLTYPE yylloc; /* position from the lexer */ 1065 #endif 1066 1067 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1068 #ifndef YYLLOC_DEFAULT 1069 #define YYLLOC_DEFAULT(loc, rhs, n) \ 1070 do \ 1071 { \ 1072 if (n == 0) \ 1073 { \ 1074 (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ 1075 (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ 1076 (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ 1077 (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ 1078 } \ 1079 else \ 1080 { \ 1081 (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ 1082 (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ 1083 (loc).last_line = YYRHSLOC(rhs, n).last_line; \ 1084 (loc).last_column = YYRHSLOC(rhs, n).last_column; \ 1085 } \ 1086 } while (0) 1087 #endif /* YYLLOC_DEFAULT */ 1088 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1089 #if YYBTYACC 1090 1091 #ifndef YYLVQUEUEGROWTH 1092 #define YYLVQUEUEGROWTH 32 1093 #endif 1094 #endif /* YYBTYACC */ 1095 1096 /* define the initial stack-sizes */ 1097 #ifdef YYSTACKSIZE 1098 #undef YYMAXDEPTH 1099 #define YYMAXDEPTH YYSTACKSIZE 1100 #else 1101 #ifdef YYMAXDEPTH 1102 #define YYSTACKSIZE YYMAXDEPTH 1103 #else 1104 #define YYSTACKSIZE 10000 1105 #define YYMAXDEPTH 10000 1106 #endif 1107 #endif 1108 1109 #ifndef YYINITSTACKSIZE 1110 #define YYINITSTACKSIZE 200 1111 #endif 1112 1113 typedef struct { 1114 unsigned stacksize; 1115 YYINT *s_base; 1116 YYINT *s_mark; 1117 YYINT *s_last; 1118 YYSTYPE *l_base; 1119 YYSTYPE *l_mark; 1120 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1121 YYLTYPE *p_base; 1122 YYLTYPE *p_mark; 1123 #endif 1124 } YYSTACKDATA; 1125 #if YYBTYACC 1126 1127 struct YYParseState_s 1128 { 1129 struct YYParseState_s *save; /* Previously saved parser state */ 1130 YYSTACKDATA yystack; /* saved parser stack */ 1131 int state; /* saved parser state */ 1132 int errflag; /* saved error recovery status */ 1133 int lexeme; /* saved index of the conflict lexeme in the lexical queue */ 1134 YYINT ctry; /* saved index in yyctable[] for this conflict */ 1135 }; 1136 typedef struct YYParseState_s YYParseState; 1137 #endif /* YYBTYACC */ 1138 /* variables for the parser stack */ 1139 static YYSTACKDATA yystack; 1140 #if YYBTYACC 1141 1142 /* Current parser state */ 1143 static YYParseState *yyps = 0; 1144 1145 /* yypath != NULL: do the full parse, starting at *yypath parser state. */ 1146 static YYParseState *yypath = 0; 1147 1148 /* Base of the lexical value queue */ 1149 static YYSTYPE *yylvals = 0; 1150 1151 /* Current position at lexical value queue */ 1152 static YYSTYPE *yylvp = 0; 1153 1154 /* End position of lexical value queue */ 1155 static YYSTYPE *yylve = 0; 1156 1157 /* The last allocated position at the lexical value queue */ 1158 static YYSTYPE *yylvlim = 0; 1159 1160 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1161 /* Base of the lexical position queue */ 1162 static YYLTYPE *yylpsns = 0; 1163 1164 /* Current position at lexical position queue */ 1165 static YYLTYPE *yylpp = 0; 1166 1167 /* End position of lexical position queue */ 1168 static YYLTYPE *yylpe = 0; 1169 1170 /* The last allocated position at the lexical position queue */ 1171 static YYLTYPE *yylplim = 0; 1172 #endif 1173 1174 /* Current position at lexical token queue */ 1175 static YYINT *yylexp = 0; 1176 1177 static YYINT *yylexemes = 0; 1178 #endif /* YYBTYACC */ 1179 #line 1015 "grammar.y" 1180 1181 /* lex.yy.c */ 1182 #define BEGIN yy_start = 1 + 2 * 1183 1184 #define CPP1 1 1185 #define INIT1 2 1186 #define INIT2 3 1187 #define CURLY 4 1188 #define LEXYACC 5 1189 #define ASM 6 1190 #define CPP_INLINE 7 1191 1192 extern char *yytext; 1193 extern FILE *yyin, *yyout; 1194 1195 static int curly; /* number of curly brace nesting levels */ 1196 static int ly_count; /* number of occurrences of %% */ 1197 static int inc_depth; /* include nesting level */ 1198 static SymbolTable *included_files; /* files already included */ 1199 static int yy_start = 0; /* start state number */ 1200 1201 #define grammar_error(s) yaccError(s) 1202 1203 static void 1204 yaccError (const char *msg) 1205 { 1206 func_params = NULL; 1207 put_error(); /* tell what line we're on, and what file */ 1208 fprintf(stderr, "%s at token '%s'\n", msg, yytext); 1209 } 1210 1211 /* Initialize the table of type qualifier keywords recognized by the lexical 1212 * analyzer. 1213 */ 1214 void 1215 init_parser (void) 1216 { 1217 static const char *keywords[] = { 1218 "const", 1219 "restrict", 1220 "volatile", 1221 "interrupt", 1222 #ifdef vms 1223 "noshare", 1224 "readonly", 1225 #endif 1226 #if defined(MSDOS) || defined(OS2) 1227 "__cdecl", 1228 "__export", 1229 "__far", 1230 "__fastcall", 1231 "__fortran", 1232 "__huge", 1233 "__inline", 1234 "__interrupt", 1235 "__loadds", 1236 "__near", 1237 "__pascal", 1238 "__saveregs", 1239 "__segment", 1240 "__stdcall", 1241 "__syscall", 1242 "_cdecl", 1243 "_cs", 1244 "_ds", 1245 "_es", 1246 "_export", 1247 "_far", 1248 "_fastcall", 1249 "_fortran", 1250 "_huge", 1251 "_interrupt", 1252 "_loadds", 1253 "_near", 1254 "_pascal", 1255 "_saveregs", 1256 "_seg", 1257 "_segment", 1258 "_ss", 1259 "cdecl", 1260 "far", 1261 "huge", 1262 "near", 1263 "pascal", 1264 #ifdef OS2 1265 "__far16", 1266 #endif 1267 #endif 1268 #ifdef __GNUC__ 1269 /* gcc aliases */ 1270 "__builtin_va_arg", 1271 "__builtin_va_list", 1272 "__const", 1273 "__const__", 1274 "__inline", 1275 "__inline__", 1276 "__restrict", 1277 "__restrict__", 1278 "__volatile", 1279 "__volatile__", 1280 #endif 1281 }; 1282 unsigned i; 1283 1284 /* Initialize type qualifier table. */ 1285 type_qualifiers = new_symbol_table(); 1286 for (i = 0; i < sizeof(keywords)/sizeof(keywords[0]); ++i) { 1287 new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE); 1288 } 1289 } 1290 1291 /* Process the C source file. Write function prototypes to the standard 1292 * output. Convert function definitions and write the converted source 1293 * code to a temporary file. 1294 */ 1295 void 1296 process_file (FILE *infile, char *name) 1297 { 1298 char *s; 1299 1300 if (strlen(name) > 2) { 1301 s = name + strlen(name) - 2; 1302 if (*s == '.') { 1303 ++s; 1304 if (*s == 'l' || *s == 'y') 1305 BEGIN LEXYACC; 1306 #if defined(MSDOS) || defined(OS2) 1307 if (*s == 'L' || *s == 'Y') 1308 BEGIN LEXYACC; 1309 #endif 1310 } 1311 } 1312 1313 included_files = new_symbol_table(); 1314 typedef_names = new_symbol_table(); 1315 define_names = new_symbol_table(); 1316 inc_depth = -1; 1317 curly = 0; 1318 ly_count = 0; 1319 func_params = NULL; 1320 yyin = infile; 1321 include_file(strcpy(base_file, name), func_style != FUNC_NONE); 1322 if (file_comments) { 1323 #if OPT_LINTLIBRARY 1324 if (lintLibrary()) { 1325 put_blankline(stdout); 1326 begin_tracking(); 1327 } 1328 #endif 1329 put_string(stdout, "/* "); 1330 put_string(stdout, cur_file_name()); 1331 put_string(stdout, " */\n"); 1332 } 1333 yyparse(); 1334 free_symbol_table(define_names); 1335 free_symbol_table(typedef_names); 1336 free_symbol_table(included_files); 1337 } 1338 1339 #ifdef NO_LEAKS 1340 void 1341 free_parser(void) 1342 { 1343 free_symbol_table (type_qualifiers); 1344 #ifdef FLEX_SCANNER 1345 if (yy_current_buffer != 0) 1346 yy_delete_buffer(yy_current_buffer); 1347 #endif 1348 } 1349 #endif 1350 #line 1351 "grammar.tab.c" 1351 1352 /* For use in generated program */ 1353 #define yydepth (int)(yystack.s_mark - yystack.s_base) 1354 #if YYBTYACC 1355 #define yytrial (yyps->save) 1356 #endif /* YYBTYACC */ 1357 1358 #if YYDEBUG 1359 #include <stdio.h> /* needed for printf */ 1360 #endif 1361 1362 #include <stdlib.h> /* needed for malloc, etc */ 1363 #include <string.h> /* needed for memset */ 1364 1365 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 1366 static int yygrowstack(YYSTACKDATA *data) 1367 { 1368 int i; 1369 unsigned newsize; 1370 YYINT *newss; 1371 YYSTYPE *newvs; 1372 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1373 YYLTYPE *newps; 1374 #endif 1375 1376 if ((newsize = data->stacksize) == 0) 1377 newsize = YYINITSTACKSIZE; 1378 else if (newsize >= YYMAXDEPTH) 1379 return YYENOMEM; 1380 else if ((newsize *= 2) > YYMAXDEPTH) 1381 newsize = YYMAXDEPTH; 1382 1383 i = (int) (data->s_mark - data->s_base); 1384 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 1385 if (newss == NULL) 1386 return YYENOMEM; 1387 1388 data->s_base = newss; 1389 data->s_mark = newss + i; 1390 1391 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 1392 if (newvs == NULL) 1393 return YYENOMEM; 1394 1395 data->l_base = newvs; 1396 data->l_mark = newvs + i; 1397 1398 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1399 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); 1400 if (newps == NULL) 1401 return YYENOMEM; 1402 1403 data->p_base = newps; 1404 data->p_mark = newps + i; 1405 #endif 1406 1407 data->stacksize = newsize; 1408 data->s_last = data->s_base + newsize - 1; 1409 1410 #if YYDEBUG 1411 if (yydebug) 1412 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); 1413 #endif 1414 return 0; 1415 } 1416 1417 #if YYPURE || defined(YY_NO_LEAKS) 1418 static void yyfreestack(YYSTACKDATA *data) 1419 { 1420 free(data->s_base); 1421 free(data->l_base); 1422 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1423 free(data->p_base); 1424 #endif 1425 memset(data, 0, sizeof(*data)); 1426 } 1427 #else 1428 #define yyfreestack(data) /* nothing */ 1429 #endif /* YYPURE || defined(YY_NO_LEAKS) */ 1430 #if YYBTYACC 1431 1432 static YYParseState * 1433 yyNewState(unsigned size) 1434 { 1435 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); 1436 if (p == NULL) return NULL; 1437 1438 p->yystack.stacksize = size; 1439 if (size == 0) 1440 { 1441 p->yystack.s_base = NULL; 1442 p->yystack.l_base = NULL; 1443 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1444 p->yystack.p_base = NULL; 1445 #endif 1446 return p; 1447 } 1448 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT)); 1449 if (p->yystack.s_base == NULL) return NULL; 1450 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); 1451 if (p->yystack.l_base == NULL) return NULL; 1452 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); 1453 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1454 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); 1455 if (p->yystack.p_base == NULL) return NULL; 1456 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); 1457 #endif 1458 1459 return p; 1460 } 1461 1462 static void 1463 yyFreeState(YYParseState *p) 1464 { 1465 yyfreestack(&p->yystack); 1466 free(p); 1467 } 1468 #endif /* YYBTYACC */ 1469 1470 #define YYABORT goto yyabort 1471 #define YYREJECT goto yyabort 1472 #define YYACCEPT goto yyaccept 1473 #define YYERROR goto yyerrlab 1474 #if YYBTYACC 1475 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0) 1476 #define YYVALID_NESTED do { if (yyps->save && \ 1477 yyps->save->save == 0) goto yyvalid; } while(0) 1478 #endif /* YYBTYACC */ 1479 1480 int 1481 YYPARSE_DECL() 1482 { 1483 int yym, yyn, yystate, yyresult; 1484 #if YYBTYACC 1485 int yynewerrflag; 1486 YYParseState *yyerrctx = NULL; 1487 #endif /* YYBTYACC */ 1488 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1489 YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ 1490 #endif 1491 #if YYDEBUG 1492 const char *yys; 1493 1494 if ((yys = getenv("YYDEBUG")) != NULL) 1495 { 1496 yyn = *yys; 1497 if (yyn >= '0' && yyn <= '9') 1498 yydebug = yyn - '0'; 1499 } 1500 if (yydebug) 1501 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); 1502 #endif 1503 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1504 memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); 1505 #endif 1506 1507 #if YYBTYACC 1508 yyps = yyNewState(0); if (yyps == 0) goto yyenomem; 1509 yyps->save = 0; 1510 #endif /* YYBTYACC */ 1511 yym = 0; 1512 /* yyn is set below */ 1513 yynerrs = 0; 1514 yyerrflag = 0; 1515 yychar = YYEMPTY; 1516 yystate = 0; 1517 1518 #if YYPURE 1519 memset(&yystack, 0, sizeof(yystack)); 1520 #endif 1521 1522 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1523 yystack.s_mark = yystack.s_base; 1524 yystack.l_mark = yystack.l_base; 1525 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1526 yystack.p_mark = yystack.p_base; 1527 #endif 1528 yystate = 0; 1529 *yystack.s_mark = 0; 1530 1531 yyloop: 1532 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 1533 if (yychar < 0) 1534 { 1535 #if YYBTYACC 1536 do { 1537 if (yylvp < yylve) 1538 { 1539 /* we're currently re-reading tokens */ 1540 yylval = *yylvp++; 1541 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1542 yylloc = *yylpp++; 1543 #endif 1544 yychar = *yylexp++; 1545 break; 1546 } 1547 if (yyps->save) 1548 { 1549 /* in trial mode; save scanner results for future parse attempts */ 1550 if (yylvp == yylvlim) 1551 { /* Enlarge lexical value queue */ 1552 size_t p = (size_t) (yylvp - yylvals); 1553 size_t s = (size_t) (yylvlim - yylvals); 1554 1555 s += YYLVQUEUEGROWTH; 1556 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; 1557 if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 1558 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1559 if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 1560 #endif 1561 yylvp = yylve = yylvals + p; 1562 yylvlim = yylvals + s; 1563 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1564 yylpp = yylpe = yylpsns + p; 1565 yylplim = yylpsns + s; 1566 #endif 1567 yylexp = yylexemes + p; 1568 } 1569 *yylexp = (YYINT) YYLEX; 1570 *yylvp++ = yylval; 1571 yylve++; 1572 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1573 *yylpp++ = yylloc; 1574 yylpe++; 1575 #endif 1576 yychar = *yylexp++; 1577 break; 1578 } 1579 /* normal operation, no conflict encountered */ 1580 #endif /* YYBTYACC */ 1581 yychar = YYLEX; 1582 #if YYBTYACC 1583 } while (0); 1584 #endif /* YYBTYACC */ 1585 if (yychar < 0) yychar = YYEOF; 1586 #if YYDEBUG 1587 if (yydebug) 1588 { 1589 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1590 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", 1591 YYDEBUGSTR, yydepth, yystate, yychar, yys); 1592 #ifdef YYSTYPE_TOSTRING 1593 #if YYBTYACC 1594 if (!yytrial) 1595 #endif /* YYBTYACC */ 1596 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); 1597 #endif 1598 fputc('\n', stderr); 1599 } 1600 #endif 1601 } 1602 #if YYBTYACC 1603 1604 /* Do we have a conflict? */ 1605 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && 1606 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 1607 { 1608 YYINT ctry; 1609 1610 if (yypath) 1611 { 1612 YYParseState *save; 1613 #if YYDEBUG 1614 if (yydebug) 1615 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", 1616 YYDEBUGSTR, yydepth, yystate); 1617 #endif 1618 /* Switch to the next conflict context */ 1619 save = yypath; 1620 yypath = save->save; 1621 save->save = NULL; 1622 ctry = save->ctry; 1623 if (save->state != yystate) YYABORT; 1624 yyFreeState(save); 1625 1626 } 1627 else 1628 { 1629 1630 /* Unresolved conflict - start/continue trial parse */ 1631 YYParseState *save; 1632 #if YYDEBUG 1633 if (yydebug) 1634 { 1635 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); 1636 if (yyps->save) 1637 fputs("ALREADY in conflict, continuing trial parse.\n", stderr); 1638 else 1639 fputs("Starting trial parse.\n", stderr); 1640 } 1641 #endif 1642 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 1643 if (save == NULL) goto yyenomem; 1644 save->save = yyps->save; 1645 save->state = yystate; 1646 save->errflag = yyerrflag; 1647 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); 1648 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1649 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); 1650 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1651 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1652 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); 1653 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1654 #endif 1655 ctry = yytable[yyn]; 1656 if (yyctable[ctry] == -1) 1657 { 1658 #if YYDEBUG 1659 if (yydebug && yychar >= YYEOF) 1660 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 1661 #endif 1662 ctry++; 1663 } 1664 save->ctry = ctry; 1665 if (yyps->save == NULL) 1666 { 1667 /* If this is a first conflict in the stack, start saving lexemes */ 1668 if (!yylexemes) 1669 { 1670 yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); 1671 if (yylexemes == NULL) goto yyenomem; 1672 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); 1673 if (yylvals == NULL) goto yyenomem; 1674 yylvlim = yylvals + YYLVQUEUEGROWTH; 1675 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1676 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); 1677 if (yylpsns == NULL) goto yyenomem; 1678 yylplim = yylpsns + YYLVQUEUEGROWTH; 1679 #endif 1680 } 1681 if (yylvp == yylve) 1682 { 1683 yylvp = yylve = yylvals; 1684 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1685 yylpp = yylpe = yylpsns; 1686 #endif 1687 yylexp = yylexemes; 1688 if (yychar >= YYEOF) 1689 { 1690 *yylve++ = yylval; 1691 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1692 *yylpe++ = yylloc; 1693 #endif 1694 *yylexp = (YYINT) yychar; 1695 yychar = YYEMPTY; 1696 } 1697 } 1698 } 1699 if (yychar >= YYEOF) 1700 { 1701 yylvp--; 1702 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1703 yylpp--; 1704 #endif 1705 yylexp--; 1706 yychar = YYEMPTY; 1707 } 1708 save->lexeme = (int) (yylvp - yylvals); 1709 yyps->save = save; 1710 } 1711 if (yytable[yyn] == ctry) 1712 { 1713 #if YYDEBUG 1714 if (yydebug) 1715 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 1716 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); 1717 #endif 1718 if (yychar < 0) 1719 { 1720 yylvp++; 1721 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1722 yylpp++; 1723 #endif 1724 yylexp++; 1725 } 1726 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 1727 goto yyoverflow; 1728 yystate = yyctable[ctry]; 1729 *++yystack.s_mark = (YYINT) yystate; 1730 *++yystack.l_mark = yylval; 1731 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1732 *++yystack.p_mark = yylloc; 1733 #endif 1734 yychar = YYEMPTY; 1735 if (yyerrflag > 0) --yyerrflag; 1736 goto yyloop; 1737 } 1738 else 1739 { 1740 yyn = yyctable[ctry]; 1741 goto yyreduce; 1742 } 1743 } /* End of code dealing with conflicts */ 1744 #endif /* YYBTYACC */ 1745 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 1746 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 1747 { 1748 #if YYDEBUG 1749 if (yydebug) 1750 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 1751 YYDEBUGSTR, yydepth, yystate, yytable[yyn]); 1752 #endif 1753 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1754 yystate = yytable[yyn]; 1755 *++yystack.s_mark = yytable[yyn]; 1756 *++yystack.l_mark = yylval; 1757 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1758 *++yystack.p_mark = yylloc; 1759 #endif 1760 yychar = YYEMPTY; 1761 if (yyerrflag > 0) --yyerrflag; 1762 goto yyloop; 1763 } 1764 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 1765 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 1766 { 1767 yyn = yytable[yyn]; 1768 goto yyreduce; 1769 } 1770 if (yyerrflag != 0) goto yyinrecovery; 1771 #if YYBTYACC 1772 1773 yynewerrflag = 1; 1774 goto yyerrhandler; 1775 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 1776 1777 yyerrlab: 1778 /* explicit YYERROR from an action -- pop the rhs of the rule reduced 1779 * before looking for error recovery */ 1780 yystack.s_mark -= yym; 1781 yystate = *yystack.s_mark; 1782 yystack.l_mark -= yym; 1783 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1784 yystack.p_mark -= yym; 1785 #endif 1786 1787 yynewerrflag = 0; 1788 yyerrhandler: 1789 while (yyps->save) 1790 { 1791 int ctry; 1792 YYParseState *save = yyps->save; 1793 #if YYDEBUG 1794 if (yydebug) 1795 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", 1796 YYDEBUGSTR, yydepth, yystate, yyps->save->state, 1797 (int)(yylvp - yylvals - yyps->save->lexeme)); 1798 #endif 1799 /* Memorize most forward-looking error state in case it's really an error. */ 1800 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) 1801 { 1802 /* Free old saved error context state */ 1803 if (yyerrctx) yyFreeState(yyerrctx); 1804 /* Create and fill out new saved error context state */ 1805 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 1806 if (yyerrctx == NULL) goto yyenomem; 1807 yyerrctx->save = yyps->save; 1808 yyerrctx->state = yystate; 1809 yyerrctx->errflag = yyerrflag; 1810 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); 1811 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1812 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); 1813 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1814 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1815 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); 1816 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1817 #endif 1818 yyerrctx->lexeme = (int) (yylvp - yylvals); 1819 } 1820 yylvp = yylvals + save->lexeme; 1821 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1822 yylpp = yylpsns + save->lexeme; 1823 #endif 1824 yylexp = yylexemes + save->lexeme; 1825 yychar = YYEMPTY; 1826 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); 1827 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1828 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); 1829 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1830 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1831 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); 1832 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1833 #endif 1834 ctry = ++save->ctry; 1835 yystate = save->state; 1836 /* We tried shift, try reduce now */ 1837 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 1838 yyps->save = save->save; 1839 save->save = NULL; 1840 yyFreeState(save); 1841 1842 /* Nothing left on the stack -- error */ 1843 if (!yyps->save) 1844 { 1845 #if YYDEBUG 1846 if (yydebug) 1847 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", 1848 YYPREFIX, yydepth); 1849 #endif 1850 /* Restore state as it was in the most forward-advanced error */ 1851 yylvp = yylvals + yyerrctx->lexeme; 1852 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1853 yylpp = yylpsns + yyerrctx->lexeme; 1854 #endif 1855 yylexp = yylexemes + yyerrctx->lexeme; 1856 yychar = yylexp[-1]; 1857 yylval = yylvp[-1]; 1858 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1859 yylloc = yylpp[-1]; 1860 #endif 1861 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); 1862 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 1863 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); 1864 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 1865 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1866 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); 1867 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 1868 #endif 1869 yystate = yyerrctx->state; 1870 yyFreeState(yyerrctx); 1871 yyerrctx = NULL; 1872 } 1873 yynewerrflag = 1; 1874 } 1875 if (yynewerrflag == 0) goto yyinrecovery; 1876 #endif /* YYBTYACC */ 1877 1878 YYERROR_CALL("syntax error"); 1879 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1880 yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ 1881 #endif 1882 1883 #if !YYBTYACC 1884 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 1885 yyerrlab: 1886 #endif 1887 ++yynerrs; 1888 1889 yyinrecovery: 1890 if (yyerrflag < 3) 1891 { 1892 yyerrflag = 3; 1893 for (;;) 1894 { 1895 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 1896 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 1897 { 1898 #if YYDEBUG 1899 if (yydebug) 1900 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", 1901 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); 1902 #endif 1903 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1904 yystate = yytable[yyn]; 1905 *++yystack.s_mark = yytable[yyn]; 1906 *++yystack.l_mark = yylval; 1907 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1908 /* lookahead position is error end position */ 1909 yyerror_loc_range[2] = yylloc; 1910 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ 1911 *++yystack.p_mark = yyloc; 1912 #endif 1913 goto yyloop; 1914 } 1915 else 1916 { 1917 #if YYDEBUG 1918 if (yydebug) 1919 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", 1920 YYDEBUGSTR, yydepth, *yystack.s_mark); 1921 #endif 1922 if (yystack.s_mark <= yystack.s_base) goto yyabort; 1923 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1924 /* the current TOS position is the error start position */ 1925 yyerror_loc_range[1] = *yystack.p_mark; 1926 #endif 1927 #if defined(YYDESTRUCT_CALL) 1928 #if YYBTYACC 1929 if (!yytrial) 1930 #endif /* YYBTYACC */ 1931 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1932 YYDESTRUCT_CALL("error: discarding state", 1933 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); 1934 #else 1935 YYDESTRUCT_CALL("error: discarding state", 1936 yystos[*yystack.s_mark], yystack.l_mark); 1937 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1938 #endif /* defined(YYDESTRUCT_CALL) */ 1939 --yystack.s_mark; 1940 --yystack.l_mark; 1941 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1942 --yystack.p_mark; 1943 #endif 1944 } 1945 } 1946 } 1947 else 1948 { 1949 if (yychar == YYEOF) goto yyabort; 1950 #if YYDEBUG 1951 if (yydebug) 1952 { 1953 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 1954 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", 1955 YYDEBUGSTR, yydepth, yystate, yychar, yys); 1956 } 1957 #endif 1958 #if defined(YYDESTRUCT_CALL) 1959 #if YYBTYACC 1960 if (!yytrial) 1961 #endif /* YYBTYACC */ 1962 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1963 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); 1964 #else 1965 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); 1966 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 1967 #endif /* defined(YYDESTRUCT_CALL) */ 1968 yychar = YYEMPTY; 1969 goto yyloop; 1970 } 1971 1972 yyreduce: 1973 yym = yylen[yyn]; 1974 #if YYDEBUG 1975 if (yydebug) 1976 { 1977 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", 1978 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); 1979 #ifdef YYSTYPE_TOSTRING 1980 #if YYBTYACC 1981 if (!yytrial) 1982 #endif /* YYBTYACC */ 1983 if (yym > 0) 1984 { 1985 int i; 1986 fputc('<', stderr); 1987 for (i = yym; i > 0; i--) 1988 { 1989 if (i != yym) fputs(", ", stderr); 1990 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], 1991 yystack.l_mark[1-i]), stderr); 1992 } 1993 fputc('>', stderr); 1994 } 1995 #endif 1996 fputc('\n', stderr); 1997 } 1998 #endif 1999 if (yym > 0) 2000 yyval = yystack.l_mark[1-yym]; 2001 else 2002 memset(&yyval, 0, sizeof yyval); 2003 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2004 2005 /* Perform position reduction */ 2006 memset(&yyloc, 0, sizeof(yyloc)); 2007 #if YYBTYACC 2008 if (!yytrial) 2009 #endif /* YYBTYACC */ 2010 { 2011 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); 2012 /* just in case YYERROR is invoked within the action, save 2013 the start of the rhs as the error start position */ 2014 yyerror_loc_range[1] = yystack.p_mark[1-yym]; 2015 } 2016 #endif 2017 2018 switch (yyn) 2019 { 2020 case 10: 2021 #line 378 "grammar.y" 2022 { 2023 yyerrok; 2024 } 2025 #line 2026 "grammar.tab.c" 2026 break; 2027 case 11: 2028 #line 382 "grammar.y" 2029 { 2030 yyerrok; 2031 } 2032 #line 2033 "grammar.tab.c" 2033 break; 2034 case 13: 2035 #line 393 "grammar.y" 2036 { 2037 /* Provide an empty action here so bison will not complain about 2038 * incompatible types in the default action it normally would 2039 * have generated. 2040 */ 2041 } 2042 #line 2043 "grammar.tab.c" 2043 break; 2044 case 14: 2045 #line 400 "grammar.y" 2046 { 2047 /* empty */ 2048 } 2049 #line 2050 "grammar.tab.c" 2050 break; 2051 case 15: 2052 #line 407 "grammar.y" 2053 { 2054 #if OPT_LINTLIBRARY 2055 if (types_out && want_typedef()) { 2056 gen_declarations(&yystack.l_mark[-1].decl_spec, (DeclaratorList *)0); 2057 flush_varargs(); 2058 } 2059 #endif 2060 free_decl_spec(&yystack.l_mark[-1].decl_spec); 2061 end_typedef(); 2062 } 2063 #line 2064 "grammar.tab.c" 2064 break; 2065 case 16: 2066 #line 418 "grammar.y" 2067 { 2068 if (func_params != NULL) { 2069 set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list); 2070 } else { 2071 gen_declarations(&yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list); 2072 #if OPT_LINTLIBRARY 2073 flush_varargs(); 2074 #endif 2075 free_decl_list(&yystack.l_mark[-1].decl_list); 2076 } 2077 free_decl_spec(&yystack.l_mark[-2].decl_spec); 2078 end_typedef(); 2079 } 2080 #line 2081 "grammar.tab.c" 2081 break; 2082 case 17: 2083 #line 432 "grammar.y" 2084 { 2085 cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags; 2086 free_decl_spec(&yystack.l_mark[0].decl_spec); 2087 } 2088 #line 2089 "grammar.tab.c" 2089 break; 2090 case 18: 2091 #line 437 "grammar.y" 2092 { 2093 end_typedef(); 2094 } 2095 #line 2096 "grammar.tab.c" 2096 break; 2097 case 19: 2098 #line 444 "grammar.y" 2099 { 2100 begin_typedef(); 2101 } 2102 #line 2103 "grammar.tab.c" 2103 break; 2104 case 20: 2105 #line 448 "grammar.y" 2106 { 2107 begin_typedef(); 2108 } 2109 #line 2110 "grammar.tab.c" 2110 break; 2111 case 23: 2112 #line 460 "grammar.y" 2113 { 2114 int flags = cur_decl_spec_flags; 2115 2116 /* If the typedef is a pointer type, then reset the short type 2117 * flags so it does not get promoted. 2118 */ 2119 if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0) 2120 flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); 2121 new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags); 2122 free_declarator(yystack.l_mark[0].declarator); 2123 } 2124 #line 2125 "grammar.tab.c" 2125 break; 2126 case 24: 2127 #line 472 "grammar.y" 2128 { 2129 int flags = cur_decl_spec_flags; 2130 2131 if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0) 2132 flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); 2133 new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags); 2134 free_declarator(yystack.l_mark[0].declarator); 2135 } 2136 #line 2137 "grammar.tab.c" 2137 break; 2138 case 25: 2139 #line 484 "grammar.y" 2140 { 2141 check_untagged(&yystack.l_mark[-1].decl_spec); 2142 if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) { 2143 yyerror("syntax error"); 2144 YYERROR; 2145 } 2146 func_params = &(yystack.l_mark[0].declarator->head->params); 2147 func_params->begin_comment = cur_file->begin_comment; 2148 func_params->end_comment = cur_file->end_comment; 2149 } 2150 #line 2151 "grammar.tab.c" 2151 break; 2152 case 26: 2153 #line 495 "grammar.y" 2154 { 2155 /* If we're converting to K&R and we've got a nominally K&R 2156 * function which has a parameter which is ANSI (i.e., a prototyped 2157 * function pointer), then we must override the deciphered value of 2158 * 'func_def' so that the parameter will be converted. 2159 */ 2160 if (func_style == FUNC_TRADITIONAL 2161 && haveAnsiParam() 2162 && yystack.l_mark[-3].declarator->head->func_def == func_style) { 2163 yystack.l_mark[-3].declarator->head->func_def = FUNC_BOTH; 2164 } 2165 2166 func_params = NULL; 2167 2168 if (cur_file->convert) 2169 gen_func_definition(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator); 2170 gen_prototype(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator); 2171 #if OPT_LINTLIBRARY 2172 flush_varargs(); 2173 #endif 2174 free_decl_spec(&yystack.l_mark[-4].decl_spec); 2175 free_declarator(yystack.l_mark[-3].declarator); 2176 } 2177 #line 2178 "grammar.tab.c" 2178 break; 2179 case 28: 2180 #line 520 "grammar.y" 2181 { 2182 if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) { 2183 yyerror("syntax error"); 2184 YYERROR; 2185 } 2186 func_params = &(yystack.l_mark[0].declarator->head->params); 2187 func_params->begin_comment = cur_file->begin_comment; 2188 func_params->end_comment = cur_file->end_comment; 2189 } 2190 #line 2191 "grammar.tab.c" 2191 break; 2192 case 29: 2193 #line 530 "grammar.y" 2194 { 2195 DeclSpec decl_spec; 2196 2197 func_params = NULL; 2198 2199 new_decl_spec(&decl_spec, dft_decl_spec(), yystack.l_mark[-4].declarator->begin, DS_NONE); 2200 if (cur_file->convert) 2201 gen_func_definition(&decl_spec, yystack.l_mark[-4].declarator); 2202 gen_prototype(&decl_spec, yystack.l_mark[-4].declarator); 2203 #if OPT_LINTLIBRARY 2204 flush_varargs(); 2205 #endif 2206 free_decl_spec(&decl_spec); 2207 free_declarator(yystack.l_mark[-4].declarator); 2208 } 2209 #line 2210 "grammar.tab.c" 2210 break; 2211 case 36: 2212 #line 561 "grammar.y" 2213 { 2214 join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec); 2215 free(yystack.l_mark[-1].decl_spec.text); 2216 free(yystack.l_mark[0].decl_spec.text); 2217 } 2218 #line 2219 "grammar.tab.c" 2219 break; 2220 case 40: 2221 #line 576 "grammar.y" 2222 { 2223 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2224 } 2225 #line 2226 "grammar.tab.c" 2226 break; 2227 case 41: 2228 #line 580 "grammar.y" 2229 { 2230 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN); 2231 } 2232 #line 2233 "grammar.tab.c" 2233 break; 2234 case 42: 2235 #line 584 "grammar.y" 2236 { 2237 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2238 } 2239 #line 2240 "grammar.tab.c" 2240 break; 2241 case 43: 2242 #line 588 "grammar.y" 2243 { 2244 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC); 2245 } 2246 #line 2247 "grammar.tab.c" 2247 break; 2248 case 44: 2249 #line 592 "grammar.y" 2250 { 2251 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE); 2252 } 2253 #line 2254 "grammar.tab.c" 2254 break; 2255 case 45: 2256 #line 596 "grammar.y" 2257 { 2258 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK); 2259 } 2260 #line 2261 "grammar.tab.c" 2261 break; 2262 case 46: 2263 #line 603 "grammar.y" 2264 { 2265 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR); 2266 } 2267 #line 2268 "grammar.tab.c" 2268 break; 2269 case 47: 2270 #line 607 "grammar.y" 2271 { 2272 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2273 } 2274 #line 2275 "grammar.tab.c" 2275 break; 2276 case 48: 2277 #line 611 "grammar.y" 2278 { 2279 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT); 2280 } 2281 #line 2282 "grammar.tab.c" 2282 break; 2283 case 49: 2284 #line 615 "grammar.y" 2285 { 2286 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2287 } 2288 #line 2289 "grammar.tab.c" 2289 break; 2290 case 50: 2291 #line 619 "grammar.y" 2292 { 2293 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2294 } 2295 #line 2296 "grammar.tab.c" 2296 break; 2297 case 51: 2298 #line 623 "grammar.y" 2299 { 2300 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT); 2301 } 2302 #line 2303 "grammar.tab.c" 2303 break; 2304 case 52: 2305 #line 627 "grammar.y" 2306 { 2307 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2308 } 2309 #line 2310 "grammar.tab.c" 2310 break; 2311 case 53: 2312 #line 631 "grammar.y" 2313 { 2314 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2315 } 2316 #line 2317 "grammar.tab.c" 2317 break; 2318 case 54: 2319 #line 635 "grammar.y" 2320 { 2321 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2322 } 2323 #line 2324 "grammar.tab.c" 2324 break; 2325 case 55: 2326 #line 639 "grammar.y" 2327 { 2328 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR); 2329 } 2330 #line 2331 "grammar.tab.c" 2331 break; 2332 case 56: 2333 #line 643 "grammar.y" 2334 { 2335 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2336 } 2337 #line 2338 "grammar.tab.c" 2338 break; 2339 case 57: 2340 #line 647 "grammar.y" 2341 { 2342 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2343 } 2344 #line 2345 "grammar.tab.c" 2345 break; 2346 case 58: 2347 #line 651 "grammar.y" 2348 { 2349 Symbol *s; 2350 s = find_symbol(typedef_names, yystack.l_mark[0].text.text); 2351 if (s != NULL) 2352 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags); 2353 } 2354 #line 2355 "grammar.tab.c" 2355 break; 2356 case 61: 2357 #line 663 "grammar.y" 2358 { 2359 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 2360 } 2361 #line 2362 "grammar.tab.c" 2362 break; 2363 case 62: 2364 #line 667 "grammar.y" 2365 { 2366 /* This rule allows the <pointer> nonterminal to scan #define 2367 * names as if they were type modifiers. 2368 */ 2369 Symbol *s; 2370 s = find_symbol(define_names, yystack.l_mark[0].text.text); 2371 if (s != NULL) 2372 new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags); 2373 } 2374 #line 2375 "grammar.tab.c" 2375 break; 2376 case 63: 2377 #line 680 "grammar.y" 2378 { 2379 char *s; 2380 if ((s = implied_typedef()) == 0) 2381 (void)sprintf(s = buf, "%.*s %.*s", TEXT_LEN, yystack.l_mark[-2].text.text, TEXT_LEN, yystack.l_mark[-1].text.text); 2382 new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE); 2383 } 2384 #line 2385 "grammar.tab.c" 2385 break; 2386 case 64: 2387 #line 687 "grammar.y" 2388 { 2389 char *s; 2390 if ((s = implied_typedef()) == 0) 2391 (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, yystack.l_mark[-1].text.text); 2392 new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE); 2393 } 2394 #line 2395 "grammar.tab.c" 2395 break; 2396 case 65: 2397 #line 694 "grammar.y" 2398 { 2399 (void)sprintf(buf, "%.*s %.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].text.text); 2400 new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE); 2401 } 2402 #line 2403 "grammar.tab.c" 2403 break; 2404 case 66: 2405 #line 702 "grammar.y" 2406 { 2407 imply_typedef(yyval.text.text); 2408 } 2409 #line 2410 "grammar.tab.c" 2410 break; 2411 case 67: 2412 #line 706 "grammar.y" 2413 { 2414 imply_typedef(yyval.text.text); 2415 } 2416 #line 2417 "grammar.tab.c" 2417 break; 2418 case 68: 2419 #line 713 "grammar.y" 2420 { 2421 new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator); 2422 } 2423 #line 2424 "grammar.tab.c" 2424 break; 2425 case 69: 2426 #line 717 "grammar.y" 2427 { 2428 add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator); 2429 } 2430 #line 2431 "grammar.tab.c" 2431 break; 2432 case 70: 2433 #line 724 "grammar.y" 2434 { 2435 if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL && 2436 func_style == FUNC_TRADITIONAL && cur_file->convert) { 2437 gen_func_declarator(yystack.l_mark[0].declarator); 2438 fputs(cur_text(), cur_file->tmp_file); 2439 } 2440 cur_declarator = yyval.declarator; 2441 } 2442 #line 2443 "grammar.tab.c" 2443 break; 2444 case 71: 2445 #line 733 "grammar.y" 2446 { 2447 if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL && 2448 func_style == FUNC_TRADITIONAL && cur_file->convert) { 2449 gen_func_declarator(yystack.l_mark[-1].declarator); 2450 fputs(" =", cur_file->tmp_file); 2451 } 2452 } 2453 #line 2454 "grammar.tab.c" 2454 break; 2455 case 73: 2456 #line 745 "grammar.y" 2457 { 2458 char *s; 2459 if ((s = implied_typedef()) == 0) 2460 (void)sprintf(s = buf, "enum %.*s", TEXT_LEN, yystack.l_mark[-1].text.text); 2461 new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE); 2462 } 2463 #line 2464 "grammar.tab.c" 2464 break; 2465 case 74: 2466 #line 752 "grammar.y" 2467 { 2468 char *s; 2469 if ((s = implied_typedef()) == 0) 2470 (void)sprintf(s = buf, "%.*s {}", TEXT_LEN, yystack.l_mark[-1].text.text); 2471 new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE); 2472 } 2473 #line 2474 "grammar.tab.c" 2474 break; 2475 case 75: 2476 #line 759 "grammar.y" 2477 { 2478 (void)sprintf(buf, "enum %.*s", TEXT_LEN, yystack.l_mark[0].text.text); 2479 new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE); 2480 } 2481 #line 2482 "grammar.tab.c" 2482 break; 2483 case 76: 2484 #line 767 "grammar.y" 2485 { 2486 imply_typedef("enum"); 2487 yyval.text = yystack.l_mark[0].text; 2488 } 2489 #line 2490 "grammar.tab.c" 2490 break; 2491 case 79: 2492 #line 780 "grammar.y" 2493 { 2494 yyval.declarator = yystack.l_mark[0].declarator; 2495 (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yyval.declarator->text); 2496 free(yyval.declarator->text); 2497 yyval.declarator->text = xstrdup(buf); 2498 yyval.declarator->begin = yystack.l_mark[-1].text.begin; 2499 yyval.declarator->pointer = TRUE; 2500 } 2501 #line 2502 "grammar.tab.c" 2502 break; 2503 case 81: 2504 #line 793 "grammar.y" 2505 { 2506 yyval.declarator = new_declarator(yystack.l_mark[0].text.text, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin); 2507 } 2508 #line 2509 "grammar.tab.c" 2509 break; 2510 case 82: 2511 #line 797 "grammar.y" 2512 { 2513 yyval.declarator = yystack.l_mark[-1].declarator; 2514 (void)sprintf(buf, "(%.*s)", TEXT_LEN, yyval.declarator->text); 2515 free(yyval.declarator->text); 2516 yyval.declarator->text = xstrdup(buf); 2517 yyval.declarator->begin = yystack.l_mark[-2].text.begin; 2518 } 2519 #line 2520 "grammar.tab.c" 2520 break; 2521 case 83: 2522 #line 805 "grammar.y" 2523 { 2524 yyval.declarator = yystack.l_mark[-1].declarator; 2525 (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yyval.declarator->text, TEXT_LEN, yystack.l_mark[0].text.text); 2526 free(yyval.declarator->text); 2527 yyval.declarator->text = xstrdup(buf); 2528 } 2529 #line 2530 "grammar.tab.c" 2530 break; 2531 case 84: 2532 #line 812 "grammar.y" 2533 { 2534 yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin); 2535 yyval.declarator->params = yystack.l_mark[-1].param_list; 2536 yyval.declarator->func_stack = yystack.l_mark[-3].declarator; 2537 yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; 2538 yyval.declarator->func_def = FUNC_ANSI; 2539 } 2540 #line 2541 "grammar.tab.c" 2541 break; 2542 case 85: 2543 #line 820 "grammar.y" 2544 { 2545 yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin); 2546 yyval.declarator->params = yystack.l_mark[-1].param_list; 2547 yyval.declarator->func_stack = yystack.l_mark[-3].declarator; 2548 yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; 2549 yyval.declarator->func_def = FUNC_TRADITIONAL; 2550 } 2551 #line 2552 "grammar.tab.c" 2552 break; 2553 case 86: 2554 #line 831 "grammar.y" 2555 { 2556 (void)sprintf(yyval.text.text, "*%.*s", TEXT_LEN, yystack.l_mark[0].text.text); 2557 yyval.text.begin = yystack.l_mark[-1].text.begin; 2558 } 2559 #line 2560 "grammar.tab.c" 2560 break; 2561 case 87: 2562 #line 836 "grammar.y" 2563 { 2564 (void)sprintf(yyval.text.text, "*%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].text.text); 2565 yyval.text.begin = yystack.l_mark[-2].text.begin; 2566 } 2567 #line 2568 "grammar.tab.c" 2568 break; 2569 case 88: 2570 #line 844 "grammar.y" 2571 { 2572 strcpy(yyval.text.text, ""); 2573 yyval.text.begin = 0L; 2574 } 2575 #line 2576 "grammar.tab.c" 2576 break; 2577 case 90: 2578 #line 853 "grammar.y" 2579 { 2580 (void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text); 2581 yyval.text.begin = yystack.l_mark[0].decl_spec.begin; 2582 free(yystack.l_mark[0].decl_spec.text); 2583 } 2584 #line 2585 "grammar.tab.c" 2585 break; 2586 case 91: 2587 #line 859 "grammar.y" 2588 { 2589 (void)sprintf(yyval.text.text, "%.*s%.*s ", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yystack.l_mark[0].decl_spec.text); 2590 yyval.text.begin = yystack.l_mark[-1].text.begin; 2591 free(yystack.l_mark[0].decl_spec.text); 2592 } 2593 #line 2594 "grammar.tab.c" 2594 break; 2595 case 93: 2596 #line 869 "grammar.y" 2597 { 2598 add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "..."); 2599 } 2600 #line 2601 "grammar.tab.c" 2601 break; 2602 case 94: 2603 #line 876 "grammar.y" 2604 { 2605 new_param_list(&yyval.param_list, yystack.l_mark[0].parameter); 2606 } 2607 #line 2608 "grammar.tab.c" 2608 break; 2609 case 95: 2610 #line 880 "grammar.y" 2611 { 2612 add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter); 2613 } 2614 #line 2615 "grammar.tab.c" 2615 break; 2616 case 96: 2617 #line 887 "grammar.y" 2618 { 2619 check_untagged(&yystack.l_mark[-1].decl_spec); 2620 yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator); 2621 } 2622 #line 2623 "grammar.tab.c" 2623 break; 2624 case 97: 2625 #line 892 "grammar.y" 2626 { 2627 check_untagged(&yystack.l_mark[-1].decl_spec); 2628 yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator); 2629 } 2630 #line 2631 "grammar.tab.c" 2631 break; 2632 case 98: 2633 #line 897 "grammar.y" 2634 { 2635 check_untagged(&yystack.l_mark[0].decl_spec); 2636 yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0); 2637 } 2638 #line 2639 "grammar.tab.c" 2639 break; 2640 case 99: 2641 #line 905 "grammar.y" 2642 { 2643 new_ident_list(&yyval.param_list); 2644 } 2645 #line 2646 "grammar.tab.c" 2646 break; 2647 case 101: 2648 #line 913 "grammar.y" 2649 { 2650 new_ident_list(&yyval.param_list); 2651 add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text); 2652 } 2653 #line 2654 "grammar.tab.c" 2654 break; 2655 case 102: 2656 #line 918 "grammar.y" 2657 { 2658 add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text); 2659 } 2660 #line 2661 "grammar.tab.c" 2661 break; 2662 case 103: 2663 #line 925 "grammar.y" 2664 { 2665 yyval.text = yystack.l_mark[0].text; 2666 } 2667 #line 2668 "grammar.tab.c" 2668 break; 2669 case 104: 2670 #line 929 "grammar.y" 2671 { 2672 #if OPT_LINTLIBRARY 2673 if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */ 2674 yyval.text = yystack.l_mark[0].text; 2675 } else 2676 #endif 2677 (void)sprintf(yyval.text.text, "&%.*s", TEXT_LEN, yystack.l_mark[0].text.text); 2678 yyval.text.begin = yystack.l_mark[-1].text.begin; 2679 } 2680 #line 2681 "grammar.tab.c" 2681 break; 2682 case 105: 2683 #line 942 "grammar.y" 2684 { 2685 yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin); 2686 } 2687 #line 2688 "grammar.tab.c" 2688 break; 2689 case 106: 2690 #line 946 "grammar.y" 2691 { 2692 yyval.declarator = yystack.l_mark[0].declarator; 2693 (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yystack.l_mark[-1].text.text, TEXT_LEN, yyval.declarator->text); 2694 free(yyval.declarator->text); 2695 yyval.declarator->text = xstrdup(buf); 2696 yyval.declarator->begin = yystack.l_mark[-1].text.begin; 2697 } 2698 #line 2699 "grammar.tab.c" 2699 break; 2700 case 108: 2701 #line 958 "grammar.y" 2702 { 2703 yyval.declarator = yystack.l_mark[-1].declarator; 2704 (void)sprintf(buf, "(%.*s)", TEXT_LEN, yyval.declarator->text); 2705 free(yyval.declarator->text); 2706 yyval.declarator->text = xstrdup(buf); 2707 yyval.declarator->begin = yystack.l_mark[-2].text.begin; 2708 } 2709 #line 2710 "grammar.tab.c" 2710 break; 2711 case 109: 2712 #line 966 "grammar.y" 2713 { 2714 yyval.declarator = yystack.l_mark[-1].declarator; 2715 (void)sprintf(buf, "%.*s%.*s", TEXT_LEN, yyval.declarator->text, TEXT_LEN, yystack.l_mark[0].text.text); 2716 free(yyval.declarator->text); 2717 yyval.declarator->text = xstrdup(buf); 2718 } 2719 #line 2720 "grammar.tab.c" 2720 break; 2721 case 110: 2722 #line 973 "grammar.y" 2723 { 2724 yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin); 2725 } 2726 #line 2727 "grammar.tab.c" 2727 break; 2728 case 111: 2729 #line 977 "grammar.y" 2730 { 2731 yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin); 2732 yyval.declarator->params = yystack.l_mark[-1].param_list; 2733 yyval.declarator->func_stack = yystack.l_mark[-3].declarator; 2734 yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; 2735 yyval.declarator->func_def = FUNC_ANSI; 2736 } 2737 #line 2738 "grammar.tab.c" 2738 break; 2739 case 112: 2740 #line 985 "grammar.y" 2741 { 2742 yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin); 2743 yyval.declarator->func_stack = yystack.l_mark[-2].declarator; 2744 yyval.declarator->head = (yystack.l_mark[-2].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-2].declarator->head; 2745 yyval.declarator->func_def = FUNC_ANSI; 2746 } 2747 #line 2748 "grammar.tab.c" 2748 break; 2749 case 113: 2750 #line 992 "grammar.y" 2751 { 2752 Declarator *d; 2753 2754 d = new_declarator("", "", yystack.l_mark[-2].text.begin); 2755 yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].text.begin); 2756 yyval.declarator->params = yystack.l_mark[-1].param_list; 2757 yyval.declarator->func_stack = d; 2758 yyval.declarator->head = yyval.declarator; 2759 yyval.declarator->func_def = FUNC_ANSI; 2760 } 2761 #line 2762 "grammar.tab.c" 2762 break; 2763 case 114: 2764 #line 1003 "grammar.y" 2765 { 2766 Declarator *d; 2767 2768 d = new_declarator("", "", yystack.l_mark[-1].text.begin); 2769 yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-1].text.begin); 2770 yyval.declarator->func_stack = d; 2771 yyval.declarator->head = yyval.declarator; 2772 yyval.declarator->func_def = FUNC_ANSI; 2773 } 2774 #line 2775 "grammar.tab.c" 2775 break; 2776 #line 2777 "grammar.tab.c" 2777 default: 2778 break; 2779 } 2780 yystack.s_mark -= yym; 2781 yystate = *yystack.s_mark; 2782 yystack.l_mark -= yym; 2783 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2784 yystack.p_mark -= yym; 2785 #endif 2786 yym = yylhs[yyn]; 2787 if (yystate == 0 && yym == 0) 2788 { 2789 #if YYDEBUG 2790 if (yydebug) 2791 { 2792 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 2793 #ifdef YYSTYPE_TOSTRING 2794 #if YYBTYACC 2795 if (!yytrial) 2796 #endif /* YYBTYACC */ 2797 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); 2798 #endif 2799 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); 2800 } 2801 #endif 2802 yystate = YYFINAL; 2803 *++yystack.s_mark = YYFINAL; 2804 *++yystack.l_mark = yyval; 2805 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2806 *++yystack.p_mark = yyloc; 2807 #endif 2808 if (yychar < 0) 2809 { 2810 #if YYBTYACC 2811 do { 2812 if (yylvp < yylve) 2813 { 2814 /* we're currently re-reading tokens */ 2815 yylval = *yylvp++; 2816 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2817 yylloc = *yylpp++; 2818 #endif 2819 yychar = *yylexp++; 2820 break; 2821 } 2822 if (yyps->save) 2823 { 2824 /* in trial mode; save scanner results for future parse attempts */ 2825 if (yylvp == yylvlim) 2826 { /* Enlarge lexical value queue */ 2827 size_t p = (size_t) (yylvp - yylvals); 2828 size_t s = (size_t) (yylvlim - yylvals); 2829 2830 s += YYLVQUEUEGROWTH; 2831 if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) 2832 goto yyenomem; 2833 if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 2834 goto yyenomem; 2835 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2836 if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 2837 goto yyenomem; 2838 #endif 2839 yylvp = yylve = yylvals + p; 2840 yylvlim = yylvals + s; 2841 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2842 yylpp = yylpe = yylpsns + p; 2843 yylplim = yylpsns + s; 2844 #endif 2845 yylexp = yylexemes + p; 2846 } 2847 *yylexp = (YYINT) YYLEX; 2848 *yylvp++ = yylval; 2849 yylve++; 2850 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2851 *yylpp++ = yylloc; 2852 yylpe++; 2853 #endif 2854 yychar = *yylexp++; 2855 break; 2856 } 2857 /* normal operation, no conflict encountered */ 2858 #endif /* YYBTYACC */ 2859 yychar = YYLEX; 2860 #if YYBTYACC 2861 } while (0); 2862 #endif /* YYBTYACC */ 2863 if (yychar < 0) yychar = YYEOF; 2864 #if YYDEBUG 2865 if (yydebug) 2866 { 2867 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 2868 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n", 2869 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); 2870 } 2871 #endif 2872 } 2873 if (yychar == YYEOF) goto yyaccept; 2874 goto yyloop; 2875 } 2876 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 2877 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 2878 yystate = yytable[yyn]; 2879 else 2880 yystate = yydgoto[yym]; 2881 #if YYDEBUG 2882 if (yydebug) 2883 { 2884 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 2885 #ifdef YYSTYPE_TOSTRING 2886 #if YYBTYACC 2887 if (!yytrial) 2888 #endif /* YYBTYACC */ 2889 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 2890 #endif 2891 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 2892 } 2893 #endif 2894 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 2895 *++yystack.s_mark = (YYINT) yystate; 2896 *++yystack.l_mark = yyval; 2897 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2898 *++yystack.p_mark = yyloc; 2899 #endif 2900 goto yyloop; 2901 #if YYBTYACC 2902 2903 /* Reduction declares that this path is valid. Set yypath and do a full parse */ 2904 yyvalid: 2905 if (yypath) YYABORT; 2906 while (yyps->save) 2907 { 2908 YYParseState *save = yyps->save; 2909 yyps->save = save->save; 2910 save->save = yypath; 2911 yypath = save; 2912 } 2913 #if YYDEBUG 2914 if (yydebug) 2915 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", 2916 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); 2917 #endif 2918 if (yyerrctx) 2919 { 2920 yyFreeState(yyerrctx); 2921 yyerrctx = NULL; 2922 } 2923 yylvp = yylvals + yypath->lexeme; 2924 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2925 yylpp = yylpsns + yypath->lexeme; 2926 #endif 2927 yylexp = yylexemes + yypath->lexeme; 2928 yychar = YYEMPTY; 2929 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 2930 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 2931 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 2932 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 2933 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2934 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 2935 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 2936 #endif 2937 yystate = yypath->state; 2938 goto yyloop; 2939 #endif /* YYBTYACC */ 2940 2941 yyoverflow: 2942 YYERROR_CALL("yacc stack overflow"); 2943 #if YYBTYACC 2944 goto yyabort_nomem; 2945 yyenomem: 2946 YYERROR_CALL("memory exhausted"); 2947 yyabort_nomem: 2948 #endif /* YYBTYACC */ 2949 yyresult = 2; 2950 goto yyreturn; 2951 2952 yyabort: 2953 yyresult = 1; 2954 goto yyreturn; 2955 2956 yyaccept: 2957 #if YYBTYACC 2958 if (yyps->save) goto yyvalid; 2959 #endif /* YYBTYACC */ 2960 yyresult = 0; 2961 2962 yyreturn: 2963 #if defined(YYDESTRUCT_CALL) 2964 if (yychar != YYEOF && yychar != YYEMPTY) 2965 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2966 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); 2967 #else 2968 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); 2969 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 2970 2971 { 2972 YYSTYPE *pv; 2973 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2974 YYLTYPE *pp; 2975 2976 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) 2977 YYDESTRUCT_CALL("cleanup: discarding state", 2978 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); 2979 #else 2980 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) 2981 YYDESTRUCT_CALL("cleanup: discarding state", 2982 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); 2983 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 2984 } 2985 #endif /* defined(YYDESTRUCT_CALL) */ 2986 2987 #if YYBTYACC 2988 if (yyerrctx) 2989 { 2990 yyFreeState(yyerrctx); 2991 yyerrctx = NULL; 2992 } 2993 while (yyps) 2994 { 2995 YYParseState *save = yyps; 2996 yyps = save->save; 2997 save->save = NULL; 2998 yyFreeState(save); 2999 } 3000 while (yypath) 3001 { 3002 YYParseState *save = yypath; 3003 yypath = save->save; 3004 save->save = NULL; 3005 yyFreeState(save); 3006 } 3007 #endif /* YYBTYACC */ 3008 yyfreestack(&yystack); 3009 return (yyresult); 3010 } 3011