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