1234949Sbapt#ifndef lint 2234949Sbaptstatic const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; 3234949Sbapt#endif 4234949Sbapt 5234949Sbapt#define YYBYACC 1 6234949Sbapt#define YYMAJOR 1 7234949Sbapt#define YYMINOR 9 8234949Sbapt 9234949Sbapt#define YYEMPTY (-1) 10234949Sbapt#define yyclearin (yychar = YYEMPTY) 11234949Sbapt#define yyerrok (yyerrflag = 0) 12234949Sbapt#define YYRECOVERING() (yyerrflag != 0) 13234949Sbapt 14234949Sbapt 15234949Sbapt#ifndef yyparse 16234949Sbapt#define yyparse grammar_parse 17234949Sbapt#endif /* yyparse */ 18234949Sbapt 19234949Sbapt#ifndef yylex 20234949Sbapt#define yylex grammar_lex 21234949Sbapt#endif /* yylex */ 22234949Sbapt 23234949Sbapt#ifndef yyerror 24234949Sbapt#define yyerror grammar_error 25234949Sbapt#endif /* yyerror */ 26234949Sbapt 27234949Sbapt#ifndef yychar 28234949Sbapt#define yychar grammar_char 29234949Sbapt#endif /* yychar */ 30234949Sbapt 31234949Sbapt#ifndef yyval 32234949Sbapt#define yyval grammar_val 33234949Sbapt#endif /* yyval */ 34234949Sbapt 35234949Sbapt#ifndef yylval 36234949Sbapt#define yylval grammar_lval 37234949Sbapt#endif /* yylval */ 38234949Sbapt 39234949Sbapt#ifndef yydebug 40234949Sbapt#define yydebug grammar_debug 41234949Sbapt#endif /* yydebug */ 42234949Sbapt 43234949Sbapt#ifndef yynerrs 44234949Sbapt#define yynerrs grammar_nerrs 45234949Sbapt#endif /* yynerrs */ 46234949Sbapt 47234949Sbapt#ifndef yyerrflag 48234949Sbapt#define yyerrflag grammar_errflag 49234949Sbapt#endif /* yyerrflag */ 50234949Sbapt 51234949Sbapt#ifndef yylhs 52234949Sbapt#define yylhs grammar_lhs 53234949Sbapt#endif /* yylhs */ 54234949Sbapt 55234949Sbapt#ifndef yylen 56234949Sbapt#define yylen grammar_len 57234949Sbapt#endif /* yylen */ 58234949Sbapt 59234949Sbapt#ifndef yydefred 60234949Sbapt#define yydefred grammar_defred 61234949Sbapt#endif /* yydefred */ 62234949Sbapt 63234949Sbapt#ifndef yydgoto 64234949Sbapt#define yydgoto grammar_dgoto 65234949Sbapt#endif /* yydgoto */ 66234949Sbapt 67234949Sbapt#ifndef yysindex 68234949Sbapt#define yysindex grammar_sindex 69234949Sbapt#endif /* yysindex */ 70234949Sbapt 71234949Sbapt#ifndef yyrindex 72234949Sbapt#define yyrindex grammar_rindex 73234949Sbapt#endif /* yyrindex */ 74234949Sbapt 75234949Sbapt#ifndef yygindex 76234949Sbapt#define yygindex grammar_gindex 77234949Sbapt#endif /* yygindex */ 78234949Sbapt 79234949Sbapt#ifndef yytable 80234949Sbapt#define yytable grammar_table 81234949Sbapt#endif /* yytable */ 82234949Sbapt 83234949Sbapt#ifndef yycheck 84234949Sbapt#define yycheck grammar_check 85234949Sbapt#endif /* yycheck */ 86234949Sbapt 87234949Sbapt#ifndef yyname 88234949Sbapt#define yyname grammar_name 89234949Sbapt#endif /* yyname */ 90234949Sbapt 91234949Sbapt#ifndef yyrule 92234949Sbapt#define yyrule grammar_rule 93234949Sbapt#endif /* yyrule */ 94234949Sbapt#define YYPREFIX "grammar_" 95234949Sbapt 96234949Sbapt#define YYPURE 0 97234949Sbapt 98234949Sbapt#line 9 "grammar.y" 99234949Sbapt#ifdef YYBISON 100234949Sbapt#include <stdlib.h> 101234949Sbapt#define YYSTYPE_IS_DECLARED 102234949Sbapt#define yyerror yaccError 103234949Sbapt#endif 104234949Sbapt 105234949Sbapt#if defined(YYBISON) || !defined(YYBYACC) 106234949Sbaptstatic void yyerror(const char *s); 107234949Sbapt#endif 108234949Sbapt#line 81 "grammar.y" 109234949Sbapt#include <stdio.h> 110234949Sbapt#include <ctype.h> 111234949Sbapt#include <string.h> 112234949Sbapt 113234949Sbapt#define OPT_LINTLIBRARY 1 114234949Sbapt 115234949Sbapt#ifndef TRUE 116234949Sbapt#define TRUE (1) 117234949Sbapt#endif 118234949Sbapt 119234949Sbapt#ifndef FALSE 120234949Sbapt#define FALSE (0) 121234949Sbapt#endif 122234949Sbapt 123234949Sbapt/* #include "cproto.h" */ 124234949Sbapt#define MAX_TEXT_SIZE 1024 125234949Sbapt 126234949Sbapt/* Prototype styles */ 127234949Sbapt#if OPT_LINTLIBRARY 128234949Sbapt#define PROTO_ANSI_LLIB -2 /* form ANSI lint-library source */ 129234949Sbapt#define PROTO_LINTLIBRARY -1 /* form lint-library source */ 130234949Sbapt#endif 131234949Sbapt#define PROTO_NONE 0 /* do not output any prototypes */ 132234949Sbapt#define PROTO_TRADITIONAL 1 /* comment out parameters */ 133234949Sbapt#define PROTO_ABSTRACT 2 /* comment out parameter names */ 134234949Sbapt#define PROTO_ANSI 3 /* ANSI C prototype */ 135234949Sbapt 136234949Sbapttypedef int PrototypeStyle; 137234949Sbapt 138234949Sbapttypedef char boolean; 139234949Sbapt 140234949Sbaptextern boolean types_out; 141234949Sbaptextern PrototypeStyle proto_style; 142234949Sbapt 143234949Sbapt#define ansiLintLibrary() (proto_style == PROTO_ANSI_LLIB) 144234949Sbapt#define knrLintLibrary() (proto_style == PROTO_LINTLIBRARY) 145234949Sbapt#define lintLibrary() (knrLintLibrary() || ansiLintLibrary()) 146234949Sbapt 147234949Sbapt#if OPT_LINTLIBRARY 148234949Sbapt#define FUNC_UNKNOWN -1 /* unspecified */ 149234949Sbapt#else 150234949Sbapt#define FUNC_UNKNOWN 0 /* unspecified (same as FUNC_NONE) */ 151234949Sbapt#endif 152234949Sbapt#define FUNC_NONE 0 /* not a function definition */ 153234949Sbapt#define FUNC_TRADITIONAL 1 /* traditional style */ 154234949Sbapt#define FUNC_ANSI 2 /* ANSI style */ 155234949Sbapt#define FUNC_BOTH 3 /* both styles */ 156234949Sbapt 157234949Sbapttypedef int FuncDefStyle; 158234949Sbapt 159234949Sbapt/* Source file text */ 160234949Sbapttypedef struct text { 161234949Sbapt char text[MAX_TEXT_SIZE]; /* source text */ 162234949Sbapt long begin; /* offset in temporary file */ 163234949Sbapt} Text; 164234949Sbapt 165234949Sbapt/* Declaration specifier flags */ 166234949Sbapt#define DS_NONE 0 /* default */ 167234949Sbapt#define DS_EXTERN 1 /* contains "extern" specifier */ 168234949Sbapt#define DS_STATIC 2 /* contains "static" specifier */ 169234949Sbapt#define DS_CHAR 4 /* contains "char" type specifier */ 170234949Sbapt#define DS_SHORT 8 /* contains "short" type specifier */ 171234949Sbapt#define DS_FLOAT 16 /* contains "float" type specifier */ 172234949Sbapt#define DS_INLINE 32 /* contains "inline" specifier */ 173234949Sbapt#define DS_JUNK 64 /* we're not interested in this declaration */ 174234949Sbapt 175234949Sbapt/* This structure stores information about a declaration specifier. */ 176234949Sbapttypedef struct decl_spec { 177234949Sbapt unsigned short flags; /* flags defined above */ 178234949Sbapt char *text; /* source text */ 179234949Sbapt long begin; /* offset in temporary file */ 180234949Sbapt} DeclSpec; 181234949Sbapt 182234949Sbapt/* This is a list of function parameters. */ 183234949Sbapttypedef struct _ParameterList { 184234949Sbapt struct parameter *first; /* pointer to first parameter in list */ 185234949Sbapt struct parameter *last; /* pointer to last parameter in list */ 186234949Sbapt long begin_comment; /* begin offset of comment */ 187234949Sbapt long end_comment; /* end offset of comment */ 188234949Sbapt char *comment; /* comment at start of parameter list */ 189234949Sbapt} ParameterList; 190234949Sbapt 191234949Sbapt/* This structure stores information about a declarator. */ 192234949Sbapttypedef struct _Declarator { 193234949Sbapt char *name; /* name of variable or function */ 194234949Sbapt char *text; /* source text */ 195234949Sbapt long begin; /* offset in temporary file */ 196234949Sbapt long begin_comment; /* begin offset of comment */ 197234949Sbapt long end_comment; /* end offset of comment */ 198234949Sbapt FuncDefStyle func_def; /* style of function definition */ 199234949Sbapt ParameterList params; /* function parameters */ 200234949Sbapt boolean pointer; /* TRUE if it declares a pointer */ 201234949Sbapt struct _Declarator *head; /* head function declarator */ 202234949Sbapt struct _Declarator *func_stack; /* stack of function declarators */ 203234949Sbapt struct _Declarator *next; /* next declarator in list */ 204234949Sbapt} Declarator; 205234949Sbapt 206234949Sbapt/* This structure stores information about a function parameter. */ 207234949Sbapttypedef struct parameter { 208234949Sbapt struct parameter *next; /* next parameter in list */ 209234949Sbapt DeclSpec decl_spec; 210234949Sbapt Declarator *declarator; 211234949Sbapt char *comment; /* comment following the parameter */ 212234949Sbapt} Parameter; 213234949Sbapt 214234949Sbapt/* This is a list of declarators. */ 215234949Sbapttypedef struct declarator_list { 216234949Sbapt Declarator *first; /* pointer to first declarator in list */ 217234949Sbapt Declarator *last; /* pointer to last declarator in list */ 218234949Sbapt} DeclaratorList; 219234949Sbapt 220234949Sbapt/* #include "symbol.h" */ 221234949Sbapttypedef struct symbol { 222234949Sbapt struct symbol *next; /* next symbol in list */ 223234949Sbapt char *name; /* name of symbol */ 224234949Sbapt char *value; /* value of symbol (for defines) */ 225234949Sbapt short flags; /* symbol attributes */ 226234949Sbapt} Symbol; 227234949Sbapt 228234949Sbapt/* parser stack entry type */ 229234949Sbapttypedef union { 230234949Sbapt Text text; 231234949Sbapt DeclSpec decl_spec; 232234949Sbapt Parameter *parameter; 233234949Sbapt ParameterList param_list; 234234949Sbapt Declarator *declarator; 235234949Sbapt DeclaratorList decl_list; 236234949Sbapt} YYSTYPE; 237234949Sbapt 238234949Sbapt/* The hash table length should be a prime number. */ 239234949Sbapt#define SYM_MAX_HASH 251 240234949Sbapt 241234949Sbapttypedef struct symbol_table { 242234949Sbapt Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */ 243234949Sbapt} SymbolTable; 244234949Sbapt 245234949Sbaptextern SymbolTable *new_symbol_table /* Create symbol table */ 246234949Sbapt (void); 247234949Sbaptextern void free_symbol_table /* Destroy symbol table */ 248234949Sbapt (SymbolTable *s); 249234949Sbaptextern Symbol *find_symbol /* Lookup symbol name */ 250234949Sbapt (SymbolTable *s, const char *n); 251234949Sbaptextern Symbol *new_symbol /* Define new symbol */ 252234949Sbapt (SymbolTable *s, const char *n, const char *v, int f); 253234949Sbapt 254234949Sbapt/* #include "semantic.h" */ 255234949Sbaptextern void new_decl_spec (DeclSpec *, const char *, long, int); 256234949Sbaptextern void free_decl_spec (DeclSpec *); 257234949Sbaptextern void join_decl_specs (DeclSpec *, DeclSpec *, DeclSpec *); 258234949Sbaptextern void check_untagged (DeclSpec *); 259234949Sbaptextern Declarator *new_declarator (const char *, const char *, long); 260234949Sbaptextern void free_declarator (Declarator *); 261234949Sbaptextern void new_decl_list (DeclaratorList *, Declarator *); 262234949Sbaptextern void free_decl_list (DeclaratorList *); 263234949Sbaptextern void add_decl_list (DeclaratorList *, DeclaratorList *, Declarator *); 264234949Sbaptextern Parameter *new_parameter (DeclSpec *, Declarator *); 265234949Sbaptextern void free_parameter (Parameter *); 266234949Sbaptextern void new_param_list (ParameterList *, Parameter *); 267234949Sbaptextern void free_param_list (ParameterList *); 268234949Sbaptextern void add_param_list (ParameterList *, ParameterList *, Parameter *); 269234949Sbaptextern void new_ident_list (ParameterList *); 270234949Sbaptextern void add_ident_list (ParameterList *, ParameterList *, const char *); 271234949Sbaptextern void set_param_types (ParameterList *, DeclSpec *, DeclaratorList *); 272234949Sbaptextern void gen_declarations (DeclSpec *, DeclaratorList *); 273234949Sbaptextern void gen_prototype (DeclSpec *, Declarator *); 274234949Sbaptextern void gen_func_declarator (Declarator *); 275234949Sbaptextern void gen_func_definition (DeclSpec *, Declarator *); 276234949Sbapt 277234949Sbaptextern void init_parser (void); 278234949Sbaptextern void process_file (FILE *infile, char *name); 279234949Sbaptextern char *cur_text (void); 280234949Sbaptextern char *cur_file_name (void); 281234949Sbaptextern char *implied_typedef (void); 282234949Sbaptextern void include_file (char *name, int convert); 283234949Sbaptextern char *supply_parm (int count); 284234949Sbaptextern char *xstrdup (const char *); 285234949Sbaptextern int already_declared (char *name); 286234949Sbaptextern int is_actual_func (Declarator *d); 287234949Sbaptextern int lint_ellipsis (Parameter *p); 288234949Sbaptextern int want_typedef (void); 289234949Sbaptextern void begin_tracking (void); 290234949Sbaptextern void begin_typedef (void); 291234949Sbaptextern void copy_typedef (char *s); 292234949Sbaptextern void ellipsis_varargs (Declarator *d); 293234949Sbaptextern void end_typedef (void); 294234949Sbaptextern void flush_varargs (void); 295234949Sbaptextern void fmt_library (int code); 296234949Sbaptextern void imply_typedef (const char *s); 297234949Sbaptextern void indent (FILE *outf); 298234949Sbaptextern void put_blankline (FILE *outf); 299234949Sbaptextern void put_body (FILE *outf, DeclSpec *decl_spec, Declarator *declarator); 300234949Sbaptextern void put_char (FILE *outf, int c); 301234949Sbaptextern void put_error (void); 302234949Sbaptextern void put_newline (FILE *outf); 303234949Sbaptextern void put_padded (FILE *outf, const char *s); 304234949Sbaptextern void put_string (FILE *outf, const char *s); 305234949Sbaptextern void track_in (void); 306234949Sbapt 307234949Sbaptextern boolean file_comments; 308234949Sbaptextern FuncDefStyle func_style; 309234949Sbaptextern char base_file[]; 310234949Sbapt 311234949Sbaptextern int yylex (void); 312234949Sbapt 313234949Sbapt/* declaration specifier attributes for the typedef statement currently being 314234949Sbapt * scanned 315234949Sbapt */ 316234949Sbaptstatic int cur_decl_spec_flags; 317234949Sbapt 318234949Sbapt/* pointer to parameter list for the current function definition */ 319234949Sbaptstatic ParameterList *func_params; 320234949Sbapt 321234949Sbapt/* A parser semantic action sets this pointer to the current declarator in 322234949Sbapt * a function parameter declaration in order to catch any comments following 323234949Sbapt * the parameter declaration on the same line. If the lexer scans a comment 324234949Sbapt * and <cur_declarator> is not NULL, then the comment is attached to the 325234949Sbapt * declarator. To ignore subsequent comments, the lexer sets this to NULL 326234949Sbapt * after scanning a comment or end of line. 327234949Sbapt */ 328234949Sbaptstatic Declarator *cur_declarator; 329234949Sbapt 330234949Sbapt/* temporary string buffer */ 331234949Sbaptstatic char buf[MAX_TEXT_SIZE]; 332234949Sbapt 333234949Sbapt/* table of typedef names */ 334234949Sbaptstatic SymbolTable *typedef_names; 335234949Sbapt 336234949Sbapt/* table of define names */ 337234949Sbaptstatic SymbolTable *define_names; 338234949Sbapt 339234949Sbapt/* table of type qualifiers */ 340234949Sbaptstatic SymbolTable *type_qualifiers; 341234949Sbapt 342234949Sbapt/* information about the current input file */ 343234949Sbapttypedef struct { 344234949Sbapt char *base_name; /* base input file name */ 345234949Sbapt char *file_name; /* current file name */ 346234949Sbapt FILE *file; /* input file */ 347234949Sbapt unsigned line_num; /* current line number in input file */ 348234949Sbapt FILE *tmp_file; /* temporary file */ 349234949Sbapt long begin_comment; /* tmp file offset after last written ) or ; */ 350234949Sbapt long end_comment; /* tmp file offset after last comment */ 351234949Sbapt boolean convert; /* if TRUE, convert function definitions */ 352234949Sbapt boolean changed; /* TRUE if conversion done in this file */ 353234949Sbapt} IncludeStack; 354234949Sbapt 355234949Sbaptstatic IncludeStack *cur_file; /* current input file */ 356234949Sbapt 357234949Sbapt/* #include "yyerror.c" */ 358234949Sbapt 359234949Sbaptstatic int haveAnsiParam (void); 360234949Sbapt 361234949Sbapt 362234949Sbapt/* Flags to enable us to find if a procedure returns a value. 363234949Sbapt */ 364234949Sbaptstatic int return_val; /* nonzero on BRACES iff return-expression found */ 365234949Sbapt 366234949Sbaptstatic const char * 367234949Sbaptdft_decl_spec (void) 368234949Sbapt{ 369234949Sbapt return (lintLibrary() && !return_val) ? "void" : "int"; 370234949Sbapt} 371234949Sbapt 372234949Sbaptstatic int 373234949SbapthaveAnsiParam (void) 374234949Sbapt{ 375234949Sbapt Parameter *p; 376234949Sbapt if (func_params != 0) { 377234949Sbapt for (p = func_params->first; p != 0; p = p->next) { 378234949Sbapt if (p->declarator->func_def == FUNC_ANSI) { 379234949Sbapt return TRUE; 380234949Sbapt } 381234949Sbapt } 382234949Sbapt } 383234949Sbapt return FALSE; 384234949Sbapt} 385234949Sbapt#line 386 "grammar.tab.c" 386234949Sbapt 387234949Sbapt/* compatibility with bison */ 388234949Sbapt#ifdef YYPARSE_PARAM 389234949Sbapt/* compatibility with FreeBSD */ 390234949Sbapt# ifdef YYPARSE_PARAM_TYPE 391234949Sbapt# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 392234949Sbapt# else 393234949Sbapt# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 394234949Sbapt# endif 395234949Sbapt#else 396234949Sbapt# define YYPARSE_DECL() yyparse(void) 397234949Sbapt#endif 398234949Sbapt 399234949Sbapt/* Parameters sent to lex. */ 400234949Sbapt#ifdef YYLEX_PARAM 401234949Sbapt# define YYLEX_DECL() yylex(void *YYLEX_PARAM) 402234949Sbapt# define YYLEX yylex(YYLEX_PARAM) 403234949Sbapt#else 404234949Sbapt# define YYLEX_DECL() yylex(void) 405234949Sbapt# define YYLEX yylex() 406234949Sbapt#endif 407234949Sbapt 408234949Sbapt/* Parameters sent to yyerror. */ 409234949Sbapt#ifndef YYERROR_DECL 410234949Sbapt#define YYERROR_DECL() yyerror(const char *s) 411234949Sbapt#endif 412234949Sbapt#ifndef YYERROR_CALL 413234949Sbapt#define YYERROR_CALL(msg) yyerror(msg) 414234949Sbapt#endif 415234949Sbapt 416234949Sbaptextern int YYPARSE_DECL(); 417234949Sbapt 418234949Sbapt#define T_IDENTIFIER 257 419234949Sbapt#define T_TYPEDEF_NAME 258 420234949Sbapt#define T_DEFINE_NAME 259 421234949Sbapt#define T_AUTO 260 422234949Sbapt#define T_EXTERN 261 423234949Sbapt#define T_REGISTER 262 424234949Sbapt#define T_STATIC 263 425234949Sbapt#define T_TYPEDEF 264 426234949Sbapt#define T_INLINE 265 427234949Sbapt#define T_EXTENSION 266 428234949Sbapt#define T_CHAR 267 429234949Sbapt#define T_DOUBLE 268 430234949Sbapt#define T_FLOAT 269 431234949Sbapt#define T_INT 270 432234949Sbapt#define T_VOID 271 433234949Sbapt#define T_LONG 272 434234949Sbapt#define T_SHORT 273 435234949Sbapt#define T_SIGNED 274 436234949Sbapt#define T_UNSIGNED 275 437234949Sbapt#define T_ENUM 276 438234949Sbapt#define T_STRUCT 277 439234949Sbapt#define T_UNION 278 440234949Sbapt#define T_Bool 279 441234949Sbapt#define T_Complex 280 442234949Sbapt#define T_Imaginary 281 443234949Sbapt#define T_TYPE_QUALIFIER 282 444234949Sbapt#define T_BRACKETS 283 445234949Sbapt#define T_LBRACE 284 446234949Sbapt#define T_MATCHRBRACE 285 447234949Sbapt#define T_ELLIPSIS 286 448234949Sbapt#define T_INITIALIZER 287 449234949Sbapt#define T_STRING_LITERAL 288 450234949Sbapt#define T_ASM 289 451234949Sbapt#define T_ASMARG 290 452234949Sbapt#define T_VA_DCL 291 453234949Sbapt#define YYERRCODE 256 454234949Sbaptstatic const short grammar_lhs[] = { -1, 455234949Sbapt 0, 0, 26, 26, 27, 27, 27, 27, 27, 27, 456234949Sbapt 27, 31, 30, 30, 28, 28, 34, 28, 32, 32, 457234949Sbapt 33, 33, 35, 35, 37, 38, 29, 39, 29, 36, 458234949Sbapt 36, 36, 40, 40, 1, 1, 2, 2, 2, 3, 459234949Sbapt 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 460234949Sbapt 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 461234949Sbapt 5, 5, 6, 6, 6, 19, 19, 8, 8, 9, 462234949Sbapt 41, 9, 7, 7, 7, 25, 23, 23, 10, 10, 463234949Sbapt 11, 11, 11, 11, 11, 20, 20, 21, 21, 22, 464234949Sbapt 22, 14, 14, 15, 15, 16, 16, 16, 17, 17, 465234949Sbapt 18, 18, 24, 24, 12, 12, 12, 13, 13, 13, 466234949Sbapt 13, 13, 13, 13, 467234949Sbapt}; 468234949Sbaptstatic const short grammar_len[] = { 2, 469234949Sbapt 0, 1, 1, 2, 1, 1, 1, 1, 3, 2, 470234949Sbapt 2, 2, 3, 3, 2, 3, 0, 5, 2, 1, 471234949Sbapt 0, 1, 1, 3, 0, 0, 7, 0, 5, 0, 472234949Sbapt 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 473234949Sbapt 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 474234949Sbapt 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 475234949Sbapt 1, 1, 3, 2, 2, 1, 1, 1, 3, 1, 476234949Sbapt 0, 4, 3, 2, 2, 1, 1, 1, 2, 1, 477234949Sbapt 1, 3, 2, 4, 4, 2, 3, 0, 1, 1, 478234949Sbapt 2, 1, 3, 1, 3, 2, 2, 1, 0, 1, 479234949Sbapt 1, 3, 1, 2, 1, 2, 1, 3, 2, 1, 480234949Sbapt 4, 3, 3, 2, 481234949Sbapt}; 482234949Sbaptstatic const short grammar_defred[] = { 0, 483234949Sbapt 0, 0, 0, 0, 77, 0, 62, 40, 0, 42, 484234949Sbapt 43, 20, 44, 0, 46, 47, 48, 49, 54, 50, 485234949Sbapt 51, 52, 53, 76, 66, 67, 55, 56, 57, 61, 486234949Sbapt 0, 7, 0, 0, 35, 37, 38, 39, 59, 60, 487234949Sbapt 28, 0, 0, 0, 103, 81, 0, 0, 3, 5, 488234949Sbapt 6, 8, 0, 10, 11, 78, 0, 90, 0, 0, 489234949Sbapt 104, 0, 19, 0, 41, 45, 15, 36, 0, 68, 490234949Sbapt 0, 0, 0, 83, 0, 0, 64, 0, 0, 74, 491234949Sbapt 4, 58, 0, 82, 87, 91, 0, 14, 13, 9, 492234949Sbapt 16, 0, 71, 0, 31, 33, 0, 0, 0, 0, 493234949Sbapt 0, 94, 0, 0, 101, 12, 63, 73, 0, 0, 494234949Sbapt 69, 0, 0, 0, 34, 0, 110, 96, 97, 0, 495234949Sbapt 0, 84, 0, 85, 0, 23, 0, 0, 72, 26, 496234949Sbapt 29, 114, 0, 0, 0, 109, 0, 93, 95, 102, 497234949Sbapt 18, 0, 0, 108, 113, 112, 0, 24, 27, 111, 498234949Sbapt}; 499234949Sbaptstatic const short grammar_dgoto[] = { 33, 500234949Sbapt 87, 35, 36, 37, 38, 39, 40, 69, 70, 41, 501234949Sbapt 42, 119, 120, 100, 101, 102, 103, 104, 43, 44, 502234949Sbapt 59, 60, 45, 46, 47, 48, 49, 50, 51, 52, 503234949Sbapt 77, 53, 127, 109, 128, 97, 94, 143, 72, 98, 504234949Sbapt 112, 505234949Sbapt}; 506234949Sbaptstatic const short grammar_sindex[] = { -2, 507234949Sbapt -3, 27, -239, -177, 0, 0, 0, 0, -274, 0, 508234949Sbapt 0, 0, 0, -246, 0, 0, 0, 0, 0, 0, 509234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 510234949Sbapt -266, 0, 0, 455, 0, 0, 0, 0, 0, 0, 511234949Sbapt 0, -35, -245, 128, 0, 0, -245, -2, 0, 0, 512234949Sbapt 0, 0, 642, 0, 0, 0, -15, 0, -12, -239, 513234949Sbapt 0, 590, 0, -27, 0, 0, 0, 0, -10, 0, 514234949Sbapt -11, 534, -72, 0, -237, -232, 0, -35, -232, 0, 515234949Sbapt 0, 0, 642, 0, 0, 0, 455, 0, 0, 0, 516234949Sbapt 0, 27, 0, 534, 0, 0, -222, 617, 209, 34, 517234949Sbapt 39, 0, 44, 42, 0, 0, 0, 0, 27, -11, 518234949Sbapt 0, -200, -196, -195, 0, 174, 0, 0, 0, -33, 519234949Sbapt 243, 0, 561, 0, -177, 0, 33, 49, 0, 0, 520234949Sbapt 0, 0, 53, 55, 417, 0, -33, 0, 0, 0, 521234949Sbapt 0, 27, -188, 0, 0, 0, 57, 0, 0, 0, 522234949Sbapt}; 523234949Sbaptstatic const short grammar_rindex[] = { 99, 524234949Sbapt 0, 0, 275, 0, 0, -38, 0, 0, 481, 0, 525234949Sbapt 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, 526234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 527234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 528234949Sbapt 0, 30, 0, 0, 0, 0, 0, 101, 0, 0, 529234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 343, 309, 530234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 531234949Sbapt 98, -182, 62, 0, 0, 133, 0, 64, 379, 0, 532234949Sbapt 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 533234949Sbapt 0, 0, 0, -182, 0, 0, 0, -180, -19, 0, 534234949Sbapt 65, 0, 0, 68, 0, 0, 0, 0, 51, 9, 535234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, 536234949Sbapt 19, 0, 0, 0, 0, 0, 0, 52, 0, 0, 537234949Sbapt 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 538234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 539234949Sbapt}; 540234949Sbaptstatic const short grammar_gindex[] = { 0, 541234949Sbapt 11, -17, 0, 0, 13, 0, 0, 0, 20, 8, 542234949Sbapt -43, -1, -8, -89, 0, -9, 0, 0, 0, -44, 543234949Sbapt 0, 0, 4, 0, 0, 0, 70, -53, 0, 0, 544234949Sbapt -18, 0, 0, 0, 0, 22, 0, 0, 0, 0, 545234949Sbapt 0, 546234949Sbapt}; 547234949Sbapt#define YYTABLESIZE 924 548234949Sbaptstatic const short grammar_table[] = { 58, 549234949Sbapt 78, 58, 58, 58, 73, 58, 135, 61, 88, 57, 550234949Sbapt 34, 5, 56, 62, 85, 58, 68, 63, 96, 7, 551234949Sbapt 58, 98, 78, 64, 98, 84, 134, 107, 80, 3, 552234949Sbapt 107, 90, 17, 92, 17, 4, 17, 2, 75, 3, 553234949Sbapt 96, 71, 30, 89, 115, 147, 76, 106, 91, 93, 554234949Sbapt 79, 75, 70, 17, 121, 55, 32, 107, 34, 105, 555234949Sbapt 108, 114, 105, 83, 4, 68, 2, 70, 3, 68, 556234949Sbapt 80, 121, 86, 80, 122, 106, 105, 78, 106, 5, 557234949Sbapt 56, 68, 123, 99, 124, 125, 129, 130, 80, 131, 558234949Sbapt 80, 141, 142, 144, 110, 145, 149, 150, 1, 110, 559234949Sbapt 2, 30, 99, 32, 79, 92, 118, 79, 100, 21, 560234949Sbapt 22, 111, 137, 139, 133, 113, 126, 81, 0, 0, 561234949Sbapt 0, 0, 79, 57, 79, 0, 99, 0, 140, 0, 562234949Sbapt 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 563234949Sbapt 0, 70, 0, 0, 0, 99, 0, 0, 0, 148, 564234949Sbapt 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 565234949Sbapt 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 566234949Sbapt 65, 0, 65, 65, 65, 0, 65, 0, 0, 0, 567234949Sbapt 0, 0, 0, 0, 5, 6, 7, 8, 65, 10, 568234949Sbapt 11, 65, 13, 66, 15, 16, 17, 18, 19, 20, 569234949Sbapt 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 570234949Sbapt 0, 4, 0, 116, 132, 3, 0, 0, 58, 58, 571234949Sbapt 58, 58, 58, 58, 58, 78, 58, 58, 58, 58, 572234949Sbapt 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 573234949Sbapt 58, 58, 58, 58, 58, 78, 4, 74, 116, 136, 574234949Sbapt 3, 17, 78, 1, 5, 6, 7, 8, 9, 10, 575234949Sbapt 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 576234949Sbapt 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 577234949Sbapt 4, 54, 116, 5, 56, 0, 31, 80, 80, 80, 578234949Sbapt 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 579234949Sbapt 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 580234949Sbapt 80, 80, 88, 80, 88, 88, 88, 0, 88, 0, 581234949Sbapt 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 582234949Sbapt 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 583234949Sbapt 79, 79, 79, 79, 79, 79, 89, 79, 89, 89, 584234949Sbapt 89, 0, 89, 0, 79, 25, 25, 25, 25, 25, 585234949Sbapt 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 586234949Sbapt 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 587234949Sbapt 86, 25, 86, 86, 5, 56, 86, 0, 25, 65, 588234949Sbapt 65, 65, 65, 65, 65, 65, 0, 65, 65, 65, 589234949Sbapt 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 590234949Sbapt 65, 65, 65, 65, 65, 65, 75, 0, 75, 75, 591234949Sbapt 75, 0, 75, 0, 0, 0, 0, 0, 0, 0, 592234949Sbapt 5, 6, 7, 8, 65, 10, 11, 75, 13, 66, 593234949Sbapt 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 594234949Sbapt 25, 26, 27, 28, 29, 30, 117, 146, 0, 0, 595234949Sbapt 0, 0, 0, 0, 0, 5, 6, 7, 8, 65, 596234949Sbapt 10, 11, 0, 13, 66, 15, 16, 17, 18, 19, 597234949Sbapt 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 598234949Sbapt 30, 117, 4, 0, 2, 0, 3, 0, 0, 5, 599234949Sbapt 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600234949Sbapt 0, 0, 0, 67, 0, 0, 0, 0, 41, 0, 601234949Sbapt 41, 0, 41, 0, 0, 117, 0, 0, 0, 0, 602234949Sbapt 0, 88, 88, 0, 0, 0, 0, 0, 0, 41, 603234949Sbapt 0, 0, 0, 0, 0, 0, 45, 0, 45, 0, 604234949Sbapt 45, 0, 0, 0, 0, 0, 0, 88, 0, 0, 605234949Sbapt 0, 0, 0, 0, 0, 89, 89, 45, 0, 0, 606234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 607234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 608234949Sbapt 0, 89, 0, 0, 0, 0, 0, 0, 0, 86, 609234949Sbapt 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 610234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 611234949Sbapt 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 612234949Sbapt 0, 0, 0, 0, 0, 75, 75, 75, 75, 75, 613234949Sbapt 75, 75, 0, 75, 75, 75, 75, 75, 75, 75, 614234949Sbapt 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 615234949Sbapt 75, 75, 0, 0, 0, 0, 0, 0, 0, 0, 616234949Sbapt 0, 0, 0, 0, 82, 7, 8, 65, 10, 11, 617234949Sbapt 0, 13, 66, 15, 16, 17, 18, 19, 20, 21, 618234949Sbapt 22, 23, 24, 25, 26, 27, 28, 29, 30, 0, 619234949Sbapt 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 620234949Sbapt 0, 5, 6, 7, 8, 65, 10, 11, 0, 13, 621234949Sbapt 66, 15, 16, 17, 18, 19, 20, 21, 22, 23, 622234949Sbapt 24, 25, 26, 27, 28, 29, 30, 41, 41, 41, 623234949Sbapt 41, 41, 41, 41, 0, 41, 41, 41, 41, 41, 624234949Sbapt 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 625234949Sbapt 41, 41, 41, 0, 0, 45, 45, 45, 45, 45, 626234949Sbapt 45, 45, 0, 45, 45, 45, 45, 45, 45, 45, 627234949Sbapt 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 628234949Sbapt 45, 82, 7, 8, 65, 10, 11, 12, 13, 14, 629234949Sbapt 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 630234949Sbapt 25, 26, 27, 28, 29, 30, 0, 0, 82, 7, 631234949Sbapt 8, 65, 10, 11, 95, 13, 66, 15, 16, 17, 632234949Sbapt 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 633234949Sbapt 28, 29, 30, 0, 0, 0, 138, 82, 7, 8, 634234949Sbapt 65, 10, 11, 12, 13, 14, 15, 16, 17, 18, 635234949Sbapt 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 636234949Sbapt 29, 30, 0, 75, 82, 7, 8, 65, 10, 11, 637234949Sbapt 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 638234949Sbapt 22, 23, 24, 25, 26, 27, 28, 29, 30, 82, 639234949Sbapt 7, 8, 65, 10, 11, 0, 13, 66, 15, 16, 640234949Sbapt 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 641234949Sbapt 27, 28, 29, 30, 642234949Sbapt}; 643234949Sbaptstatic const short grammar_check[] = { 38, 644234949Sbapt 44, 40, 41, 42, 40, 44, 40, 4, 62, 2, 645234949Sbapt 0, 257, 258, 288, 59, 3, 34, 264, 72, 259, 646234949Sbapt 59, 41, 61, 290, 44, 41, 116, 41, 47, 42, 647234949Sbapt 44, 59, 38, 44, 40, 38, 42, 40, 284, 42, 648234949Sbapt 94, 34, 282, 62, 98, 135, 43, 285, 59, 61, 649234949Sbapt 47, 284, 44, 59, 99, 59, 59, 76, 48, 41, 650234949Sbapt 79, 284, 44, 53, 38, 83, 40, 59, 42, 87, 651234949Sbapt 41, 116, 60, 44, 41, 41, 73, 121, 44, 257, 652234949Sbapt 258, 99, 44, 73, 41, 44, 287, 284, 59, 285, 653234949Sbapt 61, 59, 44, 41, 87, 41, 285, 41, 0, 92, 654234949Sbapt 0, 284, 41, 284, 41, 41, 99, 44, 41, 59, 655234949Sbapt 59, 92, 121, 123, 116, 94, 109, 48, -1, -1, 656234949Sbapt -1, -1, 59, 116, 61, -1, 116, -1, 125, -1, 657234949Sbapt -1, -1, -1, 123, -1, -1, -1, -1, -1, -1, 658234949Sbapt -1, 44, -1, -1, -1, 135, -1, -1, -1, 142, 659234949Sbapt -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, 660234949Sbapt -1, -1, -1, -1, -1, 38, -1, 40, -1, -1, 661234949Sbapt 38, -1, 40, 41, 42, -1, 44, -1, -1, -1, 662234949Sbapt -1, -1, -1, -1, 257, 258, 259, 260, 261, 262, 663234949Sbapt 263, 59, 265, 266, 267, 268, 269, 270, 271, 272, 664234949Sbapt 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 665234949Sbapt -1, 38, -1, 40, 41, 42, -1, -1, 257, 258, 666234949Sbapt 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 667234949Sbapt 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 668234949Sbapt 279, 280, 281, 282, 283, 284, 38, 283, 40, 283, 669234949Sbapt 42, 257, 291, 256, 257, 258, 259, 260, 261, 262, 670234949Sbapt 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 671234949Sbapt 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 672234949Sbapt 38, 285, 40, 257, 258, -1, 289, 258, 259, 260, 673234949Sbapt 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 674234949Sbapt 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 675234949Sbapt 281, 282, 38, 284, 40, 41, 42, -1, 44, -1, 676234949Sbapt 291, 258, 259, 260, 261, 262, 263, 264, 265, 266, 677234949Sbapt 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 678234949Sbapt 277, 278, 279, 280, 281, 282, 38, 284, 40, 41, 679234949Sbapt 42, -1, 44, -1, 291, 258, 259, 260, 261, 262, 680234949Sbapt 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 681234949Sbapt 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 682234949Sbapt 38, 284, 40, 41, 257, 258, 44, -1, 291, 257, 683234949Sbapt 258, 259, 260, 261, 262, 263, -1, 265, 266, 267, 684234949Sbapt 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 685234949Sbapt 278, 279, 280, 281, 282, 283, 38, -1, 40, 41, 686234949Sbapt 42, -1, 44, -1, -1, -1, -1, -1, -1, -1, 687234949Sbapt 257, 258, 259, 260, 261, 262, 263, 59, 265, 266, 688234949Sbapt 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 689234949Sbapt 277, 278, 279, 280, 281, 282, 283, 41, -1, -1, 690234949Sbapt -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, 691234949Sbapt 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, 692234949Sbapt 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 693234949Sbapt 282, 283, 38, -1, 40, -1, 42, -1, -1, 257, 694234949Sbapt 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, 695234949Sbapt -1, -1, -1, 59, -1, -1, -1, -1, 38, -1, 696234949Sbapt 40, -1, 42, -1, -1, 283, -1, -1, -1, -1, 697234949Sbapt -1, 257, 258, -1, -1, -1, -1, -1, -1, 59, 698234949Sbapt -1, -1, -1, -1, -1, -1, 38, -1, 40, -1, 699234949Sbapt 42, -1, -1, -1, -1, -1, -1, 283, -1, -1, 700234949Sbapt -1, -1, -1, -1, -1, 257, 258, 59, -1, -1, 701234949Sbapt -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 702234949Sbapt -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 703234949Sbapt -1, 283, -1, -1, -1, -1, -1, -1, -1, 257, 704234949Sbapt 258, -1, -1, -1, -1, -1, -1, -1, -1, -1, 705234949Sbapt -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 706234949Sbapt -1, -1, -1, -1, -1, 283, -1, -1, -1, -1, 707234949Sbapt -1, -1, -1, -1, -1, 257, 258, 259, 260, 261, 708234949Sbapt 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, 709234949Sbapt 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 710234949Sbapt 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, 711234949Sbapt -1, -1, -1, -1, 258, 259, 260, 261, 262, 263, 712234949Sbapt -1, 265, 266, 267, 268, 269, 270, 271, 272, 273, 713234949Sbapt 274, 275, 276, 277, 278, 279, 280, 281, 282, -1, 714234949Sbapt -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 715234949Sbapt -1, 257, 258, 259, 260, 261, 262, 263, -1, 265, 716234949Sbapt 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 717234949Sbapt 276, 277, 278, 279, 280, 281, 282, 257, 258, 259, 718234949Sbapt 260, 261, 262, 263, -1, 265, 266, 267, 268, 269, 719234949Sbapt 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 720234949Sbapt 280, 281, 282, -1, -1, 257, 258, 259, 260, 261, 721234949Sbapt 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, 722234949Sbapt 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 723234949Sbapt 282, 258, 259, 260, 261, 262, 263, 264, 265, 266, 724234949Sbapt 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 725234949Sbapt 277, 278, 279, 280, 281, 282, -1, -1, 258, 259, 726234949Sbapt 260, 261, 262, 263, 291, 265, 266, 267, 268, 269, 727234949Sbapt 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 728234949Sbapt 280, 281, 282, -1, -1, -1, 286, 258, 259, 260, 729234949Sbapt 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 730234949Sbapt 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 731234949Sbapt 281, 282, -1, 284, 258, 259, 260, 261, 262, 263, 732234949Sbapt 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 733234949Sbapt 274, 275, 276, 277, 278, 279, 280, 281, 282, 258, 734234949Sbapt 259, 260, 261, 262, 263, -1, 265, 266, 267, 268, 735234949Sbapt 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 736234949Sbapt 279, 280, 281, 282, 737234949Sbapt}; 738234949Sbapt#define YYFINAL 33 739234949Sbapt#ifndef YYDEBUG 740234949Sbapt#define YYDEBUG 0 741234949Sbapt#endif 742234949Sbapt#define YYMAXTOKEN 291 743234949Sbapt#if YYDEBUG 744234949Sbaptstatic const char *yyname[] = { 745234949Sbapt 746234949Sbapt"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 747234949Sbapt0,0,0,0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0, 748234949Sbapt"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 749234949Sbapt0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 750234949Sbapt0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 751234949Sbapt0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 752234949Sbapt0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 753234949Sbapt"T_IDENTIFIER","T_TYPEDEF_NAME","T_DEFINE_NAME","T_AUTO","T_EXTERN", 754234949Sbapt"T_REGISTER","T_STATIC","T_TYPEDEF","T_INLINE","T_EXTENSION","T_CHAR", 755234949Sbapt"T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED", 756234949Sbapt"T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary", 757234949Sbapt"T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS", 758234949Sbapt"T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL", 759234949Sbapt}; 760234949Sbaptstatic const char *yyrule[] = { 761234949Sbapt"$accept : program", 762234949Sbapt"program :", 763234949Sbapt"program : translation_unit", 764234949Sbapt"translation_unit : external_declaration", 765234949Sbapt"translation_unit : translation_unit external_declaration", 766234949Sbapt"external_declaration : declaration", 767234949Sbapt"external_declaration : function_definition", 768234949Sbapt"external_declaration : ';'", 769234949Sbapt"external_declaration : linkage_specification", 770234949Sbapt"external_declaration : T_ASM T_ASMARG ';'", 771234949Sbapt"external_declaration : error T_MATCHRBRACE", 772234949Sbapt"external_declaration : error ';'", 773234949Sbapt"braces : T_LBRACE T_MATCHRBRACE", 774234949Sbapt"linkage_specification : T_EXTERN T_STRING_LITERAL braces", 775234949Sbapt"linkage_specification : T_EXTERN T_STRING_LITERAL declaration", 776234949Sbapt"declaration : decl_specifiers ';'", 777234949Sbapt"declaration : decl_specifiers init_declarator_list ';'", 778234949Sbapt"$$1 :", 779234949Sbapt"declaration : any_typedef decl_specifiers $$1 opt_declarator_list ';'", 780234949Sbapt"any_typedef : T_EXTENSION T_TYPEDEF", 781234949Sbapt"any_typedef : T_TYPEDEF", 782234949Sbapt"opt_declarator_list :", 783234949Sbapt"opt_declarator_list : declarator_list", 784234949Sbapt"declarator_list : declarator", 785234949Sbapt"declarator_list : declarator_list ',' declarator", 786234949Sbapt"$$2 :", 787234949Sbapt"$$3 :", 788234949Sbapt"function_definition : decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE", 789234949Sbapt"$$4 :", 790234949Sbapt"function_definition : declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE", 791234949Sbapt"opt_declaration_list :", 792234949Sbapt"opt_declaration_list : T_VA_DCL", 793234949Sbapt"opt_declaration_list : declaration_list", 794234949Sbapt"declaration_list : declaration", 795234949Sbapt"declaration_list : declaration_list declaration", 796234949Sbapt"decl_specifiers : decl_specifier", 797234949Sbapt"decl_specifiers : decl_specifiers decl_specifier", 798234949Sbapt"decl_specifier : storage_class", 799234949Sbapt"decl_specifier : type_specifier", 800234949Sbapt"decl_specifier : type_qualifier", 801234949Sbapt"storage_class : T_AUTO", 802234949Sbapt"storage_class : T_EXTERN", 803234949Sbapt"storage_class : T_REGISTER", 804234949Sbapt"storage_class : T_STATIC", 805234949Sbapt"storage_class : T_INLINE", 806234949Sbapt"storage_class : T_EXTENSION", 807234949Sbapt"type_specifier : T_CHAR", 808234949Sbapt"type_specifier : T_DOUBLE", 809234949Sbapt"type_specifier : T_FLOAT", 810234949Sbapt"type_specifier : T_INT", 811234949Sbapt"type_specifier : T_LONG", 812234949Sbapt"type_specifier : T_SHORT", 813234949Sbapt"type_specifier : T_SIGNED", 814234949Sbapt"type_specifier : T_UNSIGNED", 815234949Sbapt"type_specifier : T_VOID", 816234949Sbapt"type_specifier : T_Bool", 817234949Sbapt"type_specifier : T_Complex", 818234949Sbapt"type_specifier : T_Imaginary", 819234949Sbapt"type_specifier : T_TYPEDEF_NAME", 820234949Sbapt"type_specifier : struct_or_union_specifier", 821234949Sbapt"type_specifier : enum_specifier", 822234949Sbapt"type_qualifier : T_TYPE_QUALIFIER", 823234949Sbapt"type_qualifier : T_DEFINE_NAME", 824234949Sbapt"struct_or_union_specifier : struct_or_union any_id braces", 825234949Sbapt"struct_or_union_specifier : struct_or_union braces", 826234949Sbapt"struct_or_union_specifier : struct_or_union any_id", 827234949Sbapt"struct_or_union : T_STRUCT", 828234949Sbapt"struct_or_union : T_UNION", 829234949Sbapt"init_declarator_list : init_declarator", 830234949Sbapt"init_declarator_list : init_declarator_list ',' init_declarator", 831234949Sbapt"init_declarator : declarator", 832234949Sbapt"$$5 :", 833234949Sbapt"init_declarator : declarator '=' $$5 T_INITIALIZER", 834234949Sbapt"enum_specifier : enumeration any_id braces", 835234949Sbapt"enum_specifier : enumeration braces", 836234949Sbapt"enum_specifier : enumeration any_id", 837234949Sbapt"enumeration : T_ENUM", 838234949Sbapt"any_id : T_IDENTIFIER", 839234949Sbapt"any_id : T_TYPEDEF_NAME", 840234949Sbapt"declarator : pointer direct_declarator", 841234949Sbapt"declarator : direct_declarator", 842234949Sbapt"direct_declarator : identifier_or_ref", 843234949Sbapt"direct_declarator : '(' declarator ')'", 844234949Sbapt"direct_declarator : direct_declarator T_BRACKETS", 845234949Sbapt"direct_declarator : direct_declarator '(' parameter_type_list ')'", 846234949Sbapt"direct_declarator : direct_declarator '(' opt_identifier_list ')'", 847234949Sbapt"pointer : '*' opt_type_qualifiers", 848234949Sbapt"pointer : '*' opt_type_qualifiers pointer", 849234949Sbapt"opt_type_qualifiers :", 850234949Sbapt"opt_type_qualifiers : type_qualifier_list", 851234949Sbapt"type_qualifier_list : type_qualifier", 852234949Sbapt"type_qualifier_list : type_qualifier_list type_qualifier", 853234949Sbapt"parameter_type_list : parameter_list", 854234949Sbapt"parameter_type_list : parameter_list ',' T_ELLIPSIS", 855234949Sbapt"parameter_list : parameter_declaration", 856234949Sbapt"parameter_list : parameter_list ',' parameter_declaration", 857234949Sbapt"parameter_declaration : decl_specifiers declarator", 858234949Sbapt"parameter_declaration : decl_specifiers abs_declarator", 859234949Sbapt"parameter_declaration : decl_specifiers", 860234949Sbapt"opt_identifier_list :", 861234949Sbapt"opt_identifier_list : identifier_list", 862234949Sbapt"identifier_list : any_id", 863234949Sbapt"identifier_list : identifier_list ',' any_id", 864234949Sbapt"identifier_or_ref : any_id", 865234949Sbapt"identifier_or_ref : '&' any_id", 866234949Sbapt"abs_declarator : pointer", 867234949Sbapt"abs_declarator : pointer direct_abs_declarator", 868234949Sbapt"abs_declarator : direct_abs_declarator", 869234949Sbapt"direct_abs_declarator : '(' abs_declarator ')'", 870234949Sbapt"direct_abs_declarator : direct_abs_declarator T_BRACKETS", 871234949Sbapt"direct_abs_declarator : T_BRACKETS", 872234949Sbapt"direct_abs_declarator : direct_abs_declarator '(' parameter_type_list ')'", 873234949Sbapt"direct_abs_declarator : direct_abs_declarator '(' ')'", 874234949Sbapt"direct_abs_declarator : '(' parameter_type_list ')'", 875234949Sbapt"direct_abs_declarator : '(' ')'", 876234949Sbapt 877234949Sbapt}; 878234949Sbapt#endif 879234949Sbapt 880234949Sbaptint yydebug; 881234949Sbaptint yynerrs; 882234949Sbapt 883234949Sbaptint yyerrflag; 884234949Sbaptint yychar; 885234949SbaptYYSTYPE yyval; 886234949SbaptYYSTYPE yylval; 887234949Sbapt 888234949Sbapt/* define the initial stack-sizes */ 889234949Sbapt#ifdef YYSTACKSIZE 890234949Sbapt#undef YYMAXDEPTH 891234949Sbapt#define YYMAXDEPTH YYSTACKSIZE 892234949Sbapt#else 893234949Sbapt#ifdef YYMAXDEPTH 894234949Sbapt#define YYSTACKSIZE YYMAXDEPTH 895234949Sbapt#else 896234949Sbapt#define YYSTACKSIZE 500 897234949Sbapt#define YYMAXDEPTH 500 898234949Sbapt#endif 899234949Sbapt#endif 900234949Sbapt 901234949Sbapt#define YYINITSTACKSIZE 500 902234949Sbapt 903234949Sbapttypedef struct { 904234949Sbapt unsigned stacksize; 905234949Sbapt short *s_base; 906234949Sbapt short *s_mark; 907234949Sbapt short *s_last; 908234949Sbapt YYSTYPE *l_base; 909234949Sbapt YYSTYPE *l_mark; 910234949Sbapt} YYSTACKDATA; 911234949Sbapt/* variables for the parser stack */ 912234949Sbaptstatic YYSTACKDATA yystack; 913234949Sbapt#line 1014 "grammar.y" 914234949Sbapt 915234949Sbapt/* lex.yy.c */ 916234949Sbapt#define BEGIN yy_start = 1 + 2 * 917234949Sbapt 918234949Sbapt#define CPP1 1 919234949Sbapt#define INIT1 2 920234949Sbapt#define INIT2 3 921234949Sbapt#define CURLY 4 922234949Sbapt#define LEXYACC 5 923234949Sbapt#define ASM 6 924234949Sbapt#define CPP_INLINE 7 925234949Sbapt 926234949Sbaptextern char *yytext; 927234949Sbaptextern FILE *yyin, *yyout; 928234949Sbapt 929234949Sbaptstatic int curly; /* number of curly brace nesting levels */ 930234949Sbaptstatic int ly_count; /* number of occurances of %% */ 931234949Sbaptstatic int inc_depth; /* include nesting level */ 932234949Sbaptstatic SymbolTable *included_files; /* files already included */ 933234949Sbaptstatic int yy_start = 0; /* start state number */ 934234949Sbapt 935234949Sbapt#define grammar_error(s) yaccError(s) 936234949Sbapt 937234949Sbaptstatic void 938234949SbaptyaccError (const char *msg) 939234949Sbapt{ 940234949Sbapt func_params = NULL; 941234949Sbapt put_error(); /* tell what line we're on, and what file */ 942234949Sbapt fprintf(stderr, "%s at token '%s'\n", msg, yytext); 943234949Sbapt} 944234949Sbapt 945234949Sbapt/* Initialize the table of type qualifier keywords recognized by the lexical 946234949Sbapt * analyzer. 947234949Sbapt */ 948234949Sbaptvoid 949234949Sbaptinit_parser (void) 950234949Sbapt{ 951234949Sbapt static const char *keywords[] = { 952234949Sbapt "const", 953234949Sbapt "restrict", 954234949Sbapt "volatile", 955234949Sbapt "interrupt", 956234949Sbapt#ifdef vms 957234949Sbapt "noshare", 958234949Sbapt "readonly", 959234949Sbapt#endif 960234949Sbapt#if defined(MSDOS) || defined(OS2) 961234949Sbapt "__cdecl", 962234949Sbapt "__export", 963234949Sbapt "__far", 964234949Sbapt "__fastcall", 965234949Sbapt "__fortran", 966234949Sbapt "__huge", 967234949Sbapt "__inline", 968234949Sbapt "__interrupt", 969234949Sbapt "__loadds", 970234949Sbapt "__near", 971234949Sbapt "__pascal", 972234949Sbapt "__saveregs", 973234949Sbapt "__segment", 974234949Sbapt "__stdcall", 975234949Sbapt "__syscall", 976234949Sbapt "_cdecl", 977234949Sbapt "_cs", 978234949Sbapt "_ds", 979234949Sbapt "_es", 980234949Sbapt "_export", 981234949Sbapt "_far", 982234949Sbapt "_fastcall", 983234949Sbapt "_fortran", 984234949Sbapt "_huge", 985234949Sbapt "_interrupt", 986234949Sbapt "_loadds", 987234949Sbapt "_near", 988234949Sbapt "_pascal", 989234949Sbapt "_saveregs", 990234949Sbapt "_seg", 991234949Sbapt "_segment", 992234949Sbapt "_ss", 993234949Sbapt "cdecl", 994234949Sbapt "far", 995234949Sbapt "huge", 996234949Sbapt "near", 997234949Sbapt "pascal", 998234949Sbapt#ifdef OS2 999234949Sbapt "__far16", 1000234949Sbapt#endif 1001234949Sbapt#endif 1002234949Sbapt#ifdef __GNUC__ 1003234949Sbapt /* gcc aliases */ 1004234949Sbapt "__builtin_va_arg", 1005234949Sbapt "__builtin_va_list", 1006234949Sbapt "__const", 1007234949Sbapt "__const__", 1008234949Sbapt "__inline", 1009234949Sbapt "__inline__", 1010234949Sbapt "__restrict", 1011234949Sbapt "__restrict__", 1012234949Sbapt "__volatile", 1013234949Sbapt "__volatile__", 1014234949Sbapt#endif 1015234949Sbapt }; 1016234949Sbapt unsigned i; 1017234949Sbapt 1018234949Sbapt /* Initialize type qualifier table. */ 1019234949Sbapt type_qualifiers = new_symbol_table(); 1020234949Sbapt for (i = 0; i < sizeof(keywords)/sizeof(keywords[0]); ++i) { 1021234949Sbapt new_symbol(type_qualifiers, keywords[i], NULL, DS_NONE); 1022234949Sbapt } 1023234949Sbapt} 1024234949Sbapt 1025234949Sbapt/* Process the C source file. Write function prototypes to the standard 1026234949Sbapt * output. Convert function definitions and write the converted source 1027234949Sbapt * code to a temporary file. 1028234949Sbapt */ 1029234949Sbaptvoid 1030234949Sbaptprocess_file (FILE *infile, char *name) 1031234949Sbapt{ 1032234949Sbapt char *s; 1033234949Sbapt 1034234949Sbapt if (strlen(name) > 2) { 1035234949Sbapt s = name + strlen(name) - 2; 1036234949Sbapt if (*s == '.') { 1037234949Sbapt ++s; 1038234949Sbapt if (*s == 'l' || *s == 'y') 1039234949Sbapt BEGIN LEXYACC; 1040234949Sbapt#if defined(MSDOS) || defined(OS2) 1041234949Sbapt if (*s == 'L' || *s == 'Y') 1042234949Sbapt BEGIN LEXYACC; 1043234949Sbapt#endif 1044234949Sbapt } 1045234949Sbapt } 1046234949Sbapt 1047234949Sbapt included_files = new_symbol_table(); 1048234949Sbapt typedef_names = new_symbol_table(); 1049234949Sbapt define_names = new_symbol_table(); 1050234949Sbapt inc_depth = -1; 1051234949Sbapt curly = 0; 1052234949Sbapt ly_count = 0; 1053234949Sbapt func_params = NULL; 1054234949Sbapt yyin = infile; 1055234949Sbapt include_file(strcpy(base_file, name), func_style != FUNC_NONE); 1056234949Sbapt if (file_comments) { 1057234949Sbapt#if OPT_LINTLIBRARY 1058234949Sbapt if (lintLibrary()) { 1059234949Sbapt put_blankline(stdout); 1060234949Sbapt begin_tracking(); 1061234949Sbapt } 1062234949Sbapt#endif 1063234949Sbapt put_string(stdout, "/* "); 1064234949Sbapt put_string(stdout, cur_file_name()); 1065234949Sbapt put_string(stdout, " */\n"); 1066234949Sbapt } 1067234949Sbapt yyparse(); 1068234949Sbapt free_symbol_table(define_names); 1069234949Sbapt free_symbol_table(typedef_names); 1070234949Sbapt free_symbol_table(included_files); 1071234949Sbapt} 1072234949Sbapt 1073234949Sbapt#ifdef NO_LEAKS 1074234949Sbaptvoid 1075234949Sbaptfree_parser(void) 1076234949Sbapt{ 1077234949Sbapt free_symbol_table (type_qualifiers); 1078234949Sbapt#ifdef FLEX_SCANNER 1079234949Sbapt if (yy_current_buffer != 0) 1080234949Sbapt yy_delete_buffer(yy_current_buffer); 1081234949Sbapt#endif 1082234949Sbapt} 1083234949Sbapt#endif 1084234949Sbapt#line 1085 "grammar.tab.c" 1085234949Sbapt 1086234949Sbapt#if YYDEBUG 1087234949Sbapt#include <stdio.h> /* needed for printf */ 1088234949Sbapt#endif 1089234949Sbapt 1090234949Sbapt#include <stdlib.h> /* needed for malloc, etc */ 1091234949Sbapt#include <string.h> /* needed for memset */ 1092234949Sbapt 1093234949Sbapt/* allocate initial stack or double stack size, up to YYMAXDEPTH */ 1094234949Sbaptstatic int yygrowstack(YYSTACKDATA *data) 1095234949Sbapt{ 1096234949Sbapt int i; 1097234949Sbapt unsigned newsize; 1098234949Sbapt short *newss; 1099234949Sbapt YYSTYPE *newvs; 1100234949Sbapt 1101234949Sbapt if ((newsize = data->stacksize) == 0) 1102234949Sbapt newsize = YYINITSTACKSIZE; 1103234949Sbapt else if (newsize >= YYMAXDEPTH) 1104234949Sbapt return -1; 1105234949Sbapt else if ((newsize *= 2) > YYMAXDEPTH) 1106234949Sbapt newsize = YYMAXDEPTH; 1107234949Sbapt 1108251143Sbapt i = (int) (data->s_mark - data->s_base); 1109234949Sbapt newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); 1110234949Sbapt if (newss == 0) 1111234949Sbapt return -1; 1112234949Sbapt 1113234949Sbapt data->s_base = newss; 1114234949Sbapt data->s_mark = newss + i; 1115234949Sbapt 1116234949Sbapt newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 1117234949Sbapt if (newvs == 0) 1118234949Sbapt return -1; 1119234949Sbapt 1120234949Sbapt data->l_base = newvs; 1121234949Sbapt data->l_mark = newvs + i; 1122234949Sbapt 1123234949Sbapt data->stacksize = newsize; 1124234949Sbapt data->s_last = data->s_base + newsize - 1; 1125234949Sbapt return 0; 1126234949Sbapt} 1127234949Sbapt 1128234949Sbapt#if YYPURE || defined(YY_NO_LEAKS) 1129234949Sbaptstatic void yyfreestack(YYSTACKDATA *data) 1130234949Sbapt{ 1131234949Sbapt free(data->s_base); 1132234949Sbapt free(data->l_base); 1133234949Sbapt memset(data, 0, sizeof(*data)); 1134234949Sbapt} 1135234949Sbapt#else 1136234949Sbapt#define yyfreestack(data) /* nothing */ 1137234949Sbapt#endif 1138234949Sbapt 1139234949Sbapt#define YYABORT goto yyabort 1140234949Sbapt#define YYREJECT goto yyabort 1141234949Sbapt#define YYACCEPT goto yyaccept 1142234949Sbapt#define YYERROR goto yyerrlab 1143234949Sbapt 1144234949Sbaptint 1145234949SbaptYYPARSE_DECL() 1146234949Sbapt{ 1147234949Sbapt int yym, yyn, yystate; 1148234949Sbapt#if YYDEBUG 1149234949Sbapt const char *yys; 1150234949Sbapt 1151234949Sbapt if ((yys = getenv("YYDEBUG")) != 0) 1152234949Sbapt { 1153234949Sbapt yyn = *yys; 1154234949Sbapt if (yyn >= '0' && yyn <= '9') 1155234949Sbapt yydebug = yyn - '0'; 1156234949Sbapt } 1157234949Sbapt#endif 1158234949Sbapt 1159234949Sbapt yynerrs = 0; 1160234949Sbapt yyerrflag = 0; 1161234949Sbapt yychar = YYEMPTY; 1162234949Sbapt yystate = 0; 1163234949Sbapt 1164234949Sbapt#if YYPURE 1165234949Sbapt memset(&yystack, 0, sizeof(yystack)); 1166234949Sbapt#endif 1167234949Sbapt 1168234949Sbapt if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; 1169234949Sbapt yystack.s_mark = yystack.s_base; 1170234949Sbapt yystack.l_mark = yystack.l_base; 1171234949Sbapt yystate = 0; 1172234949Sbapt *yystack.s_mark = 0; 1173234949Sbapt 1174234949Sbaptyyloop: 1175234949Sbapt if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 1176234949Sbapt if (yychar < 0) 1177234949Sbapt { 1178234949Sbapt if ((yychar = YYLEX) < 0) yychar = 0; 1179234949Sbapt#if YYDEBUG 1180234949Sbapt if (yydebug) 1181234949Sbapt { 1182234949Sbapt yys = 0; 1183234949Sbapt if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1184234949Sbapt if (!yys) yys = "illegal-symbol"; 1185234949Sbapt printf("%sdebug: state %d, reading %d (%s)\n", 1186234949Sbapt YYPREFIX, yystate, yychar, yys); 1187234949Sbapt } 1188234949Sbapt#endif 1189234949Sbapt } 1190234949Sbapt if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && 1191234949Sbapt yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 1192234949Sbapt { 1193234949Sbapt#if YYDEBUG 1194234949Sbapt if (yydebug) 1195234949Sbapt printf("%sdebug: state %d, shifting to state %d\n", 1196234949Sbapt YYPREFIX, yystate, yytable[yyn]); 1197234949Sbapt#endif 1198234949Sbapt if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) 1199234949Sbapt { 1200234949Sbapt goto yyoverflow; 1201234949Sbapt } 1202234949Sbapt yystate = yytable[yyn]; 1203234949Sbapt *++yystack.s_mark = yytable[yyn]; 1204234949Sbapt *++yystack.l_mark = yylval; 1205234949Sbapt yychar = YYEMPTY; 1206234949Sbapt if (yyerrflag > 0) --yyerrflag; 1207234949Sbapt goto yyloop; 1208234949Sbapt } 1209234949Sbapt if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && 1210234949Sbapt yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 1211234949Sbapt { 1212234949Sbapt yyn = yytable[yyn]; 1213234949Sbapt goto yyreduce; 1214234949Sbapt } 1215234949Sbapt if (yyerrflag) goto yyinrecovery; 1216234949Sbapt 1217234949Sbapt yyerror("syntax error"); 1218234949Sbapt 1219234949Sbapt goto yyerrlab; 1220234949Sbapt 1221234949Sbaptyyerrlab: 1222234949Sbapt ++yynerrs; 1223234949Sbapt 1224234949Sbaptyyinrecovery: 1225234949Sbapt if (yyerrflag < 3) 1226234949Sbapt { 1227234949Sbapt yyerrflag = 3; 1228234949Sbapt for (;;) 1229234949Sbapt { 1230234949Sbapt if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && 1231234949Sbapt yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) 1232234949Sbapt { 1233234949Sbapt#if YYDEBUG 1234234949Sbapt if (yydebug) 1235234949Sbapt printf("%sdebug: state %d, error recovery shifting\ 1236234949Sbapt to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 1237234949Sbapt#endif 1238234949Sbapt if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) 1239234949Sbapt { 1240234949Sbapt goto yyoverflow; 1241234949Sbapt } 1242234949Sbapt yystate = yytable[yyn]; 1243234949Sbapt *++yystack.s_mark = yytable[yyn]; 1244234949Sbapt *++yystack.l_mark = yylval; 1245234949Sbapt goto yyloop; 1246234949Sbapt } 1247234949Sbapt else 1248234949Sbapt { 1249234949Sbapt#if YYDEBUG 1250234949Sbapt if (yydebug) 1251234949Sbapt printf("%sdebug: error recovery discarding state %d\n", 1252234949Sbapt YYPREFIX, *yystack.s_mark); 1253234949Sbapt#endif 1254234949Sbapt if (yystack.s_mark <= yystack.s_base) goto yyabort; 1255234949Sbapt --yystack.s_mark; 1256234949Sbapt --yystack.l_mark; 1257234949Sbapt } 1258234949Sbapt } 1259234949Sbapt } 1260234949Sbapt else 1261234949Sbapt { 1262234949Sbapt if (yychar == 0) goto yyabort; 1263234949Sbapt#if YYDEBUG 1264234949Sbapt if (yydebug) 1265234949Sbapt { 1266234949Sbapt yys = 0; 1267234949Sbapt if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1268234949Sbapt if (!yys) yys = "illegal-symbol"; 1269234949Sbapt printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 1270234949Sbapt YYPREFIX, yystate, yychar, yys); 1271234949Sbapt } 1272234949Sbapt#endif 1273234949Sbapt yychar = YYEMPTY; 1274234949Sbapt goto yyloop; 1275234949Sbapt } 1276234949Sbapt 1277234949Sbaptyyreduce: 1278234949Sbapt#if YYDEBUG 1279234949Sbapt if (yydebug) 1280234949Sbapt printf("%sdebug: state %d, reducing by rule %d (%s)\n", 1281234949Sbapt YYPREFIX, yystate, yyn, yyrule[yyn]); 1282234949Sbapt#endif 1283234949Sbapt yym = yylen[yyn]; 1284234949Sbapt if (yym) 1285234949Sbapt yyval = yystack.l_mark[1-yym]; 1286234949Sbapt else 1287234949Sbapt memset(&yyval, 0, sizeof yyval); 1288234949Sbapt switch (yyn) 1289234949Sbapt { 1290234949Sbaptcase 10: 1291234949Sbapt#line 377 "grammar.y" 1292234949Sbapt { 1293234949Sbapt yyerrok; 1294234949Sbapt } 1295234949Sbaptbreak; 1296234949Sbaptcase 11: 1297234949Sbapt#line 381 "grammar.y" 1298234949Sbapt { 1299234949Sbapt yyerrok; 1300234949Sbapt } 1301234949Sbaptbreak; 1302234949Sbaptcase 13: 1303234949Sbapt#line 392 "grammar.y" 1304234949Sbapt { 1305234949Sbapt /* Provide an empty action here so bison will not complain about 1306234949Sbapt * incompatible types in the default action it normally would 1307234949Sbapt * have generated. 1308234949Sbapt */ 1309234949Sbapt } 1310234949Sbaptbreak; 1311234949Sbaptcase 14: 1312234949Sbapt#line 399 "grammar.y" 1313234949Sbapt { 1314234949Sbapt /* empty */ 1315234949Sbapt } 1316234949Sbaptbreak; 1317234949Sbaptcase 15: 1318234949Sbapt#line 406 "grammar.y" 1319234949Sbapt { 1320234949Sbapt#if OPT_LINTLIBRARY 1321234949Sbapt if (types_out && want_typedef()) { 1322234949Sbapt gen_declarations(&yystack.l_mark[-1].decl_spec, (DeclaratorList *)0); 1323234949Sbapt flush_varargs(); 1324234949Sbapt } 1325234949Sbapt#endif 1326234949Sbapt free_decl_spec(&yystack.l_mark[-1].decl_spec); 1327234949Sbapt end_typedef(); 1328234949Sbapt } 1329234949Sbaptbreak; 1330234949Sbaptcase 16: 1331234949Sbapt#line 417 "grammar.y" 1332234949Sbapt { 1333234949Sbapt if (func_params != NULL) { 1334234949Sbapt set_param_types(func_params, &yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list); 1335234949Sbapt } else { 1336234949Sbapt gen_declarations(&yystack.l_mark[-2].decl_spec, &yystack.l_mark[-1].decl_list); 1337234949Sbapt#if OPT_LINTLIBRARY 1338234949Sbapt flush_varargs(); 1339234949Sbapt#endif 1340234949Sbapt free_decl_list(&yystack.l_mark[-1].decl_list); 1341234949Sbapt } 1342234949Sbapt free_decl_spec(&yystack.l_mark[-2].decl_spec); 1343234949Sbapt end_typedef(); 1344234949Sbapt } 1345234949Sbaptbreak; 1346234949Sbaptcase 17: 1347234949Sbapt#line 431 "grammar.y" 1348234949Sbapt { 1349234949Sbapt cur_decl_spec_flags = yystack.l_mark[0].decl_spec.flags; 1350234949Sbapt free_decl_spec(&yystack.l_mark[0].decl_spec); 1351234949Sbapt } 1352234949Sbaptbreak; 1353234949Sbaptcase 18: 1354234949Sbapt#line 436 "grammar.y" 1355234949Sbapt { 1356234949Sbapt end_typedef(); 1357234949Sbapt } 1358234949Sbaptbreak; 1359234949Sbaptcase 19: 1360234949Sbapt#line 443 "grammar.y" 1361234949Sbapt { 1362234949Sbapt begin_typedef(); 1363234949Sbapt } 1364234949Sbaptbreak; 1365234949Sbaptcase 20: 1366234949Sbapt#line 447 "grammar.y" 1367234949Sbapt { 1368234949Sbapt begin_typedef(); 1369234949Sbapt } 1370234949Sbaptbreak; 1371234949Sbaptcase 23: 1372234949Sbapt#line 459 "grammar.y" 1373234949Sbapt { 1374234949Sbapt int flags = cur_decl_spec_flags; 1375234949Sbapt 1376234949Sbapt /* If the typedef is a pointer type, then reset the short type 1377234949Sbapt * flags so it does not get promoted. 1378234949Sbapt */ 1379234949Sbapt if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0) 1380234949Sbapt flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); 1381234949Sbapt new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags); 1382234949Sbapt free_declarator(yystack.l_mark[0].declarator); 1383234949Sbapt } 1384234949Sbaptbreak; 1385234949Sbaptcase 24: 1386234949Sbapt#line 471 "grammar.y" 1387234949Sbapt { 1388234949Sbapt int flags = cur_decl_spec_flags; 1389234949Sbapt 1390234949Sbapt if (strcmp(yystack.l_mark[0].declarator->text, yystack.l_mark[0].declarator->name) != 0) 1391234949Sbapt flags &= ~(DS_CHAR | DS_SHORT | DS_FLOAT); 1392234949Sbapt new_symbol(typedef_names, yystack.l_mark[0].declarator->name, NULL, flags); 1393234949Sbapt free_declarator(yystack.l_mark[0].declarator); 1394234949Sbapt } 1395234949Sbaptbreak; 1396234949Sbaptcase 25: 1397234949Sbapt#line 483 "grammar.y" 1398234949Sbapt { 1399234949Sbapt check_untagged(&yystack.l_mark[-1].decl_spec); 1400234949Sbapt if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) { 1401234949Sbapt yyerror("syntax error"); 1402234949Sbapt YYERROR; 1403234949Sbapt } 1404234949Sbapt func_params = &(yystack.l_mark[0].declarator->head->params); 1405234949Sbapt func_params->begin_comment = cur_file->begin_comment; 1406234949Sbapt func_params->end_comment = cur_file->end_comment; 1407234949Sbapt } 1408234949Sbaptbreak; 1409234949Sbaptcase 26: 1410234949Sbapt#line 494 "grammar.y" 1411234949Sbapt { 1412234949Sbapt /* If we're converting to K&R and we've got a nominally K&R 1413234949Sbapt * function which has a parameter which is ANSI (i.e., a prototyped 1414234949Sbapt * function pointer), then we must override the deciphered value of 1415234949Sbapt * 'func_def' so that the parameter will be converted. 1416234949Sbapt */ 1417234949Sbapt if (func_style == FUNC_TRADITIONAL 1418234949Sbapt && haveAnsiParam() 1419234949Sbapt && yystack.l_mark[-3].declarator->head->func_def == func_style) { 1420234949Sbapt yystack.l_mark[-3].declarator->head->func_def = FUNC_BOTH; 1421234949Sbapt } 1422234949Sbapt 1423234949Sbapt func_params = NULL; 1424234949Sbapt 1425234949Sbapt if (cur_file->convert) 1426234949Sbapt gen_func_definition(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator); 1427234949Sbapt gen_prototype(&yystack.l_mark[-4].decl_spec, yystack.l_mark[-3].declarator); 1428234949Sbapt#if OPT_LINTLIBRARY 1429234949Sbapt flush_varargs(); 1430234949Sbapt#endif 1431234949Sbapt free_decl_spec(&yystack.l_mark[-4].decl_spec); 1432234949Sbapt free_declarator(yystack.l_mark[-3].declarator); 1433234949Sbapt } 1434234949Sbaptbreak; 1435234949Sbaptcase 28: 1436234949Sbapt#line 519 "grammar.y" 1437234949Sbapt { 1438234949Sbapt if (yystack.l_mark[0].declarator->func_def == FUNC_NONE) { 1439234949Sbapt yyerror("syntax error"); 1440234949Sbapt YYERROR; 1441234949Sbapt } 1442234949Sbapt func_params = &(yystack.l_mark[0].declarator->head->params); 1443234949Sbapt func_params->begin_comment = cur_file->begin_comment; 1444234949Sbapt func_params->end_comment = cur_file->end_comment; 1445234949Sbapt } 1446234949Sbaptbreak; 1447234949Sbaptcase 29: 1448234949Sbapt#line 529 "grammar.y" 1449234949Sbapt { 1450234949Sbapt DeclSpec decl_spec; 1451234949Sbapt 1452234949Sbapt func_params = NULL; 1453234949Sbapt 1454234949Sbapt new_decl_spec(&decl_spec, dft_decl_spec(), yystack.l_mark[-4].declarator->begin, DS_NONE); 1455234949Sbapt if (cur_file->convert) 1456234949Sbapt gen_func_definition(&decl_spec, yystack.l_mark[-4].declarator); 1457234949Sbapt gen_prototype(&decl_spec, yystack.l_mark[-4].declarator); 1458234949Sbapt#if OPT_LINTLIBRARY 1459234949Sbapt flush_varargs(); 1460234949Sbapt#endif 1461234949Sbapt free_decl_spec(&decl_spec); 1462234949Sbapt free_declarator(yystack.l_mark[-4].declarator); 1463234949Sbapt } 1464234949Sbaptbreak; 1465234949Sbaptcase 36: 1466234949Sbapt#line 560 "grammar.y" 1467234949Sbapt { 1468234949Sbapt join_decl_specs(&yyval.decl_spec, &yystack.l_mark[-1].decl_spec, &yystack.l_mark[0].decl_spec); 1469234949Sbapt free(yystack.l_mark[-1].decl_spec.text); 1470234949Sbapt free(yystack.l_mark[0].decl_spec.text); 1471234949Sbapt } 1472234949Sbaptbreak; 1473234949Sbaptcase 40: 1474234949Sbapt#line 575 "grammar.y" 1475234949Sbapt { 1476234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1477234949Sbapt } 1478234949Sbaptbreak; 1479234949Sbaptcase 41: 1480234949Sbapt#line 579 "grammar.y" 1481234949Sbapt { 1482234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_EXTERN); 1483234949Sbapt } 1484234949Sbaptbreak; 1485234949Sbaptcase 42: 1486234949Sbapt#line 583 "grammar.y" 1487234949Sbapt { 1488234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1489234949Sbapt } 1490234949Sbaptbreak; 1491234949Sbaptcase 43: 1492234949Sbapt#line 587 "grammar.y" 1493234949Sbapt { 1494234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_STATIC); 1495234949Sbapt } 1496234949Sbaptbreak; 1497234949Sbaptcase 44: 1498234949Sbapt#line 591 "grammar.y" 1499234949Sbapt { 1500234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_INLINE); 1501234949Sbapt } 1502234949Sbaptbreak; 1503234949Sbaptcase 45: 1504234949Sbapt#line 595 "grammar.y" 1505234949Sbapt { 1506234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_JUNK); 1507234949Sbapt } 1508234949Sbaptbreak; 1509234949Sbaptcase 46: 1510234949Sbapt#line 602 "grammar.y" 1511234949Sbapt { 1512234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR); 1513234949Sbapt } 1514234949Sbaptbreak; 1515234949Sbaptcase 47: 1516234949Sbapt#line 606 "grammar.y" 1517234949Sbapt { 1518234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1519234949Sbapt } 1520234949Sbaptbreak; 1521234949Sbaptcase 48: 1522234949Sbapt#line 610 "grammar.y" 1523234949Sbapt { 1524234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_FLOAT); 1525234949Sbapt } 1526234949Sbaptbreak; 1527234949Sbaptcase 49: 1528234949Sbapt#line 614 "grammar.y" 1529234949Sbapt { 1530234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1531234949Sbapt } 1532234949Sbaptbreak; 1533234949Sbaptcase 50: 1534234949Sbapt#line 618 "grammar.y" 1535234949Sbapt { 1536234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1537234949Sbapt } 1538234949Sbaptbreak; 1539234949Sbaptcase 51: 1540234949Sbapt#line 622 "grammar.y" 1541234949Sbapt { 1542234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_SHORT); 1543234949Sbapt } 1544234949Sbaptbreak; 1545234949Sbaptcase 52: 1546234949Sbapt#line 626 "grammar.y" 1547234949Sbapt { 1548234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1549234949Sbapt } 1550234949Sbaptbreak; 1551234949Sbaptcase 53: 1552234949Sbapt#line 630 "grammar.y" 1553234949Sbapt { 1554234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1555234949Sbapt } 1556234949Sbaptbreak; 1557234949Sbaptcase 54: 1558234949Sbapt#line 634 "grammar.y" 1559234949Sbapt { 1560234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1561234949Sbapt } 1562234949Sbaptbreak; 1563234949Sbaptcase 55: 1564234949Sbapt#line 638 "grammar.y" 1565234949Sbapt { 1566234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_CHAR); 1567234949Sbapt } 1568234949Sbaptbreak; 1569234949Sbaptcase 56: 1570234949Sbapt#line 642 "grammar.y" 1571234949Sbapt { 1572234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1573234949Sbapt } 1574234949Sbaptbreak; 1575234949Sbaptcase 57: 1576234949Sbapt#line 646 "grammar.y" 1577234949Sbapt { 1578234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1579234949Sbapt } 1580234949Sbaptbreak; 1581234949Sbaptcase 58: 1582234949Sbapt#line 650 "grammar.y" 1583234949Sbapt { 1584234949Sbapt Symbol *s; 1585234949Sbapt s = find_symbol(typedef_names, yystack.l_mark[0].text.text); 1586234949Sbapt if (s != NULL) 1587234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags); 1588234949Sbapt } 1589234949Sbaptbreak; 1590234949Sbaptcase 61: 1591234949Sbapt#line 662 "grammar.y" 1592234949Sbapt { 1593234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, DS_NONE); 1594234949Sbapt } 1595234949Sbaptbreak; 1596234949Sbaptcase 62: 1597234949Sbapt#line 666 "grammar.y" 1598234949Sbapt { 1599234949Sbapt /* This rule allows the <pointer> nonterminal to scan #define 1600234949Sbapt * names as if they were type modifiers. 1601234949Sbapt */ 1602234949Sbapt Symbol *s; 1603234949Sbapt s = find_symbol(define_names, yystack.l_mark[0].text.text); 1604234949Sbapt if (s != NULL) 1605234949Sbapt new_decl_spec(&yyval.decl_spec, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin, s->flags); 1606234949Sbapt } 1607234949Sbaptbreak; 1608234949Sbaptcase 63: 1609234949Sbapt#line 679 "grammar.y" 1610234949Sbapt { 1611234949Sbapt char *s; 1612234949Sbapt if ((s = implied_typedef()) == 0) 1613234949Sbapt (void)sprintf(s = buf, "%s %s", yystack.l_mark[-2].text.text, yystack.l_mark[-1].text.text); 1614234949Sbapt new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE); 1615234949Sbapt } 1616234949Sbaptbreak; 1617234949Sbaptcase 64: 1618234949Sbapt#line 686 "grammar.y" 1619234949Sbapt { 1620234949Sbapt char *s; 1621234949Sbapt if ((s = implied_typedef()) == 0) 1622234949Sbapt (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text); 1623234949Sbapt new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE); 1624234949Sbapt } 1625234949Sbaptbreak; 1626234949Sbaptcase 65: 1627234949Sbapt#line 693 "grammar.y" 1628234949Sbapt { 1629234949Sbapt (void)sprintf(buf, "%s %s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text); 1630234949Sbapt new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE); 1631234949Sbapt } 1632234949Sbaptbreak; 1633234949Sbaptcase 66: 1634234949Sbapt#line 701 "grammar.y" 1635234949Sbapt { 1636234949Sbapt imply_typedef(yyval.text.text); 1637234949Sbapt } 1638234949Sbaptbreak; 1639234949Sbaptcase 67: 1640234949Sbapt#line 705 "grammar.y" 1641234949Sbapt { 1642234949Sbapt imply_typedef(yyval.text.text); 1643234949Sbapt } 1644234949Sbaptbreak; 1645234949Sbaptcase 68: 1646234949Sbapt#line 712 "grammar.y" 1647234949Sbapt { 1648234949Sbapt new_decl_list(&yyval.decl_list, yystack.l_mark[0].declarator); 1649234949Sbapt } 1650234949Sbaptbreak; 1651234949Sbaptcase 69: 1652234949Sbapt#line 716 "grammar.y" 1653234949Sbapt { 1654234949Sbapt add_decl_list(&yyval.decl_list, &yystack.l_mark[-2].decl_list, yystack.l_mark[0].declarator); 1655234949Sbapt } 1656234949Sbaptbreak; 1657234949Sbaptcase 70: 1658234949Sbapt#line 723 "grammar.y" 1659234949Sbapt { 1660234949Sbapt if (yystack.l_mark[0].declarator->func_def != FUNC_NONE && func_params == NULL && 1661234949Sbapt func_style == FUNC_TRADITIONAL && cur_file->convert) { 1662234949Sbapt gen_func_declarator(yystack.l_mark[0].declarator); 1663234949Sbapt fputs(cur_text(), cur_file->tmp_file); 1664234949Sbapt } 1665234949Sbapt cur_declarator = yyval.declarator; 1666234949Sbapt } 1667234949Sbaptbreak; 1668234949Sbaptcase 71: 1669234949Sbapt#line 732 "grammar.y" 1670234949Sbapt { 1671234949Sbapt if (yystack.l_mark[-1].declarator->func_def != FUNC_NONE && func_params == NULL && 1672234949Sbapt func_style == FUNC_TRADITIONAL && cur_file->convert) { 1673234949Sbapt gen_func_declarator(yystack.l_mark[-1].declarator); 1674234949Sbapt fputs(" =", cur_file->tmp_file); 1675234949Sbapt } 1676234949Sbapt } 1677234949Sbaptbreak; 1678234949Sbaptcase 73: 1679234949Sbapt#line 744 "grammar.y" 1680234949Sbapt { 1681234949Sbapt char *s; 1682234949Sbapt if ((s = implied_typedef()) == 0) 1683234949Sbapt (void)sprintf(s = buf, "enum %s", yystack.l_mark[-1].text.text); 1684234949Sbapt new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-2].text.begin, DS_NONE); 1685234949Sbapt } 1686234949Sbaptbreak; 1687234949Sbaptcase 74: 1688234949Sbapt#line 751 "grammar.y" 1689234949Sbapt { 1690234949Sbapt char *s; 1691234949Sbapt if ((s = implied_typedef()) == 0) 1692234949Sbapt (void)sprintf(s = buf, "%s {}", yystack.l_mark[-1].text.text); 1693234949Sbapt new_decl_spec(&yyval.decl_spec, s, yystack.l_mark[-1].text.begin, DS_NONE); 1694234949Sbapt } 1695234949Sbaptbreak; 1696234949Sbaptcase 75: 1697234949Sbapt#line 758 "grammar.y" 1698234949Sbapt { 1699234949Sbapt (void)sprintf(buf, "enum %s", yystack.l_mark[0].text.text); 1700234949Sbapt new_decl_spec(&yyval.decl_spec, buf, yystack.l_mark[-1].text.begin, DS_NONE); 1701234949Sbapt } 1702234949Sbaptbreak; 1703234949Sbaptcase 76: 1704234949Sbapt#line 766 "grammar.y" 1705234949Sbapt { 1706234949Sbapt imply_typedef("enum"); 1707234949Sbapt yyval.text = yystack.l_mark[0].text; 1708234949Sbapt } 1709234949Sbaptbreak; 1710234949Sbaptcase 79: 1711234949Sbapt#line 779 "grammar.y" 1712234949Sbapt { 1713234949Sbapt yyval.declarator = yystack.l_mark[0].declarator; 1714234949Sbapt (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text); 1715234949Sbapt free(yyval.declarator->text); 1716234949Sbapt yyval.declarator->text = xstrdup(buf); 1717234949Sbapt yyval.declarator->begin = yystack.l_mark[-1].text.begin; 1718234949Sbapt yyval.declarator->pointer = TRUE; 1719234949Sbapt } 1720234949Sbaptbreak; 1721234949Sbaptcase 81: 1722234949Sbapt#line 792 "grammar.y" 1723234949Sbapt { 1724234949Sbapt yyval.declarator = new_declarator(yystack.l_mark[0].text.text, yystack.l_mark[0].text.text, yystack.l_mark[0].text.begin); 1725234949Sbapt } 1726234949Sbaptbreak; 1727234949Sbaptcase 82: 1728234949Sbapt#line 796 "grammar.y" 1729234949Sbapt { 1730234949Sbapt yyval.declarator = yystack.l_mark[-1].declarator; 1731234949Sbapt (void)sprintf(buf, "(%s)", yyval.declarator->text); 1732234949Sbapt free(yyval.declarator->text); 1733234949Sbapt yyval.declarator->text = xstrdup(buf); 1734234949Sbapt yyval.declarator->begin = yystack.l_mark[-2].text.begin; 1735234949Sbapt } 1736234949Sbaptbreak; 1737234949Sbaptcase 83: 1738234949Sbapt#line 804 "grammar.y" 1739234949Sbapt { 1740234949Sbapt yyval.declarator = yystack.l_mark[-1].declarator; 1741234949Sbapt (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text); 1742234949Sbapt free(yyval.declarator->text); 1743234949Sbapt yyval.declarator->text = xstrdup(buf); 1744234949Sbapt } 1745234949Sbaptbreak; 1746234949Sbaptcase 84: 1747234949Sbapt#line 811 "grammar.y" 1748234949Sbapt { 1749234949Sbapt yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin); 1750234949Sbapt yyval.declarator->params = yystack.l_mark[-1].param_list; 1751234949Sbapt yyval.declarator->func_stack = yystack.l_mark[-3].declarator; 1752234949Sbapt yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; 1753234949Sbapt yyval.declarator->func_def = FUNC_ANSI; 1754234949Sbapt } 1755234949Sbaptbreak; 1756234949Sbaptcase 85: 1757234949Sbapt#line 819 "grammar.y" 1758234949Sbapt { 1759234949Sbapt yyval.declarator = new_declarator("%s()", yystack.l_mark[-3].declarator->name, yystack.l_mark[-3].declarator->begin); 1760234949Sbapt yyval.declarator->params = yystack.l_mark[-1].param_list; 1761234949Sbapt yyval.declarator->func_stack = yystack.l_mark[-3].declarator; 1762234949Sbapt yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; 1763234949Sbapt yyval.declarator->func_def = FUNC_TRADITIONAL; 1764234949Sbapt } 1765234949Sbaptbreak; 1766234949Sbaptcase 86: 1767234949Sbapt#line 830 "grammar.y" 1768234949Sbapt { 1769234949Sbapt (void)sprintf(yyval.text.text, "*%s", yystack.l_mark[0].text.text); 1770234949Sbapt yyval.text.begin = yystack.l_mark[-1].text.begin; 1771234949Sbapt } 1772234949Sbaptbreak; 1773234949Sbaptcase 87: 1774234949Sbapt#line 835 "grammar.y" 1775234949Sbapt { 1776234949Sbapt (void)sprintf(yyval.text.text, "*%s%s", yystack.l_mark[-1].text.text, yystack.l_mark[0].text.text); 1777234949Sbapt yyval.text.begin = yystack.l_mark[-2].text.begin; 1778234949Sbapt } 1779234949Sbaptbreak; 1780234949Sbaptcase 88: 1781234949Sbapt#line 843 "grammar.y" 1782234949Sbapt { 1783234949Sbapt strcpy(yyval.text.text, ""); 1784234949Sbapt yyval.text.begin = 0L; 1785234949Sbapt } 1786234949Sbaptbreak; 1787234949Sbaptcase 90: 1788234949Sbapt#line 852 "grammar.y" 1789234949Sbapt { 1790234949Sbapt (void)sprintf(yyval.text.text, "%s ", yystack.l_mark[0].decl_spec.text); 1791234949Sbapt yyval.text.begin = yystack.l_mark[0].decl_spec.begin; 1792234949Sbapt free(yystack.l_mark[0].decl_spec.text); 1793234949Sbapt } 1794234949Sbaptbreak; 1795234949Sbaptcase 91: 1796234949Sbapt#line 858 "grammar.y" 1797234949Sbapt { 1798234949Sbapt (void)sprintf(yyval.text.text, "%s%s ", yystack.l_mark[-1].text.text, yystack.l_mark[0].decl_spec.text); 1799234949Sbapt yyval.text.begin = yystack.l_mark[-1].text.begin; 1800234949Sbapt free(yystack.l_mark[0].decl_spec.text); 1801234949Sbapt } 1802234949Sbaptbreak; 1803234949Sbaptcase 93: 1804234949Sbapt#line 868 "grammar.y" 1805234949Sbapt { 1806234949Sbapt add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, "..."); 1807234949Sbapt } 1808234949Sbaptbreak; 1809234949Sbaptcase 94: 1810234949Sbapt#line 875 "grammar.y" 1811234949Sbapt { 1812234949Sbapt new_param_list(&yyval.param_list, yystack.l_mark[0].parameter); 1813234949Sbapt } 1814234949Sbaptbreak; 1815234949Sbaptcase 95: 1816234949Sbapt#line 879 "grammar.y" 1817234949Sbapt { 1818234949Sbapt add_param_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].parameter); 1819234949Sbapt } 1820234949Sbaptbreak; 1821234949Sbaptcase 96: 1822234949Sbapt#line 886 "grammar.y" 1823234949Sbapt { 1824234949Sbapt check_untagged(&yystack.l_mark[-1].decl_spec); 1825234949Sbapt yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator); 1826234949Sbapt } 1827234949Sbaptbreak; 1828234949Sbaptcase 97: 1829234949Sbapt#line 891 "grammar.y" 1830234949Sbapt { 1831234949Sbapt check_untagged(&yystack.l_mark[-1].decl_spec); 1832234949Sbapt yyval.parameter = new_parameter(&yystack.l_mark[-1].decl_spec, yystack.l_mark[0].declarator); 1833234949Sbapt } 1834234949Sbaptbreak; 1835234949Sbaptcase 98: 1836234949Sbapt#line 896 "grammar.y" 1837234949Sbapt { 1838234949Sbapt check_untagged(&yystack.l_mark[0].decl_spec); 1839234949Sbapt yyval.parameter = new_parameter(&yystack.l_mark[0].decl_spec, (Declarator *)0); 1840234949Sbapt } 1841234949Sbaptbreak; 1842234949Sbaptcase 99: 1843234949Sbapt#line 904 "grammar.y" 1844234949Sbapt { 1845234949Sbapt new_ident_list(&yyval.param_list); 1846234949Sbapt } 1847234949Sbaptbreak; 1848234949Sbaptcase 101: 1849234949Sbapt#line 912 "grammar.y" 1850234949Sbapt { 1851234949Sbapt new_ident_list(&yyval.param_list); 1852234949Sbapt add_ident_list(&yyval.param_list, &yyval.param_list, yystack.l_mark[0].text.text); 1853234949Sbapt } 1854234949Sbaptbreak; 1855234949Sbaptcase 102: 1856234949Sbapt#line 917 "grammar.y" 1857234949Sbapt { 1858234949Sbapt add_ident_list(&yyval.param_list, &yystack.l_mark[-2].param_list, yystack.l_mark[0].text.text); 1859234949Sbapt } 1860234949Sbaptbreak; 1861234949Sbaptcase 103: 1862234949Sbapt#line 924 "grammar.y" 1863234949Sbapt { 1864234949Sbapt yyval.text = yystack.l_mark[0].text; 1865234949Sbapt } 1866234949Sbaptbreak; 1867234949Sbaptcase 104: 1868234949Sbapt#line 928 "grammar.y" 1869234949Sbapt { 1870234949Sbapt#if OPT_LINTLIBRARY 1871234949Sbapt if (lintLibrary()) { /* Lint doesn't grok C++ ref variables */ 1872234949Sbapt yyval.text = yystack.l_mark[0].text; 1873234949Sbapt } else 1874234949Sbapt#endif 1875234949Sbapt (void)sprintf(yyval.text.text, "&%s", yystack.l_mark[0].text.text); 1876234949Sbapt yyval.text.begin = yystack.l_mark[-1].text.begin; 1877234949Sbapt } 1878234949Sbaptbreak; 1879234949Sbaptcase 105: 1880234949Sbapt#line 941 "grammar.y" 1881234949Sbapt { 1882234949Sbapt yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin); 1883234949Sbapt } 1884234949Sbaptbreak; 1885234949Sbaptcase 106: 1886234949Sbapt#line 945 "grammar.y" 1887234949Sbapt { 1888234949Sbapt yyval.declarator = yystack.l_mark[0].declarator; 1889234949Sbapt (void)sprintf(buf, "%s%s", yystack.l_mark[-1].text.text, yyval.declarator->text); 1890234949Sbapt free(yyval.declarator->text); 1891234949Sbapt yyval.declarator->text = xstrdup(buf); 1892234949Sbapt yyval.declarator->begin = yystack.l_mark[-1].text.begin; 1893234949Sbapt } 1894234949Sbaptbreak; 1895234949Sbaptcase 108: 1896234949Sbapt#line 957 "grammar.y" 1897234949Sbapt { 1898234949Sbapt yyval.declarator = yystack.l_mark[-1].declarator; 1899234949Sbapt (void)sprintf(buf, "(%s)", yyval.declarator->text); 1900234949Sbapt free(yyval.declarator->text); 1901234949Sbapt yyval.declarator->text = xstrdup(buf); 1902234949Sbapt yyval.declarator->begin = yystack.l_mark[-2].text.begin; 1903234949Sbapt } 1904234949Sbaptbreak; 1905234949Sbaptcase 109: 1906234949Sbapt#line 965 "grammar.y" 1907234949Sbapt { 1908234949Sbapt yyval.declarator = yystack.l_mark[-1].declarator; 1909234949Sbapt (void)sprintf(buf, "%s%s", yyval.declarator->text, yystack.l_mark[0].text.text); 1910234949Sbapt free(yyval.declarator->text); 1911234949Sbapt yyval.declarator->text = xstrdup(buf); 1912234949Sbapt } 1913234949Sbaptbreak; 1914234949Sbaptcase 110: 1915234949Sbapt#line 972 "grammar.y" 1916234949Sbapt { 1917234949Sbapt yyval.declarator = new_declarator(yystack.l_mark[0].text.text, "", yystack.l_mark[0].text.begin); 1918234949Sbapt } 1919234949Sbaptbreak; 1920234949Sbaptcase 111: 1921234949Sbapt#line 976 "grammar.y" 1922234949Sbapt { 1923234949Sbapt yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-3].declarator->begin); 1924234949Sbapt yyval.declarator->params = yystack.l_mark[-1].param_list; 1925234949Sbapt yyval.declarator->func_stack = yystack.l_mark[-3].declarator; 1926234949Sbapt yyval.declarator->head = (yystack.l_mark[-3].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-3].declarator->head; 1927234949Sbapt yyval.declarator->func_def = FUNC_ANSI; 1928234949Sbapt } 1929234949Sbaptbreak; 1930234949Sbaptcase 112: 1931234949Sbapt#line 984 "grammar.y" 1932234949Sbapt { 1933234949Sbapt yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].declarator->begin); 1934234949Sbapt yyval.declarator->func_stack = yystack.l_mark[-2].declarator; 1935234949Sbapt yyval.declarator->head = (yystack.l_mark[-2].declarator->func_stack == NULL) ? yyval.declarator : yystack.l_mark[-2].declarator->head; 1936234949Sbapt yyval.declarator->func_def = FUNC_ANSI; 1937234949Sbapt } 1938234949Sbaptbreak; 1939234949Sbaptcase 113: 1940234949Sbapt#line 991 "grammar.y" 1941234949Sbapt { 1942234949Sbapt Declarator *d; 1943234949Sbapt 1944234949Sbapt d = new_declarator("", "", yystack.l_mark[-2].text.begin); 1945234949Sbapt yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-2].text.begin); 1946234949Sbapt yyval.declarator->params = yystack.l_mark[-1].param_list; 1947234949Sbapt yyval.declarator->func_stack = d; 1948234949Sbapt yyval.declarator->head = yyval.declarator; 1949234949Sbapt yyval.declarator->func_def = FUNC_ANSI; 1950234949Sbapt } 1951234949Sbaptbreak; 1952234949Sbaptcase 114: 1953234949Sbapt#line 1002 "grammar.y" 1954234949Sbapt { 1955234949Sbapt Declarator *d; 1956234949Sbapt 1957234949Sbapt d = new_declarator("", "", yystack.l_mark[-1].text.begin); 1958234949Sbapt yyval.declarator = new_declarator("%s()", "", yystack.l_mark[-1].text.begin); 1959234949Sbapt yyval.declarator->func_stack = d; 1960234949Sbapt yyval.declarator->head = yyval.declarator; 1961234949Sbapt yyval.declarator->func_def = FUNC_ANSI; 1962234949Sbapt } 1963234949Sbaptbreak; 1964234949Sbapt#line 1965 "grammar.tab.c" 1965234949Sbapt } 1966234949Sbapt yystack.s_mark -= yym; 1967234949Sbapt yystate = *yystack.s_mark; 1968234949Sbapt yystack.l_mark -= yym; 1969234949Sbapt yym = yylhs[yyn]; 1970234949Sbapt if (yystate == 0 && yym == 0) 1971234949Sbapt { 1972234949Sbapt#if YYDEBUG 1973234949Sbapt if (yydebug) 1974234949Sbapt printf("%sdebug: after reduction, shifting from state 0 to\ 1975234949Sbapt state %d\n", YYPREFIX, YYFINAL); 1976234949Sbapt#endif 1977234949Sbapt yystate = YYFINAL; 1978234949Sbapt *++yystack.s_mark = YYFINAL; 1979234949Sbapt *++yystack.l_mark = yyval; 1980234949Sbapt if (yychar < 0) 1981234949Sbapt { 1982234949Sbapt if ((yychar = YYLEX) < 0) yychar = 0; 1983234949Sbapt#if YYDEBUG 1984234949Sbapt if (yydebug) 1985234949Sbapt { 1986234949Sbapt yys = 0; 1987234949Sbapt if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1988234949Sbapt if (!yys) yys = "illegal-symbol"; 1989234949Sbapt printf("%sdebug: state %d, reading %d (%s)\n", 1990234949Sbapt YYPREFIX, YYFINAL, yychar, yys); 1991234949Sbapt } 1992234949Sbapt#endif 1993234949Sbapt } 1994234949Sbapt if (yychar == 0) goto yyaccept; 1995234949Sbapt goto yyloop; 1996234949Sbapt } 1997234949Sbapt if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && 1998234949Sbapt yyn <= YYTABLESIZE && yycheck[yyn] == yystate) 1999234949Sbapt yystate = yytable[yyn]; 2000234949Sbapt else 2001234949Sbapt yystate = yydgoto[yym]; 2002234949Sbapt#if YYDEBUG 2003234949Sbapt if (yydebug) 2004234949Sbapt printf("%sdebug: after reduction, shifting from state %d \ 2005234949Sbaptto state %d\n", YYPREFIX, *yystack.s_mark, yystate); 2006234949Sbapt#endif 2007234949Sbapt if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) 2008234949Sbapt { 2009234949Sbapt goto yyoverflow; 2010234949Sbapt } 2011234949Sbapt *++yystack.s_mark = (short) yystate; 2012234949Sbapt *++yystack.l_mark = yyval; 2013234949Sbapt goto yyloop; 2014234949Sbapt 2015234949Sbaptyyoverflow: 2016234949Sbapt yyerror("yacc stack overflow"); 2017234949Sbapt 2018234949Sbaptyyabort: 2019234949Sbapt yyfreestack(&yystack); 2020234949Sbapt return (1); 2021234949Sbapt 2022234949Sbaptyyaccept: 2023234949Sbapt yyfreestack(&yystack); 2024234949Sbapt return (0); 2025234949Sbapt} 2026