1130803Smarcel/* A Bison parser, made by GNU Bison 1.875. */ 2130803Smarcel 3130803Smarcel/* Skeleton parser for Yacc-like parsing with Bison, 4130803Smarcel Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. 5130803Smarcel 6130803Smarcel This program is free software; you can redistribute it and/or modify 7130803Smarcel it under the terms of the GNU General Public License as published by 8130803Smarcel the Free Software Foundation; either version 2, or (at your option) 9130803Smarcel any later version. 10130803Smarcel 11130803Smarcel This program is distributed in the hope that it will be useful, 12130803Smarcel but WITHOUT ANY WARRANTY; without even the implied warranty of 13130803Smarcel MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14130803Smarcel GNU General Public License for more details. 15130803Smarcel 16130803Smarcel You should have received a copy of the GNU General Public License 17130803Smarcel along with this program; if not, write to the Free Software 18130803Smarcel Foundation, Inc., 59 Temple Place - Suite 330, 19130803Smarcel Boston, MA 02111-1307, USA. */ 20130803Smarcel 21130803Smarcel/* As a special exception, when this file is copied by Bison into a 22130803Smarcel Bison output file, you may use that output file without restriction. 23130803Smarcel This special exception was added by the Free Software Foundation 24130803Smarcel in version 1.24 of Bison. */ 25130803Smarcel 26130803Smarcel/* Written by Richard Stallman by simplifying the original so called 27130803Smarcel ``semantic'' parser. */ 28130803Smarcel 29130803Smarcel/* All symbols defined below should begin with yy or YY, to avoid 30130803Smarcel infringing on user name space. This should be done even for local 31130803Smarcel variables, as they might otherwise be expanded by user macros. 32130803Smarcel There are some unavoidable exceptions within include files to 33130803Smarcel define necessary library symbols; they are noted "INFRINGES ON 34130803Smarcel USER NAME SPACE" below. */ 35130803Smarcel 36130803Smarcel/* Identify Bison output. */ 37130803Smarcel#define YYBISON 1 38130803Smarcel 39130803Smarcel/* Skeleton name. */ 40130803Smarcel#define YYSKELETON_NAME "yacc.c" 41130803Smarcel 42130803Smarcel/* Pure parsers. */ 43130803Smarcel#define YYPURE 0 44130803Smarcel 45130803Smarcel/* Using locations. */ 46130803Smarcel#define YYLSP_NEEDED 0 47130803Smarcel 48130803Smarcel 49130803Smarcel 50130803Smarcel/* Tokens. */ 51130803Smarcel#ifndef YYTOKENTYPE 52130803Smarcel# define YYTOKENTYPE 53130803Smarcel /* Put the tokens into the symbol table, so that GDB and other debuggers 54130803Smarcel know about them. */ 55130803Smarcel enum yytokentype { 56130803Smarcel INT = 258, 57130803Smarcel FLOAT = 259, 58130803Smarcel STRING = 260, 59130803Smarcel NSSTRING = 261, 60130803Smarcel SELECTOR = 262, 61130803Smarcel NAME = 263, 62130803Smarcel TYPENAME = 264, 63130803Smarcel CLASSNAME = 265, 64130803Smarcel NAME_OR_INT = 266, 65130803Smarcel STRUCT = 267, 66130803Smarcel CLASS = 268, 67130803Smarcel UNION = 269, 68130803Smarcel ENUM = 270, 69130803Smarcel SIZEOF = 271, 70130803Smarcel UNSIGNED = 272, 71130803Smarcel COLONCOLON = 273, 72130803Smarcel TEMPLATE = 274, 73130803Smarcel ERROR = 275, 74130803Smarcel SIGNED_KEYWORD = 276, 75130803Smarcel LONG = 277, 76130803Smarcel SHORT = 278, 77130803Smarcel INT_KEYWORD = 279, 78130803Smarcel CONST_KEYWORD = 280, 79130803Smarcel VOLATILE_KEYWORD = 281, 80130803Smarcel DOUBLE_KEYWORD = 282, 81130803Smarcel VARIABLE = 283, 82130803Smarcel ASSIGN_MODIFY = 284, 83130803Smarcel ABOVE_COMMA = 285, 84130803Smarcel OROR = 286, 85130803Smarcel ANDAND = 287, 86130803Smarcel NOTEQUAL = 288, 87130803Smarcel EQUAL = 289, 88130803Smarcel GEQ = 290, 89130803Smarcel LEQ = 291, 90130803Smarcel RSH = 292, 91130803Smarcel LSH = 293, 92130803Smarcel DECREMENT = 294, 93130803Smarcel INCREMENT = 295, 94130803Smarcel UNARY = 296, 95130803Smarcel ARROW = 297, 96130803Smarcel BLOCKNAME = 298 97130803Smarcel }; 98130803Smarcel#endif 99130803Smarcel#define INT 258 100130803Smarcel#define FLOAT 259 101130803Smarcel#define STRING 260 102130803Smarcel#define NSSTRING 261 103130803Smarcel#define SELECTOR 262 104130803Smarcel#define NAME 263 105130803Smarcel#define TYPENAME 264 106130803Smarcel#define CLASSNAME 265 107130803Smarcel#define NAME_OR_INT 266 108130803Smarcel#define STRUCT 267 109130803Smarcel#define CLASS 268 110130803Smarcel#define UNION 269 111130803Smarcel#define ENUM 270 112130803Smarcel#define SIZEOF 271 113130803Smarcel#define UNSIGNED 272 114130803Smarcel#define COLONCOLON 273 115130803Smarcel#define TEMPLATE 274 116130803Smarcel#define ERROR 275 117130803Smarcel#define SIGNED_KEYWORD 276 118130803Smarcel#define LONG 277 119130803Smarcel#define SHORT 278 120130803Smarcel#define INT_KEYWORD 279 121130803Smarcel#define CONST_KEYWORD 280 122130803Smarcel#define VOLATILE_KEYWORD 281 123130803Smarcel#define DOUBLE_KEYWORD 282 124130803Smarcel#define VARIABLE 283 125130803Smarcel#define ASSIGN_MODIFY 284 126130803Smarcel#define ABOVE_COMMA 285 127130803Smarcel#define OROR 286 128130803Smarcel#define ANDAND 287 129130803Smarcel#define NOTEQUAL 288 130130803Smarcel#define EQUAL 289 131130803Smarcel#define GEQ 290 132130803Smarcel#define LEQ 291 133130803Smarcel#define RSH 292 134130803Smarcel#define LSH 293 135130803Smarcel#define DECREMENT 294 136130803Smarcel#define INCREMENT 295 137130803Smarcel#define UNARY 296 138130803Smarcel#define ARROW 297 139130803Smarcel#define BLOCKNAME 298 140130803Smarcel 141130803Smarcel 142130803Smarcel 143130803Smarcel 144130803Smarcel/* Copy the first part of user declarations. */ 145130803Smarcel#line 37 "objc-exp.y" 146130803Smarcel 147130803Smarcel 148130803Smarcel#include "defs.h" 149130803Smarcel#include "gdb_string.h" 150130803Smarcel#include <ctype.h> 151130803Smarcel#include "expression.h" 152130803Smarcel 153130803Smarcel#include "objc-lang.h" /* For objc language constructs. */ 154130803Smarcel 155130803Smarcel#include "value.h" 156130803Smarcel#include "parser-defs.h" 157130803Smarcel#include "language.h" 158130803Smarcel#include "c-lang.h" 159130803Smarcel#include "bfd.h" /* Required by objfiles.h. */ 160130803Smarcel#include "symfile.h" /* Required by objfiles.h. */ 161130803Smarcel#include "objfiles.h" /* For have_full_symbols and have_partial_symbols. */ 162130803Smarcel#include "top.h" 163130803Smarcel#include "completer.h" /* For skip_quoted(). */ 164130803Smarcel#include "block.h" 165130803Smarcel 166130803Smarcel/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, 167130803Smarcel etc), as well as gratuitiously global symbol names, so we can have 168130803Smarcel multiple yacc generated parsers in gdb. Note that these are only 169130803Smarcel the variables produced by yacc. If other parser generators (bison, 170130803Smarcel byacc, etc) produce additional global names that conflict at link 171130803Smarcel time, then those parser generators need to be fixed instead of 172130803Smarcel adding those names to this list. */ 173130803Smarcel 174130803Smarcel#define yymaxdepth objc_maxdepth 175130803Smarcel#define yyparse objc_parse 176130803Smarcel#define yylex objc_lex 177130803Smarcel#define yyerror objc_error 178130803Smarcel#define yylval objc_lval 179130803Smarcel#define yychar objc_char 180130803Smarcel#define yydebug objc_debug 181130803Smarcel#define yypact objc_pact 182130803Smarcel#define yyr1 objc_r1 183130803Smarcel#define yyr2 objc_r2 184130803Smarcel#define yydef objc_def 185130803Smarcel#define yychk objc_chk 186130803Smarcel#define yypgo objc_pgo 187130803Smarcel#define yyact objc_act 188130803Smarcel#define yyexca objc_exca 189130803Smarcel#define yyerrflag objc_errflag 190130803Smarcel#define yynerrs objc_nerrs 191130803Smarcel#define yyps objc_ps 192130803Smarcel#define yypv objc_pv 193130803Smarcel#define yys objc_s 194130803Smarcel#define yy_yys objc_yys 195130803Smarcel#define yystate objc_state 196130803Smarcel#define yytmp objc_tmp 197130803Smarcel#define yyv objc_v 198130803Smarcel#define yy_yyv objc_yyv 199130803Smarcel#define yyval objc_val 200130803Smarcel#define yylloc objc_lloc 201130803Smarcel#define yyreds objc_reds /* With YYDEBUG defined */ 202130803Smarcel#define yytoks objc_toks /* With YYDEBUG defined */ 203130803Smarcel#define yyname objc_name /* With YYDEBUG defined */ 204130803Smarcel#define yyrule objc_rule /* With YYDEBUG defined */ 205130803Smarcel#define yylhs objc_yylhs 206130803Smarcel#define yylen objc_yylen 207130803Smarcel#define yydefred objc_yydefred 208130803Smarcel#define yydgoto objc_yydgoto 209130803Smarcel#define yysindex objc_yysindex 210130803Smarcel#define yyrindex objc_yyrindex 211130803Smarcel#define yygindex objc_yygindex 212130803Smarcel#define yytable objc_yytable 213130803Smarcel#define yycheck objc_yycheck 214130803Smarcel 215130803Smarcel#ifndef YYDEBUG 216130803Smarcel#define YYDEBUG 0 /* Default to no yydebug support. */ 217130803Smarcel#endif 218130803Smarcel 219130803Smarcelint 220130803Smarcelyyparse PARAMS ((void)); 221130803Smarcel 222130803Smarcelstatic int 223130803Smarcelyylex PARAMS ((void)); 224130803Smarcel 225130803Smarcelvoid 226130803Smarcelyyerror PARAMS ((char *)); 227130803Smarcel 228130803Smarcel 229130803Smarcel 230130803Smarcel/* Enabling traces. */ 231130803Smarcel#ifndef YYDEBUG 232130803Smarcel# define YYDEBUG 0 233130803Smarcel#endif 234130803Smarcel 235130803Smarcel/* Enabling verbose error messages. */ 236130803Smarcel#ifdef YYERROR_VERBOSE 237130803Smarcel# undef YYERROR_VERBOSE 238130803Smarcel# define YYERROR_VERBOSE 1 239130803Smarcel#else 240130803Smarcel# define YYERROR_VERBOSE 0 241130803Smarcel#endif 242130803Smarcel 243130803Smarcel#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 244130803Smarcel#line 126 "objc-exp.y" 245130803Smarceltypedef union YYSTYPE { 246130803Smarcel LONGEST lval; 247130803Smarcel struct { 248130803Smarcel LONGEST val; 249130803Smarcel struct type *type; 250130803Smarcel } typed_val_int; 251130803Smarcel struct { 252130803Smarcel DOUBLEST dval; 253130803Smarcel struct type *type; 254130803Smarcel } typed_val_float; 255130803Smarcel struct symbol *sym; 256130803Smarcel struct type *tval; 257130803Smarcel struct stoken sval; 258130803Smarcel struct ttype tsym; 259130803Smarcel struct symtoken ssym; 260130803Smarcel int voidval; 261130803Smarcel struct block *bval; 262130803Smarcel enum exp_opcode opcode; 263130803Smarcel struct internalvar *ivar; 264130803Smarcel struct objc_class_str class; 265130803Smarcel 266130803Smarcel struct type **tvec; 267130803Smarcel int *ivec; 268130803Smarcel } YYSTYPE; 269130803Smarcel/* Line 191 of yacc.c. */ 270130803Smarcel# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 271130803Smarcel# define YYSTYPE_IS_DECLARED 1 272130803Smarcel# define YYSTYPE_IS_TRIVIAL 1 273130803Smarcel#endif 274130803Smarcel 275130803Smarcel 276130803Smarcel 277130803Smarcel/* Copy the second part of user declarations. */ 278130803Smarcel#line 151 "objc-exp.y" 279130803Smarcel 280130803Smarcel/* YYSTYPE gets defined by %union. */ 281130803Smarcelstatic int 282130803Smarcelparse_number PARAMS ((char *, int, int, YYSTYPE *)); 283130803Smarcel 284130803Smarcel 285130803Smarcel/* Line 214 of yacc.c. */ 286130803Smarcel 287130803Smarcel#if ! defined (yyoverflow) || YYERROR_VERBOSE 288130803Smarcel 289130803Smarcel/* The parser invokes alloca or xmalloc; define the necessary symbols. */ 290130803Smarcel 291130803Smarcel# if YYSTACK_USE_ALLOCA 292130803Smarcel# define YYSTACK_ALLOC alloca 293130803Smarcel# else 294130803Smarcel# ifndef YYSTACK_USE_ALLOCA 295130803Smarcel# if defined (alloca) || defined (_ALLOCA_H) 296130803Smarcel# define YYSTACK_ALLOC alloca 297130803Smarcel# else 298130803Smarcel# ifdef __GNUC__ 299130803Smarcel# define YYSTACK_ALLOC __builtin_alloca 300130803Smarcel# endif 301130803Smarcel# endif 302130803Smarcel# endif 303130803Smarcel# endif 304130803Smarcel 305130803Smarcel# ifdef YYSTACK_ALLOC 306130803Smarcel /* Pacify GCC's `empty if-body' warning. */ 307130803Smarcel# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 308130803Smarcel# else 309130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 310130803Smarcel# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 311130803Smarcel# define YYSIZE_T size_t 312130803Smarcel# endif 313130803Smarcel# define YYSTACK_ALLOC xmalloc 314130803Smarcel# define YYSTACK_FREE free 315130803Smarcel# endif 316130803Smarcel#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 317130803Smarcel 318130803Smarcel 319130803Smarcel#if (! defined (yyoverflow) \ 320130803Smarcel && (! defined (__cplusplus) \ 321130803Smarcel || (YYSTYPE_IS_TRIVIAL))) 322130803Smarcel 323130803Smarcel/* A type that is properly aligned for any stack member. */ 324130803Smarcelunion yyalloc 325130803Smarcel{ 326130803Smarcel short yyss; 327130803Smarcel YYSTYPE yyvs; 328130803Smarcel }; 329130803Smarcel 330130803Smarcel/* The size of the maximum gap between one aligned stack and the next. */ 331130803Smarcel# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 332130803Smarcel 333130803Smarcel/* The size of an array large to enough to hold all stacks, each with 334130803Smarcel N elements. */ 335130803Smarcel# define YYSTACK_BYTES(N) \ 336130803Smarcel ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ 337130803Smarcel + YYSTACK_GAP_MAXIMUM) 338130803Smarcel 339130803Smarcel/* Copy COUNT objects from FROM to TO. The source and destination do 340130803Smarcel not overlap. */ 341130803Smarcel# ifndef YYCOPY 342130803Smarcel# if 1 < __GNUC__ 343130803Smarcel# define YYCOPY(To, From, Count) \ 344130803Smarcel __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 345130803Smarcel# else 346130803Smarcel# define YYCOPY(To, From, Count) \ 347130803Smarcel do \ 348130803Smarcel { \ 349130803Smarcel register YYSIZE_T yyi; \ 350130803Smarcel for (yyi = 0; yyi < (Count); yyi++) \ 351130803Smarcel (To)[yyi] = (From)[yyi]; \ 352130803Smarcel } \ 353130803Smarcel while (0) 354130803Smarcel# endif 355130803Smarcel# endif 356130803Smarcel 357130803Smarcel/* Relocate STACK from its old location to the new one. The 358130803Smarcel local variables YYSIZE and YYSTACKSIZE give the old and new number of 359130803Smarcel elements in the stack, and YYPTR gives the new location of the 360130803Smarcel stack. Advance YYPTR to a properly aligned location for the next 361130803Smarcel stack. */ 362130803Smarcel# define YYSTACK_RELOCATE(Stack) \ 363130803Smarcel do \ 364130803Smarcel { \ 365130803Smarcel YYSIZE_T yynewbytes; \ 366130803Smarcel YYCOPY (&yyptr->Stack, Stack, yysize); \ 367130803Smarcel Stack = &yyptr->Stack; \ 368130803Smarcel yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 369130803Smarcel yyptr += yynewbytes / sizeof (*yyptr); \ 370130803Smarcel } \ 371130803Smarcel while (0) 372130803Smarcel 373130803Smarcel#endif 374130803Smarcel 375130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 376130803Smarcel typedef signed char yysigned_char; 377130803Smarcel#else 378130803Smarcel typedef short yysigned_char; 379130803Smarcel#endif 380130803Smarcel 381130803Smarcel/* YYFINAL -- State number of the termination state. */ 382130803Smarcel#define YYFINAL 89 383130803Smarcel/* YYLAST -- Last index in YYTABLE. */ 384130803Smarcel#define YYLAST 772 385130803Smarcel 386130803Smarcel/* YYNTOKENS -- Number of terminals. */ 387130803Smarcel#define YYNTOKENS 68 388130803Smarcel/* YYNNTS -- Number of nonterminals. */ 389130803Smarcel#define YYNNTS 29 390130803Smarcel/* YYNRULES -- Number of rules. */ 391130803Smarcel#define YYNRULES 147 392130803Smarcel/* YYNRULES -- Number of states. */ 393130803Smarcel#define YYNSTATES 239 394130803Smarcel 395130803Smarcel/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 396130803Smarcel#define YYUNDEFTOK 2 397130803Smarcel#define YYMAXUTOK 298 398130803Smarcel 399130803Smarcel#define YYTRANSLATE(YYX) \ 400130803Smarcel ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 401130803Smarcel 402130803Smarcel/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 403130803Smarcelstatic const unsigned char yytranslate[] = 404130803Smarcel{ 405130803Smarcel 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 406130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 407130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 408130803Smarcel 2, 2, 2, 61, 2, 2, 2, 52, 38, 2, 409130803Smarcel 58, 65, 50, 48, 30, 49, 56, 51, 2, 2, 410130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 64, 2, 411130803Smarcel 41, 32, 42, 33, 47, 2, 2, 2, 2, 2, 412130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 413130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 414130803Smarcel 2, 57, 2, 63, 37, 2, 2, 2, 2, 2, 415130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 416130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 417130803Smarcel 2, 2, 2, 66, 36, 67, 62, 2, 2, 2, 418130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 419130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 420130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 421130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 422130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 423130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 424130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 425130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 426130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 427130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 428130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 429130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 430130803Smarcel 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 431130803Smarcel 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 432130803Smarcel 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 433130803Smarcel 25, 26, 27, 28, 29, 31, 34, 35, 39, 40, 434130803Smarcel 43, 44, 45, 46, 53, 54, 55, 59, 60 435130803Smarcel}; 436130803Smarcel 437130803Smarcel#if YYDEBUG 438130803Smarcel/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 439130803Smarcel YYRHS. */ 440130803Smarcelstatic const unsigned short yyprhs[] = 441130803Smarcel{ 442130803Smarcel 0, 0, 3, 5, 7, 9, 11, 15, 18, 21, 443130803Smarcel 24, 27, 30, 33, 36, 39, 42, 45, 49, 53, 444130803Smarcel 58, 62, 66, 71, 76, 77, 83, 84, 90, 91, 445130803Smarcel 97, 99, 101, 103, 106, 110, 113, 116, 117, 123, 446130803Smarcel 125, 126, 128, 132, 134, 138, 143, 148, 152, 156, 447130803Smarcel 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 448130803Smarcel 200, 204, 208, 212, 216, 220, 224, 228, 234, 238, 449130803Smarcel 242, 244, 246, 248, 250, 252, 254, 259, 261, 263, 450130803Smarcel 265, 269, 273, 277, 282, 284, 287, 289, 291, 294, 451130803Smarcel 297, 300, 304, 308, 310, 313, 315, 318, 320, 324, 452130803Smarcel 327, 329, 332, 334, 337, 341, 344, 348, 350, 354, 453130803Smarcel 356, 358, 360, 362, 364, 367, 371, 374, 378, 382, 454130803Smarcel 387, 390, 394, 396, 399, 402, 405, 408, 411, 414, 455130803Smarcel 416, 419, 421, 427, 430, 433, 435, 437, 439, 441, 456130803Smarcel 443, 447, 449, 451, 453, 455, 457, 459 457130803Smarcel}; 458130803Smarcel 459130803Smarcel/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 460130803Smarcelstatic const yysigned_char yyrhs[] = 461130803Smarcel{ 462130803Smarcel 69, 0, -1, 71, -1, 70, -1, 91, -1, 72, 463130803Smarcel -1, 71, 30, 72, -1, 50, 72, -1, 38, 72, 464130803Smarcel -1, 49, 72, -1, 61, 72, -1, 62, 72, -1, 465130803Smarcel 54, 72, -1, 53, 72, -1, 72, 54, -1, 72, 466130803Smarcel 53, -1, 16, 72, -1, 72, 59, 95, -1, 72, 467130803Smarcel 59, 85, -1, 72, 59, 50, 72, -1, 72, 56, 468130803Smarcel 95, -1, 72, 56, 85, -1, 72, 56, 50, 72, 469130803Smarcel -1, 72, 57, 71, 63, -1, -1, 57, 9, 73, 470130803Smarcel 76, 63, -1, -1, 57, 10, 74, 76, 63, -1, 471130803Smarcel -1, 57, 72, 75, 76, 63, -1, 95, -1, 77, 472130803Smarcel -1, 78, -1, 77, 78, -1, 95, 64, 72, -1, 473130803Smarcel 64, 72, -1, 30, 72, -1, -1, 72, 58, 79, 474130803Smarcel 81, 65, -1, 66, -1, -1, 72, -1, 81, 30, 475130803Smarcel 72, -1, 67, -1, 80, 81, 82, -1, 80, 91, 476130803Smarcel 82, 72, -1, 58, 91, 65, 72, -1, 58, 71, 477130803Smarcel 65, -1, 72, 47, 72, -1, 72, 50, 72, -1, 478130803Smarcel 72, 51, 72, -1, 72, 52, 72, -1, 72, 48, 479130803Smarcel 72, -1, 72, 49, 72, -1, 72, 46, 72, -1, 480130803Smarcel 72, 45, 72, -1, 72, 40, 72, -1, 72, 39, 481130803Smarcel 72, -1, 72, 44, 72, -1, 72, 43, 72, -1, 482130803Smarcel 72, 41, 72, -1, 72, 42, 72, -1, 72, 38, 483130803Smarcel 72, -1, 72, 37, 72, -1, 72, 36, 72, -1, 484130803Smarcel 72, 35, 72, -1, 72, 34, 72, -1, 72, 33, 485130803Smarcel 72, 64, 72, -1, 72, 32, 72, -1, 72, 29, 486130803Smarcel 72, -1, 3, -1, 11, -1, 4, -1, 84, -1, 487130803Smarcel 28, -1, 7, -1, 16, 58, 91, 65, -1, 5, 488130803Smarcel -1, 6, -1, 60, -1, 83, 18, 95, -1, 83, 489130803Smarcel 18, 95, -1, 92, 18, 95, -1, 92, 18, 62, 490130803Smarcel 95, -1, 85, -1, 18, 95, -1, 96, -1, 92, 491130803Smarcel -1, 92, 25, -1, 92, 26, -1, 92, 87, -1, 492130803Smarcel 92, 25, 87, -1, 92, 26, 87, -1, 50, -1, 493130803Smarcel 50, 87, -1, 38, -1, 38, 87, -1, 88, -1, 494130803Smarcel 58, 87, 65, -1, 88, 89, -1, 89, -1, 88, 495130803Smarcel 90, -1, 90, -1, 57, 63, -1, 57, 3, 63, 496130803Smarcel -1, 58, 65, -1, 58, 94, 65, -1, 86, -1, 497130803Smarcel 92, 18, 50, -1, 9, -1, 10, -1, 24, -1, 498130803Smarcel 22, -1, 23, -1, 22, 24, -1, 17, 22, 24, 499130803Smarcel -1, 22, 22, -1, 22, 22, 24, -1, 17, 22, 500130803Smarcel 22, -1, 17, 22, 22, 24, -1, 23, 24, -1, 501130803Smarcel 17, 23, 24, -1, 27, -1, 22, 27, -1, 12, 502130803Smarcel 95, -1, 13, 95, -1, 14, 95, -1, 15, 95, 503130803Smarcel -1, 17, 93, -1, 17, -1, 21, 93, -1, 21, 504130803Smarcel -1, 19, 95, 41, 91, 42, -1, 25, 92, -1, 505130803Smarcel 26, 92, -1, 9, -1, 24, -1, 22, -1, 23, 506130803Smarcel -1, 91, -1, 94, 30, 91, -1, 8, -1, 60, 507130803Smarcel -1, 9, -1, 10, -1, 11, -1, 8, -1, 60, 508130803Smarcel -1 509130803Smarcel}; 510130803Smarcel 511130803Smarcel/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 512130803Smarcelstatic const unsigned short yyrline[] = 513130803Smarcel{ 514130803Smarcel 0, 231, 231, 232, 235, 242, 243, 248, 252, 256, 515130803Smarcel 260, 264, 268, 272, 276, 280, 284, 288, 294, 301, 516130803Smarcel 305, 312, 320, 324, 333, 332, 354, 353, 369, 368, 517130803Smarcel 377, 379, 382, 383, 386, 388, 390, 397, 394, 404, 518130803Smarcel 408, 411, 415, 419, 422, 429, 435, 441, 447, 451, 519130803Smarcel 455, 459, 463, 467, 471, 475, 479, 483, 487, 491, 520130803Smarcel 495, 499, 503, 507, 511, 515, 519, 523, 527, 531, 521130803Smarcel 537, 544, 555, 562, 565, 569, 576, 584, 609, 617, 522130803Smarcel 634, 645, 661, 674, 699, 700, 734, 793, 799, 800, 523130803Smarcel 801, 803, 805, 809, 811, 813, 815, 817, 820, 822, 524130803Smarcel 827, 834, 836, 840, 842, 846, 848, 860, 861, 866, 525130803Smarcel 868, 876, 878, 880, 882, 884, 886, 888, 890, 892, 526130803Smarcel 894, 896, 898, 900, 902, 905, 908, 911, 914, 916, 527130803Smarcel 918, 920, 922, 929, 930, 933, 934, 940, 946, 955, 528130803Smarcel 960, 967, 968, 969, 970, 971, 974, 975 529130803Smarcel}; 530130803Smarcel#endif 531130803Smarcel 532130803Smarcel#if YYDEBUG || YYERROR_VERBOSE 533130803Smarcel/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 534130803Smarcel First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 535130803Smarcelstatic const char *const yytname[] = 536130803Smarcel{ 537130803Smarcel "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING", 538130803Smarcel "SELECTOR", "NAME", "TYPENAME", "CLASSNAME", "NAME_OR_INT", "STRUCT", 539130803Smarcel "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", 540130803Smarcel "TEMPLATE", "ERROR", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD", 541130803Smarcel "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "VARIABLE", 542130803Smarcel "ASSIGN_MODIFY", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND", 543130803Smarcel "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ", 544130803Smarcel "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT", 545130803Smarcel "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME", "'!'", 546130803Smarcel "'~'", "']'", "':'", "')'", "'{'", "'}'", "$accept", "start", 547130803Smarcel "type_exp", "exp1", "exp", "@1", "@2", "@3", "msglist", "msgarglist", 548130803Smarcel "msgarg", "@4", "lcurly", "arglist", "rcurly", "block", "variable", 549130803Smarcel "qualified_name", "ptype", "abs_decl", "direct_abs_decl", "array_mod", 550130803Smarcel "func_mod", "type", "typebase", "typename", "nonempty_typelist", "name", 551130803Smarcel "name_not_typename", 0 552130803Smarcel}; 553130803Smarcel#endif 554130803Smarcel 555130803Smarcel# ifdef YYPRINT 556130803Smarcel/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 557130803Smarcel token YYLEX-NUM. */ 558130803Smarcelstatic const unsigned short yytoknum[] = 559130803Smarcel{ 560130803Smarcel 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 561130803Smarcel 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 562130803Smarcel 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 563130803Smarcel 44, 285, 61, 63, 286, 287, 124, 94, 38, 288, 564130803Smarcel 289, 60, 62, 290, 291, 292, 293, 64, 43, 45, 565130803Smarcel 42, 47, 37, 294, 295, 296, 46, 91, 40, 297, 566130803Smarcel 298, 33, 126, 93, 58, 41, 123, 125 567130803Smarcel}; 568130803Smarcel# endif 569130803Smarcel 570130803Smarcel/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 571130803Smarcelstatic const unsigned char yyr1[] = 572130803Smarcel{ 573130803Smarcel 0, 68, 69, 69, 70, 71, 71, 72, 72, 72, 574130803Smarcel 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 575130803Smarcel 72, 72, 72, 72, 73, 72, 74, 72, 75, 72, 576130803Smarcel 76, 76, 77, 77, 78, 78, 78, 79, 72, 80, 577130803Smarcel 81, 81, 81, 82, 72, 72, 72, 72, 72, 72, 578130803Smarcel 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 579130803Smarcel 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 580130803Smarcel 72, 72, 72, 72, 72, 72, 72, 72, 72, 83, 581130803Smarcel 83, 84, 85, 85, 84, 84, 84, 86, 86, 86, 582130803Smarcel 86, 86, 86, 87, 87, 87, 87, 87, 88, 88, 583130803Smarcel 88, 88, 88, 89, 89, 90, 90, 91, 91, 92, 584130803Smarcel 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 585130803Smarcel 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 586130803Smarcel 92, 92, 92, 92, 92, 93, 93, 93, 93, 94, 587130803Smarcel 94, 95, 95, 95, 95, 95, 96, 96 588130803Smarcel}; 589130803Smarcel 590130803Smarcel/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 591130803Smarcelstatic const unsigned char yyr2[] = 592130803Smarcel{ 593130803Smarcel 0, 2, 1, 1, 1, 1, 3, 2, 2, 2, 594130803Smarcel 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 595130803Smarcel 3, 3, 4, 4, 0, 5, 0, 5, 0, 5, 596130803Smarcel 1, 1, 1, 2, 3, 2, 2, 0, 5, 1, 597130803Smarcel 0, 1, 3, 1, 3, 4, 4, 3, 3, 3, 598130803Smarcel 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 599130803Smarcel 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 600130803Smarcel 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 601130803Smarcel 3, 3, 3, 4, 1, 2, 1, 1, 2, 2, 602130803Smarcel 2, 3, 3, 1, 2, 1, 2, 1, 3, 2, 603130803Smarcel 1, 2, 1, 2, 3, 2, 3, 1, 3, 1, 604130803Smarcel 1, 1, 1, 1, 2, 3, 2, 3, 3, 4, 605130803Smarcel 2, 3, 1, 2, 2, 2, 2, 2, 2, 1, 606130803Smarcel 2, 1, 5, 2, 2, 1, 1, 1, 1, 1, 607130803Smarcel 3, 1, 1, 1, 1, 1, 1, 1 608130803Smarcel}; 609130803Smarcel 610130803Smarcel/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 611130803Smarcel STATE-NUM when YYTABLE doesn't specify something else to do. Zero 612130803Smarcel means the default is an error. */ 613130803Smarcelstatic const unsigned char yydefact[] = 614130803Smarcel{ 615130803Smarcel 0, 70, 72, 77, 78, 75, 146, 109, 110, 71, 616130803Smarcel 0, 0, 0, 0, 0, 129, 0, 0, 131, 112, 617130803Smarcel 113, 111, 0, 0, 122, 74, 0, 0, 0, 0, 618130803Smarcel 0, 0, 0, 147, 0, 0, 39, 0, 3, 2, 619130803Smarcel 5, 40, 0, 73, 84, 107, 4, 87, 86, 141, 620130803Smarcel 143, 144, 145, 142, 124, 125, 126, 127, 0, 16, 621130803Smarcel 0, 135, 137, 138, 136, 128, 85, 0, 137, 138, 622130803Smarcel 130, 116, 114, 123, 120, 133, 134, 8, 9, 7, 623130803Smarcel 13, 12, 24, 26, 28, 0, 0, 10, 11, 1, 624130803Smarcel 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 625130803Smarcel 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 626130803Smarcel 0, 0, 0, 15, 14, 0, 0, 37, 0, 41, 627130803Smarcel 0, 0, 0, 0, 88, 89, 95, 93, 0, 0, 628130803Smarcel 90, 97, 100, 102, 0, 0, 118, 115, 121, 0, 629130803Smarcel 117, 0, 0, 0, 47, 0, 6, 69, 68, 0, 630130803Smarcel 66, 65, 64, 63, 62, 57, 56, 60, 61, 59, 631130803Smarcel 58, 55, 54, 48, 52, 53, 49, 50, 51, 143, 632130803Smarcel 144, 0, 21, 20, 0, 40, 0, 18, 17, 0, 633130803Smarcel 43, 44, 0, 81, 108, 0, 82, 91, 92, 96, 634130803Smarcel 94, 0, 103, 105, 0, 139, 87, 0, 0, 99, 635130803Smarcel 101, 76, 119, 0, 0, 0, 0, 31, 32, 30, 636130803Smarcel 0, 0, 46, 0, 22, 23, 0, 19, 42, 45, 637130803Smarcel 83, 104, 98, 0, 0, 106, 132, 36, 35, 25, 638130803Smarcel 33, 0, 0, 27, 29, 67, 38, 140, 34 639130803Smarcel}; 640130803Smarcel 641130803Smarcel/* YYDEFGOTO[NTERM-NUM]. */ 642130803Smarcelstatic const short yydefgoto[] = 643130803Smarcel{ 644130803Smarcel -1, 37, 38, 85, 40, 141, 142, 143, 206, 207, 645130803Smarcel 208, 175, 41, 120, 181, 42, 43, 44, 45, 130, 646130803Smarcel 131, 132, 133, 195, 60, 65, 197, 209, 48 647130803Smarcel}; 648130803Smarcel 649130803Smarcel/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 650130803Smarcel STATE-NUM. */ 651130803Smarcel#define YYPACT_NINF -90 652130803Smarcelstatic const short yypact[] = 653130803Smarcel{ 654130803Smarcel 223, -90, -90, -90, -90, -90, -90, -90, -90, -90, 655130803Smarcel 19, 19, 19, 19, 287, 195, 19, 19, 234, 82, 656130803Smarcel -9, -90, 307, 307, -90, -90, 223, 223, 223, 223, 657130803Smarcel 223, 351, 223, 8, 223, 223, -90, 39, -90, 13, 658130803Smarcel 542, 223, 32, -90, -90, -90, -90, 149, -90, -90, 659130803Smarcel -90, -90, -90, -90, -90, -90, -90, -90, 223, 212, 660130803Smarcel 38, -90, 33, 45, -90, -90, -90, 30, -90, -90, 661130803Smarcel -90, 83, -90, -90, -90, -90, -90, 212, 212, 212, 662130803Smarcel 212, 212, 107, 108, 542, -20, 66, 212, 212, -90, 663130803Smarcel 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 664130803Smarcel 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 665130803Smarcel 223, 223, 223, -90, -90, 436, 223, -90, 480, 542, 666130803Smarcel -21, 65, 19, 202, 70, 70, 70, 70, -1, 132, 667130803Smarcel -90, 54, -90, -90, 68, 43, 110, -90, -90, 307, 668130803Smarcel -90, 113, 113, 113, -90, 223, 542, 542, 542, 509, 669130803Smarcel 567, 591, 614, 636, 657, 676, 676, 691, 691, 691, 670130803Smarcel 691, 334, 334, 703, 713, 713, 212, 212, 212, 107, 671130803Smarcel 108, 223, -90, -90, 4, 223, 223, -90, -90, 223, 672130803Smarcel -90, -90, 223, 118, -90, 19, -90, -90, -90, -90, 673130803Smarcel -90, 74, -90, -90, 73, -90, 158, -17, 51, -90, 674130803Smarcel -90, 415, -90, 106, 223, 223, 87, 113, -90, 88, 675130803Smarcel 97, 99, 212, 223, 212, -90, -16, 212, 542, 212, 676130803Smarcel -90, -90, -90, 114, 307, -90, -90, 542, 542, -90, 677130803Smarcel -90, 88, 223, -90, -90, 475, -90, -90, 542 678130803Smarcel}; 679130803Smarcel 680130803Smarcel/* YYPGOTO[NTERM-NUM]. */ 681130803Smarcelstatic const short yypgoto[] = 682130803Smarcel{ 683130803Smarcel -90, -90, -90, 3, -10, -90, -90, -90, -28, -90, 684130803Smarcel -44, -90, -90, -7, 50, -90, -90, -71, -90, -89, 685130803Smarcel -90, 47, 48, 1, 0, 163, -90, -5, -90 686130803Smarcel}; 687130803Smarcel 688130803Smarcel/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 689130803Smarcel positive, shift that token. If negative, reduce the rule which 690130803Smarcel number is the opposite. If zero, do what YYDEFACT says. 691130803Smarcel If YYTABLE_NINF, syntax error. */ 692130803Smarcel#define YYTABLE_NINF -111 693130803Smarcelstatic const short yytable[] = 694130803Smarcel{ 695130803Smarcel 47, 46, 191, 39, 59, 54, 55, 56, 57, 179, 696130803Smarcel 90, 66, 67, 224, 179, 74, 77, 78, 79, 80, 697130803Smarcel 81, 84, 75, 76, 87, 88, -79, 49, 50, 51, 698130803Smarcel 52, 119, 47, 86, 90, 187, 188, 189, 190, 89, 699130803Smarcel 194, 47, 121, 90, 172, 144, 180, 177, 225, 236, 700130803Smarcel 122, 49, 50, 51, 52, 136, 135, 137, 47, 134, 701130803Smarcel 7, 8, 192, 10, 11, 12, 13, 215, 15, 138, 702130803Smarcel 17, 139, 18, 19, 20, 21, 22, 23, 24, 53, 703130803Smarcel 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 704130803Smarcel 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 705130803Smarcel 166, 167, 168, 53, 71, 185, 72, 140, 126, 73, 706130803Smarcel 173, 128, 198, 178, 210, 211, 193, 183, 186, 174, 707130803Smarcel 127, 49, 50, 51, 52, -109, -110, 128, 129, 196, 708130803Smarcel 186, 145, 180, 201, 202, 212, -80, 221, 222, 196, 709130803Smarcel 203, 7, 8, 204, 10, 11, 12, 13, 226, 15, 710130803Smarcel 229, 17, 232, 18, 19, 20, 21, 22, 23, 24, 711130803Smarcel 233, 214, 234, 230, 184, 119, 217, 123, 216, 218, 712130803Smarcel 126, 182, 219, 53, 124, 125, 223, 205, 199, 200, 713130803Smarcel 220, 70, 127, 124, 125, 0, 0, 126, 0, 128, 714130803Smarcel 129, 212, 0, 0, 227, 228, 126, 193, 196, 127, 715130803Smarcel 0, 0, 231, 235, 61, 0, 128, 129, 127, 0, 716130803Smarcel 49, 50, 51, 52, 0, 128, 129, 62, 63, 64, 717130803Smarcel 0, 0, 238, 0, 196, 237, 1, 2, 3, 4, 718130803Smarcel 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 719130803Smarcel 15, 16, 17, 61, 18, 19, 20, 21, 22, 23, 720130803Smarcel 24, 25, 184, 0, 0, 0, 68, 69, 64, 0, 721130803Smarcel 0, 26, 53, 0, 185, 113, 114, 0, 115, 116, 722130803Smarcel 117, 118, 27, 28, 0, 0, 29, 30, 0, 0, 723130803Smarcel 31, 32, 0, 33, 34, 35, 0, 0, 0, 36, 724130803Smarcel 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 725130803Smarcel 11, 12, 13, 14, 15, 16, 17, 0, 18, 19, 726130803Smarcel 20, 21, 22, 23, 24, 25, 7, 8, 0, 10, 727130803Smarcel 11, 12, 13, 0, 15, 26, 17, 0, 18, 19, 728130803Smarcel 20, 21, 22, 23, 24, 0, 27, 28, 0, 0, 729130803Smarcel 29, 30, 0, 0, 31, 58, 0, 33, 34, 35, 730130803Smarcel 0, 0, 0, 36, 1, 2, 3, 4, 5, 6, 731130803Smarcel 82, 83, 9, 10, 11, 12, 13, 14, 15, 16, 732130803Smarcel 17, 0, 18, 19, 20, 21, 22, 23, 24, 25, 733130803Smarcel 0, 107, 108, 109, 110, 111, 112, 113, 114, 26, 734130803Smarcel 115, 116, 117, 118, 0, 0, 0, 0, 0, 0, 735130803Smarcel 27, 28, 0, 0, 29, 30, 0, 0, 31, 32, 736130803Smarcel 0, 33, 34, 35, 0, 0, 0, 36, 1, 2, 737130803Smarcel 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 738130803Smarcel 13, 14, 15, 16, 17, 0, 18, 19, 20, 21, 739130803Smarcel 22, 23, 24, 25, 49, 169, 170, 52, 10, 11, 740130803Smarcel 12, 13, 0, 15, 0, 17, 0, 18, 19, 20, 741130803Smarcel 21, 22, 23, 24, 0, 0, 0, 0, 29, 30, 742130803Smarcel 0, 0, 31, 32, 0, 33, 34, 35, 0, 0, 743130803Smarcel 0, 36, 0, 0, 0, 0, 171, 0, 49, 169, 744130803Smarcel 170, 52, 10, 11, 12, 13, 53, 15, 0, 17, 745130803Smarcel 0, 18, 19, 20, 21, 22, 23, 24, 93, 94, 746130803Smarcel 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 747130803Smarcel 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 748130803Smarcel 176, 115, 116, 117, 118, 0, 0, 0, 91, 0, 749130803Smarcel 53, 92, 93, 94, 95, 96, 97, 98, 99, 100, 750130803Smarcel 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 751130803Smarcel 111, 112, 113, 114, 0, 115, 116, 117, 118, 0, 752130803Smarcel 0, 91, 0, 213, 92, 93, 94, 95, 96, 97, 753130803Smarcel 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 754130803Smarcel 108, 109, 110, 111, 112, 113, 114, 0, 115, 116, 755130803Smarcel 117, 118, 95, 96, 97, 98, 99, 100, 101, 102, 756130803Smarcel 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 757130803Smarcel 113, 114, 0, 115, 116, 117, 118, 96, 97, 98, 758130803Smarcel 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 759130803Smarcel 109, 110, 111, 112, 113, 114, 0, 115, 116, 117, 760130803Smarcel 118, 97, 98, 99, 100, 101, 102, 103, 104, 105, 761130803Smarcel 106, 107, 108, 109, 110, 111, 112, 113, 114, 0, 762130803Smarcel 115, 116, 117, 118, 98, 99, 100, 101, 102, 103, 763130803Smarcel 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 764130803Smarcel 114, 0, 115, 116, 117, 118, 99, 100, 101, 102, 765130803Smarcel 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 766130803Smarcel 113, 114, 0, 115, 116, 117, 118, 101, 102, 103, 767130803Smarcel 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 768130803Smarcel 114, 0, 115, 116, 117, 118, 105, 106, 107, 108, 769130803Smarcel 109, 110, 111, 112, 113, 114, 0, 115, 116, 117, 770130803Smarcel 118, 108, 109, 110, 111, 112, 113, 114, 0, 115, 771130803Smarcel 116, 117, 118, 110, 111, 112, 113, 114, 0, 115, 772130803Smarcel 116, 117, 118 773130803Smarcel}; 774130803Smarcel 775130803Smarcelstatic const short yycheck[] = 776130803Smarcel{ 777130803Smarcel 0, 0, 3, 0, 14, 10, 11, 12, 13, 30, 778130803Smarcel 30, 16, 17, 30, 30, 24, 26, 27, 28, 29, 779130803Smarcel 30, 31, 22, 23, 34, 35, 18, 8, 9, 10, 780130803Smarcel 11, 41, 32, 32, 30, 124, 125, 126, 127, 0, 781130803Smarcel 129, 41, 41, 30, 115, 65, 67, 118, 65, 65, 782130803Smarcel 18, 8, 9, 10, 11, 22, 18, 24, 58, 58, 783130803Smarcel 9, 10, 63, 12, 13, 14, 15, 63, 17, 24, 784130803Smarcel 19, 41, 21, 22, 23, 24, 25, 26, 27, 60, 785130803Smarcel 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 786130803Smarcel 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 787130803Smarcel 110, 111, 112, 60, 22, 62, 24, 24, 38, 27, 788130803Smarcel 115, 57, 58, 118, 142, 143, 65, 122, 123, 116, 789130803Smarcel 50, 8, 9, 10, 11, 18, 18, 57, 58, 129, 790130803Smarcel 135, 65, 67, 65, 24, 145, 18, 63, 65, 139, 791130803Smarcel 139, 9, 10, 30, 12, 13, 14, 15, 42, 17, 792130803Smarcel 63, 19, 64, 21, 22, 23, 24, 25, 26, 27, 793130803Smarcel 63, 171, 63, 207, 50, 175, 176, 18, 175, 179, 794130803Smarcel 38, 121, 182, 60, 25, 26, 18, 64, 131, 131, 795130803Smarcel 185, 18, 50, 25, 26, -1, -1, 38, -1, 57, 796130803Smarcel 58, 201, -1, -1, 204, 205, 38, 65, 198, 50, 797130803Smarcel -1, -1, 207, 213, 9, -1, 57, 58, 50, -1, 798130803Smarcel 8, 9, 10, 11, -1, 57, 58, 22, 23, 24, 799130803Smarcel -1, -1, 232, -1, 224, 224, 3, 4, 5, 6, 800130803Smarcel 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 801130803Smarcel 17, 18, 19, 9, 21, 22, 23, 24, 25, 26, 802130803Smarcel 27, 28, 50, -1, -1, -1, 22, 23, 24, -1, 803130803Smarcel -1, 38, 60, -1, 62, 53, 54, -1, 56, 57, 804130803Smarcel 58, 59, 49, 50, -1, -1, 53, 54, -1, -1, 805130803Smarcel 57, 58, -1, 60, 61, 62, -1, -1, -1, 66, 806130803Smarcel 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 807130803Smarcel 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, 808130803Smarcel 23, 24, 25, 26, 27, 28, 9, 10, -1, 12, 809130803Smarcel 13, 14, 15, -1, 17, 38, 19, -1, 21, 22, 810130803Smarcel 23, 24, 25, 26, 27, -1, 49, 50, -1, -1, 811130803Smarcel 53, 54, -1, -1, 57, 58, -1, 60, 61, 62, 812130803Smarcel -1, -1, -1, 66, 3, 4, 5, 6, 7, 8, 813130803Smarcel 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 814130803Smarcel 19, -1, 21, 22, 23, 24, 25, 26, 27, 28, 815130803Smarcel -1, 47, 48, 49, 50, 51, 52, 53, 54, 38, 816130803Smarcel 56, 57, 58, 59, -1, -1, -1, -1, -1, -1, 817130803Smarcel 49, 50, -1, -1, 53, 54, -1, -1, 57, 58, 818130803Smarcel -1, 60, 61, 62, -1, -1, -1, 66, 3, 4, 819130803Smarcel 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 820130803Smarcel 15, 16, 17, 18, 19, -1, 21, 22, 23, 24, 821130803Smarcel 25, 26, 27, 28, 8, 9, 10, 11, 12, 13, 822130803Smarcel 14, 15, -1, 17, -1, 19, -1, 21, 22, 23, 823130803Smarcel 24, 25, 26, 27, -1, -1, -1, -1, 53, 54, 824130803Smarcel -1, -1, 57, 58, -1, 60, 61, 62, -1, -1, 825130803Smarcel -1, 66, -1, -1, -1, -1, 50, -1, 8, 9, 826130803Smarcel 10, 11, 12, 13, 14, 15, 60, 17, -1, 19, 827130803Smarcel -1, 21, 22, 23, 24, 25, 26, 27, 33, 34, 828130803Smarcel 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 829130803Smarcel 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 830130803Smarcel 50, 56, 57, 58, 59, -1, -1, -1, 29, -1, 831130803Smarcel 60, 32, 33, 34, 35, 36, 37, 38, 39, 40, 832130803Smarcel 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 833130803Smarcel 51, 52, 53, 54, -1, 56, 57, 58, 59, -1, 834130803Smarcel -1, 29, -1, 64, 32, 33, 34, 35, 36, 37, 835130803Smarcel 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 836130803Smarcel 48, 49, 50, 51, 52, 53, 54, -1, 56, 57, 837130803Smarcel 58, 59, 35, 36, 37, 38, 39, 40, 41, 42, 838130803Smarcel 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 839130803Smarcel 53, 54, -1, 56, 57, 58, 59, 36, 37, 38, 840130803Smarcel 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 841130803Smarcel 49, 50, 51, 52, 53, 54, -1, 56, 57, 58, 842130803Smarcel 59, 37, 38, 39, 40, 41, 42, 43, 44, 45, 843130803Smarcel 46, 47, 48, 49, 50, 51, 52, 53, 54, -1, 844130803Smarcel 56, 57, 58, 59, 38, 39, 40, 41, 42, 43, 845130803Smarcel 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 846130803Smarcel 54, -1, 56, 57, 58, 59, 39, 40, 41, 42, 847130803Smarcel 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 848130803Smarcel 53, 54, -1, 56, 57, 58, 59, 41, 42, 43, 849130803Smarcel 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 850130803Smarcel 54, -1, 56, 57, 58, 59, 45, 46, 47, 48, 851130803Smarcel 49, 50, 51, 52, 53, 54, -1, 56, 57, 58, 852130803Smarcel 59, 48, 49, 50, 51, 52, 53, 54, -1, 56, 853130803Smarcel 57, 58, 59, 50, 51, 52, 53, 54, -1, 56, 854130803Smarcel 57, 58, 59 855130803Smarcel}; 856130803Smarcel 857130803Smarcel/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 858130803Smarcel symbol of state STATE-NUM. */ 859130803Smarcelstatic const unsigned char yystos[] = 860130803Smarcel{ 861130803Smarcel 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 862130803Smarcel 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 863130803Smarcel 23, 24, 25, 26, 27, 28, 38, 49, 50, 53, 864130803Smarcel 54, 57, 58, 60, 61, 62, 66, 69, 70, 71, 865130803Smarcel 72, 80, 83, 84, 85, 86, 91, 92, 96, 8, 866130803Smarcel 9, 10, 11, 60, 95, 95, 95, 95, 58, 72, 867130803Smarcel 92, 9, 22, 23, 24, 93, 95, 95, 22, 23, 868130803Smarcel 93, 22, 24, 27, 24, 92, 92, 72, 72, 72, 869130803Smarcel 72, 72, 9, 10, 72, 71, 91, 72, 72, 0, 870130803Smarcel 30, 29, 32, 33, 34, 35, 36, 37, 38, 39, 871130803Smarcel 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 872130803Smarcel 50, 51, 52, 53, 54, 56, 57, 58, 59, 72, 873130803Smarcel 81, 91, 18, 18, 25, 26, 38, 50, 57, 58, 874130803Smarcel 87, 88, 89, 90, 91, 18, 22, 24, 24, 41, 875130803Smarcel 24, 73, 74, 75, 65, 65, 72, 72, 72, 72, 876130803Smarcel 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 877130803Smarcel 72, 72, 72, 72, 72, 72, 72, 72, 72, 9, 878130803Smarcel 10, 50, 85, 95, 71, 79, 50, 85, 95, 30, 879130803Smarcel 67, 82, 82, 95, 50, 62, 95, 87, 87, 87, 880130803Smarcel 87, 3, 63, 65, 87, 91, 92, 94, 58, 89, 881130803Smarcel 90, 65, 24, 91, 30, 64, 76, 77, 78, 95, 882130803Smarcel 76, 76, 72, 64, 72, 63, 81, 72, 72, 72, 883130803Smarcel 95, 63, 65, 18, 30, 65, 42, 72, 72, 63, 884130803Smarcel 78, 95, 64, 63, 63, 72, 65, 91, 72 885130803Smarcel}; 886130803Smarcel 887130803Smarcel#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 888130803Smarcel# define YYSIZE_T __SIZE_TYPE__ 889130803Smarcel#endif 890130803Smarcel#if ! defined (YYSIZE_T) && defined (size_t) 891130803Smarcel# define YYSIZE_T size_t 892130803Smarcel#endif 893130803Smarcel#if ! defined (YYSIZE_T) 894130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 895130803Smarcel# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 896130803Smarcel# define YYSIZE_T size_t 897130803Smarcel# endif 898130803Smarcel#endif 899130803Smarcel#if ! defined (YYSIZE_T) 900130803Smarcel# define YYSIZE_T unsigned int 901130803Smarcel#endif 902130803Smarcel 903130803Smarcel#define yyerrok (yyerrstatus = 0) 904130803Smarcel#define yyclearin (yychar = YYEMPTY) 905130803Smarcel#define YYEMPTY (-2) 906130803Smarcel#define YYEOF 0 907130803Smarcel 908130803Smarcel#define YYACCEPT goto yyacceptlab 909130803Smarcel#define YYABORT goto yyabortlab 910130803Smarcel#define YYERROR goto yyerrlab1 911130803Smarcel 912130803Smarcel/* Like YYERROR except do call yyerror. This remains here temporarily 913130803Smarcel to ease the transition to the new meaning of YYERROR, for GCC. 914130803Smarcel Once GCC version 2 has supplanted version 1, this can go. */ 915130803Smarcel 916130803Smarcel#define YYFAIL goto yyerrlab 917130803Smarcel 918130803Smarcel#define YYRECOVERING() (!!yyerrstatus) 919130803Smarcel 920130803Smarcel#define YYBACKUP(Token, Value) \ 921130803Smarceldo \ 922130803Smarcel if (yychar == YYEMPTY && yylen == 1) \ 923130803Smarcel { \ 924130803Smarcel yychar = (Token); \ 925130803Smarcel yylval = (Value); \ 926130803Smarcel yytoken = YYTRANSLATE (yychar); \ 927130803Smarcel YYPOPSTACK; \ 928130803Smarcel goto yybackup; \ 929130803Smarcel } \ 930130803Smarcel else \ 931130803Smarcel { \ 932130803Smarcel yyerror ("syntax error: cannot back up");\ 933130803Smarcel YYERROR; \ 934130803Smarcel } \ 935130803Smarcelwhile (0) 936130803Smarcel 937130803Smarcel#define YYTERROR 1 938130803Smarcel#define YYERRCODE 256 939130803Smarcel 940130803Smarcel/* YYLLOC_DEFAULT -- Compute the default location (before the actions 941130803Smarcel are run). */ 942130803Smarcel 943130803Smarcel#ifndef YYLLOC_DEFAULT 944130803Smarcel# define YYLLOC_DEFAULT(Current, Rhs, N) \ 945130803Smarcel Current.first_line = Rhs[1].first_line; \ 946130803Smarcel Current.first_column = Rhs[1].first_column; \ 947130803Smarcel Current.last_line = Rhs[N].last_line; \ 948130803Smarcel Current.last_column = Rhs[N].last_column; 949130803Smarcel#endif 950130803Smarcel 951130803Smarcel/* YYLEX -- calling `yylex' with the right arguments. */ 952130803Smarcel 953130803Smarcel#ifdef YYLEX_PARAM 954130803Smarcel# define YYLEX yylex (YYLEX_PARAM) 955130803Smarcel#else 956130803Smarcel# define YYLEX yylex () 957130803Smarcel#endif 958130803Smarcel 959130803Smarcel/* Enable debugging if requested. */ 960130803Smarcel#if YYDEBUG 961130803Smarcel 962130803Smarcel# ifndef YYFPRINTF 963130803Smarcel# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 964130803Smarcel# define YYFPRINTF fprintf 965130803Smarcel# endif 966130803Smarcel 967130803Smarcel# define YYDPRINTF(Args) \ 968130803Smarceldo { \ 969130803Smarcel if (yydebug) \ 970130803Smarcel YYFPRINTF Args; \ 971130803Smarcel} while (0) 972130803Smarcel 973130803Smarcel# define YYDSYMPRINT(Args) \ 974130803Smarceldo { \ 975130803Smarcel if (yydebug) \ 976130803Smarcel yysymprint Args; \ 977130803Smarcel} while (0) 978130803Smarcel 979130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location) \ 980130803Smarceldo { \ 981130803Smarcel if (yydebug) \ 982130803Smarcel { \ 983130803Smarcel YYFPRINTF (stderr, "%s ", Title); \ 984130803Smarcel yysymprint (stderr, \ 985130803Smarcel Token, Value); \ 986130803Smarcel YYFPRINTF (stderr, "\n"); \ 987130803Smarcel } \ 988130803Smarcel} while (0) 989130803Smarcel 990130803Smarcel/*------------------------------------------------------------------. 991130803Smarcel| yy_stack_print -- Print the state stack from its BOTTOM up to its | 992130803Smarcel| TOP (cinluded). | 993130803Smarcel`------------------------------------------------------------------*/ 994130803Smarcel 995130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 996130803Smarcelstatic void 997130803Smarcelyy_stack_print (short *bottom, short *top) 998130803Smarcel#else 999130803Smarcelstatic void 1000130803Smarcelyy_stack_print (bottom, top) 1001130803Smarcel short *bottom; 1002130803Smarcel short *top; 1003130803Smarcel#endif 1004130803Smarcel{ 1005130803Smarcel YYFPRINTF (stderr, "Stack now"); 1006130803Smarcel for (/* Nothing. */; bottom <= top; ++bottom) 1007130803Smarcel YYFPRINTF (stderr, " %d", *bottom); 1008130803Smarcel YYFPRINTF (stderr, "\n"); 1009130803Smarcel} 1010130803Smarcel 1011130803Smarcel# define YY_STACK_PRINT(Bottom, Top) \ 1012130803Smarceldo { \ 1013130803Smarcel if (yydebug) \ 1014130803Smarcel yy_stack_print ((Bottom), (Top)); \ 1015130803Smarcel} while (0) 1016130803Smarcel 1017130803Smarcel 1018130803Smarcel/*------------------------------------------------. 1019130803Smarcel| Report that the YYRULE is going to be reduced. | 1020130803Smarcel`------------------------------------------------*/ 1021130803Smarcel 1022130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1023130803Smarcelstatic void 1024130803Smarcelyy_reduce_print (int yyrule) 1025130803Smarcel#else 1026130803Smarcelstatic void 1027130803Smarcelyy_reduce_print (yyrule) 1028130803Smarcel int yyrule; 1029130803Smarcel#endif 1030130803Smarcel{ 1031130803Smarcel int yyi; 1032130803Smarcel unsigned int yylineno = yyrline[yyrule]; 1033130803Smarcel YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", 1034130803Smarcel yyrule - 1, yylineno); 1035130803Smarcel /* Print the symbols being reduced, and their result. */ 1036130803Smarcel for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) 1037130803Smarcel YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); 1038130803Smarcel YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); 1039130803Smarcel} 1040130803Smarcel 1041130803Smarcel# define YY_REDUCE_PRINT(Rule) \ 1042130803Smarceldo { \ 1043130803Smarcel if (yydebug) \ 1044130803Smarcel yy_reduce_print (Rule); \ 1045130803Smarcel} while (0) 1046130803Smarcel 1047130803Smarcel/* Nonzero means print parse trace. It is left uninitialized so that 1048130803Smarcel multiple parsers can coexist. */ 1049130803Smarcelint yydebug; 1050130803Smarcel#else /* !YYDEBUG */ 1051130803Smarcel# define YYDPRINTF(Args) 1052130803Smarcel# define YYDSYMPRINT(Args) 1053130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location) 1054130803Smarcel# define YY_STACK_PRINT(Bottom, Top) 1055130803Smarcel# define YY_REDUCE_PRINT(Rule) 1056130803Smarcel#endif /* !YYDEBUG */ 1057130803Smarcel 1058130803Smarcel 1059130803Smarcel/* YYINITDEPTH -- initial size of the parser's stacks. */ 1060130803Smarcel#ifndef YYINITDEPTH 1061130803Smarcel# define YYINITDEPTH 200 1062130803Smarcel#endif 1063130803Smarcel 1064130803Smarcel/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1065130803Smarcel if the built-in stack extension method is used). 1066130803Smarcel 1067130803Smarcel Do not make this value too large; the results are undefined if 1068130803Smarcel SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 1069130803Smarcel evaluated with infinite-precision integer arithmetic. */ 1070130803Smarcel 1071130803Smarcel#if YYMAXDEPTH == 0 1072130803Smarcel# undef YYMAXDEPTH 1073130803Smarcel#endif 1074130803Smarcel 1075130803Smarcel#ifndef YYMAXDEPTH 1076130803Smarcel# define YYMAXDEPTH 10000 1077130803Smarcel#endif 1078130803Smarcel 1079130803Smarcel 1080130803Smarcel 1081130803Smarcel#if YYERROR_VERBOSE 1082130803Smarcel 1083130803Smarcel# ifndef yystrlen 1084130803Smarcel# if defined (__GLIBC__) && defined (_STRING_H) 1085130803Smarcel# define yystrlen strlen 1086130803Smarcel# else 1087130803Smarcel/* Return the length of YYSTR. */ 1088130803Smarcelstatic YYSIZE_T 1089130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1090130803Smarcelyystrlen (const char *yystr) 1091130803Smarcel# else 1092130803Smarcelyystrlen (yystr) 1093130803Smarcel const char *yystr; 1094130803Smarcel# endif 1095130803Smarcel{ 1096130803Smarcel register const char *yys = yystr; 1097130803Smarcel 1098130803Smarcel while (*yys++ != '\0') 1099130803Smarcel continue; 1100130803Smarcel 1101130803Smarcel return yys - yystr - 1; 1102130803Smarcel} 1103130803Smarcel# endif 1104130803Smarcel# endif 1105130803Smarcel 1106130803Smarcel# ifndef yystpcpy 1107130803Smarcel# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) 1108130803Smarcel# define yystpcpy stpcpy 1109130803Smarcel# else 1110130803Smarcel/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1111130803Smarcel YYDEST. */ 1112130803Smarcelstatic char * 1113130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1114130803Smarcelyystpcpy (char *yydest, const char *yysrc) 1115130803Smarcel# else 1116130803Smarcelyystpcpy (yydest, yysrc) 1117130803Smarcel char *yydest; 1118130803Smarcel const char *yysrc; 1119130803Smarcel# endif 1120130803Smarcel{ 1121130803Smarcel register char *yyd = yydest; 1122130803Smarcel register const char *yys = yysrc; 1123130803Smarcel 1124130803Smarcel while ((*yyd++ = *yys++) != '\0') 1125130803Smarcel continue; 1126130803Smarcel 1127130803Smarcel return yyd - 1; 1128130803Smarcel} 1129130803Smarcel# endif 1130130803Smarcel# endif 1131130803Smarcel 1132130803Smarcel#endif /* !YYERROR_VERBOSE */ 1133130803Smarcel 1134130803Smarcel 1135130803Smarcel 1136130803Smarcel#if YYDEBUG 1137130803Smarcel/*--------------------------------. 1138130803Smarcel| Print this symbol on YYOUTPUT. | 1139130803Smarcel`--------------------------------*/ 1140130803Smarcel 1141130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1142130803Smarcelstatic void 1143130803Smarcelyysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) 1144130803Smarcel#else 1145130803Smarcelstatic void 1146130803Smarcelyysymprint (yyoutput, yytype, yyvaluep) 1147130803Smarcel FILE *yyoutput; 1148130803Smarcel int yytype; 1149130803Smarcel YYSTYPE *yyvaluep; 1150130803Smarcel#endif 1151130803Smarcel{ 1152130803Smarcel /* Pacify ``unused variable'' warnings. */ 1153130803Smarcel (void) yyvaluep; 1154130803Smarcel 1155130803Smarcel if (yytype < YYNTOKENS) 1156130803Smarcel { 1157130803Smarcel YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 1158130803Smarcel# ifdef YYPRINT 1159130803Smarcel YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 1160130803Smarcel# endif 1161130803Smarcel } 1162130803Smarcel else 1163130803Smarcel YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 1164130803Smarcel 1165130803Smarcel switch (yytype) 1166130803Smarcel { 1167130803Smarcel default: 1168130803Smarcel break; 1169130803Smarcel } 1170130803Smarcel YYFPRINTF (yyoutput, ")"); 1171130803Smarcel} 1172130803Smarcel 1173130803Smarcel#endif /* ! YYDEBUG */ 1174130803Smarcel/*-----------------------------------------------. 1175130803Smarcel| Release the memory associated to this symbol. | 1176130803Smarcel`-----------------------------------------------*/ 1177130803Smarcel 1178130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1179130803Smarcelstatic void 1180130803Smarcelyydestruct (int yytype, YYSTYPE *yyvaluep) 1181130803Smarcel#else 1182130803Smarcelstatic void 1183130803Smarcelyydestruct (yytype, yyvaluep) 1184130803Smarcel int yytype; 1185130803Smarcel YYSTYPE *yyvaluep; 1186130803Smarcel#endif 1187130803Smarcel{ 1188130803Smarcel /* Pacify ``unused variable'' warnings. */ 1189130803Smarcel (void) yyvaluep; 1190130803Smarcel 1191130803Smarcel switch (yytype) 1192130803Smarcel { 1193130803Smarcel 1194130803Smarcel default: 1195130803Smarcel break; 1196130803Smarcel } 1197130803Smarcel} 1198130803Smarcel 1199130803Smarcel 1200130803Smarcel/* Prevent warnings from -Wmissing-prototypes. */ 1201130803Smarcel 1202130803Smarcel#ifdef YYPARSE_PARAM 1203130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1204130803Smarcelint yyparse (void *YYPARSE_PARAM); 1205130803Smarcel# else 1206130803Smarcelint yyparse (); 1207130803Smarcel# endif 1208130803Smarcel#else /* ! YYPARSE_PARAM */ 1209130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1210130803Smarcelint yyparse (void); 1211130803Smarcel#else 1212130803Smarcelint yyparse (); 1213130803Smarcel#endif 1214130803Smarcel#endif /* ! YYPARSE_PARAM */ 1215130803Smarcel 1216130803Smarcel 1217130803Smarcel 1218130803Smarcel/* The lookahead symbol. */ 1219130803Smarcelint yychar; 1220130803Smarcel 1221130803Smarcel/* The semantic value of the lookahead symbol. */ 1222130803SmarcelYYSTYPE yylval; 1223130803Smarcel 1224130803Smarcel/* Number of syntax errors so far. */ 1225130803Smarcelint yynerrs; 1226130803Smarcel 1227130803Smarcel 1228130803Smarcel 1229130803Smarcel/*----------. 1230130803Smarcel| yyparse. | 1231130803Smarcel`----------*/ 1232130803Smarcel 1233130803Smarcel#ifdef YYPARSE_PARAM 1234130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1235130803Smarcelint yyparse (void *YYPARSE_PARAM) 1236130803Smarcel# else 1237130803Smarcelint yyparse (YYPARSE_PARAM) 1238130803Smarcel void *YYPARSE_PARAM; 1239130803Smarcel# endif 1240130803Smarcel#else /* ! YYPARSE_PARAM */ 1241130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1242130803Smarcelint 1243130803Smarcelyyparse (void) 1244130803Smarcel#else 1245130803Smarcelint 1246130803Smarcelyyparse () 1247130803Smarcel 1248130803Smarcel#endif 1249130803Smarcel#endif 1250130803Smarcel{ 1251130803Smarcel 1252130803Smarcel register int yystate; 1253130803Smarcel register int yyn; 1254130803Smarcel int yyresult; 1255130803Smarcel /* Number of tokens to shift before error messages enabled. */ 1256130803Smarcel int yyerrstatus; 1257130803Smarcel /* Lookahead token as an internal (translated) token number. */ 1258130803Smarcel int yytoken = 0; 1259130803Smarcel 1260130803Smarcel /* Three stacks and their tools: 1261130803Smarcel `yyss': related to states, 1262130803Smarcel `yyvs': related to semantic values, 1263130803Smarcel `yyls': related to locations. 1264130803Smarcel 1265130803Smarcel Refer to the stacks thru separate pointers, to allow yyoverflow 1266130803Smarcel to xreallocate them elsewhere. */ 1267130803Smarcel 1268130803Smarcel /* The state stack. */ 1269130803Smarcel short yyssa[YYINITDEPTH]; 1270130803Smarcel short *yyss = yyssa; 1271130803Smarcel register short *yyssp; 1272130803Smarcel 1273130803Smarcel /* The semantic value stack. */ 1274130803Smarcel YYSTYPE yyvsa[YYINITDEPTH]; 1275130803Smarcel YYSTYPE *yyvs = yyvsa; 1276130803Smarcel register YYSTYPE *yyvsp; 1277130803Smarcel 1278130803Smarcel 1279130803Smarcel 1280130803Smarcel#define YYPOPSTACK (yyvsp--, yyssp--) 1281130803Smarcel 1282130803Smarcel YYSIZE_T yystacksize = YYINITDEPTH; 1283130803Smarcel 1284130803Smarcel /* The variables used to return semantic value and location from the 1285130803Smarcel action routines. */ 1286130803Smarcel YYSTYPE yyval; 1287130803Smarcel 1288130803Smarcel 1289130803Smarcel /* When reducing, the number of symbols on the RHS of the reduced 1290130803Smarcel rule. */ 1291130803Smarcel int yylen; 1292130803Smarcel 1293130803Smarcel YYDPRINTF ((stderr, "Starting parse\n")); 1294130803Smarcel 1295130803Smarcel yystate = 0; 1296130803Smarcel yyerrstatus = 0; 1297130803Smarcel yynerrs = 0; 1298130803Smarcel yychar = YYEMPTY; /* Cause a token to be read. */ 1299130803Smarcel 1300130803Smarcel /* Initialize stack pointers. 1301130803Smarcel Waste one element of value and location stack 1302130803Smarcel so that they stay on the same level as the state stack. 1303130803Smarcel The wasted elements are never initialized. */ 1304130803Smarcel 1305130803Smarcel yyssp = yyss; 1306130803Smarcel yyvsp = yyvs; 1307130803Smarcel 1308130803Smarcel goto yysetstate; 1309130803Smarcel 1310130803Smarcel/*------------------------------------------------------------. 1311130803Smarcel| yynewstate -- Push a new state, which is found in yystate. | 1312130803Smarcel`------------------------------------------------------------*/ 1313130803Smarcel yynewstate: 1314130803Smarcel /* In all cases, when you get here, the value and location stacks 1315130803Smarcel have just been pushed. so pushing a state here evens the stacks. 1316130803Smarcel */ 1317130803Smarcel yyssp++; 1318130803Smarcel 1319130803Smarcel yysetstate: 1320130803Smarcel *yyssp = yystate; 1321130803Smarcel 1322130803Smarcel if (yyss + yystacksize - 1 <= yyssp) 1323130803Smarcel { 1324130803Smarcel /* Get the current used size of the three stacks, in elements. */ 1325130803Smarcel YYSIZE_T yysize = yyssp - yyss + 1; 1326130803Smarcel 1327130803Smarcel#ifdef yyoverflow 1328130803Smarcel { 1329130803Smarcel /* Give user a chance to xreallocate the stack. Use copies of 1330130803Smarcel these so that the &'s don't force the real ones into 1331130803Smarcel memory. */ 1332130803Smarcel YYSTYPE *yyvs1 = yyvs; 1333130803Smarcel short *yyss1 = yyss; 1334130803Smarcel 1335130803Smarcel 1336130803Smarcel /* Each stack pointer address is followed by the size of the 1337130803Smarcel data in use in that stack, in bytes. This used to be a 1338130803Smarcel conditional around just the two extra args, but that might 1339130803Smarcel be undefined if yyoverflow is a macro. */ 1340130803Smarcel yyoverflow ("parser stack overflow", 1341130803Smarcel &yyss1, yysize * sizeof (*yyssp), 1342130803Smarcel &yyvs1, yysize * sizeof (*yyvsp), 1343130803Smarcel 1344130803Smarcel &yystacksize); 1345130803Smarcel 1346130803Smarcel yyss = yyss1; 1347130803Smarcel yyvs = yyvs1; 1348130803Smarcel } 1349130803Smarcel#else /* no yyoverflow */ 1350130803Smarcel# ifndef YYSTACK_RELOCATE 1351130803Smarcel goto yyoverflowlab; 1352130803Smarcel# else 1353130803Smarcel /* Extend the stack our own way. */ 1354130803Smarcel if (YYMAXDEPTH <= yystacksize) 1355130803Smarcel goto yyoverflowlab; 1356130803Smarcel yystacksize *= 2; 1357130803Smarcel if (YYMAXDEPTH < yystacksize) 1358130803Smarcel yystacksize = YYMAXDEPTH; 1359130803Smarcel 1360130803Smarcel { 1361130803Smarcel short *yyss1 = yyss; 1362130803Smarcel union yyalloc *yyptr = 1363130803Smarcel (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1364130803Smarcel if (! yyptr) 1365130803Smarcel goto yyoverflowlab; 1366130803Smarcel YYSTACK_RELOCATE (yyss); 1367130803Smarcel YYSTACK_RELOCATE (yyvs); 1368130803Smarcel 1369130803Smarcel# undef YYSTACK_RELOCATE 1370130803Smarcel if (yyss1 != yyssa) 1371130803Smarcel YYSTACK_FREE (yyss1); 1372130803Smarcel } 1373130803Smarcel# endif 1374130803Smarcel#endif /* no yyoverflow */ 1375130803Smarcel 1376130803Smarcel yyssp = yyss + yysize - 1; 1377130803Smarcel yyvsp = yyvs + yysize - 1; 1378130803Smarcel 1379130803Smarcel 1380130803Smarcel YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1381130803Smarcel (unsigned long int) yystacksize)); 1382130803Smarcel 1383130803Smarcel if (yyss + yystacksize - 1 <= yyssp) 1384130803Smarcel YYABORT; 1385130803Smarcel } 1386130803Smarcel 1387130803Smarcel YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1388130803Smarcel 1389130803Smarcel goto yybackup; 1390130803Smarcel 1391130803Smarcel/*-----------. 1392130803Smarcel| yybackup. | 1393130803Smarcel`-----------*/ 1394130803Smarcelyybackup: 1395130803Smarcel 1396130803Smarcel/* Do appropriate processing given the current state. */ 1397130803Smarcel/* Read a lookahead token if we need one and don't already have one. */ 1398130803Smarcel/* yyresume: */ 1399130803Smarcel 1400130803Smarcel /* First try to decide what to do without reference to lookahead token. */ 1401130803Smarcel 1402130803Smarcel yyn = yypact[yystate]; 1403130803Smarcel if (yyn == YYPACT_NINF) 1404130803Smarcel goto yydefault; 1405130803Smarcel 1406130803Smarcel /* Not known => get a lookahead token if don't already have one. */ 1407130803Smarcel 1408130803Smarcel /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1409130803Smarcel if (yychar == YYEMPTY) 1410130803Smarcel { 1411130803Smarcel YYDPRINTF ((stderr, "Reading a token: ")); 1412130803Smarcel yychar = YYLEX; 1413130803Smarcel } 1414130803Smarcel 1415130803Smarcel if (yychar <= YYEOF) 1416130803Smarcel { 1417130803Smarcel yychar = yytoken = YYEOF; 1418130803Smarcel YYDPRINTF ((stderr, "Now at end of input.\n")); 1419130803Smarcel } 1420130803Smarcel else 1421130803Smarcel { 1422130803Smarcel yytoken = YYTRANSLATE (yychar); 1423130803Smarcel YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); 1424130803Smarcel } 1425130803Smarcel 1426130803Smarcel /* If the proper action on seeing token YYTOKEN is to reduce or to 1427130803Smarcel detect an error, take that action. */ 1428130803Smarcel yyn += yytoken; 1429130803Smarcel if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1430130803Smarcel goto yydefault; 1431130803Smarcel yyn = yytable[yyn]; 1432130803Smarcel if (yyn <= 0) 1433130803Smarcel { 1434130803Smarcel if (yyn == 0 || yyn == YYTABLE_NINF) 1435130803Smarcel goto yyerrlab; 1436130803Smarcel yyn = -yyn; 1437130803Smarcel goto yyreduce; 1438130803Smarcel } 1439130803Smarcel 1440130803Smarcel if (yyn == YYFINAL) 1441130803Smarcel YYACCEPT; 1442130803Smarcel 1443130803Smarcel /* Shift the lookahead token. */ 1444130803Smarcel YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); 1445130803Smarcel 1446130803Smarcel /* Discard the token being shifted unless it is eof. */ 1447130803Smarcel if (yychar != YYEOF) 1448130803Smarcel yychar = YYEMPTY; 1449130803Smarcel 1450130803Smarcel *++yyvsp = yylval; 1451130803Smarcel 1452130803Smarcel 1453130803Smarcel /* Count tokens shifted since error; after three, turn off error 1454130803Smarcel status. */ 1455130803Smarcel if (yyerrstatus) 1456130803Smarcel yyerrstatus--; 1457130803Smarcel 1458130803Smarcel yystate = yyn; 1459130803Smarcel goto yynewstate; 1460130803Smarcel 1461130803Smarcel 1462130803Smarcel/*-----------------------------------------------------------. 1463130803Smarcel| yydefault -- do the default action for the current state. | 1464130803Smarcel`-----------------------------------------------------------*/ 1465130803Smarcelyydefault: 1466130803Smarcel yyn = yydefact[yystate]; 1467130803Smarcel if (yyn == 0) 1468130803Smarcel goto yyerrlab; 1469130803Smarcel goto yyreduce; 1470130803Smarcel 1471130803Smarcel 1472130803Smarcel/*-----------------------------. 1473130803Smarcel| yyreduce -- Do a reduction. | 1474130803Smarcel`-----------------------------*/ 1475130803Smarcelyyreduce: 1476130803Smarcel /* yyn is the number of a rule to reduce with. */ 1477130803Smarcel yylen = yyr2[yyn]; 1478130803Smarcel 1479130803Smarcel /* If YYLEN is nonzero, implement the default value of the action: 1480130803Smarcel `$$ = $1'. 1481130803Smarcel 1482130803Smarcel Otherwise, the following line sets YYVAL to garbage. 1483130803Smarcel This behavior is undocumented and Bison 1484130803Smarcel users should not rely upon it. Assigning to YYVAL 1485130803Smarcel unconditionally makes the parser a bit smaller, and it avoids a 1486130803Smarcel GCC warning that YYVAL may be used uninitialized. */ 1487130803Smarcel yyval = yyvsp[1-yylen]; 1488130803Smarcel 1489130803Smarcel 1490130803Smarcel YY_REDUCE_PRINT (yyn); 1491130803Smarcel switch (yyn) 1492130803Smarcel { 1493130803Smarcel case 4: 1494130803Smarcel#line 236 "objc-exp.y" 1495130803Smarcel { write_exp_elt_opcode(OP_TYPE); 1496130803Smarcel write_exp_elt_type(yyvsp[0].tval); 1497130803Smarcel write_exp_elt_opcode(OP_TYPE);} 1498130803Smarcel break; 1499130803Smarcel 1500130803Smarcel case 6: 1501130803Smarcel#line 244 "objc-exp.y" 1502130803Smarcel { write_exp_elt_opcode (BINOP_COMMA); } 1503130803Smarcel break; 1504130803Smarcel 1505130803Smarcel case 7: 1506130803Smarcel#line 249 "objc-exp.y" 1507130803Smarcel { write_exp_elt_opcode (UNOP_IND); } 1508130803Smarcel break; 1509130803Smarcel 1510130803Smarcel case 8: 1511130803Smarcel#line 253 "objc-exp.y" 1512130803Smarcel { write_exp_elt_opcode (UNOP_ADDR); } 1513130803Smarcel break; 1514130803Smarcel 1515130803Smarcel case 9: 1516130803Smarcel#line 257 "objc-exp.y" 1517130803Smarcel { write_exp_elt_opcode (UNOP_NEG); } 1518130803Smarcel break; 1519130803Smarcel 1520130803Smarcel case 10: 1521130803Smarcel#line 261 "objc-exp.y" 1522130803Smarcel { write_exp_elt_opcode (UNOP_LOGICAL_NOT); } 1523130803Smarcel break; 1524130803Smarcel 1525130803Smarcel case 11: 1526130803Smarcel#line 265 "objc-exp.y" 1527130803Smarcel { write_exp_elt_opcode (UNOP_COMPLEMENT); } 1528130803Smarcel break; 1529130803Smarcel 1530130803Smarcel case 12: 1531130803Smarcel#line 269 "objc-exp.y" 1532130803Smarcel { write_exp_elt_opcode (UNOP_PREINCREMENT); } 1533130803Smarcel break; 1534130803Smarcel 1535130803Smarcel case 13: 1536130803Smarcel#line 273 "objc-exp.y" 1537130803Smarcel { write_exp_elt_opcode (UNOP_PREDECREMENT); } 1538130803Smarcel break; 1539130803Smarcel 1540130803Smarcel case 14: 1541130803Smarcel#line 277 "objc-exp.y" 1542130803Smarcel { write_exp_elt_opcode (UNOP_POSTINCREMENT); } 1543130803Smarcel break; 1544130803Smarcel 1545130803Smarcel case 15: 1546130803Smarcel#line 281 "objc-exp.y" 1547130803Smarcel { write_exp_elt_opcode (UNOP_POSTDECREMENT); } 1548130803Smarcel break; 1549130803Smarcel 1550130803Smarcel case 16: 1551130803Smarcel#line 285 "objc-exp.y" 1552130803Smarcel { write_exp_elt_opcode (UNOP_SIZEOF); } 1553130803Smarcel break; 1554130803Smarcel 1555130803Smarcel case 17: 1556130803Smarcel#line 289 "objc-exp.y" 1557130803Smarcel { write_exp_elt_opcode (STRUCTOP_PTR); 1558130803Smarcel write_exp_string (yyvsp[0].sval); 1559130803Smarcel write_exp_elt_opcode (STRUCTOP_PTR); } 1560130803Smarcel break; 1561130803Smarcel 1562130803Smarcel case 18: 1563130803Smarcel#line 295 "objc-exp.y" 1564130803Smarcel { /* exp->type::name becomes exp->*(&type::name) */ 1565130803Smarcel /* Note: this doesn't work if name is a 1566130803Smarcel static member! FIXME */ 1567130803Smarcel write_exp_elt_opcode (UNOP_ADDR); 1568130803Smarcel write_exp_elt_opcode (STRUCTOP_MPTR); } 1569130803Smarcel break; 1570130803Smarcel 1571130803Smarcel case 19: 1572130803Smarcel#line 302 "objc-exp.y" 1573130803Smarcel { write_exp_elt_opcode (STRUCTOP_MPTR); } 1574130803Smarcel break; 1575130803Smarcel 1576130803Smarcel case 20: 1577130803Smarcel#line 306 "objc-exp.y" 1578130803Smarcel { write_exp_elt_opcode (STRUCTOP_STRUCT); 1579130803Smarcel write_exp_string (yyvsp[0].sval); 1580130803Smarcel write_exp_elt_opcode (STRUCTOP_STRUCT); } 1581130803Smarcel break; 1582130803Smarcel 1583130803Smarcel case 21: 1584130803Smarcel#line 313 "objc-exp.y" 1585130803Smarcel { /* exp.type::name becomes exp.*(&type::name) */ 1586130803Smarcel /* Note: this doesn't work if name is a 1587130803Smarcel static member! FIXME */ 1588130803Smarcel write_exp_elt_opcode (UNOP_ADDR); 1589130803Smarcel write_exp_elt_opcode (STRUCTOP_MEMBER); } 1590130803Smarcel break; 1591130803Smarcel 1592130803Smarcel case 22: 1593130803Smarcel#line 321 "objc-exp.y" 1594130803Smarcel { write_exp_elt_opcode (STRUCTOP_MEMBER); } 1595130803Smarcel break; 1596130803Smarcel 1597130803Smarcel case 23: 1598130803Smarcel#line 325 "objc-exp.y" 1599130803Smarcel { write_exp_elt_opcode (BINOP_SUBSCRIPT); } 1600130803Smarcel break; 1601130803Smarcel 1602130803Smarcel case 24: 1603130803Smarcel#line 333 "objc-exp.y" 1604130803Smarcel { 1605130803Smarcel CORE_ADDR class; 1606130803Smarcel 1607130803Smarcel class = lookup_objc_class (copy_name (yyvsp[0].tsym.stoken)); 1608130803Smarcel if (class == 0) 1609130803Smarcel error ("%s is not an ObjC Class", 1610130803Smarcel copy_name (yyvsp[0].tsym.stoken)); 1611130803Smarcel write_exp_elt_opcode (OP_LONG); 1612130803Smarcel write_exp_elt_type (builtin_type_int); 1613130803Smarcel write_exp_elt_longcst ((LONGEST) class); 1614130803Smarcel write_exp_elt_opcode (OP_LONG); 1615130803Smarcel start_msglist(); 1616130803Smarcel } 1617130803Smarcel break; 1618130803Smarcel 1619130803Smarcel case 25: 1620130803Smarcel#line 347 "objc-exp.y" 1621130803Smarcel { write_exp_elt_opcode (OP_OBJC_MSGCALL); 1622130803Smarcel end_msglist(); 1623130803Smarcel write_exp_elt_opcode (OP_OBJC_MSGCALL); 1624130803Smarcel } 1625130803Smarcel break; 1626130803Smarcel 1627130803Smarcel case 26: 1628130803Smarcel#line 354 "objc-exp.y" 1629130803Smarcel { 1630130803Smarcel write_exp_elt_opcode (OP_LONG); 1631130803Smarcel write_exp_elt_type (builtin_type_int); 1632130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].class.class); 1633130803Smarcel write_exp_elt_opcode (OP_LONG); 1634130803Smarcel start_msglist(); 1635130803Smarcel } 1636130803Smarcel break; 1637130803Smarcel 1638130803Smarcel case 27: 1639130803Smarcel#line 362 "objc-exp.y" 1640130803Smarcel { write_exp_elt_opcode (OP_OBJC_MSGCALL); 1641130803Smarcel end_msglist(); 1642130803Smarcel write_exp_elt_opcode (OP_OBJC_MSGCALL); 1643130803Smarcel } 1644130803Smarcel break; 1645130803Smarcel 1646130803Smarcel case 28: 1647130803Smarcel#line 369 "objc-exp.y" 1648130803Smarcel { start_msglist(); } 1649130803Smarcel break; 1650130803Smarcel 1651130803Smarcel case 29: 1652130803Smarcel#line 371 "objc-exp.y" 1653130803Smarcel { write_exp_elt_opcode (OP_OBJC_MSGCALL); 1654130803Smarcel end_msglist(); 1655130803Smarcel write_exp_elt_opcode (OP_OBJC_MSGCALL); 1656130803Smarcel } 1657130803Smarcel break; 1658130803Smarcel 1659130803Smarcel case 30: 1660130803Smarcel#line 378 "objc-exp.y" 1661130803Smarcel { add_msglist(&yyvsp[0].sval, 0); } 1662130803Smarcel break; 1663130803Smarcel 1664130803Smarcel case 34: 1665130803Smarcel#line 387 "objc-exp.y" 1666130803Smarcel { add_msglist(&yyvsp[-2].sval, 1); } 1667130803Smarcel break; 1668130803Smarcel 1669130803Smarcel case 35: 1670130803Smarcel#line 389 "objc-exp.y" 1671130803Smarcel { add_msglist(0, 1); } 1672130803Smarcel break; 1673130803Smarcel 1674130803Smarcel case 36: 1675130803Smarcel#line 391 "objc-exp.y" 1676130803Smarcel { add_msglist(0, 0); } 1677130803Smarcel break; 1678130803Smarcel 1679130803Smarcel case 37: 1680130803Smarcel#line 397 "objc-exp.y" 1681130803Smarcel { start_arglist (); } 1682130803Smarcel break; 1683130803Smarcel 1684130803Smarcel case 38: 1685130803Smarcel#line 399 "objc-exp.y" 1686130803Smarcel { write_exp_elt_opcode (OP_FUNCALL); 1687130803Smarcel write_exp_elt_longcst ((LONGEST) end_arglist ()); 1688130803Smarcel write_exp_elt_opcode (OP_FUNCALL); } 1689130803Smarcel break; 1690130803Smarcel 1691130803Smarcel case 39: 1692130803Smarcel#line 405 "objc-exp.y" 1693130803Smarcel { start_arglist (); } 1694130803Smarcel break; 1695130803Smarcel 1696130803Smarcel case 41: 1697130803Smarcel#line 412 "objc-exp.y" 1698130803Smarcel { arglist_len = 1; } 1699130803Smarcel break; 1700130803Smarcel 1701130803Smarcel case 42: 1702130803Smarcel#line 416 "objc-exp.y" 1703130803Smarcel { arglist_len++; } 1704130803Smarcel break; 1705130803Smarcel 1706130803Smarcel case 43: 1707130803Smarcel#line 420 "objc-exp.y" 1708130803Smarcel { yyval.lval = end_arglist () - 1; } 1709130803Smarcel break; 1710130803Smarcel 1711130803Smarcel case 44: 1712130803Smarcel#line 423 "objc-exp.y" 1713130803Smarcel { write_exp_elt_opcode (OP_ARRAY); 1714130803Smarcel write_exp_elt_longcst ((LONGEST) 0); 1715130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].lval); 1716130803Smarcel write_exp_elt_opcode (OP_ARRAY); } 1717130803Smarcel break; 1718130803Smarcel 1719130803Smarcel case 45: 1720130803Smarcel#line 430 "objc-exp.y" 1721130803Smarcel { write_exp_elt_opcode (UNOP_MEMVAL); 1722130803Smarcel write_exp_elt_type (yyvsp[-2].tval); 1723130803Smarcel write_exp_elt_opcode (UNOP_MEMVAL); } 1724130803Smarcel break; 1725130803Smarcel 1726130803Smarcel case 46: 1727130803Smarcel#line 436 "objc-exp.y" 1728130803Smarcel { write_exp_elt_opcode (UNOP_CAST); 1729130803Smarcel write_exp_elt_type (yyvsp[-2].tval); 1730130803Smarcel write_exp_elt_opcode (UNOP_CAST); } 1731130803Smarcel break; 1732130803Smarcel 1733130803Smarcel case 47: 1734130803Smarcel#line 442 "objc-exp.y" 1735130803Smarcel { } 1736130803Smarcel break; 1737130803Smarcel 1738130803Smarcel case 48: 1739130803Smarcel#line 448 "objc-exp.y" 1740130803Smarcel { write_exp_elt_opcode (BINOP_REPEAT); } 1741130803Smarcel break; 1742130803Smarcel 1743130803Smarcel case 49: 1744130803Smarcel#line 452 "objc-exp.y" 1745130803Smarcel { write_exp_elt_opcode (BINOP_MUL); } 1746130803Smarcel break; 1747130803Smarcel 1748130803Smarcel case 50: 1749130803Smarcel#line 456 "objc-exp.y" 1750130803Smarcel { write_exp_elt_opcode (BINOP_DIV); } 1751130803Smarcel break; 1752130803Smarcel 1753130803Smarcel case 51: 1754130803Smarcel#line 460 "objc-exp.y" 1755130803Smarcel { write_exp_elt_opcode (BINOP_REM); } 1756130803Smarcel break; 1757130803Smarcel 1758130803Smarcel case 52: 1759130803Smarcel#line 464 "objc-exp.y" 1760130803Smarcel { write_exp_elt_opcode (BINOP_ADD); } 1761130803Smarcel break; 1762130803Smarcel 1763130803Smarcel case 53: 1764130803Smarcel#line 468 "objc-exp.y" 1765130803Smarcel { write_exp_elt_opcode (BINOP_SUB); } 1766130803Smarcel break; 1767130803Smarcel 1768130803Smarcel case 54: 1769130803Smarcel#line 472 "objc-exp.y" 1770130803Smarcel { write_exp_elt_opcode (BINOP_LSH); } 1771130803Smarcel break; 1772130803Smarcel 1773130803Smarcel case 55: 1774130803Smarcel#line 476 "objc-exp.y" 1775130803Smarcel { write_exp_elt_opcode (BINOP_RSH); } 1776130803Smarcel break; 1777130803Smarcel 1778130803Smarcel case 56: 1779130803Smarcel#line 480 "objc-exp.y" 1780130803Smarcel { write_exp_elt_opcode (BINOP_EQUAL); } 1781130803Smarcel break; 1782130803Smarcel 1783130803Smarcel case 57: 1784130803Smarcel#line 484 "objc-exp.y" 1785130803Smarcel { write_exp_elt_opcode (BINOP_NOTEQUAL); } 1786130803Smarcel break; 1787130803Smarcel 1788130803Smarcel case 58: 1789130803Smarcel#line 488 "objc-exp.y" 1790130803Smarcel { write_exp_elt_opcode (BINOP_LEQ); } 1791130803Smarcel break; 1792130803Smarcel 1793130803Smarcel case 59: 1794130803Smarcel#line 492 "objc-exp.y" 1795130803Smarcel { write_exp_elt_opcode (BINOP_GEQ); } 1796130803Smarcel break; 1797130803Smarcel 1798130803Smarcel case 60: 1799130803Smarcel#line 496 "objc-exp.y" 1800130803Smarcel { write_exp_elt_opcode (BINOP_LESS); } 1801130803Smarcel break; 1802130803Smarcel 1803130803Smarcel case 61: 1804130803Smarcel#line 500 "objc-exp.y" 1805130803Smarcel { write_exp_elt_opcode (BINOP_GTR); } 1806130803Smarcel break; 1807130803Smarcel 1808130803Smarcel case 62: 1809130803Smarcel#line 504 "objc-exp.y" 1810130803Smarcel { write_exp_elt_opcode (BINOP_BITWISE_AND); } 1811130803Smarcel break; 1812130803Smarcel 1813130803Smarcel case 63: 1814130803Smarcel#line 508 "objc-exp.y" 1815130803Smarcel { write_exp_elt_opcode (BINOP_BITWISE_XOR); } 1816130803Smarcel break; 1817130803Smarcel 1818130803Smarcel case 64: 1819130803Smarcel#line 512 "objc-exp.y" 1820130803Smarcel { write_exp_elt_opcode (BINOP_BITWISE_IOR); } 1821130803Smarcel break; 1822130803Smarcel 1823130803Smarcel case 65: 1824130803Smarcel#line 516 "objc-exp.y" 1825130803Smarcel { write_exp_elt_opcode (BINOP_LOGICAL_AND); } 1826130803Smarcel break; 1827130803Smarcel 1828130803Smarcel case 66: 1829130803Smarcel#line 520 "objc-exp.y" 1830130803Smarcel { write_exp_elt_opcode (BINOP_LOGICAL_OR); } 1831130803Smarcel break; 1832130803Smarcel 1833130803Smarcel case 67: 1834130803Smarcel#line 524 "objc-exp.y" 1835130803Smarcel { write_exp_elt_opcode (TERNOP_COND); } 1836130803Smarcel break; 1837130803Smarcel 1838130803Smarcel case 68: 1839130803Smarcel#line 528 "objc-exp.y" 1840130803Smarcel { write_exp_elt_opcode (BINOP_ASSIGN); } 1841130803Smarcel break; 1842130803Smarcel 1843130803Smarcel case 69: 1844130803Smarcel#line 532 "objc-exp.y" 1845130803Smarcel { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); 1846130803Smarcel write_exp_elt_opcode (yyvsp[-1].opcode); 1847130803Smarcel write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); } 1848130803Smarcel break; 1849130803Smarcel 1850130803Smarcel case 70: 1851130803Smarcel#line 538 "objc-exp.y" 1852130803Smarcel { write_exp_elt_opcode (OP_LONG); 1853130803Smarcel write_exp_elt_type (yyvsp[0].typed_val_int.type); 1854130803Smarcel write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val)); 1855130803Smarcel write_exp_elt_opcode (OP_LONG); } 1856130803Smarcel break; 1857130803Smarcel 1858130803Smarcel case 71: 1859130803Smarcel#line 545 "objc-exp.y" 1860130803Smarcel { YYSTYPE val; 1861130803Smarcel parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val); 1862130803Smarcel write_exp_elt_opcode (OP_LONG); 1863130803Smarcel write_exp_elt_type (val.typed_val_int.type); 1864130803Smarcel write_exp_elt_longcst ((LONGEST)val.typed_val_int.val); 1865130803Smarcel write_exp_elt_opcode (OP_LONG); 1866130803Smarcel } 1867130803Smarcel break; 1868130803Smarcel 1869130803Smarcel case 72: 1870130803Smarcel#line 556 "objc-exp.y" 1871130803Smarcel { write_exp_elt_opcode (OP_DOUBLE); 1872130803Smarcel write_exp_elt_type (yyvsp[0].typed_val_float.type); 1873130803Smarcel write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval); 1874130803Smarcel write_exp_elt_opcode (OP_DOUBLE); } 1875130803Smarcel break; 1876130803Smarcel 1877130803Smarcel case 75: 1878130803Smarcel#line 570 "objc-exp.y" 1879130803Smarcel { 1880130803Smarcel write_exp_elt_opcode (OP_OBJC_SELECTOR); 1881130803Smarcel write_exp_string (yyvsp[0].sval); 1882130803Smarcel write_exp_elt_opcode (OP_OBJC_SELECTOR); } 1883130803Smarcel break; 1884130803Smarcel 1885130803Smarcel case 76: 1886130803Smarcel#line 577 "objc-exp.y" 1887130803Smarcel { write_exp_elt_opcode (OP_LONG); 1888130803Smarcel write_exp_elt_type (builtin_type_int); 1889130803Smarcel CHECK_TYPEDEF (yyvsp[-1].tval); 1890130803Smarcel write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval)); 1891130803Smarcel write_exp_elt_opcode (OP_LONG); } 1892130803Smarcel break; 1893130803Smarcel 1894130803Smarcel case 77: 1895130803Smarcel#line 585 "objc-exp.y" 1896130803Smarcel { /* C strings are converted into array 1897130803Smarcel constants with an explicit null byte 1898130803Smarcel added at the end. Thus the array upper 1899130803Smarcel bound is the string length. There is no 1900130803Smarcel such thing in C as a completely empty 1901130803Smarcel string. */ 1902130803Smarcel char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length; 1903130803Smarcel while (count-- > 0) 1904130803Smarcel { 1905130803Smarcel write_exp_elt_opcode (OP_LONG); 1906130803Smarcel write_exp_elt_type (builtin_type_char); 1907130803Smarcel write_exp_elt_longcst ((LONGEST)(*sp++)); 1908130803Smarcel write_exp_elt_opcode (OP_LONG); 1909130803Smarcel } 1910130803Smarcel write_exp_elt_opcode (OP_LONG); 1911130803Smarcel write_exp_elt_type (builtin_type_char); 1912130803Smarcel write_exp_elt_longcst ((LONGEST)'\0'); 1913130803Smarcel write_exp_elt_opcode (OP_LONG); 1914130803Smarcel write_exp_elt_opcode (OP_ARRAY); 1915130803Smarcel write_exp_elt_longcst ((LONGEST) 0); 1916130803Smarcel write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length)); 1917130803Smarcel write_exp_elt_opcode (OP_ARRAY); } 1918130803Smarcel break; 1919130803Smarcel 1920130803Smarcel case 78: 1921130803Smarcel#line 612 "objc-exp.y" 1922130803Smarcel { write_exp_elt_opcode (OP_OBJC_NSSTRING); 1923130803Smarcel write_exp_string (yyvsp[0].sval); 1924130803Smarcel write_exp_elt_opcode (OP_OBJC_NSSTRING); } 1925130803Smarcel break; 1926130803Smarcel 1927130803Smarcel case 79: 1928130803Smarcel#line 618 "objc-exp.y" 1929130803Smarcel { 1930130803Smarcel if (yyvsp[0].ssym.sym != 0) 1931130803Smarcel yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym); 1932130803Smarcel else 1933130803Smarcel { 1934130803Smarcel struct symtab *tem = 1935130803Smarcel lookup_symtab (copy_name (yyvsp[0].ssym.stoken)); 1936130803Smarcel if (tem) 1937130803Smarcel yyval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK); 1938130803Smarcel else 1939130803Smarcel error ("No file or function \"%s\".", 1940130803Smarcel copy_name (yyvsp[0].ssym.stoken)); 1941130803Smarcel } 1942130803Smarcel } 1943130803Smarcel break; 1944130803Smarcel 1945130803Smarcel case 80: 1946130803Smarcel#line 635 "objc-exp.y" 1947130803Smarcel { struct symbol *tem 1948130803Smarcel = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, 1949130803Smarcel VAR_DOMAIN, (int *) NULL, 1950130803Smarcel (struct symtab **) NULL); 1951130803Smarcel if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) 1952130803Smarcel error ("No function \"%s\" in specified context.", 1953130803Smarcel copy_name (yyvsp[0].sval)); 1954130803Smarcel yyval.bval = SYMBOL_BLOCK_VALUE (tem); } 1955130803Smarcel break; 1956130803Smarcel 1957130803Smarcel case 81: 1958130803Smarcel#line 646 "objc-exp.y" 1959130803Smarcel { struct symbol *sym; 1960130803Smarcel sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, 1961130803Smarcel VAR_DOMAIN, (int *) NULL, 1962130803Smarcel (struct symtab **) NULL); 1963130803Smarcel if (sym == 0) 1964130803Smarcel error ("No symbol \"%s\" in specified context.", 1965130803Smarcel copy_name (yyvsp[0].sval)); 1966130803Smarcel 1967130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 1968130803Smarcel /* block_found is set by lookup_symbol. */ 1969130803Smarcel write_exp_elt_block (block_found); 1970130803Smarcel write_exp_elt_sym (sym); 1971130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); } 1972130803Smarcel break; 1973130803Smarcel 1974130803Smarcel case 82: 1975130803Smarcel#line 662 "objc-exp.y" 1976130803Smarcel { 1977130803Smarcel struct type *type = yyvsp[-2].tval; 1978130803Smarcel if (TYPE_CODE (type) != TYPE_CODE_STRUCT 1979130803Smarcel && TYPE_CODE (type) != TYPE_CODE_UNION) 1980130803Smarcel error ("`%s' is not defined as an aggregate type.", 1981130803Smarcel TYPE_NAME (type)); 1982130803Smarcel 1983130803Smarcel write_exp_elt_opcode (OP_SCOPE); 1984130803Smarcel write_exp_elt_type (type); 1985130803Smarcel write_exp_string (yyvsp[0].sval); 1986130803Smarcel write_exp_elt_opcode (OP_SCOPE); 1987130803Smarcel } 1988130803Smarcel break; 1989130803Smarcel 1990130803Smarcel case 83: 1991130803Smarcel#line 675 "objc-exp.y" 1992130803Smarcel { 1993130803Smarcel struct type *type = yyvsp[-3].tval; 1994130803Smarcel struct stoken tmp_token; 1995130803Smarcel if (TYPE_CODE (type) != TYPE_CODE_STRUCT 1996130803Smarcel && TYPE_CODE (type) != TYPE_CODE_UNION) 1997130803Smarcel error ("`%s' is not defined as an aggregate type.", 1998130803Smarcel TYPE_NAME (type)); 1999130803Smarcel 2000130803Smarcel if (!DEPRECATED_STREQ (type_name_no_tag (type), yyvsp[0].sval.ptr)) 2001130803Smarcel error ("invalid destructor `%s::~%s'", 2002130803Smarcel type_name_no_tag (type), yyvsp[0].sval.ptr); 2003130803Smarcel 2004130803Smarcel tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2); 2005130803Smarcel tmp_token.length = yyvsp[0].sval.length + 1; 2006130803Smarcel tmp_token.ptr[0] = '~'; 2007130803Smarcel memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length); 2008130803Smarcel tmp_token.ptr[tmp_token.length] = 0; 2009130803Smarcel write_exp_elt_opcode (OP_SCOPE); 2010130803Smarcel write_exp_elt_type (type); 2011130803Smarcel write_exp_string (tmp_token); 2012130803Smarcel write_exp_elt_opcode (OP_SCOPE); 2013130803Smarcel } 2014130803Smarcel break; 2015130803Smarcel 2016130803Smarcel case 85: 2017130803Smarcel#line 701 "objc-exp.y" 2018130803Smarcel { 2019130803Smarcel char *name = copy_name (yyvsp[0].sval); 2020130803Smarcel struct symbol *sym; 2021130803Smarcel struct minimal_symbol *msymbol; 2022130803Smarcel 2023130803Smarcel sym = 2024130803Smarcel lookup_symbol (name, (const struct block *) NULL, 2025130803Smarcel VAR_DOMAIN, (int *) NULL, 2026130803Smarcel (struct symtab **) NULL); 2027130803Smarcel if (sym) 2028130803Smarcel { 2029130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 2030130803Smarcel write_exp_elt_block (NULL); 2031130803Smarcel write_exp_elt_sym (sym); 2032130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 2033130803Smarcel break; 2034130803Smarcel } 2035130803Smarcel 2036130803Smarcel msymbol = lookup_minimal_symbol (name, NULL, NULL); 2037130803Smarcel if (msymbol != NULL) 2038130803Smarcel { 2039130803Smarcel write_exp_msymbol (msymbol, 2040130803Smarcel lookup_function_type (builtin_type_int), 2041130803Smarcel builtin_type_int); 2042130803Smarcel } 2043130803Smarcel else 2044130803Smarcel if (!have_full_symbols () && !have_partial_symbols ()) 2045130803Smarcel error ("No symbol table is loaded. Use the \"file\" command."); 2046130803Smarcel else 2047130803Smarcel error ("No symbol \"%s\" in current context.", name); 2048130803Smarcel } 2049130803Smarcel break; 2050130803Smarcel 2051130803Smarcel case 86: 2052130803Smarcel#line 735 "objc-exp.y" 2053130803Smarcel { struct symbol *sym = yyvsp[0].ssym.sym; 2054130803Smarcel 2055130803Smarcel if (sym) 2056130803Smarcel { 2057130803Smarcel if (symbol_read_needs_frame (sym)) 2058130803Smarcel { 2059130803Smarcel if (innermost_block == 0 || 2060130803Smarcel contained_in (block_found, 2061130803Smarcel innermost_block)) 2062130803Smarcel innermost_block = block_found; 2063130803Smarcel } 2064130803Smarcel 2065130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 2066130803Smarcel /* We want to use the selected frame, not 2067130803Smarcel another more inner frame which happens to 2068130803Smarcel be in the same block. */ 2069130803Smarcel write_exp_elt_block (NULL); 2070130803Smarcel write_exp_elt_sym (sym); 2071130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 2072130803Smarcel } 2073130803Smarcel else if (yyvsp[0].ssym.is_a_field_of_this) 2074130803Smarcel { 2075130803Smarcel /* C++/ObjC: it hangs off of `this'/'self'. 2076130803Smarcel Must not inadvertently convert from a 2077130803Smarcel method call to data ref. */ 2078130803Smarcel if (innermost_block == 0 || 2079130803Smarcel contained_in (block_found, innermost_block)) 2080130803Smarcel innermost_block = block_found; 2081130803Smarcel write_exp_elt_opcode (OP_OBJC_SELF); 2082130803Smarcel write_exp_elt_opcode (OP_OBJC_SELF); 2083130803Smarcel write_exp_elt_opcode (STRUCTOP_PTR); 2084130803Smarcel write_exp_string (yyvsp[0].ssym.stoken); 2085130803Smarcel write_exp_elt_opcode (STRUCTOP_PTR); 2086130803Smarcel } 2087130803Smarcel else 2088130803Smarcel { 2089130803Smarcel struct minimal_symbol *msymbol; 2090130803Smarcel char *arg = copy_name (yyvsp[0].ssym.stoken); 2091130803Smarcel 2092130803Smarcel msymbol = 2093130803Smarcel lookup_minimal_symbol (arg, NULL, NULL); 2094130803Smarcel if (msymbol != NULL) 2095130803Smarcel { 2096130803Smarcel write_exp_msymbol (msymbol, 2097130803Smarcel lookup_function_type (builtin_type_int), 2098130803Smarcel builtin_type_int); 2099130803Smarcel } 2100130803Smarcel else if (!have_full_symbols () && 2101130803Smarcel !have_partial_symbols ()) 2102130803Smarcel error ("No symbol table is loaded. Use the \"file\" command."); 2103130803Smarcel else 2104130803Smarcel error ("No symbol \"%s\" in current context.", 2105130803Smarcel copy_name (yyvsp[0].ssym.stoken)); 2106130803Smarcel } 2107130803Smarcel } 2108130803Smarcel break; 2109130803Smarcel 2110130803Smarcel case 90: 2111130803Smarcel#line 802 "objc-exp.y" 2112130803Smarcel { yyval.tval = follow_types (yyvsp[-1].tval); } 2113130803Smarcel break; 2114130803Smarcel 2115130803Smarcel case 91: 2116130803Smarcel#line 804 "objc-exp.y" 2117130803Smarcel { yyval.tval = follow_types (yyvsp[-2].tval); } 2118130803Smarcel break; 2119130803Smarcel 2120130803Smarcel case 92: 2121130803Smarcel#line 806 "objc-exp.y" 2122130803Smarcel { yyval.tval = follow_types (yyvsp[-2].tval); } 2123130803Smarcel break; 2124130803Smarcel 2125130803Smarcel case 93: 2126130803Smarcel#line 810 "objc-exp.y" 2127130803Smarcel { push_type (tp_pointer); yyval.voidval = 0; } 2128130803Smarcel break; 2129130803Smarcel 2130130803Smarcel case 94: 2131130803Smarcel#line 812 "objc-exp.y" 2132130803Smarcel { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; } 2133130803Smarcel break; 2134130803Smarcel 2135130803Smarcel case 95: 2136130803Smarcel#line 814 "objc-exp.y" 2137130803Smarcel { push_type (tp_reference); yyval.voidval = 0; } 2138130803Smarcel break; 2139130803Smarcel 2140130803Smarcel case 96: 2141130803Smarcel#line 816 "objc-exp.y" 2142130803Smarcel { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; } 2143130803Smarcel break; 2144130803Smarcel 2145130803Smarcel case 98: 2146130803Smarcel#line 821 "objc-exp.y" 2147130803Smarcel { yyval.voidval = yyvsp[-1].voidval; } 2148130803Smarcel break; 2149130803Smarcel 2150130803Smarcel case 99: 2151130803Smarcel#line 823 "objc-exp.y" 2152130803Smarcel { 2153130803Smarcel push_type_int (yyvsp[0].lval); 2154130803Smarcel push_type (tp_array); 2155130803Smarcel } 2156130803Smarcel break; 2157130803Smarcel 2158130803Smarcel case 100: 2159130803Smarcel#line 828 "objc-exp.y" 2160130803Smarcel { 2161130803Smarcel push_type_int (yyvsp[0].lval); 2162130803Smarcel push_type (tp_array); 2163130803Smarcel yyval.voidval = 0; 2164130803Smarcel } 2165130803Smarcel break; 2166130803Smarcel 2167130803Smarcel case 101: 2168130803Smarcel#line 835 "objc-exp.y" 2169130803Smarcel { push_type (tp_function); } 2170130803Smarcel break; 2171130803Smarcel 2172130803Smarcel case 102: 2173130803Smarcel#line 837 "objc-exp.y" 2174130803Smarcel { push_type (tp_function); } 2175130803Smarcel break; 2176130803Smarcel 2177130803Smarcel case 103: 2178130803Smarcel#line 841 "objc-exp.y" 2179130803Smarcel { yyval.lval = -1; } 2180130803Smarcel break; 2181130803Smarcel 2182130803Smarcel case 104: 2183130803Smarcel#line 843 "objc-exp.y" 2184130803Smarcel { yyval.lval = yyvsp[-1].typed_val_int.val; } 2185130803Smarcel break; 2186130803Smarcel 2187130803Smarcel case 105: 2188130803Smarcel#line 847 "objc-exp.y" 2189130803Smarcel { yyval.voidval = 0; } 2190130803Smarcel break; 2191130803Smarcel 2192130803Smarcel case 106: 2193130803Smarcel#line 849 "objc-exp.y" 2194130803Smarcel { free (yyvsp[-1].tvec); yyval.voidval = 0; } 2195130803Smarcel break; 2196130803Smarcel 2197130803Smarcel case 108: 2198130803Smarcel#line 862 "objc-exp.y" 2199130803Smarcel { yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); } 2200130803Smarcel break; 2201130803Smarcel 2202130803Smarcel case 109: 2203130803Smarcel#line 867 "objc-exp.y" 2204130803Smarcel { yyval.tval = yyvsp[0].tsym.type; } 2205130803Smarcel break; 2206130803Smarcel 2207130803Smarcel case 110: 2208130803Smarcel#line 869 "objc-exp.y" 2209130803Smarcel { 2210130803Smarcel if (yyvsp[0].class.type == NULL) 2211130803Smarcel error ("No symbol \"%s\" in current context.", 2212130803Smarcel copy_name(yyvsp[0].class.stoken)); 2213130803Smarcel else 2214130803Smarcel yyval.tval = yyvsp[0].class.type; 2215130803Smarcel } 2216130803Smarcel break; 2217130803Smarcel 2218130803Smarcel case 111: 2219130803Smarcel#line 877 "objc-exp.y" 2220130803Smarcel { yyval.tval = builtin_type_int; } 2221130803Smarcel break; 2222130803Smarcel 2223130803Smarcel case 112: 2224130803Smarcel#line 879 "objc-exp.y" 2225130803Smarcel { yyval.tval = builtin_type_long; } 2226130803Smarcel break; 2227130803Smarcel 2228130803Smarcel case 113: 2229130803Smarcel#line 881 "objc-exp.y" 2230130803Smarcel { yyval.tval = builtin_type_short; } 2231130803Smarcel break; 2232130803Smarcel 2233130803Smarcel case 114: 2234130803Smarcel#line 883 "objc-exp.y" 2235130803Smarcel { yyval.tval = builtin_type_long; } 2236130803Smarcel break; 2237130803Smarcel 2238130803Smarcel case 115: 2239130803Smarcel#line 885 "objc-exp.y" 2240130803Smarcel { yyval.tval = builtin_type_unsigned_long; } 2241130803Smarcel break; 2242130803Smarcel 2243130803Smarcel case 116: 2244130803Smarcel#line 887 "objc-exp.y" 2245130803Smarcel { yyval.tval = builtin_type_long_long; } 2246130803Smarcel break; 2247130803Smarcel 2248130803Smarcel case 117: 2249130803Smarcel#line 889 "objc-exp.y" 2250130803Smarcel { yyval.tval = builtin_type_long_long; } 2251130803Smarcel break; 2252130803Smarcel 2253130803Smarcel case 118: 2254130803Smarcel#line 891 "objc-exp.y" 2255130803Smarcel { yyval.tval = builtin_type_unsigned_long_long; } 2256130803Smarcel break; 2257130803Smarcel 2258130803Smarcel case 119: 2259130803Smarcel#line 893 "objc-exp.y" 2260130803Smarcel { yyval.tval = builtin_type_unsigned_long_long; } 2261130803Smarcel break; 2262130803Smarcel 2263130803Smarcel case 120: 2264130803Smarcel#line 895 "objc-exp.y" 2265130803Smarcel { yyval.tval = builtin_type_short; } 2266130803Smarcel break; 2267130803Smarcel 2268130803Smarcel case 121: 2269130803Smarcel#line 897 "objc-exp.y" 2270130803Smarcel { yyval.tval = builtin_type_unsigned_short; } 2271130803Smarcel break; 2272130803Smarcel 2273130803Smarcel case 122: 2274130803Smarcel#line 899 "objc-exp.y" 2275130803Smarcel { yyval.tval = builtin_type_double; } 2276130803Smarcel break; 2277130803Smarcel 2278130803Smarcel case 123: 2279130803Smarcel#line 901 "objc-exp.y" 2280130803Smarcel { yyval.tval = builtin_type_long_double; } 2281130803Smarcel break; 2282130803Smarcel 2283130803Smarcel case 124: 2284130803Smarcel#line 903 "objc-exp.y" 2285130803Smarcel { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval), 2286130803Smarcel expression_context_block); } 2287130803Smarcel break; 2288130803Smarcel 2289130803Smarcel case 125: 2290130803Smarcel#line 906 "objc-exp.y" 2291130803Smarcel { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval), 2292130803Smarcel expression_context_block); } 2293130803Smarcel break; 2294130803Smarcel 2295130803Smarcel case 126: 2296130803Smarcel#line 909 "objc-exp.y" 2297130803Smarcel { yyval.tval = lookup_union (copy_name (yyvsp[0].sval), 2298130803Smarcel expression_context_block); } 2299130803Smarcel break; 2300130803Smarcel 2301130803Smarcel case 127: 2302130803Smarcel#line 912 "objc-exp.y" 2303130803Smarcel { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval), 2304130803Smarcel expression_context_block); } 2305130803Smarcel break; 2306130803Smarcel 2307130803Smarcel case 128: 2308130803Smarcel#line 915 "objc-exp.y" 2309130803Smarcel { yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); } 2310130803Smarcel break; 2311130803Smarcel 2312130803Smarcel case 129: 2313130803Smarcel#line 917 "objc-exp.y" 2314130803Smarcel { yyval.tval = builtin_type_unsigned_int; } 2315130803Smarcel break; 2316130803Smarcel 2317130803Smarcel case 130: 2318130803Smarcel#line 919 "objc-exp.y" 2319130803Smarcel { yyval.tval = lookup_signed_typename (TYPE_NAME(yyvsp[0].tsym.type)); } 2320130803Smarcel break; 2321130803Smarcel 2322130803Smarcel case 131: 2323130803Smarcel#line 921 "objc-exp.y" 2324130803Smarcel { yyval.tval = builtin_type_int; } 2325130803Smarcel break; 2326130803Smarcel 2327130803Smarcel case 132: 2328130803Smarcel#line 923 "objc-exp.y" 2329130803Smarcel { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval, 2330130803Smarcel expression_context_block); 2331130803Smarcel } 2332130803Smarcel break; 2333130803Smarcel 2334130803Smarcel case 133: 2335130803Smarcel#line 929 "objc-exp.y" 2336130803Smarcel { yyval.tval = yyvsp[0].tval; } 2337130803Smarcel break; 2338130803Smarcel 2339130803Smarcel case 134: 2340130803Smarcel#line 930 "objc-exp.y" 2341130803Smarcel { yyval.tval = yyvsp[0].tval; } 2342130803Smarcel break; 2343130803Smarcel 2344130803Smarcel case 136: 2345130803Smarcel#line 935 "objc-exp.y" 2346130803Smarcel { 2347130803Smarcel yyval.tsym.stoken.ptr = "int"; 2348130803Smarcel yyval.tsym.stoken.length = 3; 2349130803Smarcel yyval.tsym.type = builtin_type_int; 2350130803Smarcel } 2351130803Smarcel break; 2352130803Smarcel 2353130803Smarcel case 137: 2354130803Smarcel#line 941 "objc-exp.y" 2355130803Smarcel { 2356130803Smarcel yyval.tsym.stoken.ptr = "long"; 2357130803Smarcel yyval.tsym.stoken.length = 4; 2358130803Smarcel yyval.tsym.type = builtin_type_long; 2359130803Smarcel } 2360130803Smarcel break; 2361130803Smarcel 2362130803Smarcel case 138: 2363130803Smarcel#line 947 "objc-exp.y" 2364130803Smarcel { 2365130803Smarcel yyval.tsym.stoken.ptr = "short"; 2366130803Smarcel yyval.tsym.stoken.length = 5; 2367130803Smarcel yyval.tsym.type = builtin_type_short; 2368130803Smarcel } 2369130803Smarcel break; 2370130803Smarcel 2371130803Smarcel case 139: 2372130803Smarcel#line 956 "objc-exp.y" 2373130803Smarcel { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2); 2374130803Smarcel yyval.ivec[0] = 1; /* Number of types in vector. */ 2375130803Smarcel yyval.tvec[1] = yyvsp[0].tval; 2376130803Smarcel } 2377130803Smarcel break; 2378130803Smarcel 2379130803Smarcel case 140: 2380130803Smarcel#line 961 "objc-exp.y" 2381130803Smarcel { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1); 2382130803Smarcel yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len); 2383130803Smarcel yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval; 2384130803Smarcel } 2385130803Smarcel break; 2386130803Smarcel 2387130803Smarcel case 141: 2388130803Smarcel#line 967 "objc-exp.y" 2389130803Smarcel { yyval.sval = yyvsp[0].ssym.stoken; } 2390130803Smarcel break; 2391130803Smarcel 2392130803Smarcel case 142: 2393130803Smarcel#line 968 "objc-exp.y" 2394130803Smarcel { yyval.sval = yyvsp[0].ssym.stoken; } 2395130803Smarcel break; 2396130803Smarcel 2397130803Smarcel case 143: 2398130803Smarcel#line 969 "objc-exp.y" 2399130803Smarcel { yyval.sval = yyvsp[0].tsym.stoken; } 2400130803Smarcel break; 2401130803Smarcel 2402130803Smarcel case 144: 2403130803Smarcel#line 970 "objc-exp.y" 2404130803Smarcel { yyval.sval = yyvsp[0].class.stoken; } 2405130803Smarcel break; 2406130803Smarcel 2407130803Smarcel case 145: 2408130803Smarcel#line 971 "objc-exp.y" 2409130803Smarcel { yyval.sval = yyvsp[0].ssym.stoken; } 2410130803Smarcel break; 2411130803Smarcel 2412130803Smarcel 2413130803Smarcel } 2414130803Smarcel 2415130803Smarcel/* Line 991 of yacc.c. */ 2416130803Smarcel 2417130803Smarcel yyvsp -= yylen; 2418130803Smarcel yyssp -= yylen; 2419130803Smarcel 2420130803Smarcel 2421130803Smarcel YY_STACK_PRINT (yyss, yyssp); 2422130803Smarcel 2423130803Smarcel *++yyvsp = yyval; 2424130803Smarcel 2425130803Smarcel 2426130803Smarcel /* Now `shift' the result of the reduction. Determine what state 2427130803Smarcel that goes to, based on the state we popped back to and the rule 2428130803Smarcel number reduced by. */ 2429130803Smarcel 2430130803Smarcel yyn = yyr1[yyn]; 2431130803Smarcel 2432130803Smarcel yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 2433130803Smarcel if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 2434130803Smarcel yystate = yytable[yystate]; 2435130803Smarcel else 2436130803Smarcel yystate = yydefgoto[yyn - YYNTOKENS]; 2437130803Smarcel 2438130803Smarcel goto yynewstate; 2439130803Smarcel 2440130803Smarcel 2441130803Smarcel/*------------------------------------. 2442130803Smarcel| yyerrlab -- here on detecting error | 2443130803Smarcel`------------------------------------*/ 2444130803Smarcelyyerrlab: 2445130803Smarcel /* If not already recovering from an error, report this error. */ 2446130803Smarcel if (!yyerrstatus) 2447130803Smarcel { 2448130803Smarcel ++yynerrs; 2449130803Smarcel#if YYERROR_VERBOSE 2450130803Smarcel yyn = yypact[yystate]; 2451130803Smarcel 2452130803Smarcel if (YYPACT_NINF < yyn && yyn < YYLAST) 2453130803Smarcel { 2454130803Smarcel YYSIZE_T yysize = 0; 2455130803Smarcel int yytype = YYTRANSLATE (yychar); 2456130803Smarcel char *yymsg; 2457130803Smarcel int yyx, yycount; 2458130803Smarcel 2459130803Smarcel yycount = 0; 2460130803Smarcel /* Start YYX at -YYN if negative to avoid negative indexes in 2461130803Smarcel YYCHECK. */ 2462130803Smarcel for (yyx = yyn < 0 ? -yyn : 0; 2463130803Smarcel yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) 2464130803Smarcel if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 2465130803Smarcel yysize += yystrlen (yytname[yyx]) + 15, yycount++; 2466130803Smarcel yysize += yystrlen ("syntax error, unexpected ") + 1; 2467130803Smarcel yysize += yystrlen (yytname[yytype]); 2468130803Smarcel yymsg = (char *) YYSTACK_ALLOC (yysize); 2469130803Smarcel if (yymsg != 0) 2470130803Smarcel { 2471130803Smarcel char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); 2472130803Smarcel yyp = yystpcpy (yyp, yytname[yytype]); 2473130803Smarcel 2474130803Smarcel if (yycount < 5) 2475130803Smarcel { 2476130803Smarcel yycount = 0; 2477130803Smarcel for (yyx = yyn < 0 ? -yyn : 0; 2478130803Smarcel yyx < (int) (sizeof (yytname) / sizeof (char *)); 2479130803Smarcel yyx++) 2480130803Smarcel if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 2481130803Smarcel { 2482130803Smarcel const char *yyq = ! yycount ? ", expecting " : " or "; 2483130803Smarcel yyp = yystpcpy (yyp, yyq); 2484130803Smarcel yyp = yystpcpy (yyp, yytname[yyx]); 2485130803Smarcel yycount++; 2486130803Smarcel } 2487130803Smarcel } 2488130803Smarcel yyerror (yymsg); 2489130803Smarcel YYSTACK_FREE (yymsg); 2490130803Smarcel } 2491130803Smarcel else 2492130803Smarcel yyerror ("syntax error; also virtual memory exhausted"); 2493130803Smarcel } 2494130803Smarcel else 2495130803Smarcel#endif /* YYERROR_VERBOSE */ 2496130803Smarcel yyerror ("syntax error"); 2497130803Smarcel } 2498130803Smarcel 2499130803Smarcel 2500130803Smarcel 2501130803Smarcel if (yyerrstatus == 3) 2502130803Smarcel { 2503130803Smarcel /* If just tried and failed to reuse lookahead token after an 2504130803Smarcel error, discard it. */ 2505130803Smarcel 2506130803Smarcel /* Return failure if at end of input. */ 2507130803Smarcel if (yychar == YYEOF) 2508130803Smarcel { 2509130803Smarcel /* Pop the error token. */ 2510130803Smarcel YYPOPSTACK; 2511130803Smarcel /* Pop the rest of the stack. */ 2512130803Smarcel while (yyss < yyssp) 2513130803Smarcel { 2514130803Smarcel YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 2515130803Smarcel yydestruct (yystos[*yyssp], yyvsp); 2516130803Smarcel YYPOPSTACK; 2517130803Smarcel } 2518130803Smarcel YYABORT; 2519130803Smarcel } 2520130803Smarcel 2521130803Smarcel YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); 2522130803Smarcel yydestruct (yytoken, &yylval); 2523130803Smarcel yychar = YYEMPTY; 2524130803Smarcel 2525130803Smarcel } 2526130803Smarcel 2527130803Smarcel /* Else will try to reuse lookahead token after shifting the error 2528130803Smarcel token. */ 2529130803Smarcel goto yyerrlab2; 2530130803Smarcel 2531130803Smarcel 2532130803Smarcel/*----------------------------------------------------. 2533130803Smarcel| yyerrlab1 -- error raised explicitly by an action. | 2534130803Smarcel`----------------------------------------------------*/ 2535130803Smarcelyyerrlab1: 2536130803Smarcel 2537130803Smarcel /* Suppress GCC warning that yyerrlab1 is unused when no action 2538130803Smarcel invokes YYERROR. Doesn't work in C++ */ 2539130803Smarcel#ifndef __cplusplus 2540130803Smarcel#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) 2541130803Smarcel __attribute__ ((__unused__)) 2542130803Smarcel#endif 2543130803Smarcel#endif 2544130803Smarcel 2545130803Smarcel 2546130803Smarcel goto yyerrlab2; 2547130803Smarcel 2548130803Smarcel 2549130803Smarcel/*---------------------------------------------------------------. 2550130803Smarcel| yyerrlab2 -- pop states until the error token can be shifted. | 2551130803Smarcel`---------------------------------------------------------------*/ 2552130803Smarcelyyerrlab2: 2553130803Smarcel yyerrstatus = 3; /* Each real token shifted decrements this. */ 2554130803Smarcel 2555130803Smarcel for (;;) 2556130803Smarcel { 2557130803Smarcel yyn = yypact[yystate]; 2558130803Smarcel if (yyn != YYPACT_NINF) 2559130803Smarcel { 2560130803Smarcel yyn += YYTERROR; 2561130803Smarcel if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2562130803Smarcel { 2563130803Smarcel yyn = yytable[yyn]; 2564130803Smarcel if (0 < yyn) 2565130803Smarcel break; 2566130803Smarcel } 2567130803Smarcel } 2568130803Smarcel 2569130803Smarcel /* Pop the current state because it cannot handle the error token. */ 2570130803Smarcel if (yyssp == yyss) 2571130803Smarcel YYABORT; 2572130803Smarcel 2573130803Smarcel YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 2574130803Smarcel yydestruct (yystos[yystate], yyvsp); 2575130803Smarcel yyvsp--; 2576130803Smarcel yystate = *--yyssp; 2577130803Smarcel 2578130803Smarcel YY_STACK_PRINT (yyss, yyssp); 2579130803Smarcel } 2580130803Smarcel 2581130803Smarcel if (yyn == YYFINAL) 2582130803Smarcel YYACCEPT; 2583130803Smarcel 2584130803Smarcel YYDPRINTF ((stderr, "Shifting error token, ")); 2585130803Smarcel 2586130803Smarcel *++yyvsp = yylval; 2587130803Smarcel 2588130803Smarcel 2589130803Smarcel yystate = yyn; 2590130803Smarcel goto yynewstate; 2591130803Smarcel 2592130803Smarcel 2593130803Smarcel/*-------------------------------------. 2594130803Smarcel| yyacceptlab -- YYACCEPT comes here. | 2595130803Smarcel`-------------------------------------*/ 2596130803Smarcelyyacceptlab: 2597130803Smarcel yyresult = 0; 2598130803Smarcel goto yyreturn; 2599130803Smarcel 2600130803Smarcel/*-----------------------------------. 2601130803Smarcel| yyabortlab -- YYABORT comes here. | 2602130803Smarcel`-----------------------------------*/ 2603130803Smarcelyyabortlab: 2604130803Smarcel yyresult = 1; 2605130803Smarcel goto yyreturn; 2606130803Smarcel 2607130803Smarcel#ifndef yyoverflow 2608130803Smarcel/*----------------------------------------------. 2609130803Smarcel| yyoverflowlab -- parser overflow comes here. | 2610130803Smarcel`----------------------------------------------*/ 2611130803Smarcelyyoverflowlab: 2612130803Smarcel yyerror ("parser stack overflow"); 2613130803Smarcel yyresult = 2; 2614130803Smarcel /* Fall through. */ 2615130803Smarcel#endif 2616130803Smarcel 2617130803Smarcelyyreturn: 2618130803Smarcel#ifndef yyoverflow 2619130803Smarcel if (yyss != yyssa) 2620130803Smarcel YYSTACK_FREE (yyss); 2621130803Smarcel#endif 2622130803Smarcel return yyresult; 2623130803Smarcel} 2624130803Smarcel 2625130803Smarcel 2626130803Smarcel#line 985 "objc-exp.y" 2627130803Smarcel 2628130803Smarcel 2629130803Smarcel/* Take care of parsing a number (anything that starts with a digit). 2630130803Smarcel Set yylval and return the token type; update lexptr. LEN is the 2631130803Smarcel number of characters in it. */ 2632130803Smarcel 2633130803Smarcel/*** Needs some error checking for the float case. ***/ 2634130803Smarcel 2635130803Smarcelstatic int 2636130803Smarcelparse_number (p, len, parsed_float, putithere) 2637130803Smarcel char *p; 2638130803Smarcel int len; 2639130803Smarcel int parsed_float; 2640130803Smarcel YYSTYPE *putithere; 2641130803Smarcel{ 2642130803Smarcel /* FIXME: Shouldn't these be unsigned? We don't deal with negative 2643130803Smarcel values here, and we do kind of silly things like cast to 2644130803Smarcel unsigned. */ 2645130803Smarcel LONGEST n = 0; 2646130803Smarcel LONGEST prevn = 0; 2647130803Smarcel unsigned LONGEST un; 2648130803Smarcel 2649130803Smarcel int i = 0; 2650130803Smarcel int c; 2651130803Smarcel int base = input_radix; 2652130803Smarcel int unsigned_p = 0; 2653130803Smarcel 2654130803Smarcel /* Number of "L" suffixes encountered. */ 2655130803Smarcel int long_p = 0; 2656130803Smarcel 2657130803Smarcel /* We have found a "L" or "U" suffix. */ 2658130803Smarcel int found_suffix = 0; 2659130803Smarcel 2660130803Smarcel unsigned LONGEST high_bit; 2661130803Smarcel struct type *signed_type; 2662130803Smarcel struct type *unsigned_type; 2663130803Smarcel 2664130803Smarcel if (parsed_float) 2665130803Smarcel { 2666130803Smarcel char c; 2667130803Smarcel 2668130803Smarcel /* It's a float since it contains a point or an exponent. */ 2669130803Smarcel 2670130803Smarcel if (sizeof (putithere->typed_val_float.dval) <= sizeof (float)) 2671130803Smarcel sscanf (p, "%g", (float *)&putithere->typed_val_float.dval); 2672130803Smarcel else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double)) 2673130803Smarcel sscanf (p, "%lg", (double *)&putithere->typed_val_float.dval); 2674130803Smarcel else 2675130803Smarcel { 2676130803Smarcel#ifdef PRINTF_HAS_LONG_DOUBLE 2677130803Smarcel sscanf (p, "%Lg", &putithere->typed_val_float.dval); 2678130803Smarcel#else 2679130803Smarcel /* Scan it into a double, then assign it to the long double. 2680130803Smarcel This at least wins with values representable in the range 2681130803Smarcel of doubles. */ 2682130803Smarcel double temp; 2683130803Smarcel sscanf (p, "%lg", &temp); 2684130803Smarcel putithere->typed_val_float.dval = temp; 2685130803Smarcel#endif 2686130803Smarcel } 2687130803Smarcel 2688130803Smarcel /* See if it has `f' or `l' suffix (float or long double). */ 2689130803Smarcel 2690130803Smarcel c = tolower (p[len - 1]); 2691130803Smarcel 2692130803Smarcel if (c == 'f') 2693130803Smarcel putithere->typed_val_float.type = builtin_type_float; 2694130803Smarcel else if (c == 'l') 2695130803Smarcel putithere->typed_val_float.type = builtin_type_long_double; 2696130803Smarcel else if (isdigit (c) || c == '.') 2697130803Smarcel putithere->typed_val_float.type = builtin_type_double; 2698130803Smarcel else 2699130803Smarcel return ERROR; 2700130803Smarcel 2701130803Smarcel return FLOAT; 2702130803Smarcel } 2703130803Smarcel 2704130803Smarcel /* Handle base-switching prefixes 0x, 0t, 0d, and 0. */ 2705130803Smarcel if (p[0] == '0') 2706130803Smarcel switch (p[1]) 2707130803Smarcel { 2708130803Smarcel case 'x': 2709130803Smarcel case 'X': 2710130803Smarcel if (len >= 3) 2711130803Smarcel { 2712130803Smarcel p += 2; 2713130803Smarcel base = 16; 2714130803Smarcel len -= 2; 2715130803Smarcel } 2716130803Smarcel break; 2717130803Smarcel 2718130803Smarcel case 't': 2719130803Smarcel case 'T': 2720130803Smarcel case 'd': 2721130803Smarcel case 'D': 2722130803Smarcel if (len >= 3) 2723130803Smarcel { 2724130803Smarcel p += 2; 2725130803Smarcel base = 10; 2726130803Smarcel len -= 2; 2727130803Smarcel } 2728130803Smarcel break; 2729130803Smarcel 2730130803Smarcel default: 2731130803Smarcel base = 8; 2732130803Smarcel break; 2733130803Smarcel } 2734130803Smarcel 2735130803Smarcel while (len-- > 0) 2736130803Smarcel { 2737130803Smarcel c = *p++; 2738130803Smarcel if (c >= 'A' && c <= 'Z') 2739130803Smarcel c += 'a' - 'A'; 2740130803Smarcel if (c != 'l' && c != 'u') 2741130803Smarcel n *= base; 2742130803Smarcel if (c >= '0' && c <= '9') 2743130803Smarcel { 2744130803Smarcel if (found_suffix) 2745130803Smarcel return ERROR; 2746130803Smarcel n += i = c - '0'; 2747130803Smarcel } 2748130803Smarcel else 2749130803Smarcel { 2750130803Smarcel if (base > 10 && c >= 'a' && c <= 'f') 2751130803Smarcel { 2752130803Smarcel if (found_suffix) 2753130803Smarcel return ERROR; 2754130803Smarcel n += i = c - 'a' + 10; 2755130803Smarcel } 2756130803Smarcel else if (c == 'l') 2757130803Smarcel { 2758130803Smarcel ++long_p; 2759130803Smarcel found_suffix = 1; 2760130803Smarcel } 2761130803Smarcel else if (c == 'u') 2762130803Smarcel { 2763130803Smarcel unsigned_p = 1; 2764130803Smarcel found_suffix = 1; 2765130803Smarcel } 2766130803Smarcel else 2767130803Smarcel return ERROR; /* Char not a digit. */ 2768130803Smarcel } 2769130803Smarcel if (i >= base) 2770130803Smarcel return ERROR; /* Invalid digit in this base. */ 2771130803Smarcel 2772130803Smarcel /* Portably test for overflow (only works for nonzero values, so 2773130803Smarcel make a second check for zero). FIXME: Can't we just make n 2774130803Smarcel and prevn unsigned and avoid this? */ 2775130803Smarcel if (c != 'l' && c != 'u' && (prevn >= n) && n != 0) 2776130803Smarcel unsigned_p = 1; /* Try something unsigned. */ 2777130803Smarcel 2778130803Smarcel /* Portably test for unsigned overflow. 2779130803Smarcel FIXME: This check is wrong; for example it doesn't find 2780130803Smarcel overflow on 0x123456789 when LONGEST is 32 bits. */ 2781130803Smarcel if (c != 'l' && c != 'u' && n != 0) 2782130803Smarcel { 2783130803Smarcel if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n)) 2784130803Smarcel error ("Numeric constant too large."); 2785130803Smarcel } 2786130803Smarcel prevn = n; 2787130803Smarcel } 2788130803Smarcel 2789130803Smarcel /* An integer constant is an int, a long, or a long long. An L 2790130803Smarcel suffix forces it to be long; an LL suffix forces it to be long 2791130803Smarcel long. If not forced to a larger size, it gets the first type of 2792130803Smarcel the above that it fits in. To figure out whether it fits, we 2793130803Smarcel shift it right and see whether anything remains. Note that we 2794130803Smarcel can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one 2795130803Smarcel operation, because many compilers will warn about such a shift 2796130803Smarcel (which always produces a zero result). Sometimes TARGET_INT_BIT 2797130803Smarcel or TARGET_LONG_BIT will be that big, sometimes not. To deal with 2798130803Smarcel the case where it is we just always shift the value more than 2799130803Smarcel once, with fewer bits each time. */ 2800130803Smarcel 2801130803Smarcel un = (unsigned LONGEST)n >> 2; 2802130803Smarcel if (long_p == 0 2803130803Smarcel && (un >> (TARGET_INT_BIT - 2)) == 0) 2804130803Smarcel { 2805130803Smarcel high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1); 2806130803Smarcel 2807130803Smarcel /* A large decimal (not hex or octal) constant (between INT_MAX 2808130803Smarcel and UINT_MAX) is a long or unsigned long, according to ANSI, 2809130803Smarcel never an unsigned int, but this code treats it as unsigned 2810130803Smarcel int. This probably should be fixed. GCC gives a warning on 2811130803Smarcel such constants. */ 2812130803Smarcel 2813130803Smarcel unsigned_type = builtin_type_unsigned_int; 2814130803Smarcel signed_type = builtin_type_int; 2815130803Smarcel } 2816130803Smarcel else if (long_p <= 1 2817130803Smarcel && (un >> (TARGET_LONG_BIT - 2)) == 0) 2818130803Smarcel { 2819130803Smarcel high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1); 2820130803Smarcel unsigned_type = builtin_type_unsigned_long; 2821130803Smarcel signed_type = builtin_type_long; 2822130803Smarcel } 2823130803Smarcel else 2824130803Smarcel { 2825130803Smarcel high_bit = (((unsigned LONGEST)1) 2826130803Smarcel << (TARGET_LONG_LONG_BIT - 32 - 1) 2827130803Smarcel << 16 2828130803Smarcel << 16); 2829130803Smarcel if (high_bit == 0) 2830130803Smarcel /* A long long does not fit in a LONGEST. */ 2831130803Smarcel high_bit = 2832130803Smarcel (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1); 2833130803Smarcel unsigned_type = builtin_type_unsigned_long_long; 2834130803Smarcel signed_type = builtin_type_long_long; 2835130803Smarcel } 2836130803Smarcel 2837130803Smarcel putithere->typed_val_int.val = n; 2838130803Smarcel 2839130803Smarcel /* If the high bit of the worked out type is set then this number 2840130803Smarcel has to be unsigned. */ 2841130803Smarcel 2842130803Smarcel if (unsigned_p || (n & high_bit)) 2843130803Smarcel { 2844130803Smarcel putithere->typed_val_int.type = unsigned_type; 2845130803Smarcel } 2846130803Smarcel else 2847130803Smarcel { 2848130803Smarcel putithere->typed_val_int.type = signed_type; 2849130803Smarcel } 2850130803Smarcel 2851130803Smarcel return INT; 2852130803Smarcel} 2853130803Smarcel 2854130803Smarcelstruct token 2855130803Smarcel{ 2856130803Smarcel char *operator; 2857130803Smarcel int token; 2858130803Smarcel enum exp_opcode opcode; 2859130803Smarcel}; 2860130803Smarcel 2861130803Smarcelstatic const struct token tokentab3[] = 2862130803Smarcel { 2863130803Smarcel {">>=", ASSIGN_MODIFY, BINOP_RSH}, 2864130803Smarcel {"<<=", ASSIGN_MODIFY, BINOP_LSH} 2865130803Smarcel }; 2866130803Smarcel 2867130803Smarcelstatic const struct token tokentab2[] = 2868130803Smarcel { 2869130803Smarcel {"+=", ASSIGN_MODIFY, BINOP_ADD}, 2870130803Smarcel {"-=", ASSIGN_MODIFY, BINOP_SUB}, 2871130803Smarcel {"*=", ASSIGN_MODIFY, BINOP_MUL}, 2872130803Smarcel {"/=", ASSIGN_MODIFY, BINOP_DIV}, 2873130803Smarcel {"%=", ASSIGN_MODIFY, BINOP_REM}, 2874130803Smarcel {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR}, 2875130803Smarcel {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND}, 2876130803Smarcel {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR}, 2877130803Smarcel {"++", INCREMENT, BINOP_END}, 2878130803Smarcel {"--", DECREMENT, BINOP_END}, 2879130803Smarcel {"->", ARROW, BINOP_END}, 2880130803Smarcel {"&&", ANDAND, BINOP_END}, 2881130803Smarcel {"||", OROR, BINOP_END}, 2882130803Smarcel {"::", COLONCOLON, BINOP_END}, 2883130803Smarcel {"<<", LSH, BINOP_END}, 2884130803Smarcel {">>", RSH, BINOP_END}, 2885130803Smarcel {"==", EQUAL, BINOP_END}, 2886130803Smarcel {"!=", NOTEQUAL, BINOP_END}, 2887130803Smarcel {"<=", LEQ, BINOP_END}, 2888130803Smarcel {">=", GEQ, BINOP_END} 2889130803Smarcel }; 2890130803Smarcel 2891130803Smarcel/* Read one token, getting characters through lexptr. */ 2892130803Smarcel 2893130803Smarcelstatic int 2894130803Smarcelyylex () 2895130803Smarcel{ 2896130803Smarcel int c, tokchr; 2897130803Smarcel int namelen; 2898130803Smarcel unsigned int i; 2899130803Smarcel char *tokstart; 2900130803Smarcel char *tokptr; 2901130803Smarcel int tempbufindex; 2902130803Smarcel static char *tempbuf; 2903130803Smarcel static int tempbufsize; 2904130803Smarcel 2905130803Smarcel retry: 2906130803Smarcel 2907130803Smarcel tokstart = lexptr; 2908130803Smarcel /* See if it is a special token of length 3. */ 2909130803Smarcel for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++) 2910130803Smarcel if (DEPRECATED_STREQN (tokstart, tokentab3[i].operator, 3)) 2911130803Smarcel { 2912130803Smarcel lexptr += 3; 2913130803Smarcel yylval.opcode = tokentab3[i].opcode; 2914130803Smarcel return tokentab3[i].token; 2915130803Smarcel } 2916130803Smarcel 2917130803Smarcel /* See if it is a special token of length 2. */ 2918130803Smarcel for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++) 2919130803Smarcel if (DEPRECATED_STREQN (tokstart, tokentab2[i].operator, 2)) 2920130803Smarcel { 2921130803Smarcel lexptr += 2; 2922130803Smarcel yylval.opcode = tokentab2[i].opcode; 2923130803Smarcel return tokentab2[i].token; 2924130803Smarcel } 2925130803Smarcel 2926130803Smarcel c = 0; 2927130803Smarcel switch (tokchr = *tokstart) 2928130803Smarcel { 2929130803Smarcel case 0: 2930130803Smarcel return 0; 2931130803Smarcel 2932130803Smarcel case ' ': 2933130803Smarcel case '\t': 2934130803Smarcel case '\n': 2935130803Smarcel lexptr++; 2936130803Smarcel goto retry; 2937130803Smarcel 2938130803Smarcel case '\'': 2939130803Smarcel /* We either have a character constant ('0' or '\177' for 2940130803Smarcel example) or we have a quoted symbol reference ('foo(int,int)' 2941130803Smarcel in C++ for example). */ 2942130803Smarcel lexptr++; 2943130803Smarcel c = *lexptr++; 2944130803Smarcel if (c == '\\') 2945130803Smarcel c = parse_escape (&lexptr); 2946130803Smarcel else if (c == '\'') 2947130803Smarcel error ("Empty character constant."); 2948130803Smarcel 2949130803Smarcel yylval.typed_val_int.val = c; 2950130803Smarcel yylval.typed_val_int.type = builtin_type_char; 2951130803Smarcel 2952130803Smarcel c = *lexptr++; 2953130803Smarcel if (c != '\'') 2954130803Smarcel { 2955130803Smarcel namelen = skip_quoted (tokstart) - tokstart; 2956130803Smarcel if (namelen > 2) 2957130803Smarcel { 2958130803Smarcel lexptr = tokstart + namelen; 2959130803Smarcel if (lexptr[-1] != '\'') 2960130803Smarcel error ("Unmatched single quote."); 2961130803Smarcel namelen -= 2; 2962130803Smarcel tokstart++; 2963130803Smarcel goto tryname; 2964130803Smarcel } 2965130803Smarcel error ("Invalid character constant."); 2966130803Smarcel } 2967130803Smarcel return INT; 2968130803Smarcel 2969130803Smarcel case '(': 2970130803Smarcel paren_depth++; 2971130803Smarcel lexptr++; 2972130803Smarcel return '('; 2973130803Smarcel 2974130803Smarcel case ')': 2975130803Smarcel if (paren_depth == 0) 2976130803Smarcel return 0; 2977130803Smarcel paren_depth--; 2978130803Smarcel lexptr++; 2979130803Smarcel return ')'; 2980130803Smarcel 2981130803Smarcel case ',': 2982130803Smarcel if (comma_terminates && paren_depth == 0) 2983130803Smarcel return 0; 2984130803Smarcel lexptr++; 2985130803Smarcel return ','; 2986130803Smarcel 2987130803Smarcel case '.': 2988130803Smarcel /* Might be a floating point number. */ 2989130803Smarcel if (lexptr[1] < '0' || lexptr[1] > '9') 2990130803Smarcel goto symbol; /* Nope, must be a symbol. */ 2991130803Smarcel /* FALL THRU into number case. */ 2992130803Smarcel 2993130803Smarcel case '0': 2994130803Smarcel case '1': 2995130803Smarcel case '2': 2996130803Smarcel case '3': 2997130803Smarcel case '4': 2998130803Smarcel case '5': 2999130803Smarcel case '6': 3000130803Smarcel case '7': 3001130803Smarcel case '8': 3002130803Smarcel case '9': 3003130803Smarcel { 3004130803Smarcel /* It's a number. */ 3005130803Smarcel int got_dot = 0, got_e = 0, toktype = FLOAT; 3006130803Smarcel /* Initialize toktype to anything other than ERROR. */ 3007130803Smarcel char *p = tokstart; 3008130803Smarcel int hex = input_radix > 10; 3009130803Smarcel int local_radix = input_radix; 3010130803Smarcel if (tokchr == '0' && (p[1] == 'x' || p[1] == 'X')) 3011130803Smarcel { 3012130803Smarcel p += 2; 3013130803Smarcel hex = 1; 3014130803Smarcel local_radix = 16; 3015130803Smarcel } 3016130803Smarcel else if (tokchr == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D')) 3017130803Smarcel { 3018130803Smarcel p += 2; 3019130803Smarcel hex = 0; 3020130803Smarcel local_radix = 10; 3021130803Smarcel } 3022130803Smarcel 3023130803Smarcel for (;; ++p) 3024130803Smarcel { 3025130803Smarcel /* This test includes !hex because 'e' is a valid hex digit 3026130803Smarcel and thus does not indicate a floating point number when 3027130803Smarcel the radix is hex. */ 3028130803Smarcel 3029130803Smarcel if (!hex && (*p == 'e' || *p == 'E')) 3030130803Smarcel if (got_e) 3031130803Smarcel toktype = ERROR; /* Only one 'e' in a float. */ 3032130803Smarcel else 3033130803Smarcel got_e = 1; 3034130803Smarcel /* This test does not include !hex, because a '.' always 3035130803Smarcel indicates a decimal floating point number regardless of 3036130803Smarcel the radix. */ 3037130803Smarcel else if (*p == '.') 3038130803Smarcel if (got_dot) 3039130803Smarcel toktype = ERROR; /* Only one '.' in a float. */ 3040130803Smarcel else 3041130803Smarcel got_dot = 1; 3042130803Smarcel else if (got_e && (p[-1] == 'e' || p[-1] == 'E') && 3043130803Smarcel (*p == '-' || *p == '+')) 3044130803Smarcel /* This is the sign of the exponent, not the end of the 3045130803Smarcel number. */ 3046130803Smarcel continue; 3047130803Smarcel /* Always take decimal digits; parse_number handles radix 3048130803Smarcel error. */ 3049130803Smarcel else if (*p >= '0' && *p <= '9') 3050130803Smarcel continue; 3051130803Smarcel /* We will take letters only if hex is true, and only up 3052130803Smarcel to what the input radix would permit. FSF was content 3053130803Smarcel to rely on parse_number to validate; but it leaks. */ 3054130803Smarcel else if (*p >= 'a' && *p <= 'z') 3055130803Smarcel { 3056130803Smarcel if (!hex || *p >= ('a' + local_radix - 10)) 3057130803Smarcel toktype = ERROR; 3058130803Smarcel } 3059130803Smarcel else if (*p >= 'A' && *p <= 'Z') 3060130803Smarcel { 3061130803Smarcel if (!hex || *p >= ('A' + local_radix - 10)) 3062130803Smarcel toktype = ERROR; 3063130803Smarcel } 3064130803Smarcel else break; 3065130803Smarcel } 3066130803Smarcel if (toktype != ERROR) 3067130803Smarcel toktype = parse_number (tokstart, p - tokstart, 3068130803Smarcel got_dot | got_e, &yylval); 3069130803Smarcel if (toktype == ERROR) 3070130803Smarcel { 3071130803Smarcel char *err_copy = (char *) alloca (p - tokstart + 1); 3072130803Smarcel 3073130803Smarcel memcpy (err_copy, tokstart, p - tokstart); 3074130803Smarcel err_copy[p - tokstart] = 0; 3075130803Smarcel error ("Invalid number \"%s\".", err_copy); 3076130803Smarcel } 3077130803Smarcel lexptr = p; 3078130803Smarcel return toktype; 3079130803Smarcel } 3080130803Smarcel 3081130803Smarcel case '+': 3082130803Smarcel case '-': 3083130803Smarcel case '*': 3084130803Smarcel case '/': 3085130803Smarcel case '%': 3086130803Smarcel case '|': 3087130803Smarcel case '&': 3088130803Smarcel case '^': 3089130803Smarcel case '~': 3090130803Smarcel case '!': 3091130803Smarcel#if 0 3092130803Smarcel case '@': /* Moved out below. */ 3093130803Smarcel#endif 3094130803Smarcel case '<': 3095130803Smarcel case '>': 3096130803Smarcel case '[': 3097130803Smarcel case ']': 3098130803Smarcel case '?': 3099130803Smarcel case ':': 3100130803Smarcel case '=': 3101130803Smarcel case '{': 3102130803Smarcel case '}': 3103130803Smarcel symbol: 3104130803Smarcel lexptr++; 3105130803Smarcel return tokchr; 3106130803Smarcel 3107130803Smarcel case '@': 3108130803Smarcel if (strncmp(tokstart, "@selector", 9) == 0) 3109130803Smarcel { 3110130803Smarcel tokptr = strchr(tokstart, '('); 3111130803Smarcel if (tokptr == NULL) 3112130803Smarcel { 3113130803Smarcel error ("Missing '(' in @selector(...)"); 3114130803Smarcel } 3115130803Smarcel tempbufindex = 0; 3116130803Smarcel tokptr++; /* Skip the '('. */ 3117130803Smarcel do { 3118130803Smarcel /* Grow the static temp buffer if necessary, including 3119130803Smarcel allocating the first one on demand. */ 3120130803Smarcel if (tempbufindex + 1 >= tempbufsize) 3121130803Smarcel { 3122130803Smarcel tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64); 3123130803Smarcel } 3124130803Smarcel tempbuf[tempbufindex++] = *tokptr++; 3125130803Smarcel } while ((*tokptr != ')') && (*tokptr != '\0')); 3126130803Smarcel if (*tokptr++ != ')') 3127130803Smarcel { 3128130803Smarcel error ("Missing ')' in @selector(...)"); 3129130803Smarcel } 3130130803Smarcel tempbuf[tempbufindex] = '\0'; 3131130803Smarcel yylval.sval.ptr = tempbuf; 3132130803Smarcel yylval.sval.length = tempbufindex; 3133130803Smarcel lexptr = tokptr; 3134130803Smarcel return SELECTOR; 3135130803Smarcel } 3136130803Smarcel if (tokstart[1] != '"') 3137130803Smarcel { 3138130803Smarcel lexptr++; 3139130803Smarcel return tokchr; 3140130803Smarcel } 3141130803Smarcel /* ObjC NextStep NSString constant: fall thru and parse like 3142130803Smarcel STRING. */ 3143130803Smarcel tokstart++; 3144130803Smarcel 3145130803Smarcel case '"': 3146130803Smarcel 3147130803Smarcel /* Build the gdb internal form of the input string in tempbuf, 3148130803Smarcel translating any standard C escape forms seen. Note that the 3149130803Smarcel buffer is null byte terminated *only* for the convenience of 3150130803Smarcel debugging gdb itself and printing the buffer contents when 3151130803Smarcel the buffer contains no embedded nulls. Gdb does not depend 3152130803Smarcel upon the buffer being null byte terminated, it uses the 3153130803Smarcel length string instead. This allows gdb to handle C strings 3154130803Smarcel (as well as strings in other languages) with embedded null 3155130803Smarcel bytes. */ 3156130803Smarcel 3157130803Smarcel tokptr = ++tokstart; 3158130803Smarcel tempbufindex = 0; 3159130803Smarcel 3160130803Smarcel do { 3161130803Smarcel /* Grow the static temp buffer if necessary, including 3162130803Smarcel allocating the first one on demand. */ 3163130803Smarcel if (tempbufindex + 1 >= tempbufsize) 3164130803Smarcel { 3165130803Smarcel tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64); 3166130803Smarcel } 3167130803Smarcel switch (*tokptr) 3168130803Smarcel { 3169130803Smarcel case '\0': 3170130803Smarcel case '"': 3171130803Smarcel /* Do nothing, loop will terminate. */ 3172130803Smarcel break; 3173130803Smarcel case '\\': 3174130803Smarcel tokptr++; 3175130803Smarcel c = parse_escape (&tokptr); 3176130803Smarcel if (c == -1) 3177130803Smarcel { 3178130803Smarcel continue; 3179130803Smarcel } 3180130803Smarcel tempbuf[tempbufindex++] = c; 3181130803Smarcel break; 3182130803Smarcel default: 3183130803Smarcel tempbuf[tempbufindex++] = *tokptr++; 3184130803Smarcel break; 3185130803Smarcel } 3186130803Smarcel } while ((*tokptr != '"') && (*tokptr != '\0')); 3187130803Smarcel if (*tokptr++ != '"') 3188130803Smarcel { 3189130803Smarcel error ("Unterminated string in expression."); 3190130803Smarcel } 3191130803Smarcel tempbuf[tempbufindex] = '\0'; /* See note above. */ 3192130803Smarcel yylval.sval.ptr = tempbuf; 3193130803Smarcel yylval.sval.length = tempbufindex; 3194130803Smarcel lexptr = tokptr; 3195130803Smarcel return (tokchr == '@' ? NSSTRING : STRING); 3196130803Smarcel } 3197130803Smarcel 3198130803Smarcel if (!(tokchr == '_' || tokchr == '$' || 3199130803Smarcel (tokchr >= 'a' && tokchr <= 'z') || (tokchr >= 'A' && tokchr <= 'Z'))) 3200130803Smarcel /* We must have come across a bad character (e.g. ';'). */ 3201130803Smarcel error ("Invalid character '%c' in expression.", c); 3202130803Smarcel 3203130803Smarcel /* It's a name. See how long it is. */ 3204130803Smarcel namelen = 0; 3205130803Smarcel for (c = tokstart[namelen]; 3206130803Smarcel (c == '_' || c == '$' || (c >= '0' && c <= '9') 3207130803Smarcel || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');) 3208130803Smarcel { 3209130803Smarcel if (c == '<') 3210130803Smarcel { 3211130803Smarcel int i = namelen; 3212130803Smarcel while (tokstart[++i] && tokstart[i] != '>'); 3213130803Smarcel if (tokstart[i] == '>') 3214130803Smarcel namelen = i; 3215130803Smarcel } 3216130803Smarcel c = tokstart[++namelen]; 3217130803Smarcel } 3218130803Smarcel 3219130803Smarcel /* The token "if" terminates the expression and is NOT 3220130803Smarcel removed from the input stream. */ 3221130803Smarcel if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f') 3222130803Smarcel { 3223130803Smarcel return 0; 3224130803Smarcel } 3225130803Smarcel 3226130803Smarcel lexptr += namelen; 3227130803Smarcel 3228130803Smarcel tryname: 3229130803Smarcel 3230130803Smarcel /* Catch specific keywords. Should be done with a data structure. */ 3231130803Smarcel switch (namelen) 3232130803Smarcel { 3233130803Smarcel case 8: 3234130803Smarcel if (DEPRECATED_STREQN (tokstart, "unsigned", 8)) 3235130803Smarcel return UNSIGNED; 3236130803Smarcel if (current_language->la_language == language_cplus 3237130803Smarcel && strncmp (tokstart, "template", 8) == 0) 3238130803Smarcel return TEMPLATE; 3239130803Smarcel if (DEPRECATED_STREQN (tokstart, "volatile", 8)) 3240130803Smarcel return VOLATILE_KEYWORD; 3241130803Smarcel break; 3242130803Smarcel case 6: 3243130803Smarcel if (DEPRECATED_STREQN (tokstart, "struct", 6)) 3244130803Smarcel return STRUCT; 3245130803Smarcel if (DEPRECATED_STREQN (tokstart, "signed", 6)) 3246130803Smarcel return SIGNED_KEYWORD; 3247130803Smarcel if (DEPRECATED_STREQN (tokstart, "sizeof", 6)) 3248130803Smarcel return SIZEOF; 3249130803Smarcel if (DEPRECATED_STREQN (tokstart, "double", 6)) 3250130803Smarcel return DOUBLE_KEYWORD; 3251130803Smarcel break; 3252130803Smarcel case 5: 3253130803Smarcel if ((current_language->la_language == language_cplus) 3254130803Smarcel && strncmp (tokstart, "class", 5) == 0) 3255130803Smarcel return CLASS; 3256130803Smarcel if (DEPRECATED_STREQN (tokstart, "union", 5)) 3257130803Smarcel return UNION; 3258130803Smarcel if (DEPRECATED_STREQN (tokstart, "short", 5)) 3259130803Smarcel return SHORT; 3260130803Smarcel if (DEPRECATED_STREQN (tokstart, "const", 5)) 3261130803Smarcel return CONST_KEYWORD; 3262130803Smarcel break; 3263130803Smarcel case 4: 3264130803Smarcel if (DEPRECATED_STREQN (tokstart, "enum", 4)) 3265130803Smarcel return ENUM; 3266130803Smarcel if (DEPRECATED_STREQN (tokstart, "long", 4)) 3267130803Smarcel return LONG; 3268130803Smarcel break; 3269130803Smarcel case 3: 3270130803Smarcel if (DEPRECATED_STREQN (tokstart, "int", 3)) 3271130803Smarcel return INT_KEYWORD; 3272130803Smarcel break; 3273130803Smarcel default: 3274130803Smarcel break; 3275130803Smarcel } 3276130803Smarcel 3277130803Smarcel yylval.sval.ptr = tokstart; 3278130803Smarcel yylval.sval.length = namelen; 3279130803Smarcel 3280130803Smarcel if (*tokstart == '$') 3281130803Smarcel { 3282130803Smarcel write_dollar_variable (yylval.sval); 3283130803Smarcel return VARIABLE; 3284130803Smarcel } 3285130803Smarcel 3286130803Smarcel /* Use token-type BLOCKNAME for symbols that happen to be defined as 3287130803Smarcel functions or symtabs. If this is not so, then ... 3288130803Smarcel Use token-type TYPENAME for symbols that happen to be defined 3289130803Smarcel currently as names of types; NAME for other symbols. 3290130803Smarcel The caller is not constrained to care about the distinction. */ 3291130803Smarcel { 3292130803Smarcel char *tmp = copy_name (yylval.sval); 3293130803Smarcel struct symbol *sym; 3294130803Smarcel int is_a_field_of_this = 0, *need_this; 3295130803Smarcel int hextype; 3296130803Smarcel 3297130803Smarcel if (current_language->la_language == language_cplus || 3298130803Smarcel current_language->la_language == language_objc) 3299130803Smarcel need_this = &is_a_field_of_this; 3300130803Smarcel else 3301130803Smarcel need_this = (int *) NULL; 3302130803Smarcel 3303130803Smarcel sym = lookup_symbol (tmp, expression_context_block, 3304130803Smarcel VAR_DOMAIN, 3305130803Smarcel need_this, 3306130803Smarcel (struct symtab **) NULL); 3307130803Smarcel /* Call lookup_symtab, not lookup_partial_symtab, in case there 3308130803Smarcel are no psymtabs (coff, xcoff, or some future change to blow 3309130803Smarcel away the psymtabs once symbols are read). */ 3310130803Smarcel if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) || 3311130803Smarcel lookup_symtab (tmp)) 3312130803Smarcel { 3313130803Smarcel yylval.ssym.sym = sym; 3314130803Smarcel yylval.ssym.is_a_field_of_this = is_a_field_of_this; 3315130803Smarcel return BLOCKNAME; 3316130803Smarcel } 3317130803Smarcel if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF) 3318130803Smarcel { 3319130803Smarcel#if 1 3320130803Smarcel /* Despite the following flaw, we need to keep this code 3321130803Smarcel enabled. Because we can get called from 3322130803Smarcel check_stub_method, if we don't handle nested types then 3323130803Smarcel it screws many operations in any program which uses 3324130803Smarcel nested types. */ 3325130803Smarcel /* In "A::x", if x is a member function of A and there 3326130803Smarcel happens to be a type (nested or not, since the stabs 3327130803Smarcel don't make that distinction) named x, then this code 3328130803Smarcel incorrectly thinks we are dealing with nested types 3329130803Smarcel rather than a member function. */ 3330130803Smarcel 3331130803Smarcel char *p; 3332130803Smarcel char *namestart; 3333130803Smarcel struct symbol *best_sym; 3334130803Smarcel 3335130803Smarcel /* Look ahead to detect nested types. This probably should 3336130803Smarcel be done in the grammar, but trying seemed to introduce a 3337130803Smarcel lot of shift/reduce and reduce/reduce conflicts. It's 3338130803Smarcel possible that it could be done, though. Or perhaps a 3339130803Smarcel non-grammar, but less ad hoc, approach would work well. */ 3340130803Smarcel 3341130803Smarcel /* Since we do not currently have any way of distinguishing 3342130803Smarcel a nested type from a non-nested one (the stabs don't tell 3343130803Smarcel us whether a type is nested), we just ignore the 3344130803Smarcel containing type. */ 3345130803Smarcel 3346130803Smarcel p = lexptr; 3347130803Smarcel best_sym = sym; 3348130803Smarcel while (1) 3349130803Smarcel { 3350130803Smarcel /* Skip whitespace. */ 3351130803Smarcel while (*p == ' ' || *p == '\t' || *p == '\n') 3352130803Smarcel ++p; 3353130803Smarcel if (*p == ':' && p[1] == ':') 3354130803Smarcel { 3355130803Smarcel /* Skip the `::'. */ 3356130803Smarcel p += 2; 3357130803Smarcel /* Skip whitespace. */ 3358130803Smarcel while (*p == ' ' || *p == '\t' || *p == '\n') 3359130803Smarcel ++p; 3360130803Smarcel namestart = p; 3361130803Smarcel while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9') 3362130803Smarcel || (*p >= 'a' && *p <= 'z') 3363130803Smarcel || (*p >= 'A' && *p <= 'Z')) 3364130803Smarcel ++p; 3365130803Smarcel if (p != namestart) 3366130803Smarcel { 3367130803Smarcel struct symbol *cur_sym; 3368130803Smarcel /* As big as the whole rest of the expression, 3369130803Smarcel which is at least big enough. */ 3370130803Smarcel char *ncopy = alloca (strlen (tmp) + 3371130803Smarcel strlen (namestart) + 3); 3372130803Smarcel char *tmp1; 3373130803Smarcel 3374130803Smarcel tmp1 = ncopy; 3375130803Smarcel memcpy (tmp1, tmp, strlen (tmp)); 3376130803Smarcel tmp1 += strlen (tmp); 3377130803Smarcel memcpy (tmp1, "::", 2); 3378130803Smarcel tmp1 += 2; 3379130803Smarcel memcpy (tmp1, namestart, p - namestart); 3380130803Smarcel tmp1[p - namestart] = '\0'; 3381130803Smarcel cur_sym = lookup_symbol (ncopy, 3382130803Smarcel expression_context_block, 3383130803Smarcel VAR_DOMAIN, (int *) NULL, 3384130803Smarcel (struct symtab **) NULL); 3385130803Smarcel if (cur_sym) 3386130803Smarcel { 3387130803Smarcel if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF) 3388130803Smarcel { 3389130803Smarcel best_sym = cur_sym; 3390130803Smarcel lexptr = p; 3391130803Smarcel } 3392130803Smarcel else 3393130803Smarcel break; 3394130803Smarcel } 3395130803Smarcel else 3396130803Smarcel break; 3397130803Smarcel } 3398130803Smarcel else 3399130803Smarcel break; 3400130803Smarcel } 3401130803Smarcel else 3402130803Smarcel break; 3403130803Smarcel } 3404130803Smarcel 3405130803Smarcel yylval.tsym.type = SYMBOL_TYPE (best_sym); 3406130803Smarcel#else /* not 0 */ 3407130803Smarcel yylval.tsym.type = SYMBOL_TYPE (sym); 3408130803Smarcel#endif /* not 0 */ 3409130803Smarcel return TYPENAME; 3410130803Smarcel } 3411130803Smarcel if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0) 3412130803Smarcel return TYPENAME; 3413130803Smarcel 3414130803Smarcel /* See if it's an ObjC classname. */ 3415130803Smarcel if (!sym) 3416130803Smarcel { 3417130803Smarcel CORE_ADDR Class = lookup_objc_class(tmp); 3418130803Smarcel if (Class) 3419130803Smarcel { 3420130803Smarcel yylval.class.class = Class; 3421130803Smarcel if ((sym = lookup_struct_typedef (tmp, 3422130803Smarcel expression_context_block, 3423130803Smarcel 1))) 3424130803Smarcel yylval.class.type = SYMBOL_TYPE (sym); 3425130803Smarcel return CLASSNAME; 3426130803Smarcel } 3427130803Smarcel } 3428130803Smarcel 3429130803Smarcel /* Input names that aren't symbols but ARE valid hex numbers, 3430130803Smarcel when the input radix permits them, can be names or numbers 3431130803Smarcel depending on the parse. Note we support radixes > 16 here. */ 3432130803Smarcel if (!sym && 3433130803Smarcel ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) || 3434130803Smarcel (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10))) 3435130803Smarcel { 3436130803Smarcel YYSTYPE newlval; /* Its value is ignored. */ 3437130803Smarcel hextype = parse_number (tokstart, namelen, 0, &newlval); 3438130803Smarcel if (hextype == INT) 3439130803Smarcel { 3440130803Smarcel yylval.ssym.sym = sym; 3441130803Smarcel yylval.ssym.is_a_field_of_this = is_a_field_of_this; 3442130803Smarcel return NAME_OR_INT; 3443130803Smarcel } 3444130803Smarcel } 3445130803Smarcel 3446130803Smarcel /* Any other kind of symbol. */ 3447130803Smarcel yylval.ssym.sym = sym; 3448130803Smarcel yylval.ssym.is_a_field_of_this = is_a_field_of_this; 3449130803Smarcel return NAME; 3450130803Smarcel } 3451130803Smarcel} 3452130803Smarcel 3453130803Smarcelvoid 3454130803Smarcelyyerror (msg) 3455130803Smarcel char *msg; 3456130803Smarcel{ 3457130803Smarcel if (*lexptr == '\0') 3458130803Smarcel error("A %s near end of expression.", (msg ? msg : "error")); 3459130803Smarcel else 3460130803Smarcel error ("A %s in expression, near `%s'.", (msg ? msg : "error"), 3461130803Smarcel lexptr); 3462130803Smarcel} 3463130803Smarcel 3464130803Smarcel 3465