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