Imported Upstream version 7.9
[platform/upstream/gdb.git] / gdb / m2-exp.c
1 /* A Bison parser, made by GNU Bison 3.0.2.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5    Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 /* As a special exception, you may create a larger work that contains
21    part or all of the Bison parser skeleton and distribute that work
22    under terms of your choice, so long as that work isn't itself a
23    parser generator using the skeleton or a modified version thereof
24    as a parser skeleton.  Alternatively, if you modify or redistribute
25    the parser skeleton itself, you may (at your option) remove this
26    special exception, which will cause the skeleton and the resulting
27    Bison output files to be licensed under the GNU General Public
28    License without this special exception.
29
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37    infringing on user name space.  This should be done even for local
38    variables, as they might otherwise be expanded by user macros.
39    There are some unavoidable exceptions within include files to
40    define necessary library symbols; they are noted "INFRINGES ON
41    USER NAME SPACE" below.  */
42
43 /* Identify Bison output.  */
44 #define YYBISON 1
45
46 /* Bison version.  */
47 #define YYBISON_VERSION "3.0.2"
48
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers.  */
53 #define YYPURE 0
54
55 /* Push parsers.  */
56 #define YYPUSH 0
57
58 /* Pull parsers.  */
59 #define YYPULL 1
60
61
62
63
64 /* Copy the first part of user declarations.  */
65 #line 38 "m2-exp.y" /* yacc.c:339  */
66
67
68 #include "defs.h"
69 #include "expression.h"
70 #include "language.h"
71 #include "value.h"
72 #include "parser-defs.h"
73 #include "m2-lang.h"
74 #include "bfd.h" /* Required by objfiles.h.  */
75 #include "symfile.h" /* Required by objfiles.h.  */
76 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
77 #include "block.h"
78
79 #define parse_type(ps) builtin_type (parse_gdbarch (ps))
80 #define parse_m2_type(ps) builtin_m2_type (parse_gdbarch (ps))
81
82 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
83    as well as gratuitiously global symbol names, so we can have multiple
84    yacc generated parsers in gdb.  Note that these are only the variables
85    produced by yacc.  If other parser generators (bison, byacc, etc) produce
86    additional global names that conflict at link time, then those parser
87    generators need to be fixed instead of adding those names to this list.  */
88
89 #define yymaxdepth m2_maxdepth
90 #define yyparse m2_parse_internal
91 #define yylex   m2_lex
92 #define yyerror m2_error
93 #define yylval  m2_lval
94 #define yychar  m2_char
95 #define yydebug m2_debug
96 #define yypact  m2_pact
97 #define yyr1    m2_r1
98 #define yyr2    m2_r2
99 #define yydef   m2_def
100 #define yychk   m2_chk
101 #define yypgo   m2_pgo
102 #define yyact   m2_act
103 #define yyexca  m2_exca
104 #define yyerrflag m2_errflag
105 #define yynerrs m2_nerrs
106 #define yyps    m2_ps
107 #define yypv    m2_pv
108 #define yys     m2_s
109 #define yy_yys  m2_yys
110 #define yystate m2_state
111 #define yytmp   m2_tmp
112 #define yyv     m2_v
113 #define yy_yyv  m2_yyv
114 #define yyval   m2_val
115 #define yylloc  m2_lloc
116 #define yyreds  m2_reds         /* With YYDEBUG defined */
117 #define yytoks  m2_toks         /* With YYDEBUG defined */
118 #define yyname  m2_name         /* With YYDEBUG defined */
119 #define yyrule  m2_rule         /* With YYDEBUG defined */
120 #define yylhs   m2_yylhs
121 #define yylen   m2_yylen
122 #define yydefred m2_yydefred
123 #define yydgoto m2_yydgoto
124 #define yysindex m2_yysindex
125 #define yyrindex m2_yyrindex
126 #define yygindex m2_yygindex
127 #define yytable  m2_yytable
128 #define yycheck  m2_yycheck
129 #define yyss    m2_yyss
130 #define yysslim m2_yysslim
131 #define yyssp   m2_yyssp
132 #define yystacksize m2_yystacksize
133 #define yyvs    m2_yyvs
134 #define yyvsp   m2_yyvsp
135
136 #ifndef YYDEBUG
137 #define YYDEBUG 1               /* Default to yydebug support */
138 #endif
139
140 #define YYFPRINTF parser_fprintf
141
142 /* The state of the parser, used internally when we are parsing the
143    expression.  */
144
145 static struct parser_state *pstate = NULL;
146
147 int yyparse (void);
148
149 static int yylex (void);
150
151 void yyerror (char *);
152
153 static int parse_number (int);
154
155 /* The sign of the number being parsed.  */
156 static int number_sign = 1;
157
158
159 #line 160 "m2-exp.c" /* yacc.c:339  */
160
161 # ifndef YY_NULLPTR
162 #  if defined __cplusplus && 201103L <= __cplusplus
163 #   define YY_NULLPTR nullptr
164 #  else
165 #   define YY_NULLPTR 0
166 #  endif
167 # endif
168
169 /* Enabling verbose error messages.  */
170 #ifdef YYERROR_VERBOSE
171 # undef YYERROR_VERBOSE
172 # define YYERROR_VERBOSE 1
173 #else
174 # define YYERROR_VERBOSE 0
175 #endif
176
177
178 /* Debug traces.  */
179 #ifndef YYDEBUG
180 # define YYDEBUG 0
181 #endif
182 #if YYDEBUG
183 extern int yydebug;
184 #endif
185
186 /* Token type.  */
187 #ifndef YYTOKENTYPE
188 # define YYTOKENTYPE
189   enum yytokentype
190   {
191     INT = 258,
192     HEX = 259,
193     ERROR = 260,
194     UINT = 261,
195     M2_TRUE = 262,
196     M2_FALSE = 263,
197     CHAR = 264,
198     FLOAT = 265,
199     STRING = 266,
200     NAME = 267,
201     BLOCKNAME = 268,
202     IDENT = 269,
203     VARNAME = 270,
204     TYPENAME = 271,
205     SIZE = 272,
206     CAP = 273,
207     ORD = 274,
208     HIGH = 275,
209     ABS = 276,
210     MIN_FUNC = 277,
211     MAX_FUNC = 278,
212     FLOAT_FUNC = 279,
213     VAL = 280,
214     CHR = 281,
215     ODD = 282,
216     TRUNC = 283,
217     TSIZE = 284,
218     INC = 285,
219     DEC = 286,
220     INCL = 287,
221     EXCL = 288,
222     COLONCOLON = 289,
223     INTERNAL_VAR = 290,
224     ABOVE_COMMA = 291,
225     ASSIGN = 292,
226     LEQ = 293,
227     GEQ = 294,
228     NOTEQUAL = 295,
229     IN = 296,
230     OROR = 297,
231     LOGICAL_AND = 298,
232     DIV = 299,
233     MOD = 300,
234     UNARY = 301,
235     DOT = 302,
236     NOT = 303,
237     QID = 304
238   };
239 #endif
240 /* Tokens.  */
241 #define INT 258
242 #define HEX 259
243 #define ERROR 260
244 #define UINT 261
245 #define M2_TRUE 262
246 #define M2_FALSE 263
247 #define CHAR 264
248 #define FLOAT 265
249 #define STRING 266
250 #define NAME 267
251 #define BLOCKNAME 268
252 #define IDENT 269
253 #define VARNAME 270
254 #define TYPENAME 271
255 #define SIZE 272
256 #define CAP 273
257 #define ORD 274
258 #define HIGH 275
259 #define ABS 276
260 #define MIN_FUNC 277
261 #define MAX_FUNC 278
262 #define FLOAT_FUNC 279
263 #define VAL 280
264 #define CHR 281
265 #define ODD 282
266 #define TRUNC 283
267 #define TSIZE 284
268 #define INC 285
269 #define DEC 286
270 #define INCL 287
271 #define EXCL 288
272 #define COLONCOLON 289
273 #define INTERNAL_VAR 290
274 #define ABOVE_COMMA 291
275 #define ASSIGN 292
276 #define LEQ 293
277 #define GEQ 294
278 #define NOTEQUAL 295
279 #define IN 296
280 #define OROR 297
281 #define LOGICAL_AND 298
282 #define DIV 299
283 #define MOD 300
284 #define UNARY 301
285 #define DOT 302
286 #define NOT 303
287 #define QID 304
288
289 /* Value type.  */
290 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
291 typedef union YYSTYPE YYSTYPE;
292 union YYSTYPE
293 {
294 #line 137 "m2-exp.y" /* yacc.c:355  */
295
296     LONGEST lval;
297     ULONGEST ulval;
298     DOUBLEST dval;
299     struct symbol *sym;
300     struct type *tval;
301     struct stoken sval;
302     int voidval;
303     const struct block *bval;
304     enum exp_opcode opcode;
305     struct internalvar *ivar;
306
307     struct type **tvec;
308     int *ivec;
309   
310
311 #line 312 "m2-exp.c" /* yacc.c:355  */
312 };
313 # define YYSTYPE_IS_TRIVIAL 1
314 # define YYSTYPE_IS_DECLARED 1
315 #endif
316
317
318 extern YYSTYPE yylval;
319
320 int yyparse (void);
321
322
323
324 /* Copy the second part of user declarations.  */
325
326 #line 327 "m2-exp.c" /* yacc.c:358  */
327
328 #ifdef short
329 # undef short
330 #endif
331
332 #ifdef YYTYPE_UINT8
333 typedef YYTYPE_UINT8 yytype_uint8;
334 #else
335 typedef unsigned char yytype_uint8;
336 #endif
337
338 #ifdef YYTYPE_INT8
339 typedef YYTYPE_INT8 yytype_int8;
340 #else
341 typedef signed char yytype_int8;
342 #endif
343
344 #ifdef YYTYPE_UINT16
345 typedef YYTYPE_UINT16 yytype_uint16;
346 #else
347 typedef unsigned short int yytype_uint16;
348 #endif
349
350 #ifdef YYTYPE_INT16
351 typedef YYTYPE_INT16 yytype_int16;
352 #else
353 typedef short int yytype_int16;
354 #endif
355
356 #ifndef YYSIZE_T
357 # ifdef __SIZE_TYPE__
358 #  define YYSIZE_T __SIZE_TYPE__
359 # elif defined size_t
360 #  define YYSIZE_T size_t
361 # elif ! defined YYSIZE_T
362 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
363 #  define YYSIZE_T size_t
364 # else
365 #  define YYSIZE_T unsigned int
366 # endif
367 #endif
368
369 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
370
371 #ifndef YY_
372 # if defined YYENABLE_NLS && YYENABLE_NLS
373 #  if ENABLE_NLS
374 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
375 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
376 #  endif
377 # endif
378 # ifndef YY_
379 #  define YY_(Msgid) Msgid
380 # endif
381 #endif
382
383 #ifndef YY_ATTRIBUTE
384 # if (defined __GNUC__                                               \
385       && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
386      || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
387 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
388 # else
389 #  define YY_ATTRIBUTE(Spec) /* empty */
390 # endif
391 #endif
392
393 #ifndef YY_ATTRIBUTE_PURE
394 # define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
395 #endif
396
397 #ifndef YY_ATTRIBUTE_UNUSED
398 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
399 #endif
400
401 #if !defined _Noreturn \
402      && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
403 # if defined _MSC_VER && 1200 <= _MSC_VER
404 #  define _Noreturn __declspec (noreturn)
405 # else
406 #  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
407 # endif
408 #endif
409
410 /* Suppress unused-variable warnings by "using" E.  */
411 #if ! defined lint || defined __GNUC__
412 # define YYUSE(E) ((void) (E))
413 #else
414 # define YYUSE(E) /* empty */
415 #endif
416
417 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
418 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
419 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
420     _Pragma ("GCC diagnostic push") \
421     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
422     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
423 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
424     _Pragma ("GCC diagnostic pop")
425 #else
426 # define YY_INITIAL_VALUE(Value) Value
427 #endif
428 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
429 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
430 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
431 #endif
432 #ifndef YY_INITIAL_VALUE
433 # define YY_INITIAL_VALUE(Value) /* Nothing. */
434 #endif
435
436
437 #if ! defined yyoverflow || YYERROR_VERBOSE
438
439 /* The parser invokes alloca or xmalloc; define the necessary symbols.  */
440
441 # ifdef YYSTACK_USE_ALLOCA
442 #  if YYSTACK_USE_ALLOCA
443 #   ifdef __GNUC__
444 #    define YYSTACK_ALLOC __builtin_alloca
445 #   elif defined __BUILTIN_VA_ARG_INCR
446 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
447 #   elif defined _AIX
448 #    define YYSTACK_ALLOC __alloca
449 #   elif defined _MSC_VER
450 #    define alloca _alloca
451 #   else
452 #    define YYSTACK_ALLOC alloca
453 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
454 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
455       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
456 #     ifndef EXIT_SUCCESS
457 #      define EXIT_SUCCESS 0
458 #     endif
459 #    endif
460 #   endif
461 #  endif
462 # endif
463
464 # ifdef YYSTACK_ALLOC
465    /* Pacify GCC's 'empty if-body' warning.  */
466 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
467 #  ifndef YYSTACK_ALLOC_MAXIMUM
468     /* The OS might guarantee only one guard page at the bottom of the stack,
469        and a page size can be as small as 4096 bytes.  So we cannot safely
470        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
471        to allow for a few compiler-allocated temporary stack slots.  */
472 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
473 #  endif
474 # else
475 #  define YYSTACK_ALLOC YYMALLOC
476 #  define YYSTACK_FREE YYFREE
477 #  ifndef YYSTACK_ALLOC_MAXIMUM
478 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
479 #  endif
480 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
481        && ! ((defined YYMALLOC || defined xmalloc) \
482              && (defined YYFREE || defined xfree)))
483 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
484 #   ifndef EXIT_SUCCESS
485 #    define EXIT_SUCCESS 0
486 #   endif
487 #  endif
488 #  ifndef YYMALLOC
489 #   define YYMALLOC xmalloc
490 #   if ! defined xmalloc && ! defined EXIT_SUCCESS
491 void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
492 #   endif
493 #  endif
494 #  ifndef YYFREE
495 #   define YYFREE xfree
496 #   if ! defined xfree && ! defined EXIT_SUCCESS
497 void xfree (void *); /* INFRINGES ON USER NAME SPACE */
498 #   endif
499 #  endif
500 # endif
501 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
502
503
504 #if (! defined yyoverflow \
505      && (! defined __cplusplus \
506          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
507
508 /* A type that is properly aligned for any stack member.  */
509 union yyalloc
510 {
511   yytype_int16 yyss_alloc;
512   YYSTYPE yyvs_alloc;
513 };
514
515 /* The size of the maximum gap between one aligned stack and the next.  */
516 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
517
518 /* The size of an array large to enough to hold all stacks, each with
519    N elements.  */
520 # define YYSTACK_BYTES(N) \
521      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
522       + YYSTACK_GAP_MAXIMUM)
523
524 # define YYCOPY_NEEDED 1
525
526 /* Relocate STACK from its old location to the new one.  The
527    local variables YYSIZE and YYSTACKSIZE give the old and new number of
528    elements in the stack, and YYPTR gives the new location of the
529    stack.  Advance YYPTR to a properly aligned location for the next
530    stack.  */
531 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
532     do                                                                  \
533       {                                                                 \
534         YYSIZE_T yynewbytes;                                            \
535         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
536         Stack = &yyptr->Stack_alloc;                                    \
537         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
538         yyptr += yynewbytes / sizeof (*yyptr);                          \
539       }                                                                 \
540     while (0)
541
542 #endif
543
544 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
545 /* Copy COUNT objects from SRC to DST.  The source and destination do
546    not overlap.  */
547 # ifndef YYCOPY
548 #  if defined __GNUC__ && 1 < __GNUC__
549 #   define YYCOPY(Dst, Src, Count) \
550       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
551 #  else
552 #   define YYCOPY(Dst, Src, Count)              \
553       do                                        \
554         {                                       \
555           YYSIZE_T yyi;                         \
556           for (yyi = 0; yyi < (Count); yyi++)   \
557             (Dst)[yyi] = (Src)[yyi];            \
558         }                                       \
559       while (0)
560 #  endif
561 # endif
562 #endif /* !YYCOPY_NEEDED */
563
564 /* YYFINAL -- State number of the termination state.  */
565 #define YYFINAL  69
566 /* YYLAST -- Last index in YYTABLE.  */
567 #define YYLAST   912
568
569 /* YYNTOKENS -- Number of terminals.  */
570 #define YYNTOKENS  69
571 /* YYNNTS -- Number of nonterminals.  */
572 #define YYNNTS  15
573 /* YYNRULES -- Number of rules.  */
574 #define YYNRULES  82
575 /* YYNSTATES -- Number of states.  */
576 #define YYNSTATES  187
577
578 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
579    by yylex, with out-of-bounds checking.  */
580 #define YYUNDEFTOK  2
581 #define YYMAXUTOK   304
582
583 #define YYTRANSLATE(YYX)                                                \
584   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
585
586 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
587    as returned by yylex, without out-of-bounds checking.  */
588 static const yytype_uint8 yytranslate[] =
589 {
590        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
591        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
592        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
593        2,     2,     2,     2,     2,    45,     2,     2,    49,     2,
594       61,    65,    53,    51,    36,    52,     2,    54,     2,     2,
595        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
596       39,    43,    40,     2,    50,     2,     2,     2,     2,     2,
597        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
598        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
599        2,    60,     2,    68,    58,     2,     2,     2,     2,     2,
600        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
601        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
602        2,     2,     2,    66,     2,    67,    63,     2,     2,     2,
603        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
604        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
605        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
606        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
607        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
608        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
609        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
610        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
611        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
612        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
613        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
614        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
615        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
616        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
617       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
618       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
619       35,    37,    38,    41,    42,    44,    46,    47,    48,    55,
620       56,    57,    59,    62,    64
621 };
622
623 #if YYDEBUG
624   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
625 static const yytype_uint16 yyrline[] =
626 {
627        0,   206,   206,   207,   210,   219,   224,   223,   230,   234,
628      238,   239,   242,   246,   250,   254,   258,   264,   270,   274,
629      280,   284,   288,   292,   296,   301,   305,   312,   316,   323,
630      329,   332,   336,   340,   344,   346,   356,   352,   364,   371,
631      368,   379,   382,   386,   391,   396,   401,   407,   413,   421,
632      425,   429,   433,   437,   441,   445,   449,   453,   455,   459,
633      463,   467,   471,   475,   479,   483,   490,   496,   502,   510,
634      521,   531,   540,   543,   552,   559,   563,   573,   585,   593,
635      597,   620,   665
636 };
637 #endif
638
639 #if YYDEBUG || YYERROR_VERBOSE || 0
640 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
641    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
642 static const char *const yytname[] =
643 {
644   "$end", "error", "$undefined", "INT", "HEX", "ERROR", "UINT", "M2_TRUE",
645   "M2_FALSE", "CHAR", "FLOAT", "STRING", "NAME", "BLOCKNAME", "IDENT",
646   "VARNAME", "TYPENAME", "SIZE", "CAP", "ORD", "HIGH", "ABS", "MIN_FUNC",
647   "MAX_FUNC", "FLOAT_FUNC", "VAL", "CHR", "ODD", "TRUNC", "TSIZE", "INC",
648   "DEC", "INCL", "EXCL", "COLONCOLON", "INTERNAL_VAR", "','",
649   "ABOVE_COMMA", "ASSIGN", "'<'", "'>'", "LEQ", "GEQ", "'='", "NOTEQUAL",
650   "'#'", "IN", "OROR", "LOGICAL_AND", "'&'", "'@'", "'+'", "'-'", "'*'",
651   "'/'", "DIV", "MOD", "UNARY", "'^'", "DOT", "'['", "'('", "NOT", "'~'",
652   "QID", "')'", "'{'", "'}'", "']'", "$accept", "start", "type_exp", "exp",
653   "$@1", "not_exp", "set", "$@2", "$@3", "arglist", "non_empty_arglist",
654   "block", "fblock", "variable", "type", YY_NULLPTR
655 };
656 #endif
657
658 # ifdef YYPRINT
659 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
660    (internal) symbol number NUM (which must be that of a token).  */
661 static const yytype_uint16 yytoknum[] =
662 {
663        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
664      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
665      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
666      285,   286,   287,   288,   289,   290,    44,   291,   292,    60,
667       62,   293,   294,    61,   295,    35,   296,   297,   298,    38,
668       64,    43,    45,    42,    47,   299,   300,   301,    94,   302,
669       91,    40,   303,   126,   304,    41,   123,   125,    93
670 };
671 # endif
672
673 #define YYPACT_NINF -90
674
675 #define yypact_value_is_default(Yystate) \
676   (!!((Yystate) == (-90)))
677
678 #define YYTABLE_NINF -76
679
680 #define yytable_value_is_error(Yytable_value) \
681   (!!((Yytable_value) == (-76)))
682
683   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
684      STATE-NUM.  */
685 static const yytype_int16 yypact[] =
686 {
687      163,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
688      -90,   224,   -35,   -28,   -22,   -18,     2,     8,    17,    28,
689       30,    31,    32,    34,    35,    36,    38,    39,   -90,   163,
690      -90,   163,   -90,   -90,   163,    27,   -90,   807,   163,   -90,
691       -6,    -4,   -90,   -21,   163,     7,   -21,   163,   163,   163,
692      163,    85,    85,   163,    85,   163,   163,   163,   163,   163,
693      163,   163,   163,     7,   163,   309,   807,   -32,   -42,   -90,
694      163,   163,   163,   163,   163,   163,   163,   163,   -15,   163,
695      163,   163,   163,   163,   163,   163,   163,   163,   -90,    90,
696      163,   -90,     7,    -5,   163,   163,   -24,   337,   365,   393,
697      421,   -19,    42,   449,    67,   477,   505,   533,   561,   253,
698      281,   757,   783,     7,   -90,   163,   -90,   163,   831,   -38,
699      -38,   -38,   -38,   -38,   -38,   -38,   163,   -90,    43,   149,
700      210,   842,   851,   851,     7,     7,     7,     7,   -90,    83,
701      163,   163,   -90,   -90,   589,   -31,   -90,   -90,   -90,   -90,
702      -90,   -90,   -90,   -90,   163,   -90,   -90,   -90,   -90,   163,
703      -90,   163,   -90,   163,   163,   807,     7,   -90,   807,   -34,
704      -33,   -90,   -90,   617,   645,   673,   701,   729,   163,   -90,
705      -90,   -90,   -90,   -90,   -90,   -90,   807
706 };
707
708   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
709      Performed when YYTABLE does not specify something else to do.  Zero
710      means the default is an error.  */
711 static const yytype_uint8 yydefact[] =
712 {
713        0,    68,    69,    66,    67,    70,    71,    74,    81,    76,
714       82,     0,     0,     0,     0,     0,     0,     0,     0,     0,
715        0,     0,     0,     0,     0,     0,     0,     0,    79,     0,
716        6,     0,    10,    11,    41,     0,     3,     2,     0,    30,
717        0,    78,    72,     4,     0,    24,     0,     0,     0,     0,
718        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
719        0,     0,     0,     8,     0,     0,    42,     0,     0,     1,
720        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
721        0,     0,     0,     0,     0,     0,     0,     0,     5,     0,
722        0,    39,     9,     0,     0,    41,     0,     0,     0,     0,
723        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
724        0,     0,     0,     7,    48,     0,    34,     0,    65,    61,
725       62,    59,    60,    56,    57,    58,    41,    31,     0,    64,
726       63,    49,    54,    55,    50,    51,    52,    53,    29,     0,
727        0,    41,    80,    77,     0,     0,    73,    12,    13,    15,
728       14,    16,    17,    18,     0,    20,    21,    22,    23,     0,
729       25,     0,    27,     0,     0,    43,    46,    38,    44,     0,
730        0,    47,    35,     0,     0,     0,     0,     0,     0,    37,
731       40,    19,    26,    28,    32,    33,    45
732 };
733
734   /* YYPGOTO[NTERM-NUM].  */
735 static const yytype_int8 yypgoto[] =
736 {
737      -90,   -90,   -90,     0,   -90,   -90,    26,   -90,   -90,   -89,
738      -90,   -90,   -90,   -90,    54
739 };
740
741   /* YYDEFGOTO[NTERM-NUM].  */
742 static const yytype_int16 yydefgoto[] =
743 {
744       -1,    35,    36,    66,    64,    38,    39,   140,   141,    67,
745      169,    40,    41,    42,    46
746 };
747
748   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
749      positive, shift that token.  If negative, reduce the rule whose
750      number is the opposite.  If YYTABLE_NINF, syntax error.  */
751 static const yytype_int16 yytable[] =
752 {
753       37,    10,   178,   115,   115,   115,   145,   142,   143,    79,
754       80,    45,    81,    82,    83,    84,    85,    86,    87,    94,
755       88,    89,    90,    91,    95,   117,    47,    69,    93,    63,
756      -75,    65,   180,    48,   179,   116,   172,    94,    92,    49,
757       94,   146,    95,    50,    65,    95,   151,    97,    98,    99,
758      100,   126,   170,   103,    43,   105,   106,   107,   108,   109,
759      110,   111,   112,    51,   113,    88,    89,    90,    91,    52,
760      118,   119,   120,   121,   122,   123,   124,   125,    53,   129,
761      130,   131,   132,   133,   134,   135,   136,   137,    68,    54,
762      139,    55,    56,    57,   144,    58,    59,    60,    96,    61,
763       62,    10,   138,   154,   127,   101,   102,   152,   104,    95,
764        0,     0,     0,     0,     0,   165,     0,   166,     0,     0,
765        0,    70,    71,    72,    73,    74,    75,    76,    77,    78,
766       79,    80,   128,    81,    82,    83,    84,    85,    86,    87,
767      168,    88,    89,    90,    91,     0,     0,     0,     0,     0,
768        0,   167,     0,     0,   173,     0,     0,     0,     0,   174,
769        0,   175,     0,   176,   177,     0,     1,     0,     0,     2,
770        3,     4,     5,     6,     7,     8,     9,     0,   186,    10,
771       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
772       21,    22,    23,    24,    25,    26,    27,    80,    28,    81,
773       82,    83,    84,    85,    86,    87,     0,    88,    89,    90,
774       91,     0,     0,     0,    29,    30,     0,     0,     0,     0,
775        0,     0,     0,     0,    31,    32,    33,     1,     0,    34,
776        2,     3,     4,     5,     6,     7,     8,     9,     0,     0,
777       10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
778       20,    21,    22,    23,    24,    25,    26,    27,     0,    28,
779       81,    82,    83,    84,    85,    86,    87,     0,    88,    89,
780       90,    91,     0,     0,     0,    29,    30,     0,     0,     0,
781        0,     0,     0,     0,     0,    44,    32,    33,     0,   159,
782       34,    70,    71,    72,    73,    74,    75,    76,    77,    78,
783       79,    80,     0,    81,    82,    83,    84,    85,    86,    87,
784        0,    88,    89,    90,    91,     0,     0,   161,   160,    70,
785       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
786        0,    81,    82,    83,    84,    85,    86,    87,     0,    88,
787       89,    90,    91,     0,     0,     0,   162,    70,    71,    72,
788       73,    74,    75,    76,    77,    78,    79,    80,     0,    81,
789       82,    83,    84,    85,    86,    87,     0,    88,    89,    90,
790       91,     0,     0,     0,   114,    70,    71,    72,    73,    74,
791       75,    76,    77,    78,    79,    80,     0,    81,    82,    83,
792       84,    85,    86,    87,     0,    88,    89,    90,    91,     0,
793        0,     0,   147,    70,    71,    72,    73,    74,    75,    76,
794       77,    78,    79,    80,     0,    81,    82,    83,    84,    85,
795       86,    87,     0,    88,    89,    90,    91,     0,     0,     0,
796      148,    70,    71,    72,    73,    74,    75,    76,    77,    78,
797       79,    80,     0,    81,    82,    83,    84,    85,    86,    87,
798        0,    88,    89,    90,    91,     0,     0,     0,   149,    70,
799       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
800        0,    81,    82,    83,    84,    85,    86,    87,     0,    88,
801       89,    90,    91,     0,     0,     0,   150,    70,    71,    72,
802       73,    74,    75,    76,    77,    78,    79,    80,     0,    81,
803       82,    83,    84,    85,    86,    87,     0,    88,    89,    90,
804       91,     0,     0,     0,   153,    70,    71,    72,    73,    74,
805       75,    76,    77,    78,    79,    80,     0,    81,    82,    83,
806       84,    85,    86,    87,     0,    88,    89,    90,    91,     0,
807        0,     0,   155,    70,    71,    72,    73,    74,    75,    76,
808       77,    78,    79,    80,     0,    81,    82,    83,    84,    85,
809       86,    87,     0,    88,    89,    90,    91,     0,     0,     0,
810      156,    70,    71,    72,    73,    74,    75,    76,    77,    78,
811       79,    80,     0,    81,    82,    83,    84,    85,    86,    87,
812        0,    88,    89,    90,    91,     0,     0,     0,   157,    70,
813       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
814        0,    81,    82,    83,    84,    85,    86,    87,     0,    88,
815       89,    90,    91,     0,     0,     0,   158,    70,    71,    72,
816       73,    74,    75,    76,    77,    78,    79,    80,     0,    81,
817       82,    83,    84,    85,    86,    87,     0,    88,    89,    90,
818       91,     0,     0,     0,   171,    70,    71,    72,    73,    74,
819       75,    76,    77,    78,    79,    80,     0,    81,    82,    83,
820       84,    85,    86,    87,     0,    88,    89,    90,    91,     0,
821        0,     0,   181,    70,    71,    72,    73,    74,    75,    76,
822       77,    78,    79,    80,     0,    81,    82,    83,    84,    85,
823       86,    87,     0,    88,    89,    90,    91,     0,     0,     0,
824      182,    70,    71,    72,    73,    74,    75,    76,    77,    78,
825       79,    80,     0,    81,    82,    83,    84,    85,    86,    87,
826        0,    88,    89,    90,    91,     0,     0,     0,   183,    70,
827       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
828        0,    81,    82,    83,    84,    85,    86,    87,     0,    88,
829       89,    90,    91,     0,     0,     0,   184,    70,    71,    72,
830       73,    74,    75,    76,    77,    78,    79,    80,     0,    81,
831       82,    83,    84,    85,    86,    87,     0,    88,    89,    90,
832       91,     0,     0,   163,   185,    70,    71,    72,    73,    74,
833       75,    76,    77,    78,    79,    80,     0,    81,    82,    83,
834       84,    85,    86,    87,     0,    88,    89,    90,    91,   164,
835        0,    70,    71,    72,    73,    74,    75,    76,    77,    78,
836       79,    80,     0,    81,    82,    83,    84,    85,    86,    87,
837        0,    88,    89,    90,    91,    70,    71,    72,    73,    74,
838       75,    76,    77,    78,    79,    80,     0,    81,    82,    83,
839       84,    85,    86,    87,     0,    88,    89,    90,    91,   -76,
840       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
841        0,    81,    82,    83,    84,    85,    86,    87,     0,    88,
842       89,    90,    91,    82,    83,    84,    85,    86,    87,     0,
843       88,    89,    90,    91,    84,    85,    86,    87,     0,    88,
844       89,    90,    91
845 };
846
847 static const yytype_int16 yycheck[] =
848 {
849        0,    16,    36,    36,    36,    36,    95,    12,    13,    47,
850       48,    11,    50,    51,    52,    53,    54,    55,    56,    61,
851       58,    59,    60,    61,    66,    67,    61,     0,    34,    29,
852       34,    31,    65,    61,    68,    67,    67,    61,    38,    61,
853       61,    65,    66,    61,    44,    66,    65,    47,    48,    49,
854       50,    66,   141,    53,     0,    55,    56,    57,    58,    59,
855       60,    61,    62,    61,    64,    58,    59,    60,    61,    61,
856       70,    71,    72,    73,    74,    75,    76,    77,    61,    79,
857       80,    81,    82,    83,    84,    85,    86,    87,    34,    61,
858       90,    61,    61,    61,    94,    61,    61,    61,    44,    61,
859       61,    16,    12,    36,    78,    51,    52,    65,    54,    66,
860       -1,    -1,    -1,    -1,    -1,   115,    -1,   117,    -1,    -1,
861       -1,    38,    39,    40,    41,    42,    43,    44,    45,    46,
862       47,    48,    78,    50,    51,    52,    53,    54,    55,    56,
863      140,    58,    59,    60,    61,    -1,    -1,    -1,    -1,    -1,
864       -1,    68,    -1,    -1,   154,    -1,    -1,    -1,    -1,   159,
865       -1,   161,    -1,   163,   164,    -1,     3,    -1,    -1,     6,
866        7,     8,     9,    10,    11,    12,    13,    -1,   178,    16,
867       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
868       27,    28,    29,    30,    31,    32,    33,    48,    35,    50,
869       51,    52,    53,    54,    55,    56,    -1,    58,    59,    60,
870       61,    -1,    -1,    -1,    51,    52,    -1,    -1,    -1,    -1,
871       -1,    -1,    -1,    -1,    61,    62,    63,     3,    -1,    66,
872        6,     7,     8,     9,    10,    11,    12,    13,    -1,    -1,
873       16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
874       26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
875       50,    51,    52,    53,    54,    55,    56,    -1,    58,    59,
876       60,    61,    -1,    -1,    -1,    51,    52,    -1,    -1,    -1,
877       -1,    -1,    -1,    -1,    -1,    61,    62,    63,    -1,    36,
878       66,    38,    39,    40,    41,    42,    43,    44,    45,    46,
879       47,    48,    -1,    50,    51,    52,    53,    54,    55,    56,
880       -1,    58,    59,    60,    61,    -1,    -1,    36,    65,    38,
881       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
882       -1,    50,    51,    52,    53,    54,    55,    56,    -1,    58,
883       59,    60,    61,    -1,    -1,    -1,    65,    38,    39,    40,
884       41,    42,    43,    44,    45,    46,    47,    48,    -1,    50,
885       51,    52,    53,    54,    55,    56,    -1,    58,    59,    60,
886       61,    -1,    -1,    -1,    65,    38,    39,    40,    41,    42,
887       43,    44,    45,    46,    47,    48,    -1,    50,    51,    52,
888       53,    54,    55,    56,    -1,    58,    59,    60,    61,    -1,
889       -1,    -1,    65,    38,    39,    40,    41,    42,    43,    44,
890       45,    46,    47,    48,    -1,    50,    51,    52,    53,    54,
891       55,    56,    -1,    58,    59,    60,    61,    -1,    -1,    -1,
892       65,    38,    39,    40,    41,    42,    43,    44,    45,    46,
893       47,    48,    -1,    50,    51,    52,    53,    54,    55,    56,
894       -1,    58,    59,    60,    61,    -1,    -1,    -1,    65,    38,
895       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
896       -1,    50,    51,    52,    53,    54,    55,    56,    -1,    58,
897       59,    60,    61,    -1,    -1,    -1,    65,    38,    39,    40,
898       41,    42,    43,    44,    45,    46,    47,    48,    -1,    50,
899       51,    52,    53,    54,    55,    56,    -1,    58,    59,    60,
900       61,    -1,    -1,    -1,    65,    38,    39,    40,    41,    42,
901       43,    44,    45,    46,    47,    48,    -1,    50,    51,    52,
902       53,    54,    55,    56,    -1,    58,    59,    60,    61,    -1,
903       -1,    -1,    65,    38,    39,    40,    41,    42,    43,    44,
904       45,    46,    47,    48,    -1,    50,    51,    52,    53,    54,
905       55,    56,    -1,    58,    59,    60,    61,    -1,    -1,    -1,
906       65,    38,    39,    40,    41,    42,    43,    44,    45,    46,
907       47,    48,    -1,    50,    51,    52,    53,    54,    55,    56,
908       -1,    58,    59,    60,    61,    -1,    -1,    -1,    65,    38,
909       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
910       -1,    50,    51,    52,    53,    54,    55,    56,    -1,    58,
911       59,    60,    61,    -1,    -1,    -1,    65,    38,    39,    40,
912       41,    42,    43,    44,    45,    46,    47,    48,    -1,    50,
913       51,    52,    53,    54,    55,    56,    -1,    58,    59,    60,
914       61,    -1,    -1,    -1,    65,    38,    39,    40,    41,    42,
915       43,    44,    45,    46,    47,    48,    -1,    50,    51,    52,
916       53,    54,    55,    56,    -1,    58,    59,    60,    61,    -1,
917       -1,    -1,    65,    38,    39,    40,    41,    42,    43,    44,
918       45,    46,    47,    48,    -1,    50,    51,    52,    53,    54,
919       55,    56,    -1,    58,    59,    60,    61,    -1,    -1,    -1,
920       65,    38,    39,    40,    41,    42,    43,    44,    45,    46,
921       47,    48,    -1,    50,    51,    52,    53,    54,    55,    56,
922       -1,    58,    59,    60,    61,    -1,    -1,    -1,    65,    38,
923       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
924       -1,    50,    51,    52,    53,    54,    55,    56,    -1,    58,
925       59,    60,    61,    -1,    -1,    -1,    65,    38,    39,    40,
926       41,    42,    43,    44,    45,    46,    47,    48,    -1,    50,
927       51,    52,    53,    54,    55,    56,    -1,    58,    59,    60,
928       61,    -1,    -1,    36,    65,    38,    39,    40,    41,    42,
929       43,    44,    45,    46,    47,    48,    -1,    50,    51,    52,
930       53,    54,    55,    56,    -1,    58,    59,    60,    61,    36,
931       -1,    38,    39,    40,    41,    42,    43,    44,    45,    46,
932       47,    48,    -1,    50,    51,    52,    53,    54,    55,    56,
933       -1,    58,    59,    60,    61,    38,    39,    40,    41,    42,
934       43,    44,    45,    46,    47,    48,    -1,    50,    51,    52,
935       53,    54,    55,    56,    -1,    58,    59,    60,    61,    38,
936       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
937       -1,    50,    51,    52,    53,    54,    55,    56,    -1,    58,
938       59,    60,    61,    51,    52,    53,    54,    55,    56,    -1,
939       58,    59,    60,    61,    53,    54,    55,    56,    -1,    58,
940       59,    60,    61
941 };
942
943   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
944      symbol of state STATE-NUM.  */
945 static const yytype_uint8 yystos[] =
946 {
947        0,     3,     6,     7,     8,     9,    10,    11,    12,    13,
948       16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
949       26,    27,    28,    29,    30,    31,    32,    33,    35,    51,
950       52,    61,    62,    63,    66,    70,    71,    72,    74,    75,
951       80,    81,    82,    83,    61,    72,    83,    61,    61,    61,
952       61,    61,    61,    61,    61,    61,    61,    61,    61,    61,
953       61,    61,    61,    72,    73,    72,    72,    78,    83,     0,
954       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
955       48,    50,    51,    52,    53,    54,    55,    56,    58,    59,
956       60,    61,    72,    34,    61,    66,    83,    72,    72,    72,
957       72,    83,    83,    72,    83,    72,    72,    72,    72,    72,
958       72,    72,    72,    72,    65,    36,    67,    67,    72,    72,
959       72,    72,    72,    72,    72,    72,    66,    75,    83,    72,
960       72,    72,    72,    72,    72,    72,    72,    72,    12,    72,
961       76,    77,    12,    13,    72,    78,    65,    65,    65,    65,
962       65,    65,    65,    65,    36,    65,    65,    65,    65,    36,
963       65,    36,    65,    36,    36,    72,    72,    68,    72,    79,
964       78,    65,    67,    72,    72,    72,    72,    72,    36,    68,
965       65,    65,    65,    65,    65,    65,    72
966 };
967
968   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
969 static const yytype_uint8 yyr1[] =
970 {
971        0,    69,    70,    70,    71,    72,    73,    72,    72,    72,
972       74,    74,    72,    72,    72,    72,    72,    72,    72,    72,
973       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
974       72,    72,    72,    72,    75,    75,    76,    72,    72,    77,
975       72,    78,    78,    78,    79,    79,    72,    72,    72,    72,
976       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
977       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
978       72,    72,    72,    72,    72,    80,    81,    81,    82,    82,
979       82,    82,    83
980 };
981
982   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
983 static const yytype_uint8 yyr2[] =
984 {
985        0,     2,     1,     1,     1,     2,     0,     3,     2,     2,
986        1,     1,     4,     4,     4,     4,     4,     4,     4,     6,
987        4,     4,     4,     4,     2,     4,     6,     4,     6,     3,
988        1,     3,     6,     6,     3,     4,     0,     5,     4,     0,
989        5,     0,     1,     3,     1,     3,     4,     4,     3,     3,
990        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
991        3,     3,     3,     3,     3,     3,     1,     1,     1,     1,
992        1,     1,     1,     4,     1,     1,     1,     3,     1,     1,
993        3,     1,     1
994 };
995
996
997 #define yyerrok         (yyerrstatus = 0)
998 #define yyclearin       (yychar = YYEMPTY)
999 #define YYEMPTY         (-2)
1000 #define YYEOF           0
1001
1002 #define YYACCEPT        goto yyacceptlab
1003 #define YYABORT         goto yyabortlab
1004 #define YYERROR         goto yyerrorlab
1005
1006
1007 #define YYRECOVERING()  (!!yyerrstatus)
1008
1009 #define YYBACKUP(Token, Value)                                  \
1010 do                                                              \
1011   if (yychar == YYEMPTY)                                        \
1012     {                                                           \
1013       yychar = (Token);                                         \
1014       yylval = (Value);                                         \
1015       YYPOPSTACK (yylen);                                       \
1016       yystate = *yyssp;                                         \
1017       goto yybackup;                                            \
1018     }                                                           \
1019   else                                                          \
1020     {                                                           \
1021       yyerror (YY_("syntax error: cannot back up")); \
1022       YYERROR;                                                  \
1023     }                                                           \
1024 while (0)
1025
1026 /* Error token number */
1027 #define YYTERROR        1
1028 #define YYERRCODE       256
1029
1030
1031
1032 /* Enable debugging if requested.  */
1033 #if YYDEBUG
1034
1035 # ifndef YYFPRINTF
1036 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1037 #  define YYFPRINTF fprintf
1038 # endif
1039
1040 # define YYDPRINTF(Args)                        \
1041 do {                                            \
1042   if (yydebug)                                  \
1043     YYFPRINTF Args;                             \
1044 } while (0)
1045
1046 /* This macro is provided for backward compatibility. */
1047 #ifndef YY_LOCATION_PRINT
1048 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1049 #endif
1050
1051
1052 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1053 do {                                                                      \
1054   if (yydebug)                                                            \
1055     {                                                                     \
1056       YYFPRINTF (stderr, "%s ", Title);                                   \
1057       yy_symbol_print (stderr,                                            \
1058                   Type, Value); \
1059       YYFPRINTF (stderr, "\n");                                           \
1060     }                                                                     \
1061 } while (0)
1062
1063
1064 /*----------------------------------------.
1065 | Print this symbol's value on YYOUTPUT.  |
1066 `----------------------------------------*/
1067
1068 static void
1069 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1070 {
1071   FILE *yyo = yyoutput;
1072   YYUSE (yyo);
1073   if (!yyvaluep)
1074     return;
1075 # ifdef YYPRINT
1076   if (yytype < YYNTOKENS)
1077     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1078 # endif
1079   YYUSE (yytype);
1080 }
1081
1082
1083 /*--------------------------------.
1084 | Print this symbol on YYOUTPUT.  |
1085 `--------------------------------*/
1086
1087 static void
1088 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1089 {
1090   YYFPRINTF (yyoutput, "%s %s (",
1091              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1092
1093   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1094   YYFPRINTF (yyoutput, ")");
1095 }
1096
1097 /*------------------------------------------------------------------.
1098 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1099 | TOP (included).                                                   |
1100 `------------------------------------------------------------------*/
1101
1102 static void
1103 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1104 {
1105   YYFPRINTF (stderr, "Stack now");
1106   for (; yybottom <= yytop; yybottom++)
1107     {
1108       int yybot = *yybottom;
1109       YYFPRINTF (stderr, " %d", yybot);
1110     }
1111   YYFPRINTF (stderr, "\n");
1112 }
1113
1114 # define YY_STACK_PRINT(Bottom, Top)                            \
1115 do {                                                            \
1116   if (yydebug)                                                  \
1117     yy_stack_print ((Bottom), (Top));                           \
1118 } while (0)
1119
1120
1121 /*------------------------------------------------.
1122 | Report that the YYRULE is going to be reduced.  |
1123 `------------------------------------------------*/
1124
1125 static void
1126 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1127 {
1128   unsigned long int yylno = yyrline[yyrule];
1129   int yynrhs = yyr2[yyrule];
1130   int yyi;
1131   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1132              yyrule - 1, yylno);
1133   /* The symbols being reduced.  */
1134   for (yyi = 0; yyi < yynrhs; yyi++)
1135     {
1136       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1137       yy_symbol_print (stderr,
1138                        yystos[yyssp[yyi + 1 - yynrhs]],
1139                        &(yyvsp[(yyi + 1) - (yynrhs)])
1140                                               );
1141       YYFPRINTF (stderr, "\n");
1142     }
1143 }
1144
1145 # define YY_REDUCE_PRINT(Rule)          \
1146 do {                                    \
1147   if (yydebug)                          \
1148     yy_reduce_print (yyssp, yyvsp, Rule); \
1149 } while (0)
1150
1151 /* Nonzero means print parse trace.  It is left uninitialized so that
1152    multiple parsers can coexist.  */
1153 int yydebug;
1154 #else /* !YYDEBUG */
1155 # define YYDPRINTF(Args)
1156 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1157 # define YY_STACK_PRINT(Bottom, Top)
1158 # define YY_REDUCE_PRINT(Rule)
1159 #endif /* !YYDEBUG */
1160
1161
1162 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1163 #ifndef YYINITDEPTH
1164 # define YYINITDEPTH 200
1165 #endif
1166
1167 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1168    if the built-in stack extension method is used).
1169
1170    Do not make this value too large; the results are undefined if
1171    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1172    evaluated with infinite-precision integer arithmetic.  */
1173
1174 #ifndef YYMAXDEPTH
1175 # define YYMAXDEPTH 10000
1176 #endif
1177
1178
1179 #if YYERROR_VERBOSE
1180
1181 # ifndef yystrlen
1182 #  if defined __GLIBC__ && defined _STRING_H
1183 #   define yystrlen strlen
1184 #  else
1185 /* Return the length of YYSTR.  */
1186 static YYSIZE_T
1187 yystrlen (const char *yystr)
1188 {
1189   YYSIZE_T yylen;
1190   for (yylen = 0; yystr[yylen]; yylen++)
1191     continue;
1192   return yylen;
1193 }
1194 #  endif
1195 # endif
1196
1197 # ifndef yystpcpy
1198 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1199 #   define yystpcpy stpcpy
1200 #  else
1201 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1202    YYDEST.  */
1203 static char *
1204 yystpcpy (char *yydest, const char *yysrc)
1205 {
1206   char *yyd = yydest;
1207   const char *yys = yysrc;
1208
1209   while ((*yyd++ = *yys++) != '\0')
1210     continue;
1211
1212   return yyd - 1;
1213 }
1214 #  endif
1215 # endif
1216
1217 # ifndef yytnamerr
1218 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1219    quotes and backslashes, so that it's suitable for yyerror.  The
1220    heuristic is that double-quoting is unnecessary unless the string
1221    contains an apostrophe, a comma, or backslash (other than
1222    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1223    null, do not copy; instead, return the length of what the result
1224    would have been.  */
1225 static YYSIZE_T
1226 yytnamerr (char *yyres, const char *yystr)
1227 {
1228   if (*yystr == '"')
1229     {
1230       YYSIZE_T yyn = 0;
1231       char const *yyp = yystr;
1232
1233       for (;;)
1234         switch (*++yyp)
1235           {
1236           case '\'':
1237           case ',':
1238             goto do_not_strip_quotes;
1239
1240           case '\\':
1241             if (*++yyp != '\\')
1242               goto do_not_strip_quotes;
1243             /* Fall through.  */
1244           default:
1245             if (yyres)
1246               yyres[yyn] = *yyp;
1247             yyn++;
1248             break;
1249
1250           case '"':
1251             if (yyres)
1252               yyres[yyn] = '\0';
1253             return yyn;
1254           }
1255     do_not_strip_quotes: ;
1256     }
1257
1258   if (! yyres)
1259     return yystrlen (yystr);
1260
1261   return yystpcpy (yyres, yystr) - yyres;
1262 }
1263 # endif
1264
1265 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1266    about the unexpected token YYTOKEN for the state stack whose top is
1267    YYSSP.
1268
1269    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1270    not large enough to hold the message.  In that case, also set
1271    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1272    required number of bytes is too large to store.  */
1273 static int
1274 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1275                 yytype_int16 *yyssp, int yytoken)
1276 {
1277   YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1278   YYSIZE_T yysize = yysize0;
1279   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1280   /* Internationalized format string. */
1281   const char *yyformat = YY_NULLPTR;
1282   /* Arguments of yyformat. */
1283   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1284   /* Number of reported tokens (one for the "unexpected", one per
1285      "expected"). */
1286   int yycount = 0;
1287
1288   /* There are many possibilities here to consider:
1289      - If this state is a consistent state with a default action, then
1290        the only way this function was invoked is if the default action
1291        is an error action.  In that case, don't check for expected
1292        tokens because there are none.
1293      - The only way there can be no lookahead present (in yychar) is if
1294        this state is a consistent state with a default action.  Thus,
1295        detecting the absence of a lookahead is sufficient to determine
1296        that there is no unexpected or expected token to report.  In that
1297        case, just report a simple "syntax error".
1298      - Don't assume there isn't a lookahead just because this state is a
1299        consistent state with a default action.  There might have been a
1300        previous inconsistent state, consistent state with a non-default
1301        action, or user semantic action that manipulated yychar.
1302      - Of course, the expected token list depends on states to have
1303        correct lookahead information, and it depends on the parser not
1304        to perform extra reductions after fetching a lookahead from the
1305        scanner and before detecting a syntax error.  Thus, state merging
1306        (from LALR or IELR) and default reductions corrupt the expected
1307        token list.  However, the list is correct for canonical LR with
1308        one exception: it will still contain any token that will not be
1309        accepted due to an error action in a later state.
1310   */
1311   if (yytoken != YYEMPTY)
1312     {
1313       int yyn = yypact[*yyssp];
1314       yyarg[yycount++] = yytname[yytoken];
1315       if (!yypact_value_is_default (yyn))
1316         {
1317           /* Start YYX at -YYN if negative to avoid negative indexes in
1318              YYCHECK.  In other words, skip the first -YYN actions for
1319              this state because they are default actions.  */
1320           int yyxbegin = yyn < 0 ? -yyn : 0;
1321           /* Stay within bounds of both yycheck and yytname.  */
1322           int yychecklim = YYLAST - yyn + 1;
1323           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1324           int yyx;
1325
1326           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1327             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1328                 && !yytable_value_is_error (yytable[yyx + yyn]))
1329               {
1330                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1331                   {
1332                     yycount = 1;
1333                     yysize = yysize0;
1334                     break;
1335                   }
1336                 yyarg[yycount++] = yytname[yyx];
1337                 {
1338                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1339                   if (! (yysize <= yysize1
1340                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1341                     return 2;
1342                   yysize = yysize1;
1343                 }
1344               }
1345         }
1346     }
1347
1348   switch (yycount)
1349     {
1350 # define YYCASE_(N, S)                      \
1351       case N:                               \
1352         yyformat = S;                       \
1353       break
1354       YYCASE_(0, YY_("syntax error"));
1355       YYCASE_(1, YY_("syntax error, unexpected %s"));
1356       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1357       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1358       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1359       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1360 # undef YYCASE_
1361     }
1362
1363   {
1364     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1365     if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1366       return 2;
1367     yysize = yysize1;
1368   }
1369
1370   if (*yymsg_alloc < yysize)
1371     {
1372       *yymsg_alloc = 2 * yysize;
1373       if (! (yysize <= *yymsg_alloc
1374              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1375         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1376       return 1;
1377     }
1378
1379   /* Avoid sprintf, as that infringes on the user's name space.
1380      Don't have undefined behavior even if the translation
1381      produced a string with the wrong number of "%s"s.  */
1382   {
1383     char *yyp = *yymsg;
1384     int yyi = 0;
1385     while ((*yyp = *yyformat) != '\0')
1386       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1387         {
1388           yyp += yytnamerr (yyp, yyarg[yyi++]);
1389           yyformat += 2;
1390         }
1391       else
1392         {
1393           yyp++;
1394           yyformat++;
1395         }
1396   }
1397   return 0;
1398 }
1399 #endif /* YYERROR_VERBOSE */
1400
1401 /*-----------------------------------------------.
1402 | Release the memory associated to this symbol.  |
1403 `-----------------------------------------------*/
1404
1405 static void
1406 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1407 {
1408   YYUSE (yyvaluep);
1409   if (!yymsg)
1410     yymsg = "Deleting";
1411   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1412
1413   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1414   YYUSE (yytype);
1415   YY_IGNORE_MAYBE_UNINITIALIZED_END
1416 }
1417
1418
1419
1420
1421 /* The lookahead symbol.  */
1422 int yychar;
1423
1424 /* The semantic value of the lookahead symbol.  */
1425 YYSTYPE yylval;
1426 /* Number of syntax errors so far.  */
1427 int yynerrs;
1428
1429
1430 /*----------.
1431 | yyparse.  |
1432 `----------*/
1433
1434 int
1435 yyparse (void)
1436 {
1437     int yystate;
1438     /* Number of tokens to shift before error messages enabled.  */
1439     int yyerrstatus;
1440
1441     /* The stacks and their tools:
1442        'yyss': related to states.
1443        'yyvs': related to semantic values.
1444
1445        Refer to the stacks through separate pointers, to allow yyoverflow
1446        to xreallocate them elsewhere.  */
1447
1448     /* The state stack.  */
1449     yytype_int16 yyssa[YYINITDEPTH];
1450     yytype_int16 *yyss;
1451     yytype_int16 *yyssp;
1452
1453     /* The semantic value stack.  */
1454     YYSTYPE yyvsa[YYINITDEPTH];
1455     YYSTYPE *yyvs;
1456     YYSTYPE *yyvsp;
1457
1458     YYSIZE_T yystacksize;
1459
1460   int yyn;
1461   int yyresult;
1462   /* Lookahead token as an internal (translated) token number.  */
1463   int yytoken = 0;
1464   /* The variables used to return semantic value and location from the
1465      action routines.  */
1466   YYSTYPE yyval;
1467
1468 #if YYERROR_VERBOSE
1469   /* Buffer for error messages, and its allocated size.  */
1470   char yymsgbuf[128];
1471   char *yymsg = yymsgbuf;
1472   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1473 #endif
1474
1475 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1476
1477   /* The number of symbols on the RHS of the reduced rule.
1478      Keep to zero when no symbol should be popped.  */
1479   int yylen = 0;
1480
1481   yyssp = yyss = yyssa;
1482   yyvsp = yyvs = yyvsa;
1483   yystacksize = YYINITDEPTH;
1484
1485   YYDPRINTF ((stderr, "Starting parse\n"));
1486
1487   yystate = 0;
1488   yyerrstatus = 0;
1489   yynerrs = 0;
1490   yychar = YYEMPTY; /* Cause a token to be read.  */
1491   goto yysetstate;
1492
1493 /*------------------------------------------------------------.
1494 | yynewstate -- Push a new state, which is found in yystate.  |
1495 `------------------------------------------------------------*/
1496  yynewstate:
1497   /* In all cases, when you get here, the value and location stacks
1498      have just been pushed.  So pushing a state here evens the stacks.  */
1499   yyssp++;
1500
1501  yysetstate:
1502   *yyssp = yystate;
1503
1504   if (yyss + yystacksize - 1 <= yyssp)
1505     {
1506       /* Get the current used size of the three stacks, in elements.  */
1507       YYSIZE_T yysize = yyssp - yyss + 1;
1508
1509 #ifdef yyoverflow
1510       {
1511         /* Give user a chance to xreallocate the stack.  Use copies of
1512            these so that the &'s don't force the real ones into
1513            memory.  */
1514         YYSTYPE *yyvs1 = yyvs;
1515         yytype_int16 *yyss1 = yyss;
1516
1517         /* Each stack pointer address is followed by the size of the
1518            data in use in that stack, in bytes.  This used to be a
1519            conditional around just the two extra args, but that might
1520            be undefined if yyoverflow is a macro.  */
1521         yyoverflow (YY_("memory exhausted"),
1522                     &yyss1, yysize * sizeof (*yyssp),
1523                     &yyvs1, yysize * sizeof (*yyvsp),
1524                     &yystacksize);
1525
1526         yyss = yyss1;
1527         yyvs = yyvs1;
1528       }
1529 #else /* no yyoverflow */
1530 # ifndef YYSTACK_RELOCATE
1531       goto yyexhaustedlab;
1532 # else
1533       /* Extend the stack our own way.  */
1534       if (YYMAXDEPTH <= yystacksize)
1535         goto yyexhaustedlab;
1536       yystacksize *= 2;
1537       if (YYMAXDEPTH < yystacksize)
1538         yystacksize = YYMAXDEPTH;
1539
1540       {
1541         yytype_int16 *yyss1 = yyss;
1542         union yyalloc *yyptr =
1543           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1544         if (! yyptr)
1545           goto yyexhaustedlab;
1546         YYSTACK_RELOCATE (yyss_alloc, yyss);
1547         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1548 #  undef YYSTACK_RELOCATE
1549         if (yyss1 != yyssa)
1550           YYSTACK_FREE (yyss1);
1551       }
1552 # endif
1553 #endif /* no yyoverflow */
1554
1555       yyssp = yyss + yysize - 1;
1556       yyvsp = yyvs + yysize - 1;
1557
1558       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1559                   (unsigned long int) yystacksize));
1560
1561       if (yyss + yystacksize - 1 <= yyssp)
1562         YYABORT;
1563     }
1564
1565   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1566
1567   if (yystate == YYFINAL)
1568     YYACCEPT;
1569
1570   goto yybackup;
1571
1572 /*-----------.
1573 | yybackup.  |
1574 `-----------*/
1575 yybackup:
1576
1577   /* Do appropriate processing given the current state.  Read a
1578      lookahead token if we need one and don't already have one.  */
1579
1580   /* First try to decide what to do without reference to lookahead token.  */
1581   yyn = yypact[yystate];
1582   if (yypact_value_is_default (yyn))
1583     goto yydefault;
1584
1585   /* Not known => get a lookahead token if don't already have one.  */
1586
1587   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1588   if (yychar == YYEMPTY)
1589     {
1590       YYDPRINTF ((stderr, "Reading a token: "));
1591       yychar = yylex ();
1592     }
1593
1594   if (yychar <= YYEOF)
1595     {
1596       yychar = yytoken = YYEOF;
1597       YYDPRINTF ((stderr, "Now at end of input.\n"));
1598     }
1599   else
1600     {
1601       yytoken = YYTRANSLATE (yychar);
1602       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1603     }
1604
1605   /* If the proper action on seeing token YYTOKEN is to reduce or to
1606      detect an error, take that action.  */
1607   yyn += yytoken;
1608   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1609     goto yydefault;
1610   yyn = yytable[yyn];
1611   if (yyn <= 0)
1612     {
1613       if (yytable_value_is_error (yyn))
1614         goto yyerrlab;
1615       yyn = -yyn;
1616       goto yyreduce;
1617     }
1618
1619   /* Count tokens shifted since error; after three, turn off error
1620      status.  */
1621   if (yyerrstatus)
1622     yyerrstatus--;
1623
1624   /* Shift the lookahead token.  */
1625   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1626
1627   /* Discard the shifted token.  */
1628   yychar = YYEMPTY;
1629
1630   yystate = yyn;
1631   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1632   *++yyvsp = yylval;
1633   YY_IGNORE_MAYBE_UNINITIALIZED_END
1634
1635   goto yynewstate;
1636
1637
1638 /*-----------------------------------------------------------.
1639 | yydefault -- do the default action for the current state.  |
1640 `-----------------------------------------------------------*/
1641 yydefault:
1642   yyn = yydefact[yystate];
1643   if (yyn == 0)
1644     goto yyerrlab;
1645   goto yyreduce;
1646
1647
1648 /*-----------------------------.
1649 | yyreduce -- Do a reduction.  |
1650 `-----------------------------*/
1651 yyreduce:
1652   /* yyn is the number of a rule to reduce with.  */
1653   yylen = yyr2[yyn];
1654
1655   /* If YYLEN is nonzero, implement the default value of the action:
1656      '$$ = $1'.
1657
1658      Otherwise, the following line sets YYVAL to garbage.
1659      This behavior is undocumented and Bison
1660      users should not rely upon it.  Assigning to YYVAL
1661      unconditionally makes the parser a bit smaller, and it avoids a
1662      GCC warning that YYVAL may be used uninitialized.  */
1663   yyval = yyvsp[1-yylen];
1664
1665
1666   YY_REDUCE_PRINT (yyn);
1667   switch (yyn)
1668     {
1669         case 4:
1670 #line 211 "m2-exp.y" /* yacc.c:1646  */
1671     { write_exp_elt_opcode (pstate, OP_TYPE);
1672                   write_exp_elt_type (pstate, (yyvsp[0].tval));
1673                   write_exp_elt_opcode (pstate, OP_TYPE);
1674                 }
1675 #line 1677 "m2-exp.c" /* yacc.c:1646  */
1676     break;
1677
1678   case 5:
1679 #line 220 "m2-exp.y" /* yacc.c:1646  */
1680     { write_exp_elt_opcode (pstate, UNOP_IND); }
1681 #line 1683 "m2-exp.c" /* yacc.c:1646  */
1682     break;
1683
1684   case 6:
1685 #line 224 "m2-exp.y" /* yacc.c:1646  */
1686     { number_sign = -1; }
1687 #line 1689 "m2-exp.c" /* yacc.c:1646  */
1688     break;
1689
1690   case 7:
1691 #line 226 "m2-exp.y" /* yacc.c:1646  */
1692     { number_sign = 1;
1693                           write_exp_elt_opcode (pstate, UNOP_NEG); }
1694 #line 1696 "m2-exp.c" /* yacc.c:1646  */
1695     break;
1696
1697   case 8:
1698 #line 231 "m2-exp.y" /* yacc.c:1646  */
1699     { write_exp_elt_opcode (pstate, UNOP_PLUS); }
1700 #line 1702 "m2-exp.c" /* yacc.c:1646  */
1701     break;
1702
1703   case 9:
1704 #line 235 "m2-exp.y" /* yacc.c:1646  */
1705     { write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT); }
1706 #line 1708 "m2-exp.c" /* yacc.c:1646  */
1707     break;
1708
1709   case 12:
1710 #line 243 "m2-exp.y" /* yacc.c:1646  */
1711     { write_exp_elt_opcode (pstate, UNOP_CAP); }
1712 #line 1714 "m2-exp.c" /* yacc.c:1646  */
1713     break;
1714
1715   case 13:
1716 #line 247 "m2-exp.y" /* yacc.c:1646  */
1717     { write_exp_elt_opcode (pstate, UNOP_ORD); }
1718 #line 1720 "m2-exp.c" /* yacc.c:1646  */
1719     break;
1720
1721   case 14:
1722 #line 251 "m2-exp.y" /* yacc.c:1646  */
1723     { write_exp_elt_opcode (pstate, UNOP_ABS); }
1724 #line 1726 "m2-exp.c" /* yacc.c:1646  */
1725     break;
1726
1727   case 15:
1728 #line 255 "m2-exp.y" /* yacc.c:1646  */
1729     { write_exp_elt_opcode (pstate, UNOP_HIGH); }
1730 #line 1732 "m2-exp.c" /* yacc.c:1646  */
1731     break;
1732
1733   case 16:
1734 #line 259 "m2-exp.y" /* yacc.c:1646  */
1735     { write_exp_elt_opcode (pstate, UNOP_MIN);
1736                           write_exp_elt_type (pstate, (yyvsp[-1].tval));
1737                           write_exp_elt_opcode (pstate, UNOP_MIN); }
1738 #line 1740 "m2-exp.c" /* yacc.c:1646  */
1739     break;
1740
1741   case 17:
1742 #line 265 "m2-exp.y" /* yacc.c:1646  */
1743     { write_exp_elt_opcode (pstate, UNOP_MAX);
1744                           write_exp_elt_type (pstate, (yyvsp[-1].tval));
1745                           write_exp_elt_opcode (pstate, UNOP_MAX); }
1746 #line 1748 "m2-exp.c" /* yacc.c:1646  */
1747     break;
1748
1749   case 18:
1750 #line 271 "m2-exp.y" /* yacc.c:1646  */
1751     { write_exp_elt_opcode (pstate, UNOP_FLOAT); }
1752 #line 1754 "m2-exp.c" /* yacc.c:1646  */
1753     break;
1754
1755   case 19:
1756 #line 275 "m2-exp.y" /* yacc.c:1646  */
1757     { write_exp_elt_opcode (pstate, BINOP_VAL);
1758                           write_exp_elt_type (pstate, (yyvsp[-3].tval));
1759                           write_exp_elt_opcode (pstate, BINOP_VAL); }
1760 #line 1762 "m2-exp.c" /* yacc.c:1646  */
1761     break;
1762
1763   case 20:
1764 #line 281 "m2-exp.y" /* yacc.c:1646  */
1765     { write_exp_elt_opcode (pstate, UNOP_CHR); }
1766 #line 1768 "m2-exp.c" /* yacc.c:1646  */
1767     break;
1768
1769   case 21:
1770 #line 285 "m2-exp.y" /* yacc.c:1646  */
1771     { write_exp_elt_opcode (pstate, UNOP_ODD); }
1772 #line 1774 "m2-exp.c" /* yacc.c:1646  */
1773     break;
1774
1775   case 22:
1776 #line 289 "m2-exp.y" /* yacc.c:1646  */
1777     { write_exp_elt_opcode (pstate, UNOP_TRUNC); }
1778 #line 1780 "m2-exp.c" /* yacc.c:1646  */
1779     break;
1780
1781   case 23:
1782 #line 293 "m2-exp.y" /* yacc.c:1646  */
1783     { write_exp_elt_opcode (pstate, UNOP_SIZEOF); }
1784 #line 1786 "m2-exp.c" /* yacc.c:1646  */
1785     break;
1786
1787   case 24:
1788 #line 297 "m2-exp.y" /* yacc.c:1646  */
1789     { write_exp_elt_opcode (pstate, UNOP_SIZEOF); }
1790 #line 1792 "m2-exp.c" /* yacc.c:1646  */
1791     break;
1792
1793   case 25:
1794 #line 302 "m2-exp.y" /* yacc.c:1646  */
1795     { write_exp_elt_opcode (pstate, UNOP_PREINCREMENT); }
1796 #line 1798 "m2-exp.c" /* yacc.c:1646  */
1797     break;
1798
1799   case 26:
1800 #line 306 "m2-exp.y" /* yacc.c:1646  */
1801     { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
1802                           write_exp_elt_opcode (pstate, BINOP_ADD);
1803                           write_exp_elt_opcode (pstate,
1804                                                 BINOP_ASSIGN_MODIFY); }
1805 #line 1807 "m2-exp.c" /* yacc.c:1646  */
1806     break;
1807
1808   case 27:
1809 #line 313 "m2-exp.y" /* yacc.c:1646  */
1810     { write_exp_elt_opcode (pstate, UNOP_PREDECREMENT);}
1811 #line 1813 "m2-exp.c" /* yacc.c:1646  */
1812     break;
1813
1814   case 28:
1815 #line 317 "m2-exp.y" /* yacc.c:1646  */
1816     { write_exp_elt_opcode (pstate, BINOP_ASSIGN_MODIFY);
1817                           write_exp_elt_opcode (pstate, BINOP_SUB);
1818                           write_exp_elt_opcode (pstate,
1819                                                 BINOP_ASSIGN_MODIFY); }
1820 #line 1822 "m2-exp.c" /* yacc.c:1646  */
1821     break;
1822
1823   case 29:
1824 #line 324 "m2-exp.y" /* yacc.c:1646  */
1825     { write_exp_elt_opcode (pstate, STRUCTOP_STRUCT);
1826                           write_exp_string (pstate, (yyvsp[0].sval));
1827                           write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); }
1828 #line 1830 "m2-exp.c" /* yacc.c:1646  */
1829     break;
1830
1831   case 31:
1832 #line 333 "m2-exp.y" /* yacc.c:1646  */
1833     { error (_("Sets are not implemented."));}
1834 #line 1836 "m2-exp.c" /* yacc.c:1646  */
1835     break;
1836
1837   case 32:
1838 #line 337 "m2-exp.y" /* yacc.c:1646  */
1839     { error (_("Sets are not implemented."));}
1840 #line 1842 "m2-exp.c" /* yacc.c:1646  */
1841     break;
1842
1843   case 33:
1844 #line 341 "m2-exp.y" /* yacc.c:1646  */
1845     { error (_("Sets are not implemented."));}
1846 #line 1848 "m2-exp.c" /* yacc.c:1646  */
1847     break;
1848
1849   case 34:
1850 #line 345 "m2-exp.y" /* yacc.c:1646  */
1851     { error (_("Sets are not implemented."));}
1852 #line 1854 "m2-exp.c" /* yacc.c:1646  */
1853     break;
1854
1855   case 35:
1856 #line 347 "m2-exp.y" /* yacc.c:1646  */
1857     { error (_("Sets are not implemented."));}
1858 #line 1860 "m2-exp.c" /* yacc.c:1646  */
1859     break;
1860
1861   case 36:
1862 #line 356 "m2-exp.y" /* yacc.c:1646  */
1863     { start_arglist(); }
1864 #line 1866 "m2-exp.c" /* yacc.c:1646  */
1865     break;
1866
1867   case 37:
1868 #line 358 "m2-exp.y" /* yacc.c:1646  */
1869     { write_exp_elt_opcode (pstate, MULTI_SUBSCRIPT);
1870                           write_exp_elt_longcst (pstate,
1871                                                  (LONGEST) end_arglist());
1872                           write_exp_elt_opcode (pstate, MULTI_SUBSCRIPT); }
1873 #line 1875 "m2-exp.c" /* yacc.c:1646  */
1874     break;
1875
1876   case 38:
1877 #line 365 "m2-exp.y" /* yacc.c:1646  */
1878     { write_exp_elt_opcode (pstate, BINOP_SUBSCRIPT); }
1879 #line 1881 "m2-exp.c" /* yacc.c:1646  */
1880     break;
1881
1882   case 39:
1883 #line 371 "m2-exp.y" /* yacc.c:1646  */
1884     { start_arglist (); }
1885 #line 1887 "m2-exp.c" /* yacc.c:1646  */
1886     break;
1887
1888   case 40:
1889 #line 373 "m2-exp.y" /* yacc.c:1646  */
1890     { write_exp_elt_opcode (pstate, OP_FUNCALL);
1891                           write_exp_elt_longcst (pstate,
1892                                                  (LONGEST) end_arglist ());
1893                           write_exp_elt_opcode (pstate, OP_FUNCALL); }
1894 #line 1896 "m2-exp.c" /* yacc.c:1646  */
1895     break;
1896
1897   case 42:
1898 #line 383 "m2-exp.y" /* yacc.c:1646  */
1899     { arglist_len = 1; }
1900 #line 1902 "m2-exp.c" /* yacc.c:1646  */
1901     break;
1902
1903   case 43:
1904 #line 387 "m2-exp.y" /* yacc.c:1646  */
1905     { arglist_len++; }
1906 #line 1908 "m2-exp.c" /* yacc.c:1646  */
1907     break;
1908
1909   case 44:
1910 #line 392 "m2-exp.y" /* yacc.c:1646  */
1911     { arglist_len = 1; }
1912 #line 1914 "m2-exp.c" /* yacc.c:1646  */
1913     break;
1914
1915   case 45:
1916 #line 397 "m2-exp.y" /* yacc.c:1646  */
1917     { arglist_len++; }
1918 #line 1920 "m2-exp.c" /* yacc.c:1646  */
1919     break;
1920
1921   case 46:
1922 #line 402 "m2-exp.y" /* yacc.c:1646  */
1923     { write_exp_elt_opcode (pstate, UNOP_MEMVAL);
1924                           write_exp_elt_type (pstate, (yyvsp[-2].tval));
1925                           write_exp_elt_opcode (pstate, UNOP_MEMVAL); }
1926 #line 1928 "m2-exp.c" /* yacc.c:1646  */
1927     break;
1928
1929   case 47:
1930 #line 408 "m2-exp.y" /* yacc.c:1646  */
1931     { write_exp_elt_opcode (pstate, UNOP_CAST);
1932                           write_exp_elt_type (pstate, (yyvsp[-3].tval));
1933                           write_exp_elt_opcode (pstate, UNOP_CAST); }
1934 #line 1936 "m2-exp.c" /* yacc.c:1646  */
1935     break;
1936
1937   case 48:
1938 #line 414 "m2-exp.y" /* yacc.c:1646  */
1939     { }
1940 #line 1942 "m2-exp.c" /* yacc.c:1646  */
1941     break;
1942
1943   case 49:
1944 #line 422 "m2-exp.y" /* yacc.c:1646  */
1945     { write_exp_elt_opcode (pstate, BINOP_REPEAT); }
1946 #line 1948 "m2-exp.c" /* yacc.c:1646  */
1947     break;
1948
1949   case 50:
1950 #line 426 "m2-exp.y" /* yacc.c:1646  */
1951     { write_exp_elt_opcode (pstate, BINOP_MUL); }
1952 #line 1954 "m2-exp.c" /* yacc.c:1646  */
1953     break;
1954
1955   case 51:
1956 #line 430 "m2-exp.y" /* yacc.c:1646  */
1957     { write_exp_elt_opcode (pstate, BINOP_DIV); }
1958 #line 1960 "m2-exp.c" /* yacc.c:1646  */
1959     break;
1960
1961   case 52:
1962 #line 434 "m2-exp.y" /* yacc.c:1646  */
1963     { write_exp_elt_opcode (pstate, BINOP_INTDIV); }
1964 #line 1966 "m2-exp.c" /* yacc.c:1646  */
1965     break;
1966
1967   case 53:
1968 #line 438 "m2-exp.y" /* yacc.c:1646  */
1969     { write_exp_elt_opcode (pstate, BINOP_REM); }
1970 #line 1972 "m2-exp.c" /* yacc.c:1646  */
1971     break;
1972
1973   case 54:
1974 #line 442 "m2-exp.y" /* yacc.c:1646  */
1975     { write_exp_elt_opcode (pstate, BINOP_ADD); }
1976 #line 1978 "m2-exp.c" /* yacc.c:1646  */
1977     break;
1978
1979   case 55:
1980 #line 446 "m2-exp.y" /* yacc.c:1646  */
1981     { write_exp_elt_opcode (pstate, BINOP_SUB); }
1982 #line 1984 "m2-exp.c" /* yacc.c:1646  */
1983     break;
1984
1985   case 56:
1986 #line 450 "m2-exp.y" /* yacc.c:1646  */
1987     { write_exp_elt_opcode (pstate, BINOP_EQUAL); }
1988 #line 1990 "m2-exp.c" /* yacc.c:1646  */
1989     break;
1990
1991   case 57:
1992 #line 454 "m2-exp.y" /* yacc.c:1646  */
1993     { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
1994 #line 1996 "m2-exp.c" /* yacc.c:1646  */
1995     break;
1996
1997   case 58:
1998 #line 456 "m2-exp.y" /* yacc.c:1646  */
1999     { write_exp_elt_opcode (pstate, BINOP_NOTEQUAL); }
2000 #line 2002 "m2-exp.c" /* yacc.c:1646  */
2001     break;
2002
2003   case 59:
2004 #line 460 "m2-exp.y" /* yacc.c:1646  */
2005     { write_exp_elt_opcode (pstate, BINOP_LEQ); }
2006 #line 2008 "m2-exp.c" /* yacc.c:1646  */
2007     break;
2008
2009   case 60:
2010 #line 464 "m2-exp.y" /* yacc.c:1646  */
2011     { write_exp_elt_opcode (pstate, BINOP_GEQ); }
2012 #line 2014 "m2-exp.c" /* yacc.c:1646  */
2013     break;
2014
2015   case 61:
2016 #line 468 "m2-exp.y" /* yacc.c:1646  */
2017     { write_exp_elt_opcode (pstate, BINOP_LESS); }
2018 #line 2020 "m2-exp.c" /* yacc.c:1646  */
2019     break;
2020
2021   case 62:
2022 #line 472 "m2-exp.y" /* yacc.c:1646  */
2023     { write_exp_elt_opcode (pstate, BINOP_GTR); }
2024 #line 2026 "m2-exp.c" /* yacc.c:1646  */
2025     break;
2026
2027   case 63:
2028 #line 476 "m2-exp.y" /* yacc.c:1646  */
2029     { write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
2030 #line 2032 "m2-exp.c" /* yacc.c:1646  */
2031     break;
2032
2033   case 64:
2034 #line 480 "m2-exp.y" /* yacc.c:1646  */
2035     { write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
2036 #line 2038 "m2-exp.c" /* yacc.c:1646  */
2037     break;
2038
2039   case 65:
2040 #line 484 "m2-exp.y" /* yacc.c:1646  */
2041     { write_exp_elt_opcode (pstate, BINOP_ASSIGN); }
2042 #line 2044 "m2-exp.c" /* yacc.c:1646  */
2043     break;
2044
2045   case 66:
2046 #line 491 "m2-exp.y" /* yacc.c:1646  */
2047     { write_exp_elt_opcode (pstate, OP_BOOL);
2048                           write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2049                           write_exp_elt_opcode (pstate, OP_BOOL); }
2050 #line 2052 "m2-exp.c" /* yacc.c:1646  */
2051     break;
2052
2053   case 67:
2054 #line 497 "m2-exp.y" /* yacc.c:1646  */
2055     { write_exp_elt_opcode (pstate, OP_BOOL);
2056                           write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2057                           write_exp_elt_opcode (pstate, OP_BOOL); }
2058 #line 2060 "m2-exp.c" /* yacc.c:1646  */
2059     break;
2060
2061   case 68:
2062 #line 503 "m2-exp.y" /* yacc.c:1646  */
2063     { write_exp_elt_opcode (pstate, OP_LONG);
2064                           write_exp_elt_type (pstate,
2065                                         parse_m2_type (pstate)->builtin_int);
2066                           write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].lval));
2067                           write_exp_elt_opcode (pstate, OP_LONG); }
2068 #line 2070 "m2-exp.c" /* yacc.c:1646  */
2069     break;
2070
2071   case 69:
2072 #line 511 "m2-exp.y" /* yacc.c:1646  */
2073     {
2074                           write_exp_elt_opcode (pstate, OP_LONG);
2075                           write_exp_elt_type (pstate,
2076                                               parse_m2_type (pstate)
2077                                               ->builtin_card);
2078                           write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2079                           write_exp_elt_opcode (pstate, OP_LONG);
2080                         }
2081 #line 2083 "m2-exp.c" /* yacc.c:1646  */
2082     break;
2083
2084   case 70:
2085 #line 522 "m2-exp.y" /* yacc.c:1646  */
2086     { write_exp_elt_opcode (pstate, OP_LONG);
2087                           write_exp_elt_type (pstate,
2088                                               parse_m2_type (pstate)
2089                                               ->builtin_char);
2090                           write_exp_elt_longcst (pstate, (LONGEST) (yyvsp[0].ulval));
2091                           write_exp_elt_opcode (pstate, OP_LONG); }
2092 #line 2094 "m2-exp.c" /* yacc.c:1646  */
2093     break;
2094
2095   case 71:
2096 #line 532 "m2-exp.y" /* yacc.c:1646  */
2097     { write_exp_elt_opcode (pstate, OP_DOUBLE);
2098                           write_exp_elt_type (pstate,
2099                                               parse_m2_type (pstate)
2100                                               ->builtin_real);
2101                           write_exp_elt_dblcst (pstate, (yyvsp[0].dval));
2102                           write_exp_elt_opcode (pstate, OP_DOUBLE); }
2103 #line 2105 "m2-exp.c" /* yacc.c:1646  */
2104     break;
2105
2106   case 73:
2107 #line 544 "m2-exp.y" /* yacc.c:1646  */
2108     { write_exp_elt_opcode (pstate, OP_LONG);
2109                           write_exp_elt_type (pstate,
2110                                             parse_type (pstate)->builtin_int);
2111                           write_exp_elt_longcst (pstate,
2112                                                  (LONGEST) TYPE_LENGTH ((yyvsp[-1].tval)));
2113                           write_exp_elt_opcode (pstate, OP_LONG); }
2114 #line 2116 "m2-exp.c" /* yacc.c:1646  */
2115     break;
2116
2117   case 74:
2118 #line 553 "m2-exp.y" /* yacc.c:1646  */
2119     { write_exp_elt_opcode (pstate, OP_M2_STRING);
2120                           write_exp_string (pstate, (yyvsp[0].sval));
2121                           write_exp_elt_opcode (pstate, OP_M2_STRING); }
2122 #line 2124 "m2-exp.c" /* yacc.c:1646  */
2123     break;
2124
2125   case 75:
2126 #line 560 "m2-exp.y" /* yacc.c:1646  */
2127     { (yyval.bval) = SYMBOL_BLOCK_VALUE((yyvsp[0].sym)); }
2128 #line 2130 "m2-exp.c" /* yacc.c:1646  */
2129     break;
2130
2131   case 76:
2132 #line 564 "m2-exp.y" /* yacc.c:1646  */
2133     { struct symbol *sym
2134                             = lookup_symbol (copy_name ((yyvsp[0].sval)),
2135                                              expression_context_block,
2136                                              VAR_DOMAIN, 0);
2137                           (yyval.sym) = sym;}
2138 #line 2140 "m2-exp.c" /* yacc.c:1646  */
2139     break;
2140
2141   case 77:
2142 #line 574 "m2-exp.y" /* yacc.c:1646  */
2143     { struct symbol *tem
2144                             = lookup_symbol (copy_name ((yyvsp[0].sval)), (yyvsp[-2].bval),
2145                                              VAR_DOMAIN, 0);
2146                           if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
2147                             error (_("No function \"%s\" in specified context."),
2148                                    copy_name ((yyvsp[0].sval)));
2149                           (yyval.sym) = tem;
2150                         }
2151 #line 2153 "m2-exp.c" /* yacc.c:1646  */
2152     break;
2153
2154   case 78:
2155 #line 586 "m2-exp.y" /* yacc.c:1646  */
2156     { write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2157                           write_exp_elt_block (pstate, NULL);
2158                           write_exp_elt_sym (pstate, (yyvsp[0].sym));
2159                           write_exp_elt_opcode (pstate, OP_VAR_VALUE); }
2160 #line 2162 "m2-exp.c" /* yacc.c:1646  */
2161     break;
2162
2163   case 80:
2164 #line 598 "m2-exp.y" /* yacc.c:1646  */
2165     { struct symbol *sym;
2166                           sym = lookup_symbol (copy_name ((yyvsp[0].sval)), (yyvsp[-2].bval),
2167                                                VAR_DOMAIN, 0);
2168                           if (sym == 0)
2169                             error (_("No symbol \"%s\" in specified context."),
2170                                    copy_name ((yyvsp[0].sval)));
2171                           if (symbol_read_needs_frame (sym))
2172                             {
2173                               if (innermost_block == 0
2174                                   || contained_in (block_found,
2175                                                    innermost_block))
2176                                 innermost_block = block_found;
2177                             }
2178
2179                           write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2180                           /* block_found is set by lookup_symbol.  */
2181                           write_exp_elt_block (pstate, block_found);
2182                           write_exp_elt_sym (pstate, sym);
2183                           write_exp_elt_opcode (pstate, OP_VAR_VALUE); }
2184 #line 2186 "m2-exp.c" /* yacc.c:1646  */
2185     break;
2186
2187   case 81:
2188 #line 621 "m2-exp.y" /* yacc.c:1646  */
2189     { struct symbol *sym;
2190                           struct field_of_this_result is_a_field_of_this;
2191
2192                           sym = lookup_symbol (copy_name ((yyvsp[0].sval)),
2193                                                expression_context_block,
2194                                                VAR_DOMAIN,
2195                                                &is_a_field_of_this);
2196                           if (sym)
2197                             {
2198                               if (symbol_read_needs_frame (sym))
2199                                 {
2200                                   if (innermost_block == 0 ||
2201                                       contained_in (block_found, 
2202                                                     innermost_block))
2203                                     innermost_block = block_found;
2204                                 }
2205
2206                               write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2207                               /* We want to use the selected frame, not
2208                                  another more inner frame which happens to
2209                                  be in the same block.  */
2210                               write_exp_elt_block (pstate, NULL);
2211                               write_exp_elt_sym (pstate, sym);
2212                               write_exp_elt_opcode (pstate, OP_VAR_VALUE);
2213                             }
2214                           else
2215                             {
2216                               struct bound_minimal_symbol msymbol;
2217                               char *arg = copy_name ((yyvsp[0].sval));
2218
2219                               msymbol =
2220                                 lookup_bound_minimal_symbol (arg);
2221                               if (msymbol.minsym != NULL)
2222                                 write_exp_msymbol (pstate, msymbol);
2223                               else if (!have_full_symbols () && !have_partial_symbols ())
2224                                 error (_("No symbol table is loaded.  Use the \"symbol-file\" command."));
2225                               else
2226                                 error (_("No symbol \"%s\" in current context."),
2227                                        copy_name ((yyvsp[0].sval)));
2228                             }
2229                         }
2230 #line 2232 "m2-exp.c" /* yacc.c:1646  */
2231     break;
2232
2233   case 82:
2234 #line 666 "m2-exp.y" /* yacc.c:1646  */
2235     { (yyval.tval) = lookup_typename (parse_language (pstate),
2236                                                 parse_gdbarch (pstate),
2237                                                 copy_name ((yyvsp[0].sval)),
2238                                                 expression_context_block, 0); }
2239 #line 2241 "m2-exp.c" /* yacc.c:1646  */
2240     break;
2241
2242
2243 #line 2245 "m2-exp.c" /* yacc.c:1646  */
2244       default: break;
2245     }
2246   /* User semantic actions sometimes alter yychar, and that requires
2247      that yytoken be updated with the new translation.  We take the
2248      approach of translating immediately before every use of yytoken.
2249      One alternative is translating here after every semantic action,
2250      but that translation would be missed if the semantic action invokes
2251      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2252      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2253      incorrect destructor might then be invoked immediately.  In the
2254      case of YYERROR or YYBACKUP, subsequent parser actions might lead
2255      to an incorrect destructor call or verbose syntax error message
2256      before the lookahead is translated.  */
2257   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2258
2259   YYPOPSTACK (yylen);
2260   yylen = 0;
2261   YY_STACK_PRINT (yyss, yyssp);
2262
2263   *++yyvsp = yyval;
2264
2265   /* Now 'shift' the result of the reduction.  Determine what state
2266      that goes to, based on the state we popped back to and the rule
2267      number reduced by.  */
2268
2269   yyn = yyr1[yyn];
2270
2271   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2272   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2273     yystate = yytable[yystate];
2274   else
2275     yystate = yydefgoto[yyn - YYNTOKENS];
2276
2277   goto yynewstate;
2278
2279
2280 /*--------------------------------------.
2281 | yyerrlab -- here on detecting error.  |
2282 `--------------------------------------*/
2283 yyerrlab:
2284   /* Make sure we have latest lookahead translation.  See comments at
2285      user semantic actions for why this is necessary.  */
2286   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2287
2288   /* If not already recovering from an error, report this error.  */
2289   if (!yyerrstatus)
2290     {
2291       ++yynerrs;
2292 #if ! YYERROR_VERBOSE
2293       yyerror (YY_("syntax error"));
2294 #else
2295 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2296                                         yyssp, yytoken)
2297       {
2298         char const *yymsgp = YY_("syntax error");
2299         int yysyntax_error_status;
2300         yysyntax_error_status = YYSYNTAX_ERROR;
2301         if (yysyntax_error_status == 0)
2302           yymsgp = yymsg;
2303         else if (yysyntax_error_status == 1)
2304           {
2305             if (yymsg != yymsgbuf)
2306               YYSTACK_FREE (yymsg);
2307             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2308             if (!yymsg)
2309               {
2310                 yymsg = yymsgbuf;
2311                 yymsg_alloc = sizeof yymsgbuf;
2312                 yysyntax_error_status = 2;
2313               }
2314             else
2315               {
2316                 yysyntax_error_status = YYSYNTAX_ERROR;
2317                 yymsgp = yymsg;
2318               }
2319           }
2320         yyerror (yymsgp);
2321         if (yysyntax_error_status == 2)
2322           goto yyexhaustedlab;
2323       }
2324 # undef YYSYNTAX_ERROR
2325 #endif
2326     }
2327
2328
2329
2330   if (yyerrstatus == 3)
2331     {
2332       /* If just tried and failed to reuse lookahead token after an
2333          error, discard it.  */
2334
2335       if (yychar <= YYEOF)
2336         {
2337           /* Return failure if at end of input.  */
2338           if (yychar == YYEOF)
2339             YYABORT;
2340         }
2341       else
2342         {
2343           yydestruct ("Error: discarding",
2344                       yytoken, &yylval);
2345           yychar = YYEMPTY;
2346         }
2347     }
2348
2349   /* Else will try to reuse lookahead token after shifting the error
2350      token.  */
2351   goto yyerrlab1;
2352
2353
2354 /*---------------------------------------------------.
2355 | yyerrorlab -- error raised explicitly by YYERROR.  |
2356 `---------------------------------------------------*/
2357 yyerrorlab:
2358
2359   /* Pacify compilers like GCC when the user code never invokes
2360      YYERROR and the label yyerrorlab therefore never appears in user
2361      code.  */
2362   if (/*CONSTCOND*/ 0)
2363      goto yyerrorlab;
2364
2365   /* Do not reclaim the symbols of the rule whose action triggered
2366      this YYERROR.  */
2367   YYPOPSTACK (yylen);
2368   yylen = 0;
2369   YY_STACK_PRINT (yyss, yyssp);
2370   yystate = *yyssp;
2371   goto yyerrlab1;
2372
2373
2374 /*-------------------------------------------------------------.
2375 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2376 `-------------------------------------------------------------*/
2377 yyerrlab1:
2378   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2379
2380   for (;;)
2381     {
2382       yyn = yypact[yystate];
2383       if (!yypact_value_is_default (yyn))
2384         {
2385           yyn += YYTERROR;
2386           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2387             {
2388               yyn = yytable[yyn];
2389               if (0 < yyn)
2390                 break;
2391             }
2392         }
2393
2394       /* Pop the current state because it cannot handle the error token.  */
2395       if (yyssp == yyss)
2396         YYABORT;
2397
2398
2399       yydestruct ("Error: popping",
2400                   yystos[yystate], yyvsp);
2401       YYPOPSTACK (1);
2402       yystate = *yyssp;
2403       YY_STACK_PRINT (yyss, yyssp);
2404     }
2405
2406   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2407   *++yyvsp = yylval;
2408   YY_IGNORE_MAYBE_UNINITIALIZED_END
2409
2410
2411   /* Shift the error token.  */
2412   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2413
2414   yystate = yyn;
2415   goto yynewstate;
2416
2417
2418 /*-------------------------------------.
2419 | yyacceptlab -- YYACCEPT comes here.  |
2420 `-------------------------------------*/
2421 yyacceptlab:
2422   yyresult = 0;
2423   goto yyreturn;
2424
2425 /*-----------------------------------.
2426 | yyabortlab -- YYABORT comes here.  |
2427 `-----------------------------------*/
2428 yyabortlab:
2429   yyresult = 1;
2430   goto yyreturn;
2431
2432 #if !defined yyoverflow || YYERROR_VERBOSE
2433 /*-------------------------------------------------.
2434 | yyexhaustedlab -- memory exhaustion comes here.  |
2435 `-------------------------------------------------*/
2436 yyexhaustedlab:
2437   yyerror (YY_("memory exhausted"));
2438   yyresult = 2;
2439   /* Fall through.  */
2440 #endif
2441
2442 yyreturn:
2443   if (yychar != YYEMPTY)
2444     {
2445       /* Make sure we have latest lookahead translation.  See comments at
2446          user semantic actions for why this is necessary.  */
2447       yytoken = YYTRANSLATE (yychar);
2448       yydestruct ("Cleanup: discarding lookahead",
2449                   yytoken, &yylval);
2450     }
2451   /* Do not reclaim the symbols of the rule whose action triggered
2452      this YYABORT or YYACCEPT.  */
2453   YYPOPSTACK (yylen);
2454   YY_STACK_PRINT (yyss, yyssp);
2455   while (yyssp != yyss)
2456     {
2457       yydestruct ("Cleanup: popping",
2458                   yystos[*yyssp], yyvsp);
2459       YYPOPSTACK (1);
2460     }
2461 #ifndef yyoverflow
2462   if (yyss != yyssa)
2463     YYSTACK_FREE (yyss);
2464 #endif
2465 #if YYERROR_VERBOSE
2466   if (yymsg != yymsgbuf)
2467     YYSTACK_FREE (yymsg);
2468 #endif
2469   return yyresult;
2470 }
2471 #line 673 "m2-exp.y" /* yacc.c:1906  */
2472
2473
2474 /* Take care of parsing a number (anything that starts with a digit).
2475    Set yylval and return the token type; update lexptr.
2476    LEN is the number of characters in it.  */
2477
2478 /*** Needs some error checking for the float case ***/
2479
2480 static int
2481 parse_number (int olen)
2482 {
2483   const char *p = lexptr;
2484   LONGEST n = 0;
2485   LONGEST prevn = 0;
2486   int c,i,ischar=0;
2487   int base = input_radix;
2488   int len = olen;
2489   int unsigned_p = number_sign == 1 ? 1 : 0;
2490
2491   if(p[len-1] == 'H')
2492   {
2493      base = 16;
2494      len--;
2495   }
2496   else if(p[len-1] == 'C' || p[len-1] == 'B')
2497   {
2498      base = 8;
2499      ischar = p[len-1] == 'C';
2500      len--;
2501   }
2502
2503   /* Scan the number */
2504   for (c = 0; c < len; c++)
2505   {
2506     if (p[c] == '.' && base == 10)
2507       {
2508         /* It's a float since it contains a point.  */
2509         yylval.dval = atof (p);
2510         lexptr += len;
2511         return FLOAT;
2512       }
2513     if (p[c] == '.' && base != 10)
2514        error (_("Floating point numbers must be base 10."));
2515     if (base == 10 && (p[c] < '0' || p[c] > '9'))
2516        error (_("Invalid digit \'%c\' in number."),p[c]);
2517  }
2518
2519   while (len-- > 0)
2520     {
2521       c = *p++;
2522       n *= base;
2523       if( base == 8 && (c == '8' || c == '9'))
2524          error (_("Invalid digit \'%c\' in octal number."),c);
2525       if (c >= '0' && c <= '9')
2526         i = c - '0';
2527       else
2528         {
2529           if (base == 16 && c >= 'A' && c <= 'F')
2530             i = c - 'A' + 10;
2531           else
2532              return ERROR;
2533         }
2534       n+=i;
2535       if(i >= base)
2536          return ERROR;
2537       if(!unsigned_p && number_sign == 1 && (prevn >= n))
2538          unsigned_p=1;          /* Try something unsigned */
2539       /* Don't do the range check if n==i and i==0, since that special
2540          case will give an overflow error.  */
2541       if(RANGE_CHECK && n!=i && i)
2542       {
2543          if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
2544             ((!unsigned_p && number_sign==-1) && -prevn <= -n))
2545             range_error (_("Overflow on numeric constant."));
2546       }
2547          prevn=n;
2548     }
2549
2550   lexptr = p;
2551   if(*p == 'B' || *p == 'C' || *p == 'H')
2552      lexptr++;                  /* Advance past B,C or H */
2553
2554   if (ischar)
2555   {
2556      yylval.ulval = n;
2557      return CHAR;
2558   }
2559   else if ( unsigned_p && number_sign == 1)
2560   {
2561      yylval.ulval = n;
2562      return UINT;
2563   }
2564   else if((unsigned_p && (n<0))) {
2565      range_error (_("Overflow on numeric constant -- number too large."));
2566      /* But, this can return if range_check == range_warn.  */
2567   }
2568   yylval.lval = n;
2569   return INT;
2570 }
2571
2572
2573 /* Some tokens */
2574
2575 static struct
2576 {
2577    char name[2];
2578    int token;
2579 } tokentab2[] =
2580 {
2581     { {'<', '>'},    NOTEQUAL   },
2582     { {':', '='},    ASSIGN     },
2583     { {'<', '='},    LEQ        },
2584     { {'>', '='},    GEQ        },
2585     { {':', ':'},    COLONCOLON },
2586
2587 };
2588
2589 /* Some specific keywords */
2590
2591 struct keyword {
2592    char keyw[10];
2593    int token;
2594 };
2595
2596 static struct keyword keytab[] =
2597 {
2598     {"OR" ,   OROR       },
2599     {"IN",    IN         },/* Note space after IN */
2600     {"AND",   LOGICAL_AND},
2601     {"ABS",   ABS        },
2602     {"CHR",   CHR        },
2603     {"DEC",   DEC        },
2604     {"NOT",   NOT        },
2605     {"DIV",   DIV        },
2606     {"INC",   INC        },
2607     {"MAX",   MAX_FUNC   },
2608     {"MIN",   MIN_FUNC   },
2609     {"MOD",   MOD        },
2610     {"ODD",   ODD        },
2611     {"CAP",   CAP        },
2612     {"ORD",   ORD        },
2613     {"VAL",   VAL        },
2614     {"EXCL",  EXCL       },
2615     {"HIGH",  HIGH       },
2616     {"INCL",  INCL       },
2617     {"SIZE",  SIZE       },
2618     {"FLOAT", FLOAT_FUNC },
2619     {"TRUNC", TRUNC      },
2620     {"TSIZE", SIZE       },
2621 };
2622
2623
2624 /* Read one token, getting characters through lexptr.  */
2625
2626 /* This is where we will check to make sure that the language and the
2627    operators used are compatible  */
2628
2629 static int
2630 yylex (void)
2631 {
2632   int c;
2633   int namelen;
2634   int i;
2635   const char *tokstart;
2636   char quote;
2637
2638  retry:
2639
2640   prev_lexptr = lexptr;
2641
2642   tokstart = lexptr;
2643
2644
2645   /* See if it is a special token of length 2 */
2646   for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++)
2647      if (strncmp (tokentab2[i].name, tokstart, 2) == 0)
2648      {
2649         lexptr += 2;
2650         return tokentab2[i].token;
2651      }
2652
2653   switch (c = *tokstart)
2654     {
2655     case 0:
2656       return 0;
2657
2658     case ' ':
2659     case '\t':
2660     case '\n':
2661       lexptr++;
2662       goto retry;
2663
2664     case '(':
2665       paren_depth++;
2666       lexptr++;
2667       return c;
2668
2669     case ')':
2670       if (paren_depth == 0)
2671         return 0;
2672       paren_depth--;
2673       lexptr++;
2674       return c;
2675
2676     case ',':
2677       if (comma_terminates && paren_depth == 0)
2678         return 0;
2679       lexptr++;
2680       return c;
2681
2682     case '.':
2683       /* Might be a floating point number.  */
2684       if (lexptr[1] >= '0' && lexptr[1] <= '9')
2685         break;                  /* Falls into number code.  */
2686       else
2687       {
2688          lexptr++;
2689          return DOT;
2690       }
2691
2692 /* These are character tokens that appear as-is in the YACC grammar */
2693     case '+':
2694     case '-':
2695     case '*':
2696     case '/':
2697     case '^':
2698     case '<':
2699     case '>':
2700     case '[':
2701     case ']':
2702     case '=':
2703     case '{':
2704     case '}':
2705     case '#':
2706     case '@':
2707     case '~':
2708     case '&':
2709       lexptr++;
2710       return c;
2711
2712     case '\'' :
2713     case '"':
2714       quote = c;
2715       for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
2716         if (c == '\\')
2717           {
2718             c = tokstart[++namelen];
2719             if (c >= '0' && c <= '9')
2720               {
2721                 c = tokstart[++namelen];
2722                 if (c >= '0' && c <= '9')
2723                   c = tokstart[++namelen];
2724               }
2725           }
2726       if(c != quote)
2727          error (_("Unterminated string or character constant."));
2728       yylval.sval.ptr = tokstart + 1;
2729       yylval.sval.length = namelen - 1;
2730       lexptr += namelen + 1;
2731
2732       if(namelen == 2)          /* Single character */
2733       {
2734            yylval.ulval = tokstart[1];
2735            return CHAR;
2736       }
2737       else
2738          return STRING;
2739     }
2740
2741   /* Is it a number?  */
2742   /* Note:  We have already dealt with the case of the token '.'.
2743      See case '.' above.  */
2744   if ((c >= '0' && c <= '9'))
2745     {
2746       /* It's a number.  */
2747       int got_dot = 0, got_e = 0;
2748       const char *p = tokstart;
2749       int toktype;
2750
2751       for (++p ;; ++p)
2752         {
2753           if (!got_e && (*p == 'e' || *p == 'E'))
2754             got_dot = got_e = 1;
2755           else if (!got_dot && *p == '.')
2756             got_dot = 1;
2757           else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2758                    && (*p == '-' || *p == '+'))
2759             /* This is the sign of the exponent, not the end of the
2760                number.  */
2761             continue;
2762           else if ((*p < '0' || *p > '9') &&
2763                    (*p < 'A' || *p > 'F') &&
2764                    (*p != 'H'))  /* Modula-2 hexadecimal number */
2765             break;
2766         }
2767         toktype = parse_number (p - tokstart);
2768         if (toktype == ERROR)
2769           {
2770             char *err_copy = (char *) alloca (p - tokstart + 1);
2771
2772             memcpy (err_copy, tokstart, p - tokstart);
2773             err_copy[p - tokstart] = 0;
2774             error (_("Invalid number \"%s\"."), err_copy);
2775           }
2776         lexptr = p;
2777         return toktype;
2778     }
2779
2780   if (!(c == '_' || c == '$'
2781         || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2782     /* We must have come across a bad character (e.g. ';').  */
2783     error (_("Invalid character '%c' in expression."), c);
2784
2785   /* It's a name.  See how long it is.  */
2786   namelen = 0;
2787   for (c = tokstart[namelen];
2788        (c == '_' || c == '$' || (c >= '0' && c <= '9')
2789         || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
2790        c = tokstart[++namelen])
2791     ;
2792
2793   /* The token "if" terminates the expression and is NOT
2794      removed from the input stream.  */
2795   if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2796     {
2797       return 0;
2798     }
2799
2800   lexptr += namelen;
2801
2802   /*  Lookup special keywords */
2803   for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++)
2804      if (namelen == strlen (keytab[i].keyw)
2805          && strncmp (tokstart, keytab[i].keyw, namelen) == 0)
2806            return keytab[i].token;
2807
2808   yylval.sval.ptr = tokstart;
2809   yylval.sval.length = namelen;
2810
2811   if (*tokstart == '$')
2812     {
2813       write_dollar_variable (pstate, yylval.sval);
2814       return INTERNAL_VAR;
2815     }
2816
2817   /* Use token-type BLOCKNAME for symbols that happen to be defined as
2818      functions.  If this is not so, then ...
2819      Use token-type TYPENAME for symbols that happen to be defined
2820      currently as names of types; NAME for other symbols.
2821      The caller is not constrained to care about the distinction.  */
2822  {
2823
2824
2825     char *tmp = copy_name (yylval.sval);
2826     struct symbol *sym;
2827
2828     if (lookup_symtab (tmp))
2829       return BLOCKNAME;
2830     sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0);
2831     if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
2832       return BLOCKNAME;
2833     if (lookup_typename (parse_language (pstate), parse_gdbarch (pstate),
2834                          copy_name (yylval.sval),
2835                          expression_context_block, 1))
2836       return TYPENAME;
2837
2838     if(sym)
2839     {
2840       switch(SYMBOL_CLASS (sym))
2841        {
2842        case LOC_STATIC:
2843        case LOC_REGISTER:
2844        case LOC_ARG:
2845        case LOC_REF_ARG:
2846        case LOC_REGPARM_ADDR:
2847        case LOC_LOCAL:
2848        case LOC_CONST:
2849        case LOC_CONST_BYTES:
2850        case LOC_OPTIMIZED_OUT:
2851        case LOC_COMPUTED:
2852           return NAME;
2853
2854        case LOC_TYPEDEF:
2855           return TYPENAME;
2856
2857        case LOC_BLOCK:
2858           return BLOCKNAME;
2859
2860        case LOC_UNDEF:
2861           error (_("internal:  Undefined class in m2lex()"));
2862
2863        case LOC_LABEL:
2864        case LOC_UNRESOLVED:
2865           error (_("internal:  Unforseen case in m2lex()"));
2866
2867        default:
2868           error (_("unhandled token in m2lex()"));
2869           break;
2870        }
2871     }
2872     else
2873     {
2874        /* Built-in BOOLEAN type.  This is sort of a hack.  */
2875        if (strncmp (tokstart, "TRUE", 4) == 0)
2876        {
2877           yylval.ulval = 1;
2878           return M2_TRUE;
2879        }
2880        else if (strncmp (tokstart, "FALSE", 5) == 0)
2881        {
2882           yylval.ulval = 0;
2883           return M2_FALSE;
2884        }
2885     }
2886
2887     /* Must be another type of name...  */
2888     return NAME;
2889  }
2890 }
2891
2892 int
2893 m2_parse (struct parser_state *par_state)
2894 {
2895   int result;
2896   struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
2897
2898   /* Setting up the parser state.  */
2899   gdb_assert (par_state != NULL);
2900   pstate = par_state;
2901
2902   result = yyparse ();
2903   do_cleanups (c);
2904
2905   return result;
2906 }
2907
2908 void
2909 yyerror (char *msg)
2910 {
2911   if (prev_lexptr)
2912     lexptr = prev_lexptr;
2913
2914   error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
2915 }