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 HEX = 259, 58130803Smarcel ERROR = 260, 59130803Smarcel UINT = 261, 60130803Smarcel M2_TRUE = 262, 61130803Smarcel M2_FALSE = 263, 62130803Smarcel CHAR = 264, 63130803Smarcel FLOAT = 265, 64130803Smarcel STRING = 266, 65130803Smarcel NAME = 267, 66130803Smarcel BLOCKNAME = 268, 67130803Smarcel IDENT = 269, 68130803Smarcel VARNAME = 270, 69130803Smarcel TYPENAME = 271, 70130803Smarcel SIZE = 272, 71130803Smarcel CAP = 273, 72130803Smarcel ORD = 274, 73130803Smarcel HIGH = 275, 74130803Smarcel ABS = 276, 75130803Smarcel MIN_FUNC = 277, 76130803Smarcel MAX_FUNC = 278, 77130803Smarcel FLOAT_FUNC = 279, 78130803Smarcel VAL = 280, 79130803Smarcel CHR = 281, 80130803Smarcel ODD = 282, 81130803Smarcel TRUNC = 283, 82130803Smarcel INC = 284, 83130803Smarcel DEC = 285, 84130803Smarcel INCL = 286, 85130803Smarcel EXCL = 287, 86130803Smarcel COLONCOLON = 288, 87130803Smarcel INTERNAL_VAR = 289, 88130803Smarcel ABOVE_COMMA = 290, 89130803Smarcel ASSIGN = 291, 90130803Smarcel IN = 292, 91130803Smarcel NOTEQUAL = 293, 92130803Smarcel GEQ = 294, 93130803Smarcel LEQ = 295, 94130803Smarcel OROR = 296, 95130803Smarcel LOGICAL_AND = 297, 96130803Smarcel MOD = 298, 97130803Smarcel DIV = 299, 98130803Smarcel UNARY = 300, 99130803Smarcel DOT = 301, 100130803Smarcel NOT = 302, 101130803Smarcel QID = 303 102130803Smarcel }; 103130803Smarcel#endif 104130803Smarcel#define INT 258 105130803Smarcel#define HEX 259 106130803Smarcel#define ERROR 260 107130803Smarcel#define UINT 261 108130803Smarcel#define M2_TRUE 262 109130803Smarcel#define M2_FALSE 263 110130803Smarcel#define CHAR 264 111130803Smarcel#define FLOAT 265 112130803Smarcel#define STRING 266 113130803Smarcel#define NAME 267 114130803Smarcel#define BLOCKNAME 268 115130803Smarcel#define IDENT 269 116130803Smarcel#define VARNAME 270 117130803Smarcel#define TYPENAME 271 118130803Smarcel#define SIZE 272 119130803Smarcel#define CAP 273 120130803Smarcel#define ORD 274 121130803Smarcel#define HIGH 275 122130803Smarcel#define ABS 276 123130803Smarcel#define MIN_FUNC 277 124130803Smarcel#define MAX_FUNC 278 125130803Smarcel#define FLOAT_FUNC 279 126130803Smarcel#define VAL 280 127130803Smarcel#define CHR 281 128130803Smarcel#define ODD 282 129130803Smarcel#define TRUNC 283 130130803Smarcel#define INC 284 131130803Smarcel#define DEC 285 132130803Smarcel#define INCL 286 133130803Smarcel#define EXCL 287 134130803Smarcel#define COLONCOLON 288 135130803Smarcel#define INTERNAL_VAR 289 136130803Smarcel#define ABOVE_COMMA 290 137130803Smarcel#define ASSIGN 291 138130803Smarcel#define IN 292 139130803Smarcel#define NOTEQUAL 293 140130803Smarcel#define GEQ 294 141130803Smarcel#define LEQ 295 142130803Smarcel#define OROR 296 143130803Smarcel#define LOGICAL_AND 297 144130803Smarcel#define MOD 298 145130803Smarcel#define DIV 299 146130803Smarcel#define UNARY 300 147130803Smarcel#define DOT 301 148130803Smarcel#define NOT 302 149130803Smarcel#define QID 303 150130803Smarcel 151130803Smarcel 152130803Smarcel 153130803Smarcel 154130803Smarcel/* Copy the first part of user declarations. */ 155130803Smarcel#line 41 "m2-exp.y" 156130803Smarcel 157130803Smarcel 158130803Smarcel#include "defs.h" 159130803Smarcel#include "gdb_string.h" 160130803Smarcel#include "expression.h" 161130803Smarcel#include "language.h" 162130803Smarcel#include "value.h" 163130803Smarcel#include "parser-defs.h" 164130803Smarcel#include "m2-lang.h" 165130803Smarcel#include "bfd.h" /* Required by objfiles.h. */ 166130803Smarcel#include "symfile.h" /* Required by objfiles.h. */ 167130803Smarcel#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ 168130803Smarcel#include "block.h" 169130803Smarcel 170130803Smarcel/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), 171130803Smarcel as well as gratuitiously global symbol names, so we can have multiple 172130803Smarcel yacc generated parsers in gdb. Note that these are only the variables 173130803Smarcel produced by yacc. If other parser generators (bison, byacc, etc) produce 174130803Smarcel additional global names that conflict at link time, then those parser 175130803Smarcel generators need to be fixed instead of adding those names to this list. */ 176130803Smarcel 177130803Smarcel#define yymaxdepth m2_maxdepth 178130803Smarcel#define yyparse m2_parse 179130803Smarcel#define yylex m2_lex 180130803Smarcel#define yyerror m2_error 181130803Smarcel#define yylval m2_lval 182130803Smarcel#define yychar m2_char 183130803Smarcel#define yydebug m2_debug 184130803Smarcel#define yypact m2_pact 185130803Smarcel#define yyr1 m2_r1 186130803Smarcel#define yyr2 m2_r2 187130803Smarcel#define yydef m2_def 188130803Smarcel#define yychk m2_chk 189130803Smarcel#define yypgo m2_pgo 190130803Smarcel#define yyact m2_act 191130803Smarcel#define yyexca m2_exca 192130803Smarcel#define yyerrflag m2_errflag 193130803Smarcel#define yynerrs m2_nerrs 194130803Smarcel#define yyps m2_ps 195130803Smarcel#define yypv m2_pv 196130803Smarcel#define yys m2_s 197130803Smarcel#define yy_yys m2_yys 198130803Smarcel#define yystate m2_state 199130803Smarcel#define yytmp m2_tmp 200130803Smarcel#define yyv m2_v 201130803Smarcel#define yy_yyv m2_yyv 202130803Smarcel#define yyval m2_val 203130803Smarcel#define yylloc m2_lloc 204130803Smarcel#define yyreds m2_reds /* With YYDEBUG defined */ 205130803Smarcel#define yytoks m2_toks /* With YYDEBUG defined */ 206130803Smarcel#define yyname m2_name /* With YYDEBUG defined */ 207130803Smarcel#define yyrule m2_rule /* With YYDEBUG defined */ 208130803Smarcel#define yylhs m2_yylhs 209130803Smarcel#define yylen m2_yylen 210130803Smarcel#define yydefred m2_yydefred 211130803Smarcel#define yydgoto m2_yydgoto 212130803Smarcel#define yysindex m2_yysindex 213130803Smarcel#define yyrindex m2_yyrindex 214130803Smarcel#define yygindex m2_yygindex 215130803Smarcel#define yytable m2_yytable 216130803Smarcel#define yycheck m2_yycheck 217130803Smarcel 218130803Smarcel#ifndef YYDEBUG 219130803Smarcel#define YYDEBUG 1 /* Default to yydebug support */ 220130803Smarcel#endif 221130803Smarcel 222130803Smarcel#define YYFPRINTF parser_fprintf 223130803Smarcel 224130803Smarcelint yyparse (void); 225130803Smarcel 226130803Smarcelstatic int yylex (void); 227130803Smarcel 228130803Smarcelvoid yyerror (char *); 229130803Smarcel 230130803Smarcel#if 0 231130803Smarcelstatic char *make_qualname (char *, char *); 232130803Smarcel#endif 233130803Smarcel 234130803Smarcelstatic int parse_number (int); 235130803Smarcel 236130803Smarcel/* The sign of the number being parsed. */ 237130803Smarcelstatic int number_sign = 1; 238130803Smarcel 239130803Smarcel/* The block that the module specified by the qualifer on an identifer is 240130803Smarcel contained in, */ 241130803Smarcel#if 0 242130803Smarcelstatic struct block *modblock=0; 243130803Smarcel#endif 244130803Smarcel 245130803Smarcel 246130803Smarcel 247130803Smarcel/* Enabling traces. */ 248130803Smarcel#ifndef YYDEBUG 249130803Smarcel# define YYDEBUG 0 250130803Smarcel#endif 251130803Smarcel 252130803Smarcel/* Enabling verbose error messages. */ 253130803Smarcel#ifdef YYERROR_VERBOSE 254130803Smarcel# undef YYERROR_VERBOSE 255130803Smarcel# define YYERROR_VERBOSE 1 256130803Smarcel#else 257130803Smarcel# define YYERROR_VERBOSE 0 258130803Smarcel#endif 259130803Smarcel 260130803Smarcel#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 261130803Smarcel#line 137 "m2-exp.y" 262130803Smarceltypedef union YYSTYPE { 263130803Smarcel LONGEST lval; 264130803Smarcel ULONGEST ulval; 265130803Smarcel DOUBLEST dval; 266130803Smarcel struct symbol *sym; 267130803Smarcel struct type *tval; 268130803Smarcel struct stoken sval; 269130803Smarcel int voidval; 270130803Smarcel struct block *bval; 271130803Smarcel enum exp_opcode opcode; 272130803Smarcel struct internalvar *ivar; 273130803Smarcel 274130803Smarcel struct type **tvec; 275130803Smarcel int *ivec; 276130803Smarcel } YYSTYPE; 277130803Smarcel/* Line 191 of yacc.c. */ 278130803Smarcel# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 279130803Smarcel# define YYSTYPE_IS_DECLARED 1 280130803Smarcel# define YYSTYPE_IS_TRIVIAL 1 281130803Smarcel#endif 282130803Smarcel 283130803Smarcel 284130803Smarcel 285130803Smarcel/* Copy the second part of user declarations. */ 286130803Smarcel 287130803Smarcel 288130803Smarcel/* Line 214 of yacc.c. */ 289130803Smarcel 290130803Smarcel#if ! defined (yyoverflow) || YYERROR_VERBOSE 291130803Smarcel 292130803Smarcel/* The parser invokes alloca or xmalloc; define the necessary symbols. */ 293130803Smarcel 294130803Smarcel# if YYSTACK_USE_ALLOCA 295130803Smarcel# define YYSTACK_ALLOC alloca 296130803Smarcel# else 297130803Smarcel# ifndef YYSTACK_USE_ALLOCA 298130803Smarcel# if defined (alloca) || defined (_ALLOCA_H) 299130803Smarcel# define YYSTACK_ALLOC alloca 300130803Smarcel# else 301130803Smarcel# ifdef __GNUC__ 302130803Smarcel# define YYSTACK_ALLOC __builtin_alloca 303130803Smarcel# endif 304130803Smarcel# endif 305130803Smarcel# endif 306130803Smarcel# endif 307130803Smarcel 308130803Smarcel# ifdef YYSTACK_ALLOC 309130803Smarcel /* Pacify GCC's `empty if-body' warning. */ 310130803Smarcel# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 311130803Smarcel# else 312130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 313130803Smarcel# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 314130803Smarcel# define YYSIZE_T size_t 315130803Smarcel# endif 316130803Smarcel# define YYSTACK_ALLOC xmalloc 317130803Smarcel# define YYSTACK_FREE free 318130803Smarcel# endif 319130803Smarcel#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 320130803Smarcel 321130803Smarcel 322130803Smarcel#if (! defined (yyoverflow) \ 323130803Smarcel && (! defined (__cplusplus) \ 324130803Smarcel || (YYSTYPE_IS_TRIVIAL))) 325130803Smarcel 326130803Smarcel/* A type that is properly aligned for any stack member. */ 327130803Smarcelunion yyalloc 328130803Smarcel{ 329130803Smarcel short yyss; 330130803Smarcel YYSTYPE yyvs; 331130803Smarcel }; 332130803Smarcel 333130803Smarcel/* The size of the maximum gap between one aligned stack and the next. */ 334130803Smarcel# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 335130803Smarcel 336130803Smarcel/* The size of an array large to enough to hold all stacks, each with 337130803Smarcel N elements. */ 338130803Smarcel# define YYSTACK_BYTES(N) \ 339130803Smarcel ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ 340130803Smarcel + YYSTACK_GAP_MAXIMUM) 341130803Smarcel 342130803Smarcel/* Copy COUNT objects from FROM to TO. The source and destination do 343130803Smarcel not overlap. */ 344130803Smarcel# ifndef YYCOPY 345130803Smarcel# if 1 < __GNUC__ 346130803Smarcel# define YYCOPY(To, From, Count) \ 347130803Smarcel __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 348130803Smarcel# else 349130803Smarcel# define YYCOPY(To, From, Count) \ 350130803Smarcel do \ 351130803Smarcel { \ 352130803Smarcel register YYSIZE_T yyi; \ 353130803Smarcel for (yyi = 0; yyi < (Count); yyi++) \ 354130803Smarcel (To)[yyi] = (From)[yyi]; \ 355130803Smarcel } \ 356130803Smarcel while (0) 357130803Smarcel# endif 358130803Smarcel# endif 359130803Smarcel 360130803Smarcel/* Relocate STACK from its old location to the new one. The 361130803Smarcel local variables YYSIZE and YYSTACKSIZE give the old and new number of 362130803Smarcel elements in the stack, and YYPTR gives the new location of the 363130803Smarcel stack. Advance YYPTR to a properly aligned location for the next 364130803Smarcel stack. */ 365130803Smarcel# define YYSTACK_RELOCATE(Stack) \ 366130803Smarcel do \ 367130803Smarcel { \ 368130803Smarcel YYSIZE_T yynewbytes; \ 369130803Smarcel YYCOPY (&yyptr->Stack, Stack, yysize); \ 370130803Smarcel Stack = &yyptr->Stack; \ 371130803Smarcel yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 372130803Smarcel yyptr += yynewbytes / sizeof (*yyptr); \ 373130803Smarcel } \ 374130803Smarcel while (0) 375130803Smarcel 376130803Smarcel#endif 377130803Smarcel 378130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 379130803Smarcel typedef signed char yysigned_char; 380130803Smarcel#else 381130803Smarcel typedef short yysigned_char; 382130803Smarcel#endif 383130803Smarcel 384130803Smarcel/* YYFINAL -- State number of the termination state. */ 385130803Smarcel#define YYFINAL 67 386130803Smarcel/* YYLAST -- Last index in YYTABLE. */ 387130803Smarcel#define YYLAST 848 388130803Smarcel 389130803Smarcel/* YYNTOKENS -- Number of terminals. */ 390130803Smarcel#define YYNTOKENS 68 391130803Smarcel/* YYNNTS -- Number of nonterminals. */ 392130803Smarcel#define YYNNTS 15 393130803Smarcel/* YYNRULES -- Number of rules. */ 394130803Smarcel#define YYNRULES 80 395130803Smarcel/* YYNRULES -- Number of states. */ 396130803Smarcel#define YYNSTATES 181 397130803Smarcel 398130803Smarcel/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 399130803Smarcel#define YYUNDEFTOK 2 400130803Smarcel#define YYMAXUTOK 303 401130803Smarcel 402130803Smarcel#define YYTRANSLATE(YYX) \ 403130803Smarcel ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 404130803Smarcel 405130803Smarcel/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 406130803Smarcelstatic const unsigned char yytranslate[] = 407130803Smarcel{ 408130803Smarcel 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 409130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 410130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 411130803Smarcel 2, 2, 2, 2, 2, 41, 2, 2, 47, 2, 412130803Smarcel 59, 64, 52, 50, 35, 51, 2, 53, 2, 2, 413130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 414130803Smarcel 38, 40, 39, 2, 49, 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, 58, 2, 67, 57, 2, 2, 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, 65, 2, 66, 61, 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, 2, 2, 2, 2, 431130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 432130803Smarcel 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 433130803Smarcel 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 434130803Smarcel 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 435130803Smarcel 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 436130803Smarcel 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 437130803Smarcel 36, 37, 42, 43, 44, 45, 46, 48, 54, 55, 438130803Smarcel 56, 60, 62, 63 439130803Smarcel}; 440130803Smarcel 441130803Smarcel#if YYDEBUG 442130803Smarcel/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 443130803Smarcel YYRHS. */ 444130803Smarcelstatic const unsigned short yyprhs[] = 445130803Smarcel{ 446130803Smarcel 0, 0, 3, 5, 7, 9, 12, 13, 17, 20, 447130803Smarcel 23, 25, 27, 32, 37, 42, 47, 52, 57, 62, 448130803Smarcel 69, 74, 79, 84, 87, 92, 99, 104, 111, 115, 449130803Smarcel 117, 121, 128, 135, 139, 144, 145, 151, 152, 158, 450130803Smarcel 159, 161, 165, 167, 171, 176, 181, 185, 189, 193, 451130803Smarcel 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 452130803Smarcel 237, 241, 245, 249, 253, 255, 257, 259, 261, 263, 453130803Smarcel 265, 267, 272, 274, 276, 278, 282, 284, 286, 290, 454130803Smarcel 292 455130803Smarcel}; 456130803Smarcel 457130803Smarcel/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 458130803Smarcelstatic const yysigned_char yyrhs[] = 459130803Smarcel{ 460130803Smarcel 69, 0, -1, 71, -1, 70, -1, 82, -1, 71, 461130803Smarcel 57, -1, -1, 51, 72, 71, -1, 50, 71, -1, 462130803Smarcel 73, 71, -1, 62, -1, 61, -1, 18, 59, 71, 463130803Smarcel 64, -1, 19, 59, 71, 64, -1, 21, 59, 71, 464130803Smarcel 64, -1, 20, 59, 71, 64, -1, 22, 59, 82, 465130803Smarcel 64, -1, 23, 59, 82, 64, -1, 24, 59, 71, 466130803Smarcel 64, -1, 25, 59, 82, 35, 71, 64, -1, 26, 467130803Smarcel 59, 71, 64, -1, 27, 59, 71, 64, -1, 28, 468130803Smarcel 59, 71, 64, -1, 17, 71, -1, 29, 59, 71, 469130803Smarcel 64, -1, 29, 59, 71, 35, 71, 64, -1, 30, 470130803Smarcel 59, 71, 64, -1, 30, 59, 71, 35, 71, 64, 471130803Smarcel -1, 71, 60, 12, -1, 74, -1, 71, 42, 74, 472130803Smarcel -1, 31, 59, 71, 35, 71, 64, -1, 32, 59, 473130803Smarcel 71, 35, 71, 64, -1, 65, 77, 66, -1, 82, 474130803Smarcel 65, 77, 66, -1, -1, 71, 58, 75, 78, 67, 475130803Smarcel -1, -1, 71, 59, 76, 77, 64, -1, -1, 71, 476130803Smarcel -1, 77, 35, 71, -1, 71, -1, 78, 35, 71, 477130803Smarcel -1, 65, 82, 66, 71, -1, 82, 59, 71, 64, 478130803Smarcel -1, 59, 71, 64, -1, 71, 49, 71, -1, 71, 479130803Smarcel 52, 71, -1, 71, 53, 71, -1, 71, 55, 71, 480130803Smarcel -1, 71, 54, 71, -1, 71, 50, 71, -1, 71, 481130803Smarcel 51, 71, -1, 71, 40, 71, -1, 71, 43, 71, 482130803Smarcel -1, 71, 41, 71, -1, 71, 45, 71, -1, 71, 483130803Smarcel 44, 71, -1, 71, 38, 71, -1, 71, 39, 71, 484130803Smarcel -1, 71, 48, 71, -1, 71, 46, 71, -1, 71, 485130803Smarcel 37, 71, -1, 7, -1, 8, -1, 3, -1, 6, 486130803Smarcel -1, 9, -1, 10, -1, 81, -1, 17, 59, 82, 487130803Smarcel 64, -1, 11, -1, 80, -1, 13, -1, 79, 33, 488130803Smarcel 13, -1, 80, -1, 34, -1, 79, 33, 12, -1, 489130803Smarcel 12, -1, 16, -1 490130803Smarcel}; 491130803Smarcel 492130803Smarcel/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 493130803Smarcelstatic const unsigned short yyrline[] = 494130803Smarcel{ 495130803Smarcel 0, 205, 205, 206, 209, 218, 223, 222, 229, 233, 496130803Smarcel 237, 238, 241, 245, 249, 253, 257, 263, 269, 273, 497130803Smarcel 279, 283, 287, 291, 296, 300, 306, 310, 316, 322, 498130803Smarcel 325, 329, 333, 337, 339, 349, 345, 359, 356, 366, 499130803Smarcel 369, 373, 378, 383, 388, 394, 400, 408, 412, 416, 500130803Smarcel 420, 424, 428, 432, 436, 440, 442, 446, 450, 454, 501130803Smarcel 458, 462, 466, 470, 477, 483, 489, 496, 505, 513, 502130803Smarcel 520, 523, 530, 537, 541, 550, 562, 570, 574, 590, 503130803Smarcel 641 504130803Smarcel}; 505130803Smarcel#endif 506130803Smarcel 507130803Smarcel#if YYDEBUG || YYERROR_VERBOSE 508130803Smarcel/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 509130803Smarcel First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 510130803Smarcelstatic const char *const yytname[] = 511130803Smarcel{ 512130803Smarcel "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE", 513130803Smarcel "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT", 514130803Smarcel "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC", 515130803Smarcel "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "INC", "DEC", 516130803Smarcel "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','", "ABOVE_COMMA", 517130803Smarcel "ASSIGN", "'<'", "'>'", "'='", "'#'", "IN", "NOTEQUAL", "GEQ", "LEQ", 518130803Smarcel "OROR", "'&'", "LOGICAL_AND", "'@'", "'+'", "'-'", "'*'", "'/'", "MOD", 519130803Smarcel "DIV", "UNARY", "'^'", "'['", "'('", "DOT", "'~'", "NOT", "QID", "')'", 520130803Smarcel "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp", "@1", 521130803Smarcel "not_exp", "set", "@2", "@3", "arglist", "non_empty_arglist", "block", 522130803Smarcel "fblock", "variable", "type", 0 523130803Smarcel}; 524130803Smarcel#endif 525130803Smarcel 526130803Smarcel# ifdef YYPRINT 527130803Smarcel/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 528130803Smarcel token YYLEX-NUM. */ 529130803Smarcelstatic const unsigned short yytoknum[] = 530130803Smarcel{ 531130803Smarcel 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 532130803Smarcel 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 533130803Smarcel 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 534130803Smarcel 285, 286, 287, 288, 289, 44, 290, 291, 60, 62, 535130803Smarcel 61, 35, 292, 293, 294, 295, 296, 38, 297, 64, 536130803Smarcel 43, 45, 42, 47, 298, 299, 300, 94, 91, 40, 537130803Smarcel 301, 126, 302, 303, 41, 123, 125, 93 538130803Smarcel}; 539130803Smarcel# endif 540130803Smarcel 541130803Smarcel/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 542130803Smarcelstatic const unsigned char yyr1[] = 543130803Smarcel{ 544130803Smarcel 0, 68, 69, 69, 70, 71, 72, 71, 71, 71, 545130803Smarcel 73, 73, 71, 71, 71, 71, 71, 71, 71, 71, 546130803Smarcel 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 547130803Smarcel 71, 71, 71, 74, 74, 75, 71, 76, 71, 77, 548130803Smarcel 77, 77, 78, 78, 71, 71, 71, 71, 71, 71, 549130803Smarcel 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 550130803Smarcel 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 551130803Smarcel 71, 71, 71, 79, 80, 80, 81, 81, 81, 81, 552130803Smarcel 82 553130803Smarcel}; 554130803Smarcel 555130803Smarcel/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 556130803Smarcelstatic const unsigned char yyr2[] = 557130803Smarcel{ 558130803Smarcel 0, 2, 1, 1, 1, 2, 0, 3, 2, 2, 559130803Smarcel 1, 1, 4, 4, 4, 4, 4, 4, 4, 6, 560130803Smarcel 4, 4, 4, 2, 4, 6, 4, 6, 3, 1, 561130803Smarcel 3, 6, 6, 3, 4, 0, 5, 0, 5, 0, 562130803Smarcel 1, 3, 1, 3, 4, 4, 3, 3, 3, 3, 563130803Smarcel 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 564130803Smarcel 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 565130803Smarcel 1, 4, 1, 1, 1, 3, 1, 1, 3, 1, 566130803Smarcel 1 567130803Smarcel}; 568130803Smarcel 569130803Smarcel/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 570130803Smarcel STATE-NUM when YYTABLE doesn't specify something else to do. Zero 571130803Smarcel means the default is an error. */ 572130803Smarcelstatic const unsigned char yydefact[] = 573130803Smarcel{ 574130803Smarcel 0, 66, 67, 64, 65, 68, 69, 72, 79, 74, 575130803Smarcel 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 576130803Smarcel 0, 0, 0, 0, 0, 0, 0, 77, 0, 6, 577130803Smarcel 0, 11, 10, 39, 0, 3, 2, 0, 29, 0, 578130803Smarcel 76, 70, 4, 0, 23, 0, 0, 0, 0, 0, 579130803Smarcel 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 580130803Smarcel 0, 8, 0, 0, 40, 0, 0, 1, 0, 0, 581130803Smarcel 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 582130803Smarcel 0, 0, 0, 0, 0, 0, 5, 35, 37, 0, 583130803Smarcel 9, 0, 0, 39, 0, 0, 0, 0, 0, 0, 584130803Smarcel 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 585130803Smarcel 7, 46, 0, 33, 0, 63, 59, 60, 54, 56, 586130803Smarcel 39, 30, 0, 55, 58, 57, 62, 61, 47, 52, 587130803Smarcel 53, 48, 49, 51, 50, 0, 39, 28, 78, 75, 588130803Smarcel 0, 0, 71, 12, 13, 15, 14, 16, 17, 18, 589130803Smarcel 0, 20, 21, 22, 0, 24, 0, 26, 0, 0, 590130803Smarcel 41, 44, 42, 0, 0, 45, 34, 0, 0, 0, 591130803Smarcel 0, 0, 0, 36, 38, 19, 25, 27, 31, 32, 592130803Smarcel 43 593130803Smarcel}; 594130803Smarcel 595130803Smarcel/* YYDEFGOTO[NTERM-NUM]. */ 596130803Smarcelstatic const short yydefgoto[] = 597130803Smarcel{ 598130803Smarcel -1, 34, 35, 64, 62, 37, 38, 135, 136, 65, 599130803Smarcel 163, 39, 40, 41, 45 600130803Smarcel}; 601130803Smarcel 602130803Smarcel/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 603130803Smarcel STATE-NUM. */ 604130803Smarcel#define YYPACT_NINF -92 605130803Smarcelstatic const short yypact[] = 606130803Smarcel{ 607130803Smarcel 157, -92, -92, -92, -92, -92, -92, -92, -92, -92, 608130803Smarcel -92, 217, -53, -27, -18, -17, -8, 2, 8, 14, 609130803Smarcel 28, 29, 30, 31, 32, 34, 35, -92, 157, -92, 610130803Smarcel 157, -92, -92, 157, 44, -92, 744, 157, -92, 62, 611130803Smarcel 64, -92, -34, 157, 6, -34, 157, 157, 157, 157, 612130803Smarcel 13, 13, 157, 13, 157, 157, 157, 157, 157, 157, 613130803Smarcel 157, 6, 157, 79, 744, -30, -39, -92, 157, 157, 614130803Smarcel 157, 157, 157, -15, 157, 157, 157, 157, 157, 157, 615130803Smarcel 157, 157, 157, 157, 157, 157, -92, -92, -92, 86, 616130803Smarcel 6, -4, 157, 157, -25, 302, 330, 358, 386, 36, 617130803Smarcel 37, 414, 67, 442, 470, 498, 246, 274, 694, 720, 618130803Smarcel 6, -92, 157, -92, 157, 768, -36, -36, -36, -36, 619130803Smarcel 157, -92, 40, -36, -36, -36, 144, 203, 779, 788, 620130803Smarcel 788, 6, 6, 6, 6, 157, 157, -92, -92, -92, 621130803Smarcel 526, -28, -92, -92, -92, -92, -92, -92, -92, -92, 622130803Smarcel 157, -92, -92, -92, 157, -92, 157, -92, 157, 157, 623130803Smarcel 744, 6, 744, -32, -31, -92, -92, 554, 582, 610, 624130803Smarcel 638, 666, 157, -92, -92, -92, -92, -92, -92, -92, 625130803Smarcel 744 626130803Smarcel}; 627130803Smarcel 628130803Smarcel/* YYPGOTO[NTERM-NUM]. */ 629130803Smarcelstatic const yysigned_char yypgoto[] = 630130803Smarcel{ 631130803Smarcel -92, -92, -92, 0, -92, -92, 26, -92, -92, -91, 632130803Smarcel -92, -92, -92, -92, 53 633130803Smarcel}; 634130803Smarcel 635130803Smarcel/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 636130803Smarcel positive, shift that token. If negative, reduce the rule which 637130803Smarcel number is the opposite. If zero, do what YYDEFACT says. 638130803Smarcel If YYTABLE_NINF, syntax error. */ 639130803Smarcel#define YYTABLE_NINF -74 640130803Smarcelstatic const short yytable[] = 641130803Smarcel{ 642130803Smarcel 36, 10, 141, 172, 112, 112, 46, 112, 138, 139, 643130803Smarcel 77, 44, 78, 79, 80, 81, 82, 83, 84, 85, 644130803Smarcel 92, 86, 87, 88, 89, 92, 93, 114, 61, 10, 645130803Smarcel 63, 93, 47, 174, 92, 173, 113, 90, 166, 142, 646130803Smarcel 93, 48, 49, 63, 67, 164, 95, 96, 97, 98, 647130803Smarcel 120, 50, 101, 42, 103, 104, 105, 106, 107, 108, 648130803Smarcel 109, 51, 110, 86, 87, 88, 89, 52, 115, 116, 649130803Smarcel 117, 118, 119, 53, 123, 124, 125, 126, 127, 128, 650130803Smarcel 129, 130, 131, 132, 133, 134, 66, 54, 55, 56, 651130803Smarcel 57, 58, 140, 59, 60, 91, 94, -73, 137, 121, 652130803Smarcel 147, 148, 150, 99, 100, 93, 102, 0, 0, 0, 653130803Smarcel 0, 0, 160, 0, 161, 0, 68, 69, 70, 71, 654130803Smarcel 72, 73, 74, 75, 76, 77, 122, 78, 79, 80, 655130803Smarcel 81, 82, 83, 84, 85, 162, 86, 87, 88, 89, 656130803Smarcel 0, 0, 0, 111, 0, 0, 0, 0, 0, 0, 657130803Smarcel 167, 0, 0, 0, 168, 0, 169, 0, 170, 171, 658130803Smarcel 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 659130803Smarcel 9, 0, 180, 10, 11, 12, 13, 14, 15, 16, 660130803Smarcel 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 661130803Smarcel 0, 27, 78, 79, 80, 81, 82, 83, 84, 85, 662130803Smarcel 0, 86, 87, 88, 89, 0, 0, 28, 29, 0, 663130803Smarcel 0, 0, 0, 0, 0, 0, 30, 0, 31, 32, 664130803Smarcel 1, 0, 33, 2, 3, 4, 5, 6, 7, 8, 665130803Smarcel 9, 0, 0, 10, 11, 12, 13, 14, 15, 16, 666130803Smarcel 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 667130803Smarcel 0, 27, 79, 80, 81, 82, 83, 84, 85, 0, 668130803Smarcel 86, 87, 88, 89, 0, 0, 0, 28, 29, 0, 669130803Smarcel 0, 0, 0, 0, 0, 0, 43, 0, 31, 32, 670130803Smarcel 0, 154, 33, 68, 69, 70, 71, 72, 73, 74, 671130803Smarcel 75, 76, 77, 0, 78, 79, 80, 81, 82, 83, 672130803Smarcel 84, 85, 0, 86, 87, 88, 89, 0, 0, 156, 673130803Smarcel 155, 68, 69, 70, 71, 72, 73, 74, 75, 76, 674130803Smarcel 77, 0, 78, 79, 80, 81, 82, 83, 84, 85, 675130803Smarcel 0, 86, 87, 88, 89, 0, 0, 0, 157, 68, 676130803Smarcel 69, 70, 71, 72, 73, 74, 75, 76, 77, 0, 677130803Smarcel 78, 79, 80, 81, 82, 83, 84, 85, 0, 86, 678130803Smarcel 87, 88, 89, 0, 0, 0, 143, 68, 69, 70, 679130803Smarcel 71, 72, 73, 74, 75, 76, 77, 0, 78, 79, 680130803Smarcel 80, 81, 82, 83, 84, 85, 0, 86, 87, 88, 681130803Smarcel 89, 0, 0, 0, 144, 68, 69, 70, 71, 72, 682130803Smarcel 73, 74, 75, 76, 77, 0, 78, 79, 80, 81, 683130803Smarcel 82, 83, 84, 85, 0, 86, 87, 88, 89, 0, 684130803Smarcel 0, 0, 145, 68, 69, 70, 71, 72, 73, 74, 685130803Smarcel 75, 76, 77, 0, 78, 79, 80, 81, 82, 83, 686130803Smarcel 84, 85, 0, 86, 87, 88, 89, 0, 0, 0, 687130803Smarcel 146, 68, 69, 70, 71, 72, 73, 74, 75, 76, 688130803Smarcel 77, 0, 78, 79, 80, 81, 82, 83, 84, 85, 689130803Smarcel 0, 86, 87, 88, 89, 0, 0, 0, 149, 68, 690130803Smarcel 69, 70, 71, 72, 73, 74, 75, 76, 77, 0, 691130803Smarcel 78, 79, 80, 81, 82, 83, 84, 85, 0, 86, 692130803Smarcel 87, 88, 89, 0, 0, 0, 151, 68, 69, 70, 693130803Smarcel 71, 72, 73, 74, 75, 76, 77, 0, 78, 79, 694130803Smarcel 80, 81, 82, 83, 84, 85, 0, 86, 87, 88, 695130803Smarcel 89, 0, 0, 0, 152, 68, 69, 70, 71, 72, 696130803Smarcel 73, 74, 75, 76, 77, 0, 78, 79, 80, 81, 697130803Smarcel 82, 83, 84, 85, 0, 86, 87, 88, 89, 0, 698130803Smarcel 0, 0, 153, 68, 69, 70, 71, 72, 73, 74, 699130803Smarcel 75, 76, 77, 0, 78, 79, 80, 81, 82, 83, 700130803Smarcel 84, 85, 0, 86, 87, 88, 89, 0, 0, 0, 701130803Smarcel 165, 68, 69, 70, 71, 72, 73, 74, 75, 76, 702130803Smarcel 77, 0, 78, 79, 80, 81, 82, 83, 84, 85, 703130803Smarcel 0, 86, 87, 88, 89, 0, 0, 0, 175, 68, 704130803Smarcel 69, 70, 71, 72, 73, 74, 75, 76, 77, 0, 705130803Smarcel 78, 79, 80, 81, 82, 83, 84, 85, 0, 86, 706130803Smarcel 87, 88, 89, 0, 0, 0, 176, 68, 69, 70, 707130803Smarcel 71, 72, 73, 74, 75, 76, 77, 0, 78, 79, 708130803Smarcel 80, 81, 82, 83, 84, 85, 0, 86, 87, 88, 709130803Smarcel 89, 0, 0, 0, 177, 68, 69, 70, 71, 72, 710130803Smarcel 73, 74, 75, 76, 77, 0, 78, 79, 80, 81, 711130803Smarcel 82, 83, 84, 85, 0, 86, 87, 88, 89, 0, 712130803Smarcel 0, 0, 178, 68, 69, 70, 71, 72, 73, 74, 713130803Smarcel 75, 76, 77, 0, 78, 79, 80, 81, 82, 83, 714130803Smarcel 84, 85, 0, 86, 87, 88, 89, 0, 0, 158, 715130803Smarcel 179, 68, 69, 70, 71, 72, 73, 74, 75, 76, 716130803Smarcel 77, 0, 78, 79, 80, 81, 82, 83, 84, 85, 717130803Smarcel 0, 86, 87, 88, 89, 159, 0, 68, 69, 70, 718130803Smarcel 71, 72, 73, 74, 75, 76, 77, 0, 78, 79, 719130803Smarcel 80, 81, 82, 83, 84, 85, 0, 86, 87, 88, 720130803Smarcel 89, 68, 69, 70, 71, 72, 73, 74, 75, 76, 721130803Smarcel 77, 0, 78, 79, 80, 81, 82, 83, 84, 85, 722130803Smarcel 0, 86, 87, 88, 89, -74, 69, 70, 71, 72, 723130803Smarcel 73, 74, 75, 76, 77, 0, 78, 79, 80, 81, 724130803Smarcel 82, 83, 84, 85, 0, 86, 87, 88, 89, 80, 725130803Smarcel 81, 82, 83, 84, 85, 0, 86, 87, 88, 89, 726130803Smarcel 82, 83, 84, 85, 0, 86, 87, 88, 89 727130803Smarcel}; 728130803Smarcel 729130803Smarcelstatic const short yycheck[] = 730130803Smarcel{ 731130803Smarcel 0, 16, 93, 35, 35, 35, 59, 35, 12, 13, 732130803Smarcel 46, 11, 48, 49, 50, 51, 52, 53, 54, 55, 733130803Smarcel 59, 57, 58, 59, 60, 59, 65, 66, 28, 16, 734130803Smarcel 30, 65, 59, 64, 59, 67, 66, 37, 66, 64, 735130803Smarcel 65, 59, 59, 43, 0, 136, 46, 47, 48, 49, 736130803Smarcel 65, 59, 52, 0, 54, 55, 56, 57, 58, 59, 737130803Smarcel 60, 59, 62, 57, 58, 59, 60, 59, 68, 69, 738130803Smarcel 70, 71, 72, 59, 74, 75, 76, 77, 78, 79, 739130803Smarcel 80, 81, 82, 83, 84, 85, 33, 59, 59, 59, 740130803Smarcel 59, 59, 92, 59, 59, 33, 43, 33, 12, 73, 741130803Smarcel 64, 64, 35, 50, 51, 65, 53, -1, -1, -1, 742130803Smarcel -1, -1, 112, -1, 114, -1, 37, 38, 39, 40, 743130803Smarcel 41, 42, 43, 44, 45, 46, 73, 48, 49, 50, 744130803Smarcel 51, 52, 53, 54, 55, 135, 57, 58, 59, 60, 745130803Smarcel -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, 746130803Smarcel 150, -1, -1, -1, 154, -1, 156, -1, 158, 159, 747130803Smarcel 3, -1, -1, 6, 7, 8, 9, 10, 11, 12, 748130803Smarcel 13, -1, 172, 16, 17, 18, 19, 20, 21, 22, 749130803Smarcel 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 750130803Smarcel -1, 34, 48, 49, 50, 51, 52, 53, 54, 55, 751130803Smarcel -1, 57, 58, 59, 60, -1, -1, 50, 51, -1, 752130803Smarcel -1, -1, -1, -1, -1, -1, 59, -1, 61, 62, 753130803Smarcel 3, -1, 65, 6, 7, 8, 9, 10, 11, 12, 754130803Smarcel 13, -1, -1, 16, 17, 18, 19, 20, 21, 22, 755130803Smarcel 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 756130803Smarcel -1, 34, 49, 50, 51, 52, 53, 54, 55, -1, 757130803Smarcel 57, 58, 59, 60, -1, -1, -1, 50, 51, -1, 758130803Smarcel -1, -1, -1, -1, -1, -1, 59, -1, 61, 62, 759130803Smarcel -1, 35, 65, 37, 38, 39, 40, 41, 42, 43, 760130803Smarcel 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 761130803Smarcel 54, 55, -1, 57, 58, 59, 60, -1, -1, 35, 762130803Smarcel 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 763130803Smarcel 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 764130803Smarcel -1, 57, 58, 59, 60, -1, -1, -1, 64, 37, 765130803Smarcel 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 766130803Smarcel 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 767130803Smarcel 58, 59, 60, -1, -1, -1, 64, 37, 38, 39, 768130803Smarcel 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 769130803Smarcel 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, 770130803Smarcel 60, -1, -1, -1, 64, 37, 38, 39, 40, 41, 771130803Smarcel 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 772130803Smarcel 52, 53, 54, 55, -1, 57, 58, 59, 60, -1, 773130803Smarcel -1, -1, 64, 37, 38, 39, 40, 41, 42, 43, 774130803Smarcel 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 775130803Smarcel 54, 55, -1, 57, 58, 59, 60, -1, -1, -1, 776130803Smarcel 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 777130803Smarcel 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 778130803Smarcel -1, 57, 58, 59, 60, -1, -1, -1, 64, 37, 779130803Smarcel 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 780130803Smarcel 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 781130803Smarcel 58, 59, 60, -1, -1, -1, 64, 37, 38, 39, 782130803Smarcel 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 783130803Smarcel 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, 784130803Smarcel 60, -1, -1, -1, 64, 37, 38, 39, 40, 41, 785130803Smarcel 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 786130803Smarcel 52, 53, 54, 55, -1, 57, 58, 59, 60, -1, 787130803Smarcel -1, -1, 64, 37, 38, 39, 40, 41, 42, 43, 788130803Smarcel 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 789130803Smarcel 54, 55, -1, 57, 58, 59, 60, -1, -1, -1, 790130803Smarcel 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 791130803Smarcel 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 792130803Smarcel -1, 57, 58, 59, 60, -1, -1, -1, 64, 37, 793130803Smarcel 38, 39, 40, 41, 42, 43, 44, 45, 46, -1, 794130803Smarcel 48, 49, 50, 51, 52, 53, 54, 55, -1, 57, 795130803Smarcel 58, 59, 60, -1, -1, -1, 64, 37, 38, 39, 796130803Smarcel 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 797130803Smarcel 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, 798130803Smarcel 60, -1, -1, -1, 64, 37, 38, 39, 40, 41, 799130803Smarcel 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 800130803Smarcel 52, 53, 54, 55, -1, 57, 58, 59, 60, -1, 801130803Smarcel -1, -1, 64, 37, 38, 39, 40, 41, 42, 43, 802130803Smarcel 44, 45, 46, -1, 48, 49, 50, 51, 52, 53, 803130803Smarcel 54, 55, -1, 57, 58, 59, 60, -1, -1, 35, 804130803Smarcel 64, 37, 38, 39, 40, 41, 42, 43, 44, 45, 805130803Smarcel 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 806130803Smarcel -1, 57, 58, 59, 60, 35, -1, 37, 38, 39, 807130803Smarcel 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 808130803Smarcel 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, 809130803Smarcel 60, 37, 38, 39, 40, 41, 42, 43, 44, 45, 810130803Smarcel 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, 811130803Smarcel -1, 57, 58, 59, 60, 37, 38, 39, 40, 41, 812130803Smarcel 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, 813130803Smarcel 52, 53, 54, 55, -1, 57, 58, 59, 60, 50, 814130803Smarcel 51, 52, 53, 54, 55, -1, 57, 58, 59, 60, 815130803Smarcel 52, 53, 54, 55, -1, 57, 58, 59, 60 816130803Smarcel}; 817130803Smarcel 818130803Smarcel/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 819130803Smarcel symbol of state STATE-NUM. */ 820130803Smarcelstatic const unsigned char yystos[] = 821130803Smarcel{ 822130803Smarcel 0, 3, 6, 7, 8, 9, 10, 11, 12, 13, 823130803Smarcel 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 824130803Smarcel 26, 27, 28, 29, 30, 31, 32, 34, 50, 51, 825130803Smarcel 59, 61, 62, 65, 69, 70, 71, 73, 74, 79, 826130803Smarcel 80, 81, 82, 59, 71, 82, 59, 59, 59, 59, 827130803Smarcel 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 828130803Smarcel 59, 71, 72, 71, 71, 77, 82, 0, 37, 38, 829130803Smarcel 39, 40, 41, 42, 43, 44, 45, 46, 48, 49, 830130803Smarcel 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 831130803Smarcel 71, 33, 59, 65, 82, 71, 71, 71, 71, 82, 832130803Smarcel 82, 71, 82, 71, 71, 71, 71, 71, 71, 71, 833130803Smarcel 71, 64, 35, 66, 66, 71, 71, 71, 71, 71, 834130803Smarcel 65, 74, 82, 71, 71, 71, 71, 71, 71, 71, 835130803Smarcel 71, 71, 71, 71, 71, 75, 76, 12, 12, 13, 836130803Smarcel 71, 77, 64, 64, 64, 64, 64, 64, 64, 64, 837130803Smarcel 35, 64, 64, 64, 35, 64, 35, 64, 35, 35, 838130803Smarcel 71, 71, 71, 78, 77, 64, 66, 71, 71, 71, 839130803Smarcel 71, 71, 35, 67, 64, 64, 64, 64, 64, 64, 840130803Smarcel 71 841130803Smarcel}; 842130803Smarcel 843130803Smarcel#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 844130803Smarcel# define YYSIZE_T __SIZE_TYPE__ 845130803Smarcel#endif 846130803Smarcel#if ! defined (YYSIZE_T) && defined (size_t) 847130803Smarcel# define YYSIZE_T size_t 848130803Smarcel#endif 849130803Smarcel#if ! defined (YYSIZE_T) 850130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 851130803Smarcel# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 852130803Smarcel# define YYSIZE_T size_t 853130803Smarcel# endif 854130803Smarcel#endif 855130803Smarcel#if ! defined (YYSIZE_T) 856130803Smarcel# define YYSIZE_T unsigned int 857130803Smarcel#endif 858130803Smarcel 859130803Smarcel#define yyerrok (yyerrstatus = 0) 860130803Smarcel#define yyclearin (yychar = YYEMPTY) 861130803Smarcel#define YYEMPTY (-2) 862130803Smarcel#define YYEOF 0 863130803Smarcel 864130803Smarcel#define YYACCEPT goto yyacceptlab 865130803Smarcel#define YYABORT goto yyabortlab 866130803Smarcel#define YYERROR goto yyerrlab1 867130803Smarcel 868130803Smarcel/* Like YYERROR except do call yyerror. This remains here temporarily 869130803Smarcel to ease the transition to the new meaning of YYERROR, for GCC. 870130803Smarcel Once GCC version 2 has supplanted version 1, this can go. */ 871130803Smarcel 872130803Smarcel#define YYFAIL goto yyerrlab 873130803Smarcel 874130803Smarcel#define YYRECOVERING() (!!yyerrstatus) 875130803Smarcel 876130803Smarcel#define YYBACKUP(Token, Value) \ 877130803Smarceldo \ 878130803Smarcel if (yychar == YYEMPTY && yylen == 1) \ 879130803Smarcel { \ 880130803Smarcel yychar = (Token); \ 881130803Smarcel yylval = (Value); \ 882130803Smarcel yytoken = YYTRANSLATE (yychar); \ 883130803Smarcel YYPOPSTACK; \ 884130803Smarcel goto yybackup; \ 885130803Smarcel } \ 886130803Smarcel else \ 887130803Smarcel { \ 888130803Smarcel yyerror ("syntax error: cannot back up");\ 889130803Smarcel YYERROR; \ 890130803Smarcel } \ 891130803Smarcelwhile (0) 892130803Smarcel 893130803Smarcel#define YYTERROR 1 894130803Smarcel#define YYERRCODE 256 895130803Smarcel 896130803Smarcel/* YYLLOC_DEFAULT -- Compute the default location (before the actions 897130803Smarcel are run). */ 898130803Smarcel 899130803Smarcel#ifndef YYLLOC_DEFAULT 900130803Smarcel# define YYLLOC_DEFAULT(Current, Rhs, N) \ 901130803Smarcel Current.first_line = Rhs[1].first_line; \ 902130803Smarcel Current.first_column = Rhs[1].first_column; \ 903130803Smarcel Current.last_line = Rhs[N].last_line; \ 904130803Smarcel Current.last_column = Rhs[N].last_column; 905130803Smarcel#endif 906130803Smarcel 907130803Smarcel/* YYLEX -- calling `yylex' with the right arguments. */ 908130803Smarcel 909130803Smarcel#ifdef YYLEX_PARAM 910130803Smarcel# define YYLEX yylex (YYLEX_PARAM) 911130803Smarcel#else 912130803Smarcel# define YYLEX yylex () 913130803Smarcel#endif 914130803Smarcel 915130803Smarcel/* Enable debugging if requested. */ 916130803Smarcel#if YYDEBUG 917130803Smarcel 918130803Smarcel# ifndef YYFPRINTF 919130803Smarcel# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 920130803Smarcel# define YYFPRINTF fprintf 921130803Smarcel# endif 922130803Smarcel 923130803Smarcel# define YYDPRINTF(Args) \ 924130803Smarceldo { \ 925130803Smarcel if (yydebug) \ 926130803Smarcel YYFPRINTF Args; \ 927130803Smarcel} while (0) 928130803Smarcel 929130803Smarcel# define YYDSYMPRINT(Args) \ 930130803Smarceldo { \ 931130803Smarcel if (yydebug) \ 932130803Smarcel yysymprint Args; \ 933130803Smarcel} while (0) 934130803Smarcel 935130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location) \ 936130803Smarceldo { \ 937130803Smarcel if (yydebug) \ 938130803Smarcel { \ 939130803Smarcel YYFPRINTF (stderr, "%s ", Title); \ 940130803Smarcel yysymprint (stderr, \ 941130803Smarcel Token, Value); \ 942130803Smarcel YYFPRINTF (stderr, "\n"); \ 943130803Smarcel } \ 944130803Smarcel} while (0) 945130803Smarcel 946130803Smarcel/*------------------------------------------------------------------. 947130803Smarcel| yy_stack_print -- Print the state stack from its BOTTOM up to its | 948130803Smarcel| TOP (cinluded). | 949130803Smarcel`------------------------------------------------------------------*/ 950130803Smarcel 951130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 952130803Smarcelstatic void 953130803Smarcelyy_stack_print (short *bottom, short *top) 954130803Smarcel#else 955130803Smarcelstatic void 956130803Smarcelyy_stack_print (bottom, top) 957130803Smarcel short *bottom; 958130803Smarcel short *top; 959130803Smarcel#endif 960130803Smarcel{ 961130803Smarcel YYFPRINTF (stderr, "Stack now"); 962130803Smarcel for (/* Nothing. */; bottom <= top; ++bottom) 963130803Smarcel YYFPRINTF (stderr, " %d", *bottom); 964130803Smarcel YYFPRINTF (stderr, "\n"); 965130803Smarcel} 966130803Smarcel 967130803Smarcel# define YY_STACK_PRINT(Bottom, Top) \ 968130803Smarceldo { \ 969130803Smarcel if (yydebug) \ 970130803Smarcel yy_stack_print ((Bottom), (Top)); \ 971130803Smarcel} while (0) 972130803Smarcel 973130803Smarcel 974130803Smarcel/*------------------------------------------------. 975130803Smarcel| Report that the YYRULE is going to be reduced. | 976130803Smarcel`------------------------------------------------*/ 977130803Smarcel 978130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 979130803Smarcelstatic void 980130803Smarcelyy_reduce_print (int yyrule) 981130803Smarcel#else 982130803Smarcelstatic void 983130803Smarcelyy_reduce_print (yyrule) 984130803Smarcel int yyrule; 985130803Smarcel#endif 986130803Smarcel{ 987130803Smarcel int yyi; 988130803Smarcel unsigned int yylineno = yyrline[yyrule]; 989130803Smarcel YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", 990130803Smarcel yyrule - 1, yylineno); 991130803Smarcel /* Print the symbols being reduced, and their result. */ 992130803Smarcel for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) 993130803Smarcel YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); 994130803Smarcel YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); 995130803Smarcel} 996130803Smarcel 997130803Smarcel# define YY_REDUCE_PRINT(Rule) \ 998130803Smarceldo { \ 999130803Smarcel if (yydebug) \ 1000130803Smarcel yy_reduce_print (Rule); \ 1001130803Smarcel} while (0) 1002130803Smarcel 1003130803Smarcel/* Nonzero means print parse trace. It is left uninitialized so that 1004130803Smarcel multiple parsers can coexist. */ 1005130803Smarcelint yydebug; 1006130803Smarcel#else /* !YYDEBUG */ 1007130803Smarcel# define YYDPRINTF(Args) 1008130803Smarcel# define YYDSYMPRINT(Args) 1009130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location) 1010130803Smarcel# define YY_STACK_PRINT(Bottom, Top) 1011130803Smarcel# define YY_REDUCE_PRINT(Rule) 1012130803Smarcel#endif /* !YYDEBUG */ 1013130803Smarcel 1014130803Smarcel 1015130803Smarcel/* YYINITDEPTH -- initial size of the parser's stacks. */ 1016130803Smarcel#ifndef YYINITDEPTH 1017130803Smarcel# define YYINITDEPTH 200 1018130803Smarcel#endif 1019130803Smarcel 1020130803Smarcel/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1021130803Smarcel if the built-in stack extension method is used). 1022130803Smarcel 1023130803Smarcel Do not make this value too large; the results are undefined if 1024130803Smarcel SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 1025130803Smarcel evaluated with infinite-precision integer arithmetic. */ 1026130803Smarcel 1027130803Smarcel#if YYMAXDEPTH == 0 1028130803Smarcel# undef YYMAXDEPTH 1029130803Smarcel#endif 1030130803Smarcel 1031130803Smarcel#ifndef YYMAXDEPTH 1032130803Smarcel# define YYMAXDEPTH 10000 1033130803Smarcel#endif 1034130803Smarcel 1035130803Smarcel 1036130803Smarcel 1037130803Smarcel#if YYERROR_VERBOSE 1038130803Smarcel 1039130803Smarcel# ifndef yystrlen 1040130803Smarcel# if defined (__GLIBC__) && defined (_STRING_H) 1041130803Smarcel# define yystrlen strlen 1042130803Smarcel# else 1043130803Smarcel/* Return the length of YYSTR. */ 1044130803Smarcelstatic YYSIZE_T 1045130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1046130803Smarcelyystrlen (const char *yystr) 1047130803Smarcel# else 1048130803Smarcelyystrlen (yystr) 1049130803Smarcel const char *yystr; 1050130803Smarcel# endif 1051130803Smarcel{ 1052130803Smarcel register const char *yys = yystr; 1053130803Smarcel 1054130803Smarcel while (*yys++ != '\0') 1055130803Smarcel continue; 1056130803Smarcel 1057130803Smarcel return yys - yystr - 1; 1058130803Smarcel} 1059130803Smarcel# endif 1060130803Smarcel# endif 1061130803Smarcel 1062130803Smarcel# ifndef yystpcpy 1063130803Smarcel# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) 1064130803Smarcel# define yystpcpy stpcpy 1065130803Smarcel# else 1066130803Smarcel/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1067130803Smarcel YYDEST. */ 1068130803Smarcelstatic char * 1069130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1070130803Smarcelyystpcpy (char *yydest, const char *yysrc) 1071130803Smarcel# else 1072130803Smarcelyystpcpy (yydest, yysrc) 1073130803Smarcel char *yydest; 1074130803Smarcel const char *yysrc; 1075130803Smarcel# endif 1076130803Smarcel{ 1077130803Smarcel register char *yyd = yydest; 1078130803Smarcel register const char *yys = yysrc; 1079130803Smarcel 1080130803Smarcel while ((*yyd++ = *yys++) != '\0') 1081130803Smarcel continue; 1082130803Smarcel 1083130803Smarcel return yyd - 1; 1084130803Smarcel} 1085130803Smarcel# endif 1086130803Smarcel# endif 1087130803Smarcel 1088130803Smarcel#endif /* !YYERROR_VERBOSE */ 1089130803Smarcel 1090130803Smarcel 1091130803Smarcel 1092130803Smarcel#if YYDEBUG 1093130803Smarcel/*--------------------------------. 1094130803Smarcel| Print this symbol on YYOUTPUT. | 1095130803Smarcel`--------------------------------*/ 1096130803Smarcel 1097130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1098130803Smarcelstatic void 1099130803Smarcelyysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) 1100130803Smarcel#else 1101130803Smarcelstatic void 1102130803Smarcelyysymprint (yyoutput, yytype, yyvaluep) 1103130803Smarcel FILE *yyoutput; 1104130803Smarcel int yytype; 1105130803Smarcel YYSTYPE *yyvaluep; 1106130803Smarcel#endif 1107130803Smarcel{ 1108130803Smarcel /* Pacify ``unused variable'' warnings. */ 1109130803Smarcel (void) yyvaluep; 1110130803Smarcel 1111130803Smarcel if (yytype < YYNTOKENS) 1112130803Smarcel { 1113130803Smarcel YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 1114130803Smarcel# ifdef YYPRINT 1115130803Smarcel YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 1116130803Smarcel# endif 1117130803Smarcel } 1118130803Smarcel else 1119130803Smarcel YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 1120130803Smarcel 1121130803Smarcel switch (yytype) 1122130803Smarcel { 1123130803Smarcel default: 1124130803Smarcel break; 1125130803Smarcel } 1126130803Smarcel YYFPRINTF (yyoutput, ")"); 1127130803Smarcel} 1128130803Smarcel 1129130803Smarcel#endif /* ! YYDEBUG */ 1130130803Smarcel/*-----------------------------------------------. 1131130803Smarcel| Release the memory associated to this symbol. | 1132130803Smarcel`-----------------------------------------------*/ 1133130803Smarcel 1134130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1135130803Smarcelstatic void 1136130803Smarcelyydestruct (int yytype, YYSTYPE *yyvaluep) 1137130803Smarcel#else 1138130803Smarcelstatic void 1139130803Smarcelyydestruct (yytype, yyvaluep) 1140130803Smarcel int yytype; 1141130803Smarcel YYSTYPE *yyvaluep; 1142130803Smarcel#endif 1143130803Smarcel{ 1144130803Smarcel /* Pacify ``unused variable'' warnings. */ 1145130803Smarcel (void) yyvaluep; 1146130803Smarcel 1147130803Smarcel switch (yytype) 1148130803Smarcel { 1149130803Smarcel 1150130803Smarcel default: 1151130803Smarcel break; 1152130803Smarcel } 1153130803Smarcel} 1154130803Smarcel 1155130803Smarcel 1156130803Smarcel/* Prevent warnings from -Wmissing-prototypes. */ 1157130803Smarcel 1158130803Smarcel#ifdef YYPARSE_PARAM 1159130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1160130803Smarcelint yyparse (void *YYPARSE_PARAM); 1161130803Smarcel# else 1162130803Smarcelint yyparse (); 1163130803Smarcel# endif 1164130803Smarcel#else /* ! YYPARSE_PARAM */ 1165130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1166130803Smarcelint yyparse (void); 1167130803Smarcel#else 1168130803Smarcelint yyparse (); 1169130803Smarcel#endif 1170130803Smarcel#endif /* ! YYPARSE_PARAM */ 1171130803Smarcel 1172130803Smarcel 1173130803Smarcel 1174130803Smarcel/* The lookahead symbol. */ 1175130803Smarcelint yychar; 1176130803Smarcel 1177130803Smarcel/* The semantic value of the lookahead symbol. */ 1178130803SmarcelYYSTYPE yylval; 1179130803Smarcel 1180130803Smarcel/* Number of syntax errors so far. */ 1181130803Smarcelint yynerrs; 1182130803Smarcel 1183130803Smarcel 1184130803Smarcel 1185130803Smarcel/*----------. 1186130803Smarcel| yyparse. | 1187130803Smarcel`----------*/ 1188130803Smarcel 1189130803Smarcel#ifdef YYPARSE_PARAM 1190130803Smarcel# if defined (__STDC__) || defined (__cplusplus) 1191130803Smarcelint yyparse (void *YYPARSE_PARAM) 1192130803Smarcel# else 1193130803Smarcelint yyparse (YYPARSE_PARAM) 1194130803Smarcel void *YYPARSE_PARAM; 1195130803Smarcel# endif 1196130803Smarcel#else /* ! YYPARSE_PARAM */ 1197130803Smarcel#if defined (__STDC__) || defined (__cplusplus) 1198130803Smarcelint 1199130803Smarcelyyparse (void) 1200130803Smarcel#else 1201130803Smarcelint 1202130803Smarcelyyparse () 1203130803Smarcel 1204130803Smarcel#endif 1205130803Smarcel#endif 1206130803Smarcel{ 1207130803Smarcel 1208130803Smarcel register int yystate; 1209130803Smarcel register int yyn; 1210130803Smarcel int yyresult; 1211130803Smarcel /* Number of tokens to shift before error messages enabled. */ 1212130803Smarcel int yyerrstatus; 1213130803Smarcel /* Lookahead token as an internal (translated) token number. */ 1214130803Smarcel int yytoken = 0; 1215130803Smarcel 1216130803Smarcel /* Three stacks and their tools: 1217130803Smarcel `yyss': related to states, 1218130803Smarcel `yyvs': related to semantic values, 1219130803Smarcel `yyls': related to locations. 1220130803Smarcel 1221130803Smarcel Refer to the stacks thru separate pointers, to allow yyoverflow 1222130803Smarcel to xreallocate them elsewhere. */ 1223130803Smarcel 1224130803Smarcel /* The state stack. */ 1225130803Smarcel short yyssa[YYINITDEPTH]; 1226130803Smarcel short *yyss = yyssa; 1227130803Smarcel register short *yyssp; 1228130803Smarcel 1229130803Smarcel /* The semantic value stack. */ 1230130803Smarcel YYSTYPE yyvsa[YYINITDEPTH]; 1231130803Smarcel YYSTYPE *yyvs = yyvsa; 1232130803Smarcel register YYSTYPE *yyvsp; 1233130803Smarcel 1234130803Smarcel 1235130803Smarcel 1236130803Smarcel#define YYPOPSTACK (yyvsp--, yyssp--) 1237130803Smarcel 1238130803Smarcel YYSIZE_T yystacksize = YYINITDEPTH; 1239130803Smarcel 1240130803Smarcel /* The variables used to return semantic value and location from the 1241130803Smarcel action routines. */ 1242130803Smarcel YYSTYPE yyval; 1243130803Smarcel 1244130803Smarcel 1245130803Smarcel /* When reducing, the number of symbols on the RHS of the reduced 1246130803Smarcel rule. */ 1247130803Smarcel int yylen; 1248130803Smarcel 1249130803Smarcel YYDPRINTF ((stderr, "Starting parse\n")); 1250130803Smarcel 1251130803Smarcel yystate = 0; 1252130803Smarcel yyerrstatus = 0; 1253130803Smarcel yynerrs = 0; 1254130803Smarcel yychar = YYEMPTY; /* Cause a token to be read. */ 1255130803Smarcel 1256130803Smarcel /* Initialize stack pointers. 1257130803Smarcel Waste one element of value and location stack 1258130803Smarcel so that they stay on the same level as the state stack. 1259130803Smarcel The wasted elements are never initialized. */ 1260130803Smarcel 1261130803Smarcel yyssp = yyss; 1262130803Smarcel yyvsp = yyvs; 1263130803Smarcel 1264130803Smarcel goto yysetstate; 1265130803Smarcel 1266130803Smarcel/*------------------------------------------------------------. 1267130803Smarcel| yynewstate -- Push a new state, which is found in yystate. | 1268130803Smarcel`------------------------------------------------------------*/ 1269130803Smarcel yynewstate: 1270130803Smarcel /* In all cases, when you get here, the value and location stacks 1271130803Smarcel have just been pushed. so pushing a state here evens the stacks. 1272130803Smarcel */ 1273130803Smarcel yyssp++; 1274130803Smarcel 1275130803Smarcel yysetstate: 1276130803Smarcel *yyssp = yystate; 1277130803Smarcel 1278130803Smarcel if (yyss + yystacksize - 1 <= yyssp) 1279130803Smarcel { 1280130803Smarcel /* Get the current used size of the three stacks, in elements. */ 1281130803Smarcel YYSIZE_T yysize = yyssp - yyss + 1; 1282130803Smarcel 1283130803Smarcel#ifdef yyoverflow 1284130803Smarcel { 1285130803Smarcel /* Give user a chance to xreallocate the stack. Use copies of 1286130803Smarcel these so that the &'s don't force the real ones into 1287130803Smarcel memory. */ 1288130803Smarcel YYSTYPE *yyvs1 = yyvs; 1289130803Smarcel short *yyss1 = yyss; 1290130803Smarcel 1291130803Smarcel 1292130803Smarcel /* Each stack pointer address is followed by the size of the 1293130803Smarcel data in use in that stack, in bytes. This used to be a 1294130803Smarcel conditional around just the two extra args, but that might 1295130803Smarcel be undefined if yyoverflow is a macro. */ 1296130803Smarcel yyoverflow ("parser stack overflow", 1297130803Smarcel &yyss1, yysize * sizeof (*yyssp), 1298130803Smarcel &yyvs1, yysize * sizeof (*yyvsp), 1299130803Smarcel 1300130803Smarcel &yystacksize); 1301130803Smarcel 1302130803Smarcel yyss = yyss1; 1303130803Smarcel yyvs = yyvs1; 1304130803Smarcel } 1305130803Smarcel#else /* no yyoverflow */ 1306130803Smarcel# ifndef YYSTACK_RELOCATE 1307130803Smarcel goto yyoverflowlab; 1308130803Smarcel# else 1309130803Smarcel /* Extend the stack our own way. */ 1310130803Smarcel if (YYMAXDEPTH <= yystacksize) 1311130803Smarcel goto yyoverflowlab; 1312130803Smarcel yystacksize *= 2; 1313130803Smarcel if (YYMAXDEPTH < yystacksize) 1314130803Smarcel yystacksize = YYMAXDEPTH; 1315130803Smarcel 1316130803Smarcel { 1317130803Smarcel short *yyss1 = yyss; 1318130803Smarcel union yyalloc *yyptr = 1319130803Smarcel (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1320130803Smarcel if (! yyptr) 1321130803Smarcel goto yyoverflowlab; 1322130803Smarcel YYSTACK_RELOCATE (yyss); 1323130803Smarcel YYSTACK_RELOCATE (yyvs); 1324130803Smarcel 1325130803Smarcel# undef YYSTACK_RELOCATE 1326130803Smarcel if (yyss1 != yyssa) 1327130803Smarcel YYSTACK_FREE (yyss1); 1328130803Smarcel } 1329130803Smarcel# endif 1330130803Smarcel#endif /* no yyoverflow */ 1331130803Smarcel 1332130803Smarcel yyssp = yyss + yysize - 1; 1333130803Smarcel yyvsp = yyvs + yysize - 1; 1334130803Smarcel 1335130803Smarcel 1336130803Smarcel YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1337130803Smarcel (unsigned long int) yystacksize)); 1338130803Smarcel 1339130803Smarcel if (yyss + yystacksize - 1 <= yyssp) 1340130803Smarcel YYABORT; 1341130803Smarcel } 1342130803Smarcel 1343130803Smarcel YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1344130803Smarcel 1345130803Smarcel goto yybackup; 1346130803Smarcel 1347130803Smarcel/*-----------. 1348130803Smarcel| yybackup. | 1349130803Smarcel`-----------*/ 1350130803Smarcelyybackup: 1351130803Smarcel 1352130803Smarcel/* Do appropriate processing given the current state. */ 1353130803Smarcel/* Read a lookahead token if we need one and don't already have one. */ 1354130803Smarcel/* yyresume: */ 1355130803Smarcel 1356130803Smarcel /* First try to decide what to do without reference to lookahead token. */ 1357130803Smarcel 1358130803Smarcel yyn = yypact[yystate]; 1359130803Smarcel if (yyn == YYPACT_NINF) 1360130803Smarcel goto yydefault; 1361130803Smarcel 1362130803Smarcel /* Not known => get a lookahead token if don't already have one. */ 1363130803Smarcel 1364130803Smarcel /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1365130803Smarcel if (yychar == YYEMPTY) 1366130803Smarcel { 1367130803Smarcel YYDPRINTF ((stderr, "Reading a token: ")); 1368130803Smarcel yychar = YYLEX; 1369130803Smarcel } 1370130803Smarcel 1371130803Smarcel if (yychar <= YYEOF) 1372130803Smarcel { 1373130803Smarcel yychar = yytoken = YYEOF; 1374130803Smarcel YYDPRINTF ((stderr, "Now at end of input.\n")); 1375130803Smarcel } 1376130803Smarcel else 1377130803Smarcel { 1378130803Smarcel yytoken = YYTRANSLATE (yychar); 1379130803Smarcel YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); 1380130803Smarcel } 1381130803Smarcel 1382130803Smarcel /* If the proper action on seeing token YYTOKEN is to reduce or to 1383130803Smarcel detect an error, take that action. */ 1384130803Smarcel yyn += yytoken; 1385130803Smarcel if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1386130803Smarcel goto yydefault; 1387130803Smarcel yyn = yytable[yyn]; 1388130803Smarcel if (yyn <= 0) 1389130803Smarcel { 1390130803Smarcel if (yyn == 0 || yyn == YYTABLE_NINF) 1391130803Smarcel goto yyerrlab; 1392130803Smarcel yyn = -yyn; 1393130803Smarcel goto yyreduce; 1394130803Smarcel } 1395130803Smarcel 1396130803Smarcel if (yyn == YYFINAL) 1397130803Smarcel YYACCEPT; 1398130803Smarcel 1399130803Smarcel /* Shift the lookahead token. */ 1400130803Smarcel YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); 1401130803Smarcel 1402130803Smarcel /* Discard the token being shifted unless it is eof. */ 1403130803Smarcel if (yychar != YYEOF) 1404130803Smarcel yychar = YYEMPTY; 1405130803Smarcel 1406130803Smarcel *++yyvsp = yylval; 1407130803Smarcel 1408130803Smarcel 1409130803Smarcel /* Count tokens shifted since error; after three, turn off error 1410130803Smarcel status. */ 1411130803Smarcel if (yyerrstatus) 1412130803Smarcel yyerrstatus--; 1413130803Smarcel 1414130803Smarcel yystate = yyn; 1415130803Smarcel goto yynewstate; 1416130803Smarcel 1417130803Smarcel 1418130803Smarcel/*-----------------------------------------------------------. 1419130803Smarcel| yydefault -- do the default action for the current state. | 1420130803Smarcel`-----------------------------------------------------------*/ 1421130803Smarcelyydefault: 1422130803Smarcel yyn = yydefact[yystate]; 1423130803Smarcel if (yyn == 0) 1424130803Smarcel goto yyerrlab; 1425130803Smarcel goto yyreduce; 1426130803Smarcel 1427130803Smarcel 1428130803Smarcel/*-----------------------------. 1429130803Smarcel| yyreduce -- Do a reduction. | 1430130803Smarcel`-----------------------------*/ 1431130803Smarcelyyreduce: 1432130803Smarcel /* yyn is the number of a rule to reduce with. */ 1433130803Smarcel yylen = yyr2[yyn]; 1434130803Smarcel 1435130803Smarcel /* If YYLEN is nonzero, implement the default value of the action: 1436130803Smarcel `$$ = $1'. 1437130803Smarcel 1438130803Smarcel Otherwise, the following line sets YYVAL to garbage. 1439130803Smarcel This behavior is undocumented and Bison 1440130803Smarcel users should not rely upon it. Assigning to YYVAL 1441130803Smarcel unconditionally makes the parser a bit smaller, and it avoids a 1442130803Smarcel GCC warning that YYVAL may be used uninitialized. */ 1443130803Smarcel yyval = yyvsp[1-yylen]; 1444130803Smarcel 1445130803Smarcel 1446130803Smarcel YY_REDUCE_PRINT (yyn); 1447130803Smarcel switch (yyn) 1448130803Smarcel { 1449130803Smarcel case 4: 1450130803Smarcel#line 210 "m2-exp.y" 1451130803Smarcel { write_exp_elt_opcode(OP_TYPE); 1452130803Smarcel write_exp_elt_type(yyvsp[0].tval); 1453130803Smarcel write_exp_elt_opcode(OP_TYPE); 1454130803Smarcel } 1455130803Smarcel break; 1456130803Smarcel 1457130803Smarcel case 5: 1458130803Smarcel#line 219 "m2-exp.y" 1459130803Smarcel { write_exp_elt_opcode (UNOP_IND); } 1460130803Smarcel break; 1461130803Smarcel 1462130803Smarcel case 6: 1463130803Smarcel#line 223 "m2-exp.y" 1464130803Smarcel { number_sign = -1; } 1465130803Smarcel break; 1466130803Smarcel 1467130803Smarcel case 7: 1468130803Smarcel#line 225 "m2-exp.y" 1469130803Smarcel { number_sign = 1; 1470130803Smarcel write_exp_elt_opcode (UNOP_NEG); } 1471130803Smarcel break; 1472130803Smarcel 1473130803Smarcel case 8: 1474130803Smarcel#line 230 "m2-exp.y" 1475130803Smarcel { write_exp_elt_opcode(UNOP_PLUS); } 1476130803Smarcel break; 1477130803Smarcel 1478130803Smarcel case 9: 1479130803Smarcel#line 234 "m2-exp.y" 1480130803Smarcel { write_exp_elt_opcode (UNOP_LOGICAL_NOT); } 1481130803Smarcel break; 1482130803Smarcel 1483130803Smarcel case 12: 1484130803Smarcel#line 242 "m2-exp.y" 1485130803Smarcel { write_exp_elt_opcode (UNOP_CAP); } 1486130803Smarcel break; 1487130803Smarcel 1488130803Smarcel case 13: 1489130803Smarcel#line 246 "m2-exp.y" 1490130803Smarcel { write_exp_elt_opcode (UNOP_ORD); } 1491130803Smarcel break; 1492130803Smarcel 1493130803Smarcel case 14: 1494130803Smarcel#line 250 "m2-exp.y" 1495130803Smarcel { write_exp_elt_opcode (UNOP_ABS); } 1496130803Smarcel break; 1497130803Smarcel 1498130803Smarcel case 15: 1499130803Smarcel#line 254 "m2-exp.y" 1500130803Smarcel { write_exp_elt_opcode (UNOP_HIGH); } 1501130803Smarcel break; 1502130803Smarcel 1503130803Smarcel case 16: 1504130803Smarcel#line 258 "m2-exp.y" 1505130803Smarcel { write_exp_elt_opcode (UNOP_MIN); 1506130803Smarcel write_exp_elt_type (yyvsp[-1].tval); 1507130803Smarcel write_exp_elt_opcode (UNOP_MIN); } 1508130803Smarcel break; 1509130803Smarcel 1510130803Smarcel case 17: 1511130803Smarcel#line 264 "m2-exp.y" 1512130803Smarcel { write_exp_elt_opcode (UNOP_MAX); 1513130803Smarcel write_exp_elt_type (yyvsp[-1].tval); 1514130803Smarcel write_exp_elt_opcode (UNOP_MIN); } 1515130803Smarcel break; 1516130803Smarcel 1517130803Smarcel case 18: 1518130803Smarcel#line 270 "m2-exp.y" 1519130803Smarcel { write_exp_elt_opcode (UNOP_FLOAT); } 1520130803Smarcel break; 1521130803Smarcel 1522130803Smarcel case 19: 1523130803Smarcel#line 274 "m2-exp.y" 1524130803Smarcel { write_exp_elt_opcode (BINOP_VAL); 1525130803Smarcel write_exp_elt_type (yyvsp[-3].tval); 1526130803Smarcel write_exp_elt_opcode (BINOP_VAL); } 1527130803Smarcel break; 1528130803Smarcel 1529130803Smarcel case 20: 1530130803Smarcel#line 280 "m2-exp.y" 1531130803Smarcel { write_exp_elt_opcode (UNOP_CHR); } 1532130803Smarcel break; 1533130803Smarcel 1534130803Smarcel case 21: 1535130803Smarcel#line 284 "m2-exp.y" 1536130803Smarcel { write_exp_elt_opcode (UNOP_ODD); } 1537130803Smarcel break; 1538130803Smarcel 1539130803Smarcel case 22: 1540130803Smarcel#line 288 "m2-exp.y" 1541130803Smarcel { write_exp_elt_opcode (UNOP_TRUNC); } 1542130803Smarcel break; 1543130803Smarcel 1544130803Smarcel case 23: 1545130803Smarcel#line 292 "m2-exp.y" 1546130803Smarcel { write_exp_elt_opcode (UNOP_SIZEOF); } 1547130803Smarcel break; 1548130803Smarcel 1549130803Smarcel case 24: 1550130803Smarcel#line 297 "m2-exp.y" 1551130803Smarcel { write_exp_elt_opcode(UNOP_PREINCREMENT); } 1552130803Smarcel break; 1553130803Smarcel 1554130803Smarcel case 25: 1555130803Smarcel#line 301 "m2-exp.y" 1556130803Smarcel { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); 1557130803Smarcel write_exp_elt_opcode(BINOP_ADD); 1558130803Smarcel write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); } 1559130803Smarcel break; 1560130803Smarcel 1561130803Smarcel case 26: 1562130803Smarcel#line 307 "m2-exp.y" 1563130803Smarcel { write_exp_elt_opcode(UNOP_PREDECREMENT);} 1564130803Smarcel break; 1565130803Smarcel 1566130803Smarcel case 27: 1567130803Smarcel#line 311 "m2-exp.y" 1568130803Smarcel { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); 1569130803Smarcel write_exp_elt_opcode(BINOP_SUB); 1570130803Smarcel write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); } 1571130803Smarcel break; 1572130803Smarcel 1573130803Smarcel case 28: 1574130803Smarcel#line 317 "m2-exp.y" 1575130803Smarcel { write_exp_elt_opcode (STRUCTOP_STRUCT); 1576130803Smarcel write_exp_string (yyvsp[0].sval); 1577130803Smarcel write_exp_elt_opcode (STRUCTOP_STRUCT); } 1578130803Smarcel break; 1579130803Smarcel 1580130803Smarcel case 30: 1581130803Smarcel#line 326 "m2-exp.y" 1582130803Smarcel { error("Sets are not implemented.");} 1583130803Smarcel break; 1584130803Smarcel 1585130803Smarcel case 31: 1586130803Smarcel#line 330 "m2-exp.y" 1587130803Smarcel { error("Sets are not implemented.");} 1588130803Smarcel break; 1589130803Smarcel 1590130803Smarcel case 32: 1591130803Smarcel#line 334 "m2-exp.y" 1592130803Smarcel { error("Sets are not implemented.");} 1593130803Smarcel break; 1594130803Smarcel 1595130803Smarcel case 33: 1596130803Smarcel#line 338 "m2-exp.y" 1597130803Smarcel { error("Sets are not implemented.");} 1598130803Smarcel break; 1599130803Smarcel 1600130803Smarcel case 34: 1601130803Smarcel#line 340 "m2-exp.y" 1602130803Smarcel { error("Sets are not implemented.");} 1603130803Smarcel break; 1604130803Smarcel 1605130803Smarcel case 35: 1606130803Smarcel#line 349 "m2-exp.y" 1607130803Smarcel { start_arglist(); } 1608130803Smarcel break; 1609130803Smarcel 1610130803Smarcel case 36: 1611130803Smarcel#line 351 "m2-exp.y" 1612130803Smarcel { write_exp_elt_opcode (MULTI_SUBSCRIPT); 1613130803Smarcel write_exp_elt_longcst ((LONGEST) end_arglist()); 1614130803Smarcel write_exp_elt_opcode (MULTI_SUBSCRIPT); } 1615130803Smarcel break; 1616130803Smarcel 1617130803Smarcel case 37: 1618130803Smarcel#line 359 "m2-exp.y" 1619130803Smarcel { start_arglist (); } 1620130803Smarcel break; 1621130803Smarcel 1622130803Smarcel case 38: 1623130803Smarcel#line 361 "m2-exp.y" 1624130803Smarcel { write_exp_elt_opcode (OP_FUNCALL); 1625130803Smarcel write_exp_elt_longcst ((LONGEST) end_arglist ()); 1626130803Smarcel write_exp_elt_opcode (OP_FUNCALL); } 1627130803Smarcel break; 1628130803Smarcel 1629130803Smarcel case 40: 1630130803Smarcel#line 370 "m2-exp.y" 1631130803Smarcel { arglist_len = 1; } 1632130803Smarcel break; 1633130803Smarcel 1634130803Smarcel case 41: 1635130803Smarcel#line 374 "m2-exp.y" 1636130803Smarcel { arglist_len++; } 1637130803Smarcel break; 1638130803Smarcel 1639130803Smarcel case 42: 1640130803Smarcel#line 379 "m2-exp.y" 1641130803Smarcel { arglist_len = 1; } 1642130803Smarcel break; 1643130803Smarcel 1644130803Smarcel case 43: 1645130803Smarcel#line 384 "m2-exp.y" 1646130803Smarcel { arglist_len++; } 1647130803Smarcel break; 1648130803Smarcel 1649130803Smarcel case 44: 1650130803Smarcel#line 389 "m2-exp.y" 1651130803Smarcel { write_exp_elt_opcode (UNOP_MEMVAL); 1652130803Smarcel write_exp_elt_type (yyvsp[-2].tval); 1653130803Smarcel write_exp_elt_opcode (UNOP_MEMVAL); } 1654130803Smarcel break; 1655130803Smarcel 1656130803Smarcel case 45: 1657130803Smarcel#line 395 "m2-exp.y" 1658130803Smarcel { write_exp_elt_opcode (UNOP_CAST); 1659130803Smarcel write_exp_elt_type (yyvsp[-3].tval); 1660130803Smarcel write_exp_elt_opcode (UNOP_CAST); } 1661130803Smarcel break; 1662130803Smarcel 1663130803Smarcel case 46: 1664130803Smarcel#line 401 "m2-exp.y" 1665130803Smarcel { } 1666130803Smarcel break; 1667130803Smarcel 1668130803Smarcel case 47: 1669130803Smarcel#line 409 "m2-exp.y" 1670130803Smarcel { write_exp_elt_opcode (BINOP_REPEAT); } 1671130803Smarcel break; 1672130803Smarcel 1673130803Smarcel case 48: 1674130803Smarcel#line 413 "m2-exp.y" 1675130803Smarcel { write_exp_elt_opcode (BINOP_MUL); } 1676130803Smarcel break; 1677130803Smarcel 1678130803Smarcel case 49: 1679130803Smarcel#line 417 "m2-exp.y" 1680130803Smarcel { write_exp_elt_opcode (BINOP_DIV); } 1681130803Smarcel break; 1682130803Smarcel 1683130803Smarcel case 50: 1684130803Smarcel#line 421 "m2-exp.y" 1685130803Smarcel { write_exp_elt_opcode (BINOP_INTDIV); } 1686130803Smarcel break; 1687130803Smarcel 1688130803Smarcel case 51: 1689130803Smarcel#line 425 "m2-exp.y" 1690130803Smarcel { write_exp_elt_opcode (BINOP_REM); } 1691130803Smarcel break; 1692130803Smarcel 1693130803Smarcel case 52: 1694130803Smarcel#line 429 "m2-exp.y" 1695130803Smarcel { write_exp_elt_opcode (BINOP_ADD); } 1696130803Smarcel break; 1697130803Smarcel 1698130803Smarcel case 53: 1699130803Smarcel#line 433 "m2-exp.y" 1700130803Smarcel { write_exp_elt_opcode (BINOP_SUB); } 1701130803Smarcel break; 1702130803Smarcel 1703130803Smarcel case 54: 1704130803Smarcel#line 437 "m2-exp.y" 1705130803Smarcel { write_exp_elt_opcode (BINOP_EQUAL); } 1706130803Smarcel break; 1707130803Smarcel 1708130803Smarcel case 55: 1709130803Smarcel#line 441 "m2-exp.y" 1710130803Smarcel { write_exp_elt_opcode (BINOP_NOTEQUAL); } 1711130803Smarcel break; 1712130803Smarcel 1713130803Smarcel case 56: 1714130803Smarcel#line 443 "m2-exp.y" 1715130803Smarcel { write_exp_elt_opcode (BINOP_NOTEQUAL); } 1716130803Smarcel break; 1717130803Smarcel 1718130803Smarcel case 57: 1719130803Smarcel#line 447 "m2-exp.y" 1720130803Smarcel { write_exp_elt_opcode (BINOP_LEQ); } 1721130803Smarcel break; 1722130803Smarcel 1723130803Smarcel case 58: 1724130803Smarcel#line 451 "m2-exp.y" 1725130803Smarcel { write_exp_elt_opcode (BINOP_GEQ); } 1726130803Smarcel break; 1727130803Smarcel 1728130803Smarcel case 59: 1729130803Smarcel#line 455 "m2-exp.y" 1730130803Smarcel { write_exp_elt_opcode (BINOP_LESS); } 1731130803Smarcel break; 1732130803Smarcel 1733130803Smarcel case 60: 1734130803Smarcel#line 459 "m2-exp.y" 1735130803Smarcel { write_exp_elt_opcode (BINOP_GTR); } 1736130803Smarcel break; 1737130803Smarcel 1738130803Smarcel case 61: 1739130803Smarcel#line 463 "m2-exp.y" 1740130803Smarcel { write_exp_elt_opcode (BINOP_LOGICAL_AND); } 1741130803Smarcel break; 1742130803Smarcel 1743130803Smarcel case 62: 1744130803Smarcel#line 467 "m2-exp.y" 1745130803Smarcel { write_exp_elt_opcode (BINOP_LOGICAL_OR); } 1746130803Smarcel break; 1747130803Smarcel 1748130803Smarcel case 63: 1749130803Smarcel#line 471 "m2-exp.y" 1750130803Smarcel { write_exp_elt_opcode (BINOP_ASSIGN); } 1751130803Smarcel break; 1752130803Smarcel 1753130803Smarcel case 64: 1754130803Smarcel#line 478 "m2-exp.y" 1755130803Smarcel { write_exp_elt_opcode (OP_BOOL); 1756130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval); 1757130803Smarcel write_exp_elt_opcode (OP_BOOL); } 1758130803Smarcel break; 1759130803Smarcel 1760130803Smarcel case 65: 1761130803Smarcel#line 484 "m2-exp.y" 1762130803Smarcel { write_exp_elt_opcode (OP_BOOL); 1763130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval); 1764130803Smarcel write_exp_elt_opcode (OP_BOOL); } 1765130803Smarcel break; 1766130803Smarcel 1767130803Smarcel case 66: 1768130803Smarcel#line 490 "m2-exp.y" 1769130803Smarcel { write_exp_elt_opcode (OP_LONG); 1770130803Smarcel write_exp_elt_type (builtin_type_m2_int); 1771130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].lval); 1772130803Smarcel write_exp_elt_opcode (OP_LONG); } 1773130803Smarcel break; 1774130803Smarcel 1775130803Smarcel case 67: 1776130803Smarcel#line 497 "m2-exp.y" 1777130803Smarcel { 1778130803Smarcel write_exp_elt_opcode (OP_LONG); 1779130803Smarcel write_exp_elt_type (builtin_type_m2_card); 1780130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval); 1781130803Smarcel write_exp_elt_opcode (OP_LONG); 1782130803Smarcel } 1783130803Smarcel break; 1784130803Smarcel 1785130803Smarcel case 68: 1786130803Smarcel#line 506 "m2-exp.y" 1787130803Smarcel { write_exp_elt_opcode (OP_LONG); 1788130803Smarcel write_exp_elt_type (builtin_type_m2_char); 1789130803Smarcel write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval); 1790130803Smarcel write_exp_elt_opcode (OP_LONG); } 1791130803Smarcel break; 1792130803Smarcel 1793130803Smarcel case 69: 1794130803Smarcel#line 514 "m2-exp.y" 1795130803Smarcel { write_exp_elt_opcode (OP_DOUBLE); 1796130803Smarcel write_exp_elt_type (builtin_type_m2_real); 1797130803Smarcel write_exp_elt_dblcst (yyvsp[0].dval); 1798130803Smarcel write_exp_elt_opcode (OP_DOUBLE); } 1799130803Smarcel break; 1800130803Smarcel 1801130803Smarcel case 71: 1802130803Smarcel#line 524 "m2-exp.y" 1803130803Smarcel { write_exp_elt_opcode (OP_LONG); 1804130803Smarcel write_exp_elt_type (builtin_type_int); 1805130803Smarcel write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval)); 1806130803Smarcel write_exp_elt_opcode (OP_LONG); } 1807130803Smarcel break; 1808130803Smarcel 1809130803Smarcel case 72: 1810130803Smarcel#line 531 "m2-exp.y" 1811130803Smarcel { write_exp_elt_opcode (OP_M2_STRING); 1812130803Smarcel write_exp_string (yyvsp[0].sval); 1813130803Smarcel write_exp_elt_opcode (OP_M2_STRING); } 1814130803Smarcel break; 1815130803Smarcel 1816130803Smarcel case 73: 1817130803Smarcel#line 538 "m2-exp.y" 1818130803Smarcel { yyval.bval = SYMBOL_BLOCK_VALUE(yyvsp[0].sym); } 1819130803Smarcel break; 1820130803Smarcel 1821130803Smarcel case 74: 1822130803Smarcel#line 542 "m2-exp.y" 1823130803Smarcel { struct symbol *sym 1824130803Smarcel = lookup_symbol (copy_name (yyvsp[0].sval), expression_context_block, 1825130803Smarcel VAR_DOMAIN, 0, NULL); 1826130803Smarcel yyval.sym = sym;} 1827130803Smarcel break; 1828130803Smarcel 1829130803Smarcel case 75: 1830130803Smarcel#line 551 "m2-exp.y" 1831130803Smarcel { struct symbol *tem 1832130803Smarcel = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, 1833130803Smarcel VAR_DOMAIN, 0, NULL); 1834130803Smarcel if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK) 1835130803Smarcel error ("No function \"%s\" in specified context.", 1836130803Smarcel copy_name (yyvsp[0].sval)); 1837130803Smarcel yyval.sym = tem; 1838130803Smarcel } 1839130803Smarcel break; 1840130803Smarcel 1841130803Smarcel case 76: 1842130803Smarcel#line 563 "m2-exp.y" 1843130803Smarcel { write_exp_elt_opcode(OP_VAR_VALUE); 1844130803Smarcel write_exp_elt_block (NULL); 1845130803Smarcel write_exp_elt_sym (yyvsp[0].sym); 1846130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); } 1847130803Smarcel break; 1848130803Smarcel 1849130803Smarcel case 78: 1850130803Smarcel#line 575 "m2-exp.y" 1851130803Smarcel { struct symbol *sym; 1852130803Smarcel sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval, 1853130803Smarcel VAR_DOMAIN, 0, NULL); 1854130803Smarcel if (sym == 0) 1855130803Smarcel error ("No symbol \"%s\" in specified context.", 1856130803Smarcel copy_name (yyvsp[0].sval)); 1857130803Smarcel 1858130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 1859130803Smarcel /* block_found is set by lookup_symbol. */ 1860130803Smarcel write_exp_elt_block (block_found); 1861130803Smarcel write_exp_elt_sym (sym); 1862130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); } 1863130803Smarcel break; 1864130803Smarcel 1865130803Smarcel case 79: 1866130803Smarcel#line 591 "m2-exp.y" 1867130803Smarcel { struct symbol *sym; 1868130803Smarcel int is_a_field_of_this; 1869130803Smarcel 1870130803Smarcel sym = lookup_symbol (copy_name (yyvsp[0].sval), 1871130803Smarcel expression_context_block, 1872130803Smarcel VAR_DOMAIN, 1873130803Smarcel &is_a_field_of_this, 1874130803Smarcel NULL); 1875130803Smarcel if (sym) 1876130803Smarcel { 1877130803Smarcel if (symbol_read_needs_frame (sym)) 1878130803Smarcel { 1879130803Smarcel if (innermost_block == 0 || 1880130803Smarcel contained_in (block_found, 1881130803Smarcel innermost_block)) 1882130803Smarcel innermost_block = block_found; 1883130803Smarcel } 1884130803Smarcel 1885130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 1886130803Smarcel /* We want to use the selected frame, not 1887130803Smarcel another more inner frame which happens to 1888130803Smarcel be in the same block. */ 1889130803Smarcel write_exp_elt_block (NULL); 1890130803Smarcel write_exp_elt_sym (sym); 1891130803Smarcel write_exp_elt_opcode (OP_VAR_VALUE); 1892130803Smarcel } 1893130803Smarcel else 1894130803Smarcel { 1895130803Smarcel struct minimal_symbol *msymbol; 1896130803Smarcel char *arg = copy_name (yyvsp[0].sval); 1897130803Smarcel 1898130803Smarcel msymbol = 1899130803Smarcel lookup_minimal_symbol (arg, NULL, NULL); 1900130803Smarcel if (msymbol != NULL) 1901130803Smarcel { 1902130803Smarcel write_exp_msymbol 1903130803Smarcel (msymbol, 1904130803Smarcel lookup_function_type (builtin_type_int), 1905130803Smarcel builtin_type_int); 1906130803Smarcel } 1907130803Smarcel else if (!have_full_symbols () && !have_partial_symbols ()) 1908130803Smarcel error ("No symbol table is loaded. Use the \"symbol-file\" command."); 1909130803Smarcel else 1910130803Smarcel error ("No symbol \"%s\" in current context.", 1911130803Smarcel copy_name (yyvsp[0].sval)); 1912130803Smarcel } 1913130803Smarcel } 1914130803Smarcel break; 1915130803Smarcel 1916130803Smarcel case 80: 1917130803Smarcel#line 642 "m2-exp.y" 1918130803Smarcel { yyval.tval = lookup_typename (copy_name (yyvsp[0].sval), 1919130803Smarcel expression_context_block, 0); } 1920130803Smarcel break; 1921130803Smarcel 1922130803Smarcel 1923130803Smarcel } 1924130803Smarcel 1925130803Smarcel/* Line 991 of yacc.c. */ 1926130803Smarcel 1927130803Smarcel yyvsp -= yylen; 1928130803Smarcel yyssp -= yylen; 1929130803Smarcel 1930130803Smarcel 1931130803Smarcel YY_STACK_PRINT (yyss, yyssp); 1932130803Smarcel 1933130803Smarcel *++yyvsp = yyval; 1934130803Smarcel 1935130803Smarcel 1936130803Smarcel /* Now `shift' the result of the reduction. Determine what state 1937130803Smarcel that goes to, based on the state we popped back to and the rule 1938130803Smarcel number reduced by. */ 1939130803Smarcel 1940130803Smarcel yyn = yyr1[yyn]; 1941130803Smarcel 1942130803Smarcel yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1943130803Smarcel if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1944130803Smarcel yystate = yytable[yystate]; 1945130803Smarcel else 1946130803Smarcel yystate = yydefgoto[yyn - YYNTOKENS]; 1947130803Smarcel 1948130803Smarcel goto yynewstate; 1949130803Smarcel 1950130803Smarcel 1951130803Smarcel/*------------------------------------. 1952130803Smarcel| yyerrlab -- here on detecting error | 1953130803Smarcel`------------------------------------*/ 1954130803Smarcelyyerrlab: 1955130803Smarcel /* If not already recovering from an error, report this error. */ 1956130803Smarcel if (!yyerrstatus) 1957130803Smarcel { 1958130803Smarcel ++yynerrs; 1959130803Smarcel#if YYERROR_VERBOSE 1960130803Smarcel yyn = yypact[yystate]; 1961130803Smarcel 1962130803Smarcel if (YYPACT_NINF < yyn && yyn < YYLAST) 1963130803Smarcel { 1964130803Smarcel YYSIZE_T yysize = 0; 1965130803Smarcel int yytype = YYTRANSLATE (yychar); 1966130803Smarcel char *yymsg; 1967130803Smarcel int yyx, yycount; 1968130803Smarcel 1969130803Smarcel yycount = 0; 1970130803Smarcel /* Start YYX at -YYN if negative to avoid negative indexes in 1971130803Smarcel YYCHECK. */ 1972130803Smarcel for (yyx = yyn < 0 ? -yyn : 0; 1973130803Smarcel yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) 1974130803Smarcel if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1975130803Smarcel yysize += yystrlen (yytname[yyx]) + 15, yycount++; 1976130803Smarcel yysize += yystrlen ("syntax error, unexpected ") + 1; 1977130803Smarcel yysize += yystrlen (yytname[yytype]); 1978130803Smarcel yymsg = (char *) YYSTACK_ALLOC (yysize); 1979130803Smarcel if (yymsg != 0) 1980130803Smarcel { 1981130803Smarcel char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); 1982130803Smarcel yyp = yystpcpy (yyp, yytname[yytype]); 1983130803Smarcel 1984130803Smarcel if (yycount < 5) 1985130803Smarcel { 1986130803Smarcel yycount = 0; 1987130803Smarcel for (yyx = yyn < 0 ? -yyn : 0; 1988130803Smarcel yyx < (int) (sizeof (yytname) / sizeof (char *)); 1989130803Smarcel yyx++) 1990130803Smarcel if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1991130803Smarcel { 1992130803Smarcel const char *yyq = ! yycount ? ", expecting " : " or "; 1993130803Smarcel yyp = yystpcpy (yyp, yyq); 1994130803Smarcel yyp = yystpcpy (yyp, yytname[yyx]); 1995130803Smarcel yycount++; 1996130803Smarcel } 1997130803Smarcel } 1998130803Smarcel yyerror (yymsg); 1999130803Smarcel YYSTACK_FREE (yymsg); 2000130803Smarcel } 2001130803Smarcel else 2002130803Smarcel yyerror ("syntax error; also virtual memory exhausted"); 2003130803Smarcel } 2004130803Smarcel else 2005130803Smarcel#endif /* YYERROR_VERBOSE */ 2006130803Smarcel yyerror ("syntax error"); 2007130803Smarcel } 2008130803Smarcel 2009130803Smarcel 2010130803Smarcel 2011130803Smarcel if (yyerrstatus == 3) 2012130803Smarcel { 2013130803Smarcel /* If just tried and failed to reuse lookahead token after an 2014130803Smarcel error, discard it. */ 2015130803Smarcel 2016130803Smarcel /* Return failure if at end of input. */ 2017130803Smarcel if (yychar == YYEOF) 2018130803Smarcel { 2019130803Smarcel /* Pop the error token. */ 2020130803Smarcel YYPOPSTACK; 2021130803Smarcel /* Pop the rest of the stack. */ 2022130803Smarcel while (yyss < yyssp) 2023130803Smarcel { 2024130803Smarcel YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 2025130803Smarcel yydestruct (yystos[*yyssp], yyvsp); 2026130803Smarcel YYPOPSTACK; 2027130803Smarcel } 2028130803Smarcel YYABORT; 2029130803Smarcel } 2030130803Smarcel 2031130803Smarcel YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); 2032130803Smarcel yydestruct (yytoken, &yylval); 2033130803Smarcel yychar = YYEMPTY; 2034130803Smarcel 2035130803Smarcel } 2036130803Smarcel 2037130803Smarcel /* Else will try to reuse lookahead token after shifting the error 2038130803Smarcel token. */ 2039130803Smarcel goto yyerrlab2; 2040130803Smarcel 2041130803Smarcel 2042130803Smarcel/*----------------------------------------------------. 2043130803Smarcel| yyerrlab1 -- error raised explicitly by an action. | 2044130803Smarcel`----------------------------------------------------*/ 2045130803Smarcelyyerrlab1: 2046130803Smarcel 2047130803Smarcel /* Suppress GCC warning that yyerrlab1 is unused when no action 2048130803Smarcel invokes YYERROR. Doesn't work in C++ */ 2049130803Smarcel#ifndef __cplusplus 2050130803Smarcel#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) 2051130803Smarcel __attribute__ ((__unused__)) 2052130803Smarcel#endif 2053130803Smarcel#endif 2054130803Smarcel 2055130803Smarcel 2056130803Smarcel goto yyerrlab2; 2057130803Smarcel 2058130803Smarcel 2059130803Smarcel/*---------------------------------------------------------------. 2060130803Smarcel| yyerrlab2 -- pop states until the error token can be shifted. | 2061130803Smarcel`---------------------------------------------------------------*/ 2062130803Smarcelyyerrlab2: 2063130803Smarcel yyerrstatus = 3; /* Each real token shifted decrements this. */ 2064130803Smarcel 2065130803Smarcel for (;;) 2066130803Smarcel { 2067130803Smarcel yyn = yypact[yystate]; 2068130803Smarcel if (yyn != YYPACT_NINF) 2069130803Smarcel { 2070130803Smarcel yyn += YYTERROR; 2071130803Smarcel if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2072130803Smarcel { 2073130803Smarcel yyn = yytable[yyn]; 2074130803Smarcel if (0 < yyn) 2075130803Smarcel break; 2076130803Smarcel } 2077130803Smarcel } 2078130803Smarcel 2079130803Smarcel /* Pop the current state because it cannot handle the error token. */ 2080130803Smarcel if (yyssp == yyss) 2081130803Smarcel YYABORT; 2082130803Smarcel 2083130803Smarcel YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 2084130803Smarcel yydestruct (yystos[yystate], yyvsp); 2085130803Smarcel yyvsp--; 2086130803Smarcel yystate = *--yyssp; 2087130803Smarcel 2088130803Smarcel YY_STACK_PRINT (yyss, yyssp); 2089130803Smarcel } 2090130803Smarcel 2091130803Smarcel if (yyn == YYFINAL) 2092130803Smarcel YYACCEPT; 2093130803Smarcel 2094130803Smarcel YYDPRINTF ((stderr, "Shifting error token, ")); 2095130803Smarcel 2096130803Smarcel *++yyvsp = yylval; 2097130803Smarcel 2098130803Smarcel 2099130803Smarcel yystate = yyn; 2100130803Smarcel goto yynewstate; 2101130803Smarcel 2102130803Smarcel 2103130803Smarcel/*-------------------------------------. 2104130803Smarcel| yyacceptlab -- YYACCEPT comes here. | 2105130803Smarcel`-------------------------------------*/ 2106130803Smarcelyyacceptlab: 2107130803Smarcel yyresult = 0; 2108130803Smarcel goto yyreturn; 2109130803Smarcel 2110130803Smarcel/*-----------------------------------. 2111130803Smarcel| yyabortlab -- YYABORT comes here. | 2112130803Smarcel`-----------------------------------*/ 2113130803Smarcelyyabortlab: 2114130803Smarcel yyresult = 1; 2115130803Smarcel goto yyreturn; 2116130803Smarcel 2117130803Smarcel#ifndef yyoverflow 2118130803Smarcel/*----------------------------------------------. 2119130803Smarcel| yyoverflowlab -- parser overflow comes here. | 2120130803Smarcel`----------------------------------------------*/ 2121130803Smarcelyyoverflowlab: 2122130803Smarcel yyerror ("parser stack overflow"); 2123130803Smarcel yyresult = 2; 2124130803Smarcel /* Fall through. */ 2125130803Smarcel#endif 2126130803Smarcel 2127130803Smarcelyyreturn: 2128130803Smarcel#ifndef yyoverflow 2129130803Smarcel if (yyss != yyssa) 2130130803Smarcel YYSTACK_FREE (yyss); 2131130803Smarcel#endif 2132130803Smarcel return yyresult; 2133130803Smarcel} 2134130803Smarcel 2135130803Smarcel 2136130803Smarcel#line 647 "m2-exp.y" 2137130803Smarcel 2138130803Smarcel 2139130803Smarcel#if 0 /* FIXME! */ 2140130803Smarcelint 2141130803Smarceloverflow(a,b) 2142130803Smarcel long a,b; 2143130803Smarcel{ 2144130803Smarcel return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a; 2145130803Smarcel} 2146130803Smarcel 2147130803Smarcelint 2148130803Smarceluoverflow(a,b) 2149130803Smarcel unsigned long a,b; 2150130803Smarcel{ 2151130803Smarcel return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a; 2152130803Smarcel} 2153130803Smarcel#endif /* FIXME */ 2154130803Smarcel 2155130803Smarcel/* Take care of parsing a number (anything that starts with a digit). 2156130803Smarcel Set yylval and return the token type; update lexptr. 2157130803Smarcel LEN is the number of characters in it. */ 2158130803Smarcel 2159130803Smarcel/*** Needs some error checking for the float case ***/ 2160130803Smarcel 2161130803Smarcelstatic int 2162130803Smarcelparse_number (olen) 2163130803Smarcel int olen; 2164130803Smarcel{ 2165130803Smarcel char *p = lexptr; 2166130803Smarcel LONGEST n = 0; 2167130803Smarcel LONGEST prevn = 0; 2168130803Smarcel int c,i,ischar=0; 2169130803Smarcel int base = input_radix; 2170130803Smarcel int len = olen; 2171130803Smarcel int unsigned_p = number_sign == 1 ? 1 : 0; 2172130803Smarcel 2173130803Smarcel if(p[len-1] == 'H') 2174130803Smarcel { 2175130803Smarcel base = 16; 2176130803Smarcel len--; 2177130803Smarcel } 2178130803Smarcel else if(p[len-1] == 'C' || p[len-1] == 'B') 2179130803Smarcel { 2180130803Smarcel base = 8; 2181130803Smarcel ischar = p[len-1] == 'C'; 2182130803Smarcel len--; 2183130803Smarcel } 2184130803Smarcel 2185130803Smarcel /* Scan the number */ 2186130803Smarcel for (c = 0; c < len; c++) 2187130803Smarcel { 2188130803Smarcel if (p[c] == '.' && base == 10) 2189130803Smarcel { 2190130803Smarcel /* It's a float since it contains a point. */ 2191130803Smarcel yylval.dval = atof (p); 2192130803Smarcel lexptr += len; 2193130803Smarcel return FLOAT; 2194130803Smarcel } 2195130803Smarcel if (p[c] == '.' && base != 10) 2196130803Smarcel error("Floating point numbers must be base 10."); 2197130803Smarcel if (base == 10 && (p[c] < '0' || p[c] > '9')) 2198130803Smarcel error("Invalid digit \'%c\' in number.",p[c]); 2199130803Smarcel } 2200130803Smarcel 2201130803Smarcel while (len-- > 0) 2202130803Smarcel { 2203130803Smarcel c = *p++; 2204130803Smarcel n *= base; 2205130803Smarcel if( base == 8 && (c == '8' || c == '9')) 2206130803Smarcel error("Invalid digit \'%c\' in octal number.",c); 2207130803Smarcel if (c >= '0' && c <= '9') 2208130803Smarcel i = c - '0'; 2209130803Smarcel else 2210130803Smarcel { 2211130803Smarcel if (base == 16 && c >= 'A' && c <= 'F') 2212130803Smarcel i = c - 'A' + 10; 2213130803Smarcel else 2214130803Smarcel return ERROR; 2215130803Smarcel } 2216130803Smarcel n+=i; 2217130803Smarcel if(i >= base) 2218130803Smarcel return ERROR; 2219130803Smarcel if(!unsigned_p && number_sign == 1 && (prevn >= n)) 2220130803Smarcel unsigned_p=1; /* Try something unsigned */ 2221130803Smarcel /* Don't do the range check if n==i and i==0, since that special 2222130803Smarcel case will give an overflow error. */ 2223130803Smarcel if(RANGE_CHECK && n!=i && i) 2224130803Smarcel { 2225130803Smarcel if((unsigned_p && (unsigned)prevn >= (unsigned)n) || 2226130803Smarcel ((!unsigned_p && number_sign==-1) && -prevn <= -n)) 2227130803Smarcel range_error("Overflow on numeric constant."); 2228130803Smarcel } 2229130803Smarcel prevn=n; 2230130803Smarcel } 2231130803Smarcel 2232130803Smarcel lexptr = p; 2233130803Smarcel if(*p == 'B' || *p == 'C' || *p == 'H') 2234130803Smarcel lexptr++; /* Advance past B,C or H */ 2235130803Smarcel 2236130803Smarcel if (ischar) 2237130803Smarcel { 2238130803Smarcel yylval.ulval = n; 2239130803Smarcel return CHAR; 2240130803Smarcel } 2241130803Smarcel else if ( unsigned_p && number_sign == 1) 2242130803Smarcel { 2243130803Smarcel yylval.ulval = n; 2244130803Smarcel return UINT; 2245130803Smarcel } 2246130803Smarcel else if((unsigned_p && (n<0))) { 2247130803Smarcel range_error("Overflow on numeric constant -- number too large."); 2248130803Smarcel /* But, this can return if range_check == range_warn. */ 2249130803Smarcel } 2250130803Smarcel yylval.lval = n; 2251130803Smarcel return INT; 2252130803Smarcel} 2253130803Smarcel 2254130803Smarcel 2255130803Smarcel/* Some tokens */ 2256130803Smarcel 2257130803Smarcelstatic struct 2258130803Smarcel{ 2259130803Smarcel char name[2]; 2260130803Smarcel int token; 2261130803Smarcel} tokentab2[] = 2262130803Smarcel{ 2263130803Smarcel { {'<', '>'}, NOTEQUAL }, 2264130803Smarcel { {':', '='}, ASSIGN }, 2265130803Smarcel { {'<', '='}, LEQ }, 2266130803Smarcel { {'>', '='}, GEQ }, 2267130803Smarcel { {':', ':'}, COLONCOLON }, 2268130803Smarcel 2269130803Smarcel}; 2270130803Smarcel 2271130803Smarcel/* Some specific keywords */ 2272130803Smarcel 2273130803Smarcelstruct keyword { 2274130803Smarcel char keyw[10]; 2275130803Smarcel int token; 2276130803Smarcel}; 2277130803Smarcel 2278130803Smarcelstatic struct keyword keytab[] = 2279130803Smarcel{ 2280130803Smarcel {"OR" , OROR }, 2281130803Smarcel {"IN", IN },/* Note space after IN */ 2282130803Smarcel {"AND", LOGICAL_AND}, 2283130803Smarcel {"ABS", ABS }, 2284130803Smarcel {"CHR", CHR }, 2285130803Smarcel {"DEC", DEC }, 2286130803Smarcel {"NOT", NOT }, 2287130803Smarcel {"DIV", DIV }, 2288130803Smarcel {"INC", INC }, 2289130803Smarcel {"MAX", MAX_FUNC }, 2290130803Smarcel {"MIN", MIN_FUNC }, 2291130803Smarcel {"MOD", MOD }, 2292130803Smarcel {"ODD", ODD }, 2293130803Smarcel {"CAP", CAP }, 2294130803Smarcel {"ORD", ORD }, 2295130803Smarcel {"VAL", VAL }, 2296130803Smarcel {"EXCL", EXCL }, 2297130803Smarcel {"HIGH", HIGH }, 2298130803Smarcel {"INCL", INCL }, 2299130803Smarcel {"SIZE", SIZE }, 2300130803Smarcel {"FLOAT", FLOAT_FUNC }, 2301130803Smarcel {"TRUNC", TRUNC }, 2302130803Smarcel}; 2303130803Smarcel 2304130803Smarcel 2305130803Smarcel/* Read one token, getting characters through lexptr. */ 2306130803Smarcel 2307130803Smarcel/* This is where we will check to make sure that the language and the operators used are 2308130803Smarcel compatible */ 2309130803Smarcel 2310130803Smarcelstatic int 2311130803Smarcelyylex () 2312130803Smarcel{ 2313130803Smarcel int c; 2314130803Smarcel int namelen; 2315130803Smarcel int i; 2316130803Smarcel char *tokstart; 2317130803Smarcel char quote; 2318130803Smarcel 2319130803Smarcel retry: 2320130803Smarcel 2321130803Smarcel prev_lexptr = lexptr; 2322130803Smarcel 2323130803Smarcel tokstart = lexptr; 2324130803Smarcel 2325130803Smarcel 2326130803Smarcel /* See if it is a special token of length 2 */ 2327130803Smarcel for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++) 2328130803Smarcel if(DEPRECATED_STREQN(tokentab2[i].name, tokstart, 2)) 2329130803Smarcel { 2330130803Smarcel lexptr += 2; 2331130803Smarcel return tokentab2[i].token; 2332130803Smarcel } 2333130803Smarcel 2334130803Smarcel switch (c = *tokstart) 2335130803Smarcel { 2336130803Smarcel case 0: 2337130803Smarcel return 0; 2338130803Smarcel 2339130803Smarcel case ' ': 2340130803Smarcel case '\t': 2341130803Smarcel case '\n': 2342130803Smarcel lexptr++; 2343130803Smarcel goto retry; 2344130803Smarcel 2345130803Smarcel case '(': 2346130803Smarcel paren_depth++; 2347130803Smarcel lexptr++; 2348130803Smarcel return c; 2349130803Smarcel 2350130803Smarcel case ')': 2351130803Smarcel if (paren_depth == 0) 2352130803Smarcel return 0; 2353130803Smarcel paren_depth--; 2354130803Smarcel lexptr++; 2355130803Smarcel return c; 2356130803Smarcel 2357130803Smarcel case ',': 2358130803Smarcel if (comma_terminates && paren_depth == 0) 2359130803Smarcel return 0; 2360130803Smarcel lexptr++; 2361130803Smarcel return c; 2362130803Smarcel 2363130803Smarcel case '.': 2364130803Smarcel /* Might be a floating point number. */ 2365130803Smarcel if (lexptr[1] >= '0' && lexptr[1] <= '9') 2366130803Smarcel break; /* Falls into number code. */ 2367130803Smarcel else 2368130803Smarcel { 2369130803Smarcel lexptr++; 2370130803Smarcel return DOT; 2371130803Smarcel } 2372130803Smarcel 2373130803Smarcel/* These are character tokens that appear as-is in the YACC grammar */ 2374130803Smarcel case '+': 2375130803Smarcel case '-': 2376130803Smarcel case '*': 2377130803Smarcel case '/': 2378130803Smarcel case '^': 2379130803Smarcel case '<': 2380130803Smarcel case '>': 2381130803Smarcel case '[': 2382130803Smarcel case ']': 2383130803Smarcel case '=': 2384130803Smarcel case '{': 2385130803Smarcel case '}': 2386130803Smarcel case '#': 2387130803Smarcel case '@': 2388130803Smarcel case '~': 2389130803Smarcel case '&': 2390130803Smarcel lexptr++; 2391130803Smarcel return c; 2392130803Smarcel 2393130803Smarcel case '\'' : 2394130803Smarcel case '"': 2395130803Smarcel quote = c; 2396130803Smarcel for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++) 2397130803Smarcel if (c == '\\') 2398130803Smarcel { 2399130803Smarcel c = tokstart[++namelen]; 2400130803Smarcel if (c >= '0' && c <= '9') 2401130803Smarcel { 2402130803Smarcel c = tokstart[++namelen]; 2403130803Smarcel if (c >= '0' && c <= '9') 2404130803Smarcel c = tokstart[++namelen]; 2405130803Smarcel } 2406130803Smarcel } 2407130803Smarcel if(c != quote) 2408130803Smarcel error("Unterminated string or character constant."); 2409130803Smarcel yylval.sval.ptr = tokstart + 1; 2410130803Smarcel yylval.sval.length = namelen - 1; 2411130803Smarcel lexptr += namelen + 1; 2412130803Smarcel 2413130803Smarcel if(namelen == 2) /* Single character */ 2414130803Smarcel { 2415130803Smarcel yylval.ulval = tokstart[1]; 2416130803Smarcel return CHAR; 2417130803Smarcel } 2418130803Smarcel else 2419130803Smarcel return STRING; 2420130803Smarcel } 2421130803Smarcel 2422130803Smarcel /* Is it a number? */ 2423130803Smarcel /* Note: We have already dealt with the case of the token '.'. 2424130803Smarcel See case '.' above. */ 2425130803Smarcel if ((c >= '0' && c <= '9')) 2426130803Smarcel { 2427130803Smarcel /* It's a number. */ 2428130803Smarcel int got_dot = 0, got_e = 0; 2429130803Smarcel char *p = tokstart; 2430130803Smarcel int toktype; 2431130803Smarcel 2432130803Smarcel for (++p ;; ++p) 2433130803Smarcel { 2434130803Smarcel if (!got_e && (*p == 'e' || *p == 'E')) 2435130803Smarcel got_dot = got_e = 1; 2436130803Smarcel else if (!got_dot && *p == '.') 2437130803Smarcel got_dot = 1; 2438130803Smarcel else if (got_e && (p[-1] == 'e' || p[-1] == 'E') 2439130803Smarcel && (*p == '-' || *p == '+')) 2440130803Smarcel /* This is the sign of the exponent, not the end of the 2441130803Smarcel number. */ 2442130803Smarcel continue; 2443130803Smarcel else if ((*p < '0' || *p > '9') && 2444130803Smarcel (*p < 'A' || *p > 'F') && 2445130803Smarcel (*p != 'H')) /* Modula-2 hexadecimal number */ 2446130803Smarcel break; 2447130803Smarcel } 2448130803Smarcel toktype = parse_number (p - tokstart); 2449130803Smarcel if (toktype == ERROR) 2450130803Smarcel { 2451130803Smarcel char *err_copy = (char *) alloca (p - tokstart + 1); 2452130803Smarcel 2453130803Smarcel memcpy (err_copy, tokstart, p - tokstart); 2454130803Smarcel err_copy[p - tokstart] = 0; 2455130803Smarcel error ("Invalid number \"%s\".", err_copy); 2456130803Smarcel } 2457130803Smarcel lexptr = p; 2458130803Smarcel return toktype; 2459130803Smarcel } 2460130803Smarcel 2461130803Smarcel if (!(c == '_' || c == '$' 2462130803Smarcel || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))) 2463130803Smarcel /* We must have come across a bad character (e.g. ';'). */ 2464130803Smarcel error ("Invalid character '%c' in expression.", c); 2465130803Smarcel 2466130803Smarcel /* It's a name. See how long it is. */ 2467130803Smarcel namelen = 0; 2468130803Smarcel for (c = tokstart[namelen]; 2469130803Smarcel (c == '_' || c == '$' || (c >= '0' && c <= '9') 2470130803Smarcel || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); 2471130803Smarcel c = tokstart[++namelen]) 2472130803Smarcel ; 2473130803Smarcel 2474130803Smarcel /* The token "if" terminates the expression and is NOT 2475130803Smarcel removed from the input stream. */ 2476130803Smarcel if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f') 2477130803Smarcel { 2478130803Smarcel return 0; 2479130803Smarcel } 2480130803Smarcel 2481130803Smarcel lexptr += namelen; 2482130803Smarcel 2483130803Smarcel /* Lookup special keywords */ 2484130803Smarcel for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++) 2485130803Smarcel if(namelen == strlen(keytab[i].keyw) && DEPRECATED_STREQN(tokstart,keytab[i].keyw,namelen)) 2486130803Smarcel return keytab[i].token; 2487130803Smarcel 2488130803Smarcel yylval.sval.ptr = tokstart; 2489130803Smarcel yylval.sval.length = namelen; 2490130803Smarcel 2491130803Smarcel if (*tokstart == '$') 2492130803Smarcel { 2493130803Smarcel write_dollar_variable (yylval.sval); 2494130803Smarcel return INTERNAL_VAR; 2495130803Smarcel } 2496130803Smarcel 2497130803Smarcel /* Use token-type BLOCKNAME for symbols that happen to be defined as 2498130803Smarcel functions. If this is not so, then ... 2499130803Smarcel Use token-type TYPENAME for symbols that happen to be defined 2500130803Smarcel currently as names of types; NAME for other symbols. 2501130803Smarcel The caller is not constrained to care about the distinction. */ 2502130803Smarcel { 2503130803Smarcel 2504130803Smarcel 2505130803Smarcel char *tmp = copy_name (yylval.sval); 2506130803Smarcel struct symbol *sym; 2507130803Smarcel 2508130803Smarcel if (lookup_partial_symtab (tmp)) 2509130803Smarcel return BLOCKNAME; 2510130803Smarcel sym = lookup_symbol (tmp, expression_context_block, 2511130803Smarcel VAR_DOMAIN, 0, NULL); 2512130803Smarcel if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) 2513130803Smarcel return BLOCKNAME; 2514130803Smarcel if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1)) 2515130803Smarcel return TYPENAME; 2516130803Smarcel 2517130803Smarcel if(sym) 2518130803Smarcel { 2519130803Smarcel switch(sym->aclass) 2520130803Smarcel { 2521130803Smarcel case LOC_STATIC: 2522130803Smarcel case LOC_REGISTER: 2523130803Smarcel case LOC_ARG: 2524130803Smarcel case LOC_REF_ARG: 2525130803Smarcel case LOC_REGPARM: 2526130803Smarcel case LOC_REGPARM_ADDR: 2527130803Smarcel case LOC_LOCAL: 2528130803Smarcel case LOC_LOCAL_ARG: 2529130803Smarcel case LOC_BASEREG: 2530130803Smarcel case LOC_BASEREG_ARG: 2531130803Smarcel case LOC_CONST: 2532130803Smarcel case LOC_CONST_BYTES: 2533130803Smarcel case LOC_OPTIMIZED_OUT: 2534130803Smarcel case LOC_COMPUTED: 2535130803Smarcel case LOC_COMPUTED_ARG: 2536130803Smarcel return NAME; 2537130803Smarcel 2538130803Smarcel case LOC_TYPEDEF: 2539130803Smarcel return TYPENAME; 2540130803Smarcel 2541130803Smarcel case LOC_BLOCK: 2542130803Smarcel return BLOCKNAME; 2543130803Smarcel 2544130803Smarcel case LOC_UNDEF: 2545130803Smarcel error("internal: Undefined class in m2lex()"); 2546130803Smarcel 2547130803Smarcel case LOC_LABEL: 2548130803Smarcel case LOC_UNRESOLVED: 2549130803Smarcel error("internal: Unforseen case in m2lex()"); 2550130803Smarcel 2551130803Smarcel default: 2552130803Smarcel error ("unhandled token in m2lex()"); 2553130803Smarcel break; 2554130803Smarcel } 2555130803Smarcel } 2556130803Smarcel else 2557130803Smarcel { 2558130803Smarcel /* Built-in BOOLEAN type. This is sort of a hack. */ 2559130803Smarcel if(DEPRECATED_STREQN(tokstart,"TRUE",4)) 2560130803Smarcel { 2561130803Smarcel yylval.ulval = 1; 2562130803Smarcel return M2_TRUE; 2563130803Smarcel } 2564130803Smarcel else if(DEPRECATED_STREQN(tokstart,"FALSE",5)) 2565130803Smarcel { 2566130803Smarcel yylval.ulval = 0; 2567130803Smarcel return M2_FALSE; 2568130803Smarcel } 2569130803Smarcel } 2570130803Smarcel 2571130803Smarcel /* Must be another type of name... */ 2572130803Smarcel return NAME; 2573130803Smarcel } 2574130803Smarcel} 2575130803Smarcel 2576130803Smarcel#if 0 /* Unused */ 2577130803Smarcelstatic char * 2578130803Smarcelmake_qualname(mod,ident) 2579130803Smarcel char *mod, *ident; 2580130803Smarcel{ 2581130803Smarcel char *new = xmalloc(strlen(mod)+strlen(ident)+2); 2582130803Smarcel 2583130803Smarcel strcpy(new,mod); 2584130803Smarcel strcat(new,"."); 2585130803Smarcel strcat(new,ident); 2586130803Smarcel return new; 2587130803Smarcel} 2588130803Smarcel#endif /* 0 */ 2589130803Smarcel 2590130803Smarcelvoid 2591130803Smarcelyyerror (msg) 2592130803Smarcel char *msg; 2593130803Smarcel{ 2594130803Smarcel if (prev_lexptr) 2595130803Smarcel lexptr = prev_lexptr; 2596130803Smarcel 2597130803Smarcel error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); 2598130803Smarcel} 2599130803Smarcel 2600130803Smarcel 2601