GDB (xrefs)
Loading...
Searching...
No Matches
f-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 43 "f-exp.y"
71
72
73#include "defs.h"
74#include "expression.h"
75#include "value.h"
76#include "parser-defs.h"
77#include "language.h"
78#include "f-lang.h"
79#include "block.h"
80#include <ctype.h>
81#include <algorithm>
82#include "type-stack.h"
83#include "f-exp.h"
84
85#define parse_type(ps) builtin_type (ps->gdbarch ())
86#define parse_f_type(ps) builtin_f_type (ps->gdbarch ())
87
88/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
89 etc). */
90#define GDB_YY_REMAP_PREFIX f_
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
98/* Depth of parentheses. */
99static int paren_depth;
100
101/* The current type stack. */
102static struct type_stack *type_stack;
103
104int yyparse (void);
105
106static int yylex (void);
107
108static void yyerror (const char *);
109
110static void growbuf_by_size (int);
111
112static int match_string_literal (void);
113
114static void push_kind_type (LONGEST val, struct type *type);
115
116static struct type *convert_to_kind_type (struct type *basetype, int kind);
117
118static void wrap_unop_intrinsic (exp_opcode opcode);
119
120static void wrap_binop_intrinsic (exp_opcode opcode);
121
122static void wrap_ternop_intrinsic (exp_opcode opcode);
123
124template<typename T>
125static void fortran_wrap2_kind (type *base_type);
126
127template<typename T>
128static void fortran_wrap3_kind (type *base_type);
129
130using namespace expr;
131
132#line 133 "f-exp.c.tmp"
133
134# ifndef YY_CAST
135# ifdef __cplusplus
136# define YY_CAST(Type, Val) static_cast<Type> (Val)
137# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
138# else
139# define YY_CAST(Type, Val) ((Type) (Val))
140# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
141# endif
142# endif
143# ifndef YY_NULLPTRPTR
144# if defined __cplusplus
145# if 201103L <= __cplusplus
146# define YY_NULLPTRPTR nullptr
147# else
148# define YY_NULLPTRPTR 0
149# endif
150# else
151# define YY_NULLPTRPTR ((void*)0)
152# endif
153# endif
154
155
156/* Debug traces. */
157#ifndef YYDEBUG
158# define YYDEBUG 0
159#endif
160#if YYDEBUG
161extern int yydebug;
162#endif
163
164/* Token kinds. */
165#ifndef YYTOKENTYPE
166# define YYTOKENTYPE
168 {
170 YYEOF = 0, /* "end of file" */
171 YYerror = 256, /* error */
172 YYUNDEF = 257, /* "invalid token" */
173 INT = 258, /* INT */
174 FLOAT = 259, /* FLOAT */
175 STRING_LITERAL = 260, /* STRING_LITERAL */
176 BOOLEAN_LITERAL = 261, /* BOOLEAN_LITERAL */
177 NAME = 262, /* NAME */
178 TYPENAME = 263, /* TYPENAME */
179 COMPLETE = 264, /* COMPLETE */
180 NAME_OR_INT = 265, /* NAME_OR_INT */
181 SIZEOF = 266, /* SIZEOF */
182 KIND = 267, /* KIND */
183 ERROR = 268, /* ERROR */
184 INT_S1_KEYWORD = 269, /* INT_S1_KEYWORD */
185 INT_S2_KEYWORD = 270, /* INT_S2_KEYWORD */
186 INT_KEYWORD = 271, /* INT_KEYWORD */
187 INT_S4_KEYWORD = 272, /* INT_S4_KEYWORD */
188 INT_S8_KEYWORD = 273, /* INT_S8_KEYWORD */
189 LOGICAL_S1_KEYWORD = 274, /* LOGICAL_S1_KEYWORD */
190 LOGICAL_S2_KEYWORD = 275, /* LOGICAL_S2_KEYWORD */
191 LOGICAL_KEYWORD = 276, /* LOGICAL_KEYWORD */
192 LOGICAL_S4_KEYWORD = 277, /* LOGICAL_S4_KEYWORD */
193 LOGICAL_S8_KEYWORD = 278, /* LOGICAL_S8_KEYWORD */
194 REAL_KEYWORD = 279, /* REAL_KEYWORD */
195 REAL_S4_KEYWORD = 280, /* REAL_S4_KEYWORD */
196 REAL_S8_KEYWORD = 281, /* REAL_S8_KEYWORD */
197 REAL_S16_KEYWORD = 282, /* REAL_S16_KEYWORD */
198 COMPLEX_KEYWORD = 283, /* COMPLEX_KEYWORD */
199 COMPLEX_S4_KEYWORD = 284, /* COMPLEX_S4_KEYWORD */
200 COMPLEX_S8_KEYWORD = 285, /* COMPLEX_S8_KEYWORD */
201 COMPLEX_S16_KEYWORD = 286, /* COMPLEX_S16_KEYWORD */
202 BOOL_AND = 287, /* BOOL_AND */
203 BOOL_OR = 288, /* BOOL_OR */
204 BOOL_NOT = 289, /* BOOL_NOT */
205 SINGLE = 290, /* SINGLE */
206 DOUBLE = 291, /* DOUBLE */
207 PRECISION = 292, /* PRECISION */
208 CHARACTER = 293, /* CHARACTER */
209 DOLLAR_VARIABLE = 294, /* DOLLAR_VARIABLE */
210 ASSIGN_MODIFY = 295, /* ASSIGN_MODIFY */
211 UNOP_INTRINSIC = 296, /* UNOP_INTRINSIC */
212 BINOP_INTRINSIC = 297, /* BINOP_INTRINSIC */
213 UNOP_OR_BINOP_INTRINSIC = 298, /* UNOP_OR_BINOP_INTRINSIC */
214 UNOP_OR_BINOP_OR_TERNOP_INTRINSIC = 299, /* UNOP_OR_BINOP_OR_TERNOP_INTRINSIC */
215 ABOVE_COMMA = 300, /* ABOVE_COMMA */
216 EQUAL = 301, /* EQUAL */
217 NOTEQUAL = 302, /* NOTEQUAL */
218 LESSTHAN = 303, /* LESSTHAN */
219 GREATERTHAN = 304, /* GREATERTHAN */
220 LEQ = 305, /* LEQ */
221 GEQ = 306, /* GEQ */
222 LSH = 307, /* LSH */
223 RSH = 308, /* RSH */
224 STARSTAR = 309, /* STARSTAR */
225 UNARY = 310 /* UNARY */
226 };
228#endif
229/* Token kinds. */
230#define YYEMPTY -2
231#define YYEOF 0
232#define YYerror 256
233#define YYUNDEF 257
234#define INT 258
235#define FLOAT 259
236#define STRING_LITERAL 260
237#define BOOLEAN_LITERAL 261
238#define NAME 262
239#define TYPENAME 263
240#define COMPLETE 264
241#define NAME_OR_INT 265
242#define SIZEOF 266
243#define KIND 267
244#define ERROR 268
245#define INT_S1_KEYWORD 269
246#define INT_S2_KEYWORD 270
247#define INT_KEYWORD 271
248#define INT_S4_KEYWORD 272
249#define INT_S8_KEYWORD 273
250#define LOGICAL_S1_KEYWORD 274
251#define LOGICAL_S2_KEYWORD 275
252#define LOGICAL_KEYWORD 276
253#define LOGICAL_S4_KEYWORD 277
254#define LOGICAL_S8_KEYWORD 278
255#define REAL_KEYWORD 279
256#define REAL_S4_KEYWORD 280
257#define REAL_S8_KEYWORD 281
258#define REAL_S16_KEYWORD 282
259#define COMPLEX_KEYWORD 283
260#define COMPLEX_S4_KEYWORD 284
261#define COMPLEX_S8_KEYWORD 285
262#define COMPLEX_S16_KEYWORD 286
263#define BOOL_AND 287
264#define BOOL_OR 288
265#define BOOL_NOT 289
266#define SINGLE 290
267#define DOUBLE 291
268#define PRECISION 292
269#define CHARACTER 293
270#define DOLLAR_VARIABLE 294
271#define ASSIGN_MODIFY 295
272#define UNOP_INTRINSIC 296
273#define BINOP_INTRINSIC 297
274#define UNOP_OR_BINOP_INTRINSIC 298
275#define UNOP_OR_BINOP_OR_TERNOP_INTRINSIC 299
276#define ABOVE_COMMA 300
277#define EQUAL 301
278#define NOTEQUAL 302
279#define LESSTHAN 303
280#define GREATERTHAN 304
281#define LEQ 305
282#define GEQ 306
283#define LSH 307
284#define RSH 308
285#define STARSTAR 309
286#define UNARY 310
287
288/* Value type. */
289#if ! defined f_exp_YYSTYPE && ! defined f_exp_YYSTYPE_IS_DECLARED
291{
292#line 110 "f-exp.y"
293
294 LONGEST lval;
295 struct {
296 LONGEST val;
297 struct type *type;
299 struct {
300 gdb_byte val[16];
301 struct type *type;
303 struct symbol *sym;
304 struct type *tval;
305 struct stoken sval;
306 struct ttype tsym;
311
312 struct type **tvec;
313 int *ivec;
314
315
316#line 317 "f-exp.c.tmp"
317
318};
320# define f_exp_YYSTYPE_IS_TRIVIAL 1
321# define f_exp_YYSTYPE_IS_DECLARED 1
322#endif
323
324
325extern f_exp_YYSTYPE yylval;
326
327
328int yyparse (void);
329
330
331
332/* Symbol kind. */
334{
336 YYSYMBOL_YYEOF = 0, /* "end of file" */
337 YYSYMBOL_YYerror = 1, /* error */
338 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
339 YYSYMBOL_INT = 3, /* INT */
340 YYSYMBOL_FLOAT = 4, /* FLOAT */
341 YYSYMBOL_STRING_LITERAL = 5, /* STRING_LITERAL */
342 YYSYMBOL_BOOLEAN_LITERAL = 6, /* BOOLEAN_LITERAL */
343 YYSYMBOL_NAME = 7, /* NAME */
344 YYSYMBOL_TYPENAME = 8, /* TYPENAME */
345 YYSYMBOL_COMPLETE = 9, /* COMPLETE */
346 YYSYMBOL_NAME_OR_INT = 10, /* NAME_OR_INT */
347 YYSYMBOL_SIZEOF = 11, /* SIZEOF */
348 YYSYMBOL_KIND = 12, /* KIND */
349 YYSYMBOL_ERROR = 13, /* ERROR */
350 YYSYMBOL_INT_S1_KEYWORD = 14, /* INT_S1_KEYWORD */
351 YYSYMBOL_INT_S2_KEYWORD = 15, /* INT_S2_KEYWORD */
352 YYSYMBOL_INT_KEYWORD = 16, /* INT_KEYWORD */
353 YYSYMBOL_INT_S4_KEYWORD = 17, /* INT_S4_KEYWORD */
354 YYSYMBOL_INT_S8_KEYWORD = 18, /* INT_S8_KEYWORD */
355 YYSYMBOL_LOGICAL_S1_KEYWORD = 19, /* LOGICAL_S1_KEYWORD */
356 YYSYMBOL_LOGICAL_S2_KEYWORD = 20, /* LOGICAL_S2_KEYWORD */
357 YYSYMBOL_LOGICAL_KEYWORD = 21, /* LOGICAL_KEYWORD */
358 YYSYMBOL_LOGICAL_S4_KEYWORD = 22, /* LOGICAL_S4_KEYWORD */
359 YYSYMBOL_LOGICAL_S8_KEYWORD = 23, /* LOGICAL_S8_KEYWORD */
360 YYSYMBOL_REAL_KEYWORD = 24, /* REAL_KEYWORD */
361 YYSYMBOL_REAL_S4_KEYWORD = 25, /* REAL_S4_KEYWORD */
362 YYSYMBOL_REAL_S8_KEYWORD = 26, /* REAL_S8_KEYWORD */
363 YYSYMBOL_REAL_S16_KEYWORD = 27, /* REAL_S16_KEYWORD */
364 YYSYMBOL_COMPLEX_KEYWORD = 28, /* COMPLEX_KEYWORD */
365 YYSYMBOL_COMPLEX_S4_KEYWORD = 29, /* COMPLEX_S4_KEYWORD */
366 YYSYMBOL_COMPLEX_S8_KEYWORD = 30, /* COMPLEX_S8_KEYWORD */
367 YYSYMBOL_COMPLEX_S16_KEYWORD = 31, /* COMPLEX_S16_KEYWORD */
368 YYSYMBOL_BOOL_AND = 32, /* BOOL_AND */
369 YYSYMBOL_BOOL_OR = 33, /* BOOL_OR */
370 YYSYMBOL_BOOL_NOT = 34, /* BOOL_NOT */
371 YYSYMBOL_SINGLE = 35, /* SINGLE */
372 YYSYMBOL_DOUBLE = 36, /* DOUBLE */
373 YYSYMBOL_PRECISION = 37, /* PRECISION */
374 YYSYMBOL_CHARACTER = 38, /* CHARACTER */
375 YYSYMBOL_DOLLAR_VARIABLE = 39, /* DOLLAR_VARIABLE */
376 YYSYMBOL_ASSIGN_MODIFY = 40, /* ASSIGN_MODIFY */
377 YYSYMBOL_UNOP_INTRINSIC = 41, /* UNOP_INTRINSIC */
378 YYSYMBOL_BINOP_INTRINSIC = 42, /* BINOP_INTRINSIC */
379 YYSYMBOL_UNOP_OR_BINOP_INTRINSIC = 43, /* UNOP_OR_BINOP_INTRINSIC */
380 YYSYMBOL_UNOP_OR_BINOP_OR_TERNOP_INTRINSIC = 44, /* UNOP_OR_BINOP_OR_TERNOP_INTRINSIC */
381 YYSYMBOL_45_ = 45, /* ',' */
382 YYSYMBOL_ABOVE_COMMA = 46, /* ABOVE_COMMA */
383 YYSYMBOL_47_ = 47, /* '=' */
384 YYSYMBOL_48_ = 48, /* '?' */
385 YYSYMBOL_49_ = 49, /* '|' */
386 YYSYMBOL_50_ = 50, /* '^' */
387 YYSYMBOL_51_ = 51, /* '&' */
388 YYSYMBOL_EQUAL = 52, /* EQUAL */
389 YYSYMBOL_NOTEQUAL = 53, /* NOTEQUAL */
390 YYSYMBOL_LESSTHAN = 54, /* LESSTHAN */
391 YYSYMBOL_GREATERTHAN = 55, /* GREATERTHAN */
392 YYSYMBOL_LEQ = 56, /* LEQ */
393 YYSYMBOL_GEQ = 57, /* GEQ */
394 YYSYMBOL_LSH = 58, /* LSH */
395 YYSYMBOL_RSH = 59, /* RSH */
396 YYSYMBOL_60_ = 60, /* '@' */
397 YYSYMBOL_61_ = 61, /* '+' */
398 YYSYMBOL_62_ = 62, /* '-' */
399 YYSYMBOL_63_ = 63, /* '*' */
400 YYSYMBOL_64_ = 64, /* '/' */
401 YYSYMBOL_STARSTAR = 65, /* STARSTAR */
402 YYSYMBOL_66_ = 66, /* '%' */
403 YYSYMBOL_UNARY = 67, /* UNARY */
404 YYSYMBOL_68_ = 68, /* '(' */
405 YYSYMBOL_69_ = 69, /* ')' */
406 YYSYMBOL_70_ = 70, /* '~' */
407 YYSYMBOL_71_ = 71, /* ':' */
408 YYSYMBOL_YYACCEPT = 72, /* $accept */
409 YYSYMBOL_start = 73, /* start */
410 YYSYMBOL_type_exp = 74, /* type_exp */
411 YYSYMBOL_exp = 75, /* exp */
412 YYSYMBOL_76_1 = 76, /* $@1 */
413 YYSYMBOL_77_2 = 77, /* $@2 */
414 YYSYMBOL_78_3 = 78, /* $@3 */
415 YYSYMBOL_arglist = 79, /* arglist */
416 YYSYMBOL_subrange = 80, /* subrange */
417 YYSYMBOL_complexnum = 81, /* complexnum */
418 YYSYMBOL_variable = 82, /* variable */
419 YYSYMBOL_type = 83, /* type */
420 YYSYMBOL_ptype = 84, /* ptype */
421 YYSYMBOL_abs_decl = 85, /* abs_decl */
422 YYSYMBOL_direct_abs_decl = 86, /* direct_abs_decl */
423 YYSYMBOL_func_mod = 87, /* func_mod */
424 YYSYMBOL_typebase = 88, /* typebase */
425 YYSYMBOL_nonempty_typelist = 89, /* nonempty_typelist */
426 YYSYMBOL_name = 90, /* name */
427 YYSYMBOL_name_not_typename = 91 /* name_not_typename */
430
431
432/* Second part of user prologue. */
433#line 133 "f-exp.y"
434
435/* f_exp_YYSTYPE gets defined by %union */
436static int parse_number (struct parser_state *, const char *, int,
437 int, f_exp_YYSTYPE *);
438
439#line 440 "f-exp.c.tmp"
440
441
442#ifdef short
443# undef short
444#endif
445
446/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
447 <limits.h> and (if available) <stdint.h> are included
448 so that the code can choose integer types of a good width. */
449
450#ifndef __PTRDIFF_MAX__
451# include <limits.h> /* INFRINGES ON USER NAME SPACE */
452# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
453# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
454# define YY_STDINT_H
455# endif
456#endif
457
458/* Narrow types that promote to a signed type and that can represent a
459 signed or unsigned integer of at least N bits. In tables they can
460 save space and decrease cache pressure. Promoting to a signed type
461 helps avoid bugs in integer arithmetic. */
462
463#ifdef __INT_LEAST8_MAX__
464typedef __INT_LEAST8_TYPE__ yytype_int8;
465#elif defined YY_STDINT_H
466typedef int_least8_t yytype_int8;
467#else
468typedef signed char yytype_int8;
469#endif
470
471#ifdef __INT_LEAST16_MAX__
472typedef __INT_LEAST16_TYPE__ yytype_int16;
473#elif defined YY_STDINT_H
474typedef int_least16_t yytype_int16;
475#else
476typedef short yytype_int16;
477#endif
478
479/* Work around bug in HP-UX 11.23, which defines these macros
480 incorrectly for preprocessor constants. This workaround can likely
481 be removed in 2023, as HPE has promised support for HP-UX 11.23
482 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
483 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
484#ifdef __hpux
485# undef UINT_LEAST8_MAX
486# undef UINT_LEAST16_MAX
487# define UINT_LEAST8_MAX 255
488# define UINT_LEAST16_MAX 65535
489#endif
490
491#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
492typedef __UINT_LEAST8_TYPE__ yytype_uint8;
493#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
494 && UINT_LEAST8_MAX <= INT_MAX)
495typedef uint_least8_t yytype_uint8;
496#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
497typedef unsigned char yytype_uint8;
498#else
499typedef short yytype_uint8;
500#endif
501
502#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
503typedef __UINT_LEAST16_TYPE__ yytype_uint16;
504#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
505 && UINT_LEAST16_MAX <= INT_MAX)
506typedef uint_least16_t yytype_uint16;
507#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
508typedef unsigned short yytype_uint16;
509#else
510typedef int yytype_uint16;
511#endif
512
513#ifndef YYPTRDIFF_T
514# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
515# define YYPTRDIFF_T __PTRDIFF_TYPE__
516# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
517# elif defined PTRDIFF_MAX
518# ifndef ptrdiff_t
519# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
520# endif
521# define YYPTRDIFF_T ptrdiff_t
522# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
523# else
524# define YYPTRDIFF_T long
525# define YYPTRDIFF_MAXIMUM LONG_MAX
526# endif
527#endif
528
529#ifndef YYSIZE_T
530# ifdef __SIZE_TYPE__
531# define YYSIZE_T __SIZE_TYPE__
532# elif defined size_t
533# define YYSIZE_T size_t
534# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
535# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
536# define YYSIZE_T size_t
537# else
538# define YYSIZE_T unsigned
539# endif
540#endif
541
542#define YYSIZE_MAXIMUM \
543 YY_CAST (YYPTRDIFF_T, \
544 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
545 ? YYPTRDIFF_MAXIMUM \
546 : YY_CAST (YYSIZE_T, -1)))
547
548#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
549
550
551/* Stored state numbers (used for stacks). */
553
554/* State numbers in computations. */
555typedef int yy_state_fast_t;
556
557#ifndef YY_
558# if defined YYENABLE_NLS && YYENABLE_NLS
559# if ENABLE_NLS
560# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
561# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
562# endif
563# endif
564# ifndef YY_
565# define YY_(Msgid) Msgid
566# endif
567#endif
568
569
570#ifndef YY_ATTRIBUTE_PURE
571# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
572# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
573# else
574# define YY_ATTRIBUTE_PURE
575# endif
576#endif
577
578#ifndef YY_ATTRIBUTE_UNUSED
579# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
580# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
581# else
582# define YY_ATTRIBUTE_UNUSED
583# endif
584#endif
585
586/* Suppress unused-variable warnings by "using" E. */
587#if ! defined lint || defined __GNUC__
588# define YY_USE(E) ((void) (E))
589#else
590# define YY_USE(E) /* empty */
591#endif
592
593/* Suppress an incorrect diagnostic about yylval being uninitialized. */
594#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
595# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
596# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
597 _Pragma ("GCC diagnostic push") \
598 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
599# else
600# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
601 _Pragma ("GCC diagnostic push") \
602 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
603 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
604# endif
605# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
606 _Pragma ("GCC diagnostic pop")
607#else
608# define YY_INITIAL_VALUE(Value) Value
609#endif
610#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
611# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
612# define YY_IGNORE_MAYBE_UNINITIALIZED_END
613#endif
614#ifndef YY_INITIAL_VALUE
615# define YY_INITIAL_VALUE(Value) /* Nothing. */
616#endif
617
618#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
619# define YY_IGNORE_USELESS_CAST_BEGIN \
620 _Pragma ("GCC diagnostic push") \
621 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
622# define YY_IGNORE_USELESS_CAST_END \
623 _Pragma ("GCC diagnostic pop")
624#endif
625#ifndef YY_IGNORE_USELESS_CAST_BEGIN
626# define YY_IGNORE_USELESS_CAST_BEGIN
627# define YY_IGNORE_USELESS_CAST_END
628#endif
629
630
631#define YY_ASSERT(E) ((void) (0 && (E)))
632
633#if !defined yyoverflow
634
635/* The parser invokes alloca or xmalloc; define the necessary symbols. */
636
637# ifdef YYSTACK_USE_ALLOCA
638# if YYSTACK_USE_ALLOCA
639# ifdef __GNUC__
640# define YYSTACK_ALLOC __builtin_alloca
641# elif defined __BUILTIN_VA_ARG_INCR
642# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
643# elif defined _AIX
644# define YYSTACK_ALLOC __alloca
645# elif defined _MSC_VER
646# define alloca _alloca
647# else
648# define YYSTACK_ALLOC alloca
649# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
650# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
651 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
652# ifndef EXIT_SUCCESS
653# define EXIT_SUCCESS 0
654# endif
655# endif
656# endif
657# endif
658# endif
659
660# ifdef YYSTACK_ALLOC
661 /* Pacify GCC's 'empty if-body' warning. */
662# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
663# ifndef YYSTACK_ALLOC_MAXIMUM
664 /* The OS might guarantee only one guard page at the bottom of the stack,
665 and a page size can be as small as 4096 bytes. So we cannot safely
666 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
667 to allow for a few compiler-allocated temporary stack slots. */
668# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
669# endif
670# else
671# define YYSTACK_ALLOC YYMALLOC
672# define YYSTACK_FREE YYFREE
673# ifndef YYSTACK_ALLOC_MAXIMUM
674# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
675# endif
676# if (defined __cplusplus && ! defined EXIT_SUCCESS \
677 && ! ((defined YYMALLOC || defined xmalloc) \
678 && (defined YYFREE || defined xfree)))
679# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
680# ifndef EXIT_SUCCESS
681# define EXIT_SUCCESS 0
682# endif
683# endif
684# ifndef YYMALLOC
685# define YYMALLOC xmalloc
686# if ! defined xmalloc && ! defined EXIT_SUCCESS
687void *xmalloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
688# endif
689# endif
690# ifndef YYFREE
691# define YYFREE xfree
692# if ! defined xfree && ! defined EXIT_SUCCESS
693void xfree (void *); /* INFRINGES ON USER NAME SPACE */
694# endif
695# endif
696# endif
697#endif /* !defined yyoverflow */
698
699#if (! defined yyoverflow \
700 && (! defined __cplusplus \
701 || (defined f_exp_YYSTYPE_IS_TRIVIAL && f_exp_YYSTYPE_IS_TRIVIAL)))
702
703/* A type that is properly aligned for any stack member. */
709
710/* The size of the maximum gap between one aligned stack and the next. */
711# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union f_exp_yyalloc) - 1)
712
713/* The size of an array large to enough to hold all stacks, each with
714 N elements. */
715# define YYSTACK_BYTES(N) \
716 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (f_exp_YYSTYPE)) \
717 + YYSTACK_GAP_MAXIMUM)
718
719# define YYCOPY_NEEDED 1
720
721/* Relocate STACK from its old location to the new one. The
722 local variables YYSIZE and YYSTACKSIZE give the old and new number of
723 elements in the stack, and YYPTR gives the new location of the
724 stack. Advance YYPTR to a properly aligned location for the next
725 stack. */
726# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
727 do \
728 { \
729 YYPTRDIFF_T yynewbytes; \
730 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
731 Stack = &yyptr->Stack_alloc; \
732 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
733 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
734 } \
735 while (0)
736
737#endif
738
739#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
740/* Copy COUNT objects from SRC to DST. The source and destination do
741 not overlap. */
742# ifndef YYCOPY
743# if defined __GNUC__ && 1 < __GNUC__
744# define YYCOPY(Dst, Src, Count) \
745 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
746# else
747# define YYCOPY(Dst, Src, Count) \
748 do \
749 { \
750 YYPTRDIFF_T yyi; \
751 for (yyi = 0; yyi < (Count); yyi++) \
752 (Dst)[yyi] = (Src)[yyi]; \
753 } \
754 while (0)
755# endif
756# endif
757#endif /* !YYCOPY_NEEDED */
758
759/* YYFINAL -- State number of the termination state. */
760#define YYFINAL 69
761/* YYLAST -- Last index in YYTABLE. */
762#define YYLAST 924
763
764/* YYNTOKENS -- Number of terminals. */
765#define YYNTOKENS 72
766/* YYNNTS -- Number of nonterminals. */
767#define YYNNTS 20
768/* YYNRULES -- Number of rules. */
769#define YYNRULES 113
770/* YYNSTATES -- Number of states. */
771#define YYNSTATES 184
772
773/* YYMAXUTOK -- Last valid token kind. */
774#define YYMAXUTOK 310
775
776
777/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
778 as returned by yylex, with out-of-bounds checking. */
779#define YYTRANSLATE(YYX) \
780 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
781 ? YY_CAST (f_exp_yysymbol_kind_t, yytranslate[YYX]) \
782 : YYSYMBOL_YYUNDEF)
783
784/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
785 as returned by yylex. */
786static const yytype_int8 yytranslate[] =
787{
788 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
789 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
790 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
791 2, 2, 2, 2, 2, 2, 2, 66, 51, 2,
792 68, 69, 63, 61, 45, 62, 2, 64, 2, 2,
793 2, 2, 2, 2, 2, 2, 2, 2, 71, 2,
794 2, 47, 2, 48, 60, 2, 2, 2, 2, 2,
795 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
796 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
797 2, 2, 2, 2, 50, 2, 2, 2, 2, 2,
798 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
799 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
800 2, 2, 2, 2, 49, 2, 70, 2, 2, 2,
801 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
802 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
803 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
804 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
805 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
806 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
807 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
808 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
809 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
810 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
811 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
812 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
813 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
814 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
815 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
816 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
817 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
818 46, 52, 53, 54, 55, 56, 57, 58, 59, 65,
819 67
820};
821
822#if YYDEBUG
823/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
824static const yytype_int16 yyrline[] =
825{
826 0, 219, 219, 220, 223, 227, 232, 236, 240, 244,
827 248, 252, 256, 266, 265, 276, 282, 289, 288, 309,
828 308, 332, 335, 339, 343, 347, 353, 363, 372, 381,
829 392, 404, 416, 428, 440, 444, 454, 461, 468, 478,
830 490, 494, 498, 502, 506, 510, 514, 518, 522, 526,
831 530, 534, 538, 542, 546, 550, 554, 558, 563, 567,
832 571, 580, 587, 597, 606, 609, 613, 622, 626, 633,
833 641, 644, 645, 697, 699, 701, 703, 705, 708, 710,
834 712, 714, 716, 720, 722, 727, 729, 731, 733, 735,
835 737, 739, 741, 743, 745, 747, 749, 751, 753, 755,
836 757, 759, 761, 763, 765, 767, 769, 771, 773, 778,
837 783, 791, 793, 797
838};
839#endif
840
842#define YY_ACCESSING_SYMBOL(State) YY_CAST (f_exp_yysymbol_kind_t, yystos[State])
843
844#if YYDEBUG || 0
845/* The user-facing name of the symbol whose (internal) number is
846 YYSYMBOL. No bounds checking. */
847static const char *yysymbol_name (f_exp_yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
848
849/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
850 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
851static const char *const yytname[] =
852{
853 "\"end of file\"", "error", "\"invalid token\"", "INT", "FLOAT",
854 "STRING_LITERAL", "BOOLEAN_LITERAL", "NAME", "TYPENAME", "COMPLETE",
855 "NAME_OR_INT", "SIZEOF", "KIND", "ERROR", "INT_S1_KEYWORD",
856 "INT_S2_KEYWORD", "INT_KEYWORD", "INT_S4_KEYWORD", "INT_S8_KEYWORD",
857 "LOGICAL_S1_KEYWORD", "LOGICAL_S2_KEYWORD", "LOGICAL_KEYWORD",
858 "LOGICAL_S4_KEYWORD", "LOGICAL_S8_KEYWORD", "REAL_KEYWORD",
859 "REAL_S4_KEYWORD", "REAL_S8_KEYWORD", "REAL_S16_KEYWORD",
860 "COMPLEX_KEYWORD", "COMPLEX_S4_KEYWORD", "COMPLEX_S8_KEYWORD",
861 "COMPLEX_S16_KEYWORD", "BOOL_AND", "BOOL_OR", "BOOL_NOT", "SINGLE",
862 "DOUBLE", "PRECISION", "CHARACTER", "DOLLAR_VARIABLE", "ASSIGN_MODIFY",
863 "UNOP_INTRINSIC", "BINOP_INTRINSIC", "UNOP_OR_BINOP_INTRINSIC",
864 "UNOP_OR_BINOP_OR_TERNOP_INTRINSIC", "','", "ABOVE_COMMA", "'='", "'?'",
865 "'|'", "'^'", "'&'", "EQUAL", "NOTEQUAL", "LESSTHAN", "GREATERTHAN",
866 "LEQ", "GEQ", "LSH", "RSH", "'@'", "'+'", "'-'", "'*'", "'/'",
867 "STARSTAR", "'%'", "UNARY", "'('", "')'", "'~'", "':'", "$accept",
868 "start", "type_exp", "exp", "$@1", "$@2", "$@3", "arglist", "subrange",
869 "complexnum", "variable", "type", "ptype", "abs_decl", "direct_abs_decl",
870 "func_mod", "typebase", "nonempty_typelist", "name", "name_not_typename", YY_NULLPTRPTR
871};
872
873static const char *
875{
876 return yytname[yysymbol];
877}
878#endif
879
880#define YYPACT_NINF (-103)
881
882#define yypact_value_is_default(Yyn) \
883 ((Yyn) == YYPACT_NINF)
884
885#define YYTABLE_NINF (-1)
886
887#define yytable_value_is_error(Yyn) \
888 0
889
890/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
891 STATE-NUM. */
892static const yytype_int16 yypact[] =
893{
894 249, -103, -103, -103, -103, -103, -103, -103, 291, -62,
895 -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
896 -103, -103, -103, -103, -103, -103, -103, -103, 333, 6,
897 18, -103, -103, -61, -33, -26, -21, 333, 333, 333,
898 249, 333, 56, -103, 718, -103, -103, -103, -6, -103,
899 249, -20, 333, -20, -103, -103, -103, -103, 333, 333,
900 -103, -103, -20, -20, -20, 567, -16, -4, -20, -103,
901 333, 333, 333, 333, 333, 333, 333, 333, 333, 333,
902 333, 333, 333, 333, 333, 333, 333, 333, 333, 333,
903 333, 60, -103, -6, -2, 432, -103, 29, -103, 40,
904 373, 605, 681, 88, 88, 333, -103, -103, 333, 802,
905 753, 718, 718, 821, 839, 856, 733, 733, 53, 53,
906 53, 53, 133, 133, 72, 38, 38, 58, 58, 58,
907 -103, -103, -103, 54, 88, -103, -103, -103, 63, -103,
908 -103, 59, -40, -5, -103, 375, -103, -103, 333, 166,
909 456, -18, -103, -9, 718, -20, -103, 51, 104, -103,
910 812, -103, 643, 333, 493, 180, 88, -103, -103, -103,
911 75, -103, -103, 718, 333, 333, 530, 456, -103, -103,
912 718, 718, 333, 718
913};
914
915/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
916 Performed when YYTABLE does not specify something else to do. Zero
917 means the default is an error. */
918static const yytype_int8 yydefact[] =
919{
920 0, 61, 63, 68, 67, 113, 85, 62, 0, 0,
921 86, 87, 88, 89, 90, 92, 93, 94, 95, 96,
922 97, 98, 99, 100, 101, 102, 103, 104, 0, 0,
923 0, 91, 65, 0, 0, 0, 0, 0, 0, 0,
924 0, 0, 0, 3, 2, 64, 4, 70, 71, 69,
925 0, 11, 0, 9, 107, 105, 108, 106, 0, 0,
926 17, 19, 7, 8, 6, 0, 0, 0, 10, 1,
927 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
928 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
929 0, 0, 13, 75, 73, 0, 72, 77, 82, 0,
930 0, 0, 0, 21, 21, 0, 5, 35, 0, 57,
931 58, 60, 59, 56, 55, 54, 48, 49, 52, 53,
932 50, 51, 46, 47, 40, 44, 45, 42, 43, 41,
933 111, 112, 39, 37, 21, 76, 80, 74, 0, 83,
934 109, 0, 0, 0, 81, 66, 12, 15, 0, 29,
935 22, 0, 23, 0, 34, 36, 38, 0, 0, 78,
936 0, 84, 0, 0, 28, 27, 0, 18, 20, 14,
937 0, 110, 16, 33, 0, 0, 26, 24, 25, 79,
938 32, 31, 0, 30
939};
940
941/* YYPGOTO[NTERM-NUM]. */
942static const yytype_int8 yypgoto[] =
943{
944 -103, -103, -103, 0, -103, -103, -103, -102, -41, -103,
945 -103, 4, -103, 48, -103, 49, -103, -103, -103, -103
946};
947
948/* YYDEFGOTO[NTERM-NUM]. */
949static const yytype_uint8 yydefgoto[] =
950{
951 0, 42, 43, 150, 134, 103, 104, 151, 152, 66,
952 45, 140, 47, 96, 97, 98, 48, 142, 133, 49
953};
954
955/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
956 positive, shift that token. If negative, reduce the rule whose
957 number is the opposite. If YYTABLE_NINF, syntax error. */
958static const yytype_uint8 yytable[] =
959{
960 44, 136, 153, 6, 46, 160, 52, 58, 51, 10,
961 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
962 21, 22, 23, 24, 25, 26, 27, 166, 53, 161,
963 29, 30, 157, 31, 54, 59, 166, 62, 63, 64,
964 65, 68, 60, 55, 67, 93, 56, 61, 92, 93,
965 65, 167, 100, 107, 99, 57, 69, 94, 101, 102,
966 168, 94, 95, 156, 139, 108, 95, 130, 131, 132,
967 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
968 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
969 129, 1, 2, 3, 4, 5, 166, 143, 7, 8,
970 9, 88, 89, 90, 91, 154, 92, 170, 155, 145,
971 158, 83, 84, 85, 86, 87, 88, 89, 90, 91,
972 169, 92, 28, 90, 91, 178, 92, 32, 159, 33,
973 34, 35, 36, 86, 87, 88, 89, 90, 91, 37,
974 92, 135, 137, 141, 179, 155, 144, 0, 162, 164,
975 38, 39, 0, 0, 0, 0, 40, 0, 41, 149,
976 0, 0, 0, 173, 171, 176, 177, 0, 0, 1,
977 2, 3, 4, 5, 180, 181, 7, 8, 9, 0,
978 0, 0, 183, 1, 2, 3, 4, 5, 0, 0,
979 7, 8, 9, 85, 86, 87, 88, 89, 90, 91,
980 28, 92, 0, 0, 0, 32, 0, 33, 34, 35,
981 36, 0, 0, 0, 28, 0, 0, 37, 0, 32,
982 0, 33, 34, 35, 36, 0, 0, 0, 38, 39,
983 0, 37, 0, 0, 40, 0, 41, 163, 0, 0,
984 0, 0, 38, 39, 0, 0, 0, 0, 40, 0,
985 41, 175, 1, 2, 3, 4, 5, 6, 0, 7,
986 8, 9, 0, 10, 11, 12, 13, 14, 15, 16,
987 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
988 27, 0, 0, 28, 29, 30, 0, 31, 32, 0,
989 33, 34, 35, 36, 1, 2, 3, 4, 5, 0,
990 37, 7, 8, 9, 0, 0, 0, 0, 0, 0,
991 0, 38, 39, 0, 0, 0, 0, 40, 0, 41,
992 0, 0, 0, 0, 0, 28, 0, 0, 0, 0,
993 32, 0, 33, 34, 35, 36, 1, 2, 3, 4,
994 5, 0, 37, 7, 8, 9, 0, 0, 0, 0,
995 0, 0, 0, 38, 39, 0, 0, 0, 0, 50,
996 0, 41, 0, 0, 0, 0, 0, 28, 0, 0,
997 0, 0, 32, 0, 33, 34, 35, 36, 1, 2,
998 3, 4, 5, 0, 37, 7, 8, 9, 0, 0,
999 0, 0, 0, 0, 0, 38, 39, 0, 0, 0,
1000 0, 40, 0, 41, 0, 70, 71, 0, 0, 28,
1001 0, 0, 0, 72, 32, 0, 33, 34, 35, 36,
1002 73, 0, 74, 75, 76, 77, 78, 79, 80, 81,
1003 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
1004 6, 92, 146, 40, 138, 41, 10, 11, 12, 13,
1005 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1006 24, 25, 26, 27, 0, 0, 0, 29, 30, 0,
1007 31, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1008 0, 0, 0, 93, 0, 0, 0, 0, 70, 71,
1009 0, 0, 0, 0, 0, 94, 72, 0, 0, 0,
1010 95, 139, 0, 73, 0, 74, 75, 76, 77, 78,
1011 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1012 89, 90, 91, 0, 92, 70, 71, 165, 0, 0,
1013 0, 0, 0, 72, 0, 0, 0, 0, 0, 0,
1014 73, 0, 74, 75, 76, 77, 78, 79, 80, 81,
1015 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
1016 0, 92, 70, 71, 174, 0, 0, 0, 0, 0,
1017 72, 0, 0, 0, 0, 0, 0, 73, 0, 74,
1018 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1019 85, 86, 87, 88, 89, 90, 91, 0, 92, 70,
1020 71, 182, 0, 0, 0, 0, 0, 72, 0, 0,
1021 0, 0, 105, 0, 73, 0, 74, 75, 76, 77,
1022 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
1023 88, 89, 90, 91, 0, 92, 106, 70, 71, 0,
1024 0, 0, 0, 0, 0, 72, 0, 0, 0, 0,
1025 0, 0, 73, 0, 74, 75, 76, 77, 78, 79,
1026 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1027 90, 91, 0, 92, 147, 70, 71, 0, 0, 0,
1028 0, 0, 0, 72, 0, 0, 0, 0, 0, 0,
1029 73, 0, 74, 75, 76, 77, 78, 79, 80, 81,
1030 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
1031 0, 92, 172, 70, 71, 0, 0, 0, 0, 0,
1032 0, 72, 0, 0, 0, 0, 148, 0, 73, 0,
1033 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
1034 84, 85, 86, 87, 88, 89, 90, 91, 0, 92,
1035 70, 71, 0, 0, 0, 0, 0, 0, 72, 0,
1036 0, 0, 0, 0, 0, 73, 0, 74, 75, 76,
1037 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1038 87, 88, 89, 90, 91, 70, 92, 79, 80, 81,
1039 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
1040 0, 92, 74, 75, 76, 77, 78, 79, 80, 81,
1041 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
1042 6, 92, 0, 0, 0, 0, 10, 11, 12, 13,
1043 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1044 24, 25, 26, 27, 0, 0, 0, 29, 30, 0,
1045 31, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1046 83, 84, 85, 86, 87, 88, 89, 90, 91, 0,
1047 92, 75, 76, 77, 78, 79, 80, 81, 82, 83,
1048 84, 85, 86, 87, 88, 89, 90, 91, 0, 92,
1049 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1050 86, 87, 88, 89, 90, 91, 0, 92, 77, 78,
1051 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1052 89, 90, 91, 0, 92
1053};
1054
1055static const yytype_int16 yycheck[] =
1056{
1057 0, 3, 104, 8, 0, 45, 68, 68, 8, 14,
1058 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1059 25, 26, 27, 28, 29, 30, 31, 45, 28, 69,
1060 35, 36, 134, 38, 28, 68, 45, 37, 38, 39,
1061 40, 41, 68, 37, 40, 51, 28, 68, 68, 51,
1062 50, 69, 52, 69, 50, 37, 0, 63, 58, 59,
1063 69, 63, 68, 9, 69, 69, 68, 7, 8, 9,
1064 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
1065 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1066 90, 3, 4, 5, 6, 7, 45, 68, 10, 11,
1067 12, 63, 64, 65, 66, 105, 68, 3, 108, 69,
1068 47, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1069 69, 68, 34, 65, 66, 166, 68, 39, 69, 41,
1070 42, 43, 44, 61, 62, 63, 64, 65, 66, 51,
1071 68, 93, 94, 95, 69, 145, 97, -1, 148, 149,
1072 62, 63, -1, -1, -1, -1, 68, -1, 70, 71,
1073 -1, -1, -1, 163, 160, 165, 166, -1, -1, 3,
1074 4, 5, 6, 7, 174, 175, 10, 11, 12, -1,
1075 -1, -1, 182, 3, 4, 5, 6, 7, -1, -1,
1076 10, 11, 12, 60, 61, 62, 63, 64, 65, 66,
1077 34, 68, -1, -1, -1, 39, -1, 41, 42, 43,
1078 44, -1, -1, -1, 34, -1, -1, 51, -1, 39,
1079 -1, 41, 42, 43, 44, -1, -1, -1, 62, 63,
1080 -1, 51, -1, -1, 68, -1, 70, 71, -1, -1,
1081 -1, -1, 62, 63, -1, -1, -1, -1, 68, -1,
1082 70, 71, 3, 4, 5, 6, 7, 8, -1, 10,
1083 11, 12, -1, 14, 15, 16, 17, 18, 19, 20,
1084 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1085 31, -1, -1, 34, 35, 36, -1, 38, 39, -1,
1086 41, 42, 43, 44, 3, 4, 5, 6, 7, -1,
1087 51, 10, 11, 12, -1, -1, -1, -1, -1, -1,
1088 -1, 62, 63, -1, -1, -1, -1, 68, -1, 70,
1089 -1, -1, -1, -1, -1, 34, -1, -1, -1, -1,
1090 39, -1, 41, 42, 43, 44, 3, 4, 5, 6,
1091 7, -1, 51, 10, 11, 12, -1, -1, -1, -1,
1092 -1, -1, -1, 62, 63, -1, -1, -1, -1, 68,
1093 -1, 70, -1, -1, -1, -1, -1, 34, -1, -1,
1094 -1, -1, 39, -1, 41, 42, 43, 44, 3, 4,
1095 5, 6, 7, -1, 51, 10, 11, 12, -1, -1,
1096 -1, -1, -1, -1, -1, 62, 63, -1, -1, -1,
1097 -1, 68, -1, 70, -1, 32, 33, -1, -1, 34,
1098 -1, -1, -1, 40, 39, -1, 41, 42, 43, 44,
1099 47, -1, 49, 50, 51, 52, 53, 54, 55, 56,
1100 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1101 8, 68, 69, 68, 12, 70, 14, 15, 16, 17,
1102 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1103 28, 29, 30, 31, -1, -1, -1, 35, 36, -1,
1104 38, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1105 -1, -1, -1, 51, -1, -1, -1, -1, 32, 33,
1106 -1, -1, -1, -1, -1, 63, 40, -1, -1, -1,
1107 68, 69, -1, 47, -1, 49, 50, 51, 52, 53,
1108 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
1109 64, 65, 66, -1, 68, 32, 33, 71, -1, -1,
1110 -1, -1, -1, 40, -1, -1, -1, -1, -1, -1,
1111 47, -1, 49, 50, 51, 52, 53, 54, 55, 56,
1112 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1113 -1, 68, 32, 33, 71, -1, -1, -1, -1, -1,
1114 40, -1, -1, -1, -1, -1, -1, 47, -1, 49,
1115 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1116 60, 61, 62, 63, 64, 65, 66, -1, 68, 32,
1117 33, 71, -1, -1, -1, -1, -1, 40, -1, -1,
1118 -1, -1, 45, -1, 47, -1, 49, 50, 51, 52,
1119 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
1120 63, 64, 65, 66, -1, 68, 69, 32, 33, -1,
1121 -1, -1, -1, -1, -1, 40, -1, -1, -1, -1,
1122 -1, -1, 47, -1, 49, 50, 51, 52, 53, 54,
1123 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1124 65, 66, -1, 68, 69, 32, 33, -1, -1, -1,
1125 -1, -1, -1, 40, -1, -1, -1, -1, -1, -1,
1126 47, -1, 49, 50, 51, 52, 53, 54, 55, 56,
1127 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1128 -1, 68, 69, 32, 33, -1, -1, -1, -1, -1,
1129 -1, 40, -1, -1, -1, -1, 45, -1, 47, -1,
1130 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1131 59, 60, 61, 62, 63, 64, 65, 66, -1, 68,
1132 32, 33, -1, -1, -1, -1, -1, -1, 40, -1,
1133 -1, -1, -1, -1, -1, 47, -1, 49, 50, 51,
1134 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
1135 62, 63, 64, 65, 66, 32, 68, 54, 55, 56,
1136 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1137 -1, 68, 49, 50, 51, 52, 53, 54, 55, 56,
1138 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1139 8, 68, -1, -1, -1, -1, 14, 15, 16, 17,
1140 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1141 28, 29, 30, 31, -1, -1, -1, 35, 36, -1,
1142 38, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1143 58, 59, 60, 61, 62, 63, 64, 65, 66, -1,
1144 68, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1145 59, 60, 61, 62, 63, 64, 65, 66, -1, 68,
1146 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
1147 61, 62, 63, 64, 65, 66, -1, 68, 52, 53,
1148 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
1149 64, 65, 66, -1, 68
1150};
1151
1152/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1153 state STATE-NUM. */
1154static const yytype_int8 yystos[] =
1155{
1156 0, 3, 4, 5, 6, 7, 8, 10, 11, 12,
1157 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1158 24, 25, 26, 27, 28, 29, 30, 31, 34, 35,
1159 36, 38, 39, 41, 42, 43, 44, 51, 62, 63,
1160 68, 70, 73, 74, 75, 82, 83, 84, 88, 91,
1161 68, 75, 68, 75, 28, 37, 28, 37, 68, 68,
1162 68, 68, 75, 75, 75, 75, 81, 83, 75, 0,
1163 32, 33, 40, 47, 49, 50, 51, 52, 53, 54,
1164 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1165 65, 66, 68, 51, 63, 68, 85, 86, 87, 83,
1166 75, 75, 75, 77, 78, 45, 69, 69, 69, 75,
1167 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
1168 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
1169 7, 8, 9, 90, 76, 85, 3, 85, 12, 69,
1170 83, 85, 89, 68, 87, 69, 69, 69, 45, 71,
1171 75, 79, 80, 79, 75, 75, 9, 79, 47, 69,
1172 45, 69, 75, 71, 75, 71, 45, 69, 69, 69,
1173 3, 83, 69, 75, 71, 71, 75, 75, 80, 69,
1174 75, 75, 71, 75
1175};
1176
1177/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1178static const yytype_int8 yyr1[] =
1179{
1180 0, 72, 73, 73, 74, 75, 75, 75, 75, 75,
1181 75, 75, 75, 76, 75, 75, 75, 77, 75, 78,
1182 75, 79, 79, 79, 79, 79, 80, 80, 80, 80,
1183 80, 80, 80, 80, 81, 75, 75, 75, 75, 75,
1184 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
1185 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
1186 75, 75, 75, 75, 75, 75, 75, 75, 75, 82,
1187 83, 84, 84, 85, 85, 85, 85, 85, 86, 86,
1188 86, 86, 86, 87, 87, 88, 88, 88, 88, 88,
1189 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
1190 88, 88, 88, 88, 88, 88, 88, 88, 88, 89,
1191 89, 90, 90, 91
1192};
1193
1194/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1195static const yytype_int8 yyr2[] =
1196{
1197 0, 2, 1, 1, 1, 3, 2, 2, 2, 2,
1198 2, 2, 4, 0, 5, 4, 6, 0, 5, 0,
1199 5, 0, 1, 1, 3, 3, 3, 2, 2, 1,
1200 5, 4, 4, 3, 3, 3, 4, 3, 4, 3,
1201 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1202 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1203 3, 1, 1, 1, 1, 1, 4, 1, 1, 1,
1204 1, 1, 2, 1, 2, 1, 2, 1, 3, 5,
1205 2, 2, 1, 2, 3, 1, 1, 1, 1, 1,
1206 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1207 1, 1, 1, 1, 1, 2, 2, 2, 2, 1,
1208 3, 1, 1, 1
1209};
1210
1211
1212enum { YYENOMEM = -2 };
1213
1214#define yyerrok (yyerrstatus = 0)
1215#define yyclearin (yychar = YYEMPTY)
1216
1217#define YYACCEPT goto yyacceptlab
1218#define YYABORT goto yyabortlab
1219#define YYERROR goto yyerrorlab
1220#define YYNOMEM goto yyexhaustedlab
1221
1222
1223#define YYRECOVERING() (!!yyerrstatus)
1224
1225#define YYBACKUP(Token, Value) \
1226 do \
1227 if (yychar == YYEMPTY) \
1228 { \
1229 yychar = (Token); \
1230 yylval = (Value); \
1231 YYPOPSTACK (yylen); \
1232 yystate = *yyssp; \
1233 goto yybackup; \
1234 } \
1235 else \
1236 { \
1237 yyerror (YY_("syntax error: cannot back up")); \
1238 YYERROR; \
1239 } \
1240 while (0)
1241
1242/* Backward compatibility with an undocumented macro.
1243 Use YYerror or YYUNDEF. */
1244#define YYERRCODE YYUNDEF
1245
1246
1247/* Enable debugging if requested. */
1248#if YYDEBUG
1249
1250# ifndef YYFPRINTF
1251# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1252# define YYFPRINTF fprintf
1253# endif
1254
1255# define YYDPRINTF(Args) \
1256do { \
1257 if (yydebug) \
1258 YYFPRINTF Args; \
1259} while (0)
1260
1261
1262
1263
1264# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1265do { \
1266 if (yydebug) \
1267 { \
1268 YYFPRINTF (stderr, "%s ", Title); \
1269 yy_symbol_print (stderr, \
1270 Kind, Value); \
1271 YYFPRINTF (stderr, "\n"); \
1272 } \
1273} while (0)
1274
1275
1276/*-----------------------------------.
1277| Print this symbol's value on YYO. |
1278`-----------------------------------*/
1279
1280static void
1282 f_exp_yysymbol_kind_t yykind, f_exp_YYSTYPE const * const yyvaluep)
1283{
1284 FILE *yyoutput = yyo;
1285 YY_USE (yyoutput);
1286 if (!yyvaluep)
1287 return;
1289 YY_USE (yykind);
1291}
1292
1293
1294/*---------------------------.
1295| Print this symbol on YYO. |
1296`---------------------------*/
1297
1298static void
1300 f_exp_yysymbol_kind_t yykind, f_exp_YYSTYPE const * const yyvaluep)
1301{
1302 YYFPRINTF (yyo, "%s %s (",
1303 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1304
1305 yy_symbol_value_print (yyo, yykind, yyvaluep);
1306 YYFPRINTF (yyo, ")");
1307}
1308
1309/*------------------------------------------------------------------.
1310| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1311| TOP (included). |
1312`------------------------------------------------------------------*/
1313
1314static void
1316{
1317 YYFPRINTF (stderr, "Stack now");
1318 for (; yybottom <= yytop; yybottom++)
1319 {
1320 int yybot = *yybottom;
1321 YYFPRINTF (stderr, " %d", yybot);
1322 }
1323 YYFPRINTF (stderr, "\n");
1324}
1325
1326# define YY_STACK_PRINT(Bottom, Top) \
1327do { \
1328 if (yydebug) \
1329 yy_stack_print ((Bottom), (Top)); \
1330} while (0)
1331
1332
1333/*------------------------------------------------.
1334| Report that the YYRULE is going to be reduced. |
1335`------------------------------------------------*/
1336
1337static void
1339 int yyrule)
1340{
1341 int yylno = yyrline[yyrule];
1342 int yynrhs = yyr2[yyrule];
1343 int yyi;
1344 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1345 yyrule - 1, yylno);
1346 /* The symbols being reduced. */
1347 for (yyi = 0; yyi < yynrhs; yyi++)
1348 {
1349 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1350 yy_symbol_print (stderr,
1351 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1352 &yyvsp[(yyi + 1) - (yynrhs)]);
1353 YYFPRINTF (stderr, "\n");
1354 }
1355}
1356
1357# define YY_REDUCE_PRINT(Rule) \
1358do { \
1359 if (yydebug) \
1360 yy_reduce_print (yyssp, yyvsp, Rule); \
1361} while (0)
1362
1363/* Nonzero means print parse trace. It is left uninitialized so that
1364 multiple parsers can coexist. */
1366#else /* !YYDEBUG */
1367# define YYDPRINTF(Args) ((void) 0)
1368# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1369# define YY_STACK_PRINT(Bottom, Top)
1370# define YY_REDUCE_PRINT(Rule)
1371#endif /* !YYDEBUG */
1372
1373
1374/* YYINITDEPTH -- initial size of the parser's stacks. */
1375#ifndef YYINITDEPTH
1376# define YYINITDEPTH 200
1377#endif
1378
1379/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1380 if the built-in stack extension method is used).
1381
1382 Do not make this value too large; the results are undefined if
1383 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1384 evaluated with infinite-precision integer arithmetic. */
1385
1386#ifndef YYMAXDEPTH
1387# define YYMAXDEPTH 10000
1388#endif
1389
1390
1391
1392
1393
1394
1395/*-----------------------------------------------.
1396| Release the memory associated to this symbol. |
1397`-----------------------------------------------*/
1398
1399static void
1400yydestruct (const char *yymsg,
1401 f_exp_yysymbol_kind_t yykind, f_exp_YYSTYPE *yyvaluep)
1402{
1403 YY_USE (yyvaluep);
1404 if (!yymsg)
1405 yymsg = "Deleting";
1406 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1407
1409 YY_USE (yykind);
1411}
1412
1413
1414/* Lookahead token kind. */
1416
1417/* The semantic value of the lookahead symbol. */
1419/* Number of syntax errors so far. */
1421
1422
1423
1424
1425/*----------.
1426| yyparse. |
1427`----------*/
1428
1429int
1431{
1433 /* Number of tokens to shift before error messages enabled. */
1434 int yyerrstatus = 0;
1435
1436 /* Refer to the stacks through separate pointers, to allow yyoverflow
1437 to xreallocate them elsewhere. */
1438
1439 /* Their size. */
1441
1442 /* The state stack: array, bottom, top. */
1443 yy_state_t yyssa[YYINITDEPTH];
1444 yy_state_t *yyss = yyssa;
1446
1447 /* The semantic value stack: array, bottom, top. */
1449 f_exp_YYSTYPE *yyvs = yyvsa;
1451
1452 int yyn;
1453 /* The return value of yyparse. */
1454 int yyresult;
1455 /* Lookahead symbol kind. */
1457 /* The variables used to return semantic value and location from the
1458 action routines. */
1460
1461
1462
1463#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1464
1465 /* The number of symbols on the RHS of the reduced rule.
1466 Keep to zero when no symbol should be popped. */
1467 int yylen = 0;
1468
1469 YYDPRINTF ((stderr, "Starting parse\n"));
1470
1471 yychar = YYEMPTY; /* Cause a token to be read. */
1472
1473 goto yysetstate;
1474
1475
1476/*------------------------------------------------------------.
1477| yynewstate -- push a new state, which is found in yystate. |
1478`------------------------------------------------------------*/
1479yynewstate:
1480 /* In all cases, when you get here, the value and location stacks
1481 have just been pushed. So pushing a state here evens the stacks. */
1482 yyssp++;
1483
1484
1485/*--------------------------------------------------------------------.
1486| yysetstate -- set current state (the top of the stack) to yystate. |
1487`--------------------------------------------------------------------*/
1488yysetstate:
1489 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1490 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1495
1496 if (yyss + yystacksize - 1 <= yyssp)
1497#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1498 YYNOMEM;
1499#else
1500 {
1501 /* Get the current used size of the three stacks, in elements. */
1502 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1503
1504# if defined yyoverflow
1505 {
1506 /* Give user a chance to xreallocate the stack. Use copies of
1507 these so that the &'s don't force the real ones into
1508 memory. */
1509 yy_state_t *yyss1 = yyss;
1510 f_exp_YYSTYPE *yyvs1 = yyvs;
1511
1512 /* Each stack pointer address is followed by the size of the
1513 data in use in that stack, in bytes. This used to be a
1514 conditional around just the two extra args, but that might
1515 be undefined if yyoverflow is a macro. */
1516 yyoverflow (YY_("memory exhausted"),
1517 &yyss1, yysize * YYSIZEOF (*yyssp),
1518 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1519 &yystacksize);
1520 yyss = yyss1;
1521 yyvs = yyvs1;
1522 }
1523# else /* defined YYSTACK_RELOCATE */
1524 /* Extend the stack our own way. */
1525 if (YYMAXDEPTH <= yystacksize)
1526 YYNOMEM;
1527 yystacksize *= 2;
1528 if (YYMAXDEPTH < yystacksize)
1530
1531 {
1532 yy_state_t *yyss1 = yyss;
1533 union f_exp_yyalloc *yyptr =
1534 YY_CAST (union f_exp_yyalloc *,
1536 if (! yyptr)
1537 YYNOMEM;
1540# undef YYSTACK_RELOCATE
1541 if (yyss1 != yyssa)
1542 YYSTACK_FREE (yyss1);
1543 }
1544# endif
1545
1546 yyssp = yyss + yysize - 1;
1547 yyvsp = yyvs + yysize - 1;
1548
1550 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1551 YY_CAST (long, yystacksize)));
1553
1554 if (yyss + yystacksize - 1 <= yyssp)
1555 YYABORT;
1556 }
1557#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1558
1559
1560 if (yystate == YYFINAL)
1561 YYACCEPT;
1562
1563 goto yybackup;
1564
1565
1566/*-----------.
1567| yybackup. |
1568`-----------*/
1569yybackup:
1570 /* Do appropriate processing given the current state. Read a
1571 lookahead token if we need one and don't already have one. */
1572
1573 /* First try to decide what to do without reference to lookahead token. */
1574 yyn = yypact[yystate];
1575 if (yypact_value_is_default (yyn))
1576 goto yydefault;
1577
1578 /* Not known => get a lookahead token if don't already have one. */
1579
1580 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1581 if (yychar == YYEMPTY)
1582 {
1583 YYDPRINTF ((stderr, "Reading a token\n"));
1584 yychar = yylex ();
1585 }
1586
1587 if (yychar <= YYEOF)
1588 {
1589 yychar = YYEOF;
1590 yytoken = YYSYMBOL_YYEOF;
1591 YYDPRINTF ((stderr, "Now at end of input.\n"));
1592 }
1593 else if (yychar == YYerror)
1594 {
1595 /* The scanner already issued an error message, process directly
1596 to error recovery. But do not keep the error token as
1597 lookahead, it is too special and may lead us to an endless
1598 loop in error recovery. */
1599 yychar = YYUNDEF;
1600 yytoken = YYSYMBOL_YYerror;
1601 goto yyerrlab1;
1602 }
1603 else
1604 {
1605 yytoken = YYTRANSLATE (yychar);
1606 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1607 }
1608
1609 /* If the proper action on seeing token YYTOKEN is to reduce or to
1610 detect an error, take that action. */
1611 yyn += yytoken;
1612 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1613 goto yydefault;
1614 yyn = yytable[yyn];
1615 if (yyn <= 0)
1616 {
1617 if (yytable_value_is_error (yyn))
1618 goto yyerrlab;
1619 yyn = -yyn;
1620 goto yyreduce;
1621 }
1622
1623 /* Count tokens shifted since error; after three, turn off error
1624 status. */
1625 if (yyerrstatus)
1626 yyerrstatus--;
1627
1628 /* Shift the lookahead token. */
1629 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1630 yystate = yyn;
1632 *++yyvsp = yylval;
1634
1635 /* Discard the shifted token. */
1636 yychar = YYEMPTY;
1637 goto yynewstate;
1638
1639
1640/*-----------------------------------------------------------.
1641| yydefault -- do the default action for the current state. |
1642`-----------------------------------------------------------*/
1643yydefault:
1644 yyn = yydefact[yystate];
1645 if (yyn == 0)
1646 goto yyerrlab;
1647 goto yyreduce;
1648
1649
1650/*-----------------------------.
1651| yyreduce -- do a reduction. |
1652`-----------------------------*/
1653yyreduce:
1654 /* yyn is the number of a rule to reduce with. */
1655 yylen = yyr2[yyn];
1656
1657 /* If YYLEN is nonzero, implement the default value of the action:
1658 '$$ = $1'.
1659
1660 Otherwise, the following line sets YYVAL to garbage.
1661 This behavior is undocumented and Bison
1662 users should not rely upon it. Assigning to YYVAL
1663 unconditionally makes the parser a bit smaller, and it avoids a
1664 GCC warning that YYVAL may be used uninitialized. */
1665 yyval = yyvsp[1-yylen];
1666
1667
1668 YY_REDUCE_PRINT (yyn);
1669 switch (yyn)
1670 {
1671 case 4: /* type_exp: type */
1672#line 224 "f-exp.y"
1673 { pstate->push_new<type_operation> ((yyvsp[0].tval)); }
1674#line 1676 "f-exp.c.tmp"
1675 break;
1676
1677 case 5: /* exp: '(' exp ')' */
1678#line 228 "f-exp.y"
1679 { }
1680#line 1682 "f-exp.c.tmp"
1681 break;
1682
1683 case 6: /* exp: '*' exp */
1684#line 233 "f-exp.y"
1686#line 1688 "f-exp.c.tmp"
1687 break;
1688
1689 case 7: /* exp: '&' exp */
1690#line 237 "f-exp.y"
1692#line 1694 "f-exp.c.tmp"
1693 break;
1694
1695 case 8: /* exp: '-' exp */
1696#line 241 "f-exp.y"
1698#line 1700 "f-exp.c.tmp"
1699 break;
1700
1701 case 9: /* exp: BOOL_NOT exp */
1702#line 245 "f-exp.y"
1704#line 1706 "f-exp.c.tmp"
1705 break;
1706
1707 case 10: /* exp: '~' exp */
1708#line 249 "f-exp.y"
1710#line 1712 "f-exp.c.tmp"
1711 break;
1712
1713 case 11: /* exp: SIZEOF exp */
1714#line 253 "f-exp.y"
1716#line 1718 "f-exp.c.tmp"
1717 break;
1718
1719 case 12: /* exp: KIND '(' exp ')' */
1720#line 257 "f-exp.y"
1722#line 1724 "f-exp.c.tmp"
1723 break;
1724
1725 case 13: /* $@1: %empty */
1726#line 266 "f-exp.y"
1727 { pstate->start_arglist (); }
1728#line 1730 "f-exp.c.tmp"
1729 break;
1730
1731 case 14: /* exp: exp '(' $@1 arglist ')' */
1732#line 268 "f-exp.y"
1733 {
1734 std::vector<operation_up> args
1737 (pstate->pop (), std::move (args));
1738 }
1739#line 1741 "f-exp.c.tmp"
1740 break;
1741
1742 case 15: /* exp: UNOP_INTRINSIC '(' exp ')' */
1743#line 277 "f-exp.y"
1744 {
1745 wrap_unop_intrinsic ((yyvsp[-3].opcode));
1746 }
1747#line 1749 "f-exp.c.tmp"
1748 break;
1749
1750 case 16: /* exp: BINOP_INTRINSIC '(' exp ',' exp ')' */
1751#line 283 "f-exp.y"
1752 {
1753 wrap_binop_intrinsic ((yyvsp[-5].opcode));
1754 }
1755#line 1757 "f-exp.c.tmp"
1756 break;
1757
1758 case 17: /* $@2: %empty */
1759#line 289 "f-exp.y"
1760 { pstate->start_arglist (); }
1761#line 1763 "f-exp.c.tmp"
1762 break;
1763
1764 case 18: /* exp: UNOP_OR_BINOP_INTRINSIC '(' $@2 arglist ')' */
1765#line 291 "f-exp.y"
1766 {
1767 const int n = pstate->end_arglist ();
1768
1769 switch (n)
1770 {
1771 case 1:
1772 wrap_unop_intrinsic ((yyvsp[-4].opcode));
1773 break;
1774 case 2:
1775 wrap_binop_intrinsic ((yyvsp[-4].opcode));
1776 break;
1777 default:
1778 gdb_assert_not_reached
1779 ("wrong number of arguments for intrinsics");
1780 }
1781 }
1782#line 1784 "f-exp.c.tmp"
1783 break;
1784
1785 case 19: /* $@3: %empty */
1786#line 309 "f-exp.y"
1787 { pstate->start_arglist (); }
1788#line 1790 "f-exp.c.tmp"
1789 break;
1790
1791 case 20: /* exp: UNOP_OR_BINOP_OR_TERNOP_INTRINSIC '(' $@3 arglist ')' */
1792#line 311 "f-exp.y"
1793 {
1794 const int n = pstate->end_arglist ();
1795
1796 switch (n)
1797 {
1798 case 1:
1799 wrap_unop_intrinsic ((yyvsp[-4].opcode));
1800 break;
1801 case 2:
1802 wrap_binop_intrinsic ((yyvsp[-4].opcode));
1803 break;
1804 case 3:
1805 wrap_ternop_intrinsic ((yyvsp[-4].opcode));
1806 break;
1807 default:
1808 gdb_assert_not_reached
1809 ("wrong number of arguments for intrinsics");
1810 }
1811 }
1812#line 1814 "f-exp.c.tmp"
1813 break;
1814
1815 case 22: /* arglist: exp */
1816#line 336 "f-exp.y"
1817 { pstate->arglist_len = 1; }
1818#line 1820 "f-exp.c.tmp"
1819 break;
1820
1821 case 23: /* arglist: subrange */
1822#line 340 "f-exp.y"
1823 { pstate->arglist_len = 1; }
1824#line 1826 "f-exp.c.tmp"
1825 break;
1826
1827 case 24: /* arglist: arglist ',' exp */
1828#line 344 "f-exp.y"
1829 { pstate->arglist_len++; }
1830#line 1832 "f-exp.c.tmp"
1831 break;
1832
1833 case 25: /* arglist: arglist ',' subrange */
1834#line 348 "f-exp.y"
1835 { pstate->arglist_len++; }
1836#line 1838 "f-exp.c.tmp"
1837 break;
1838
1839 case 26: /* subrange: exp ':' exp */
1840#line 354 "f-exp.y"
1841 {
1842 operation_up high = pstate->pop ();
1843 operation_up low = pstate->pop ();
1845 (RANGE_STANDARD, std::move (low),
1846 std::move (high), operation_up ());
1847 }
1848#line 1850 "f-exp.c.tmp"
1849 break;
1850
1851 case 27: /* subrange: exp ':' */
1852#line 364 "f-exp.y"
1853 {
1854 operation_up low = pstate->pop ();
1856 (RANGE_HIGH_BOUND_DEFAULT, std::move (low),
1857 operation_up (), operation_up ());
1858 }
1859#line 1861 "f-exp.c.tmp"
1860 break;
1861
1862 case 28: /* subrange: ':' exp */
1863#line 373 "f-exp.y"
1864 {
1865 operation_up high = pstate->pop ();
1868 std::move (high), operation_up ());
1869 }
1870#line 1872 "f-exp.c.tmp"
1871 break;
1872
1873 case 29: /* subrange: ':' */
1874#line 382 "f-exp.y"
1875 {
1880 operation_up ());
1881 }
1882#line 1884 "f-exp.c.tmp"
1883 break;
1884
1885 case 30: /* subrange: exp ':' exp ':' exp */
1886#line 393 "f-exp.y"
1887 {
1888 operation_up stride = pstate->pop ();
1889 operation_up high = pstate->pop ();
1890 operation_up low = pstate->pop ();
1893 std::move (low), std::move (high),
1894 std::move (stride));
1895 }
1896#line 1898 "f-exp.c.tmp"
1897 break;
1898
1899 case 31: /* subrange: exp ':' ':' exp */
1900#line 405 "f-exp.y"
1901 {
1902 operation_up stride = pstate->pop ();
1903 operation_up low = pstate->pop ();
1907 std::move (low), operation_up (),
1908 std::move (stride));
1909 }
1910#line 1912 "f-exp.c.tmp"
1911 break;
1912
1913 case 32: /* subrange: ':' exp ':' exp */
1914#line 417 "f-exp.y"
1915 {
1916 operation_up stride = pstate->pop ();
1917 operation_up high = pstate->pop ();
1921 operation_up (), std::move (high),
1922 std::move (stride));
1923 }
1924#line 1926 "f-exp.c.tmp"
1925 break;
1926
1927 case 33: /* subrange: ':' ':' exp */
1928#line 429 "f-exp.y"
1929 {
1930 operation_up stride = pstate->pop ();
1936 std::move (stride));
1937 }
1938#line 1940 "f-exp.c.tmp"
1939 break;
1940
1941 case 34: /* complexnum: exp ',' exp */
1942#line 441 "f-exp.y"
1943 { }
1944#line 1946 "f-exp.c.tmp"
1945 break;
1946
1947 case 35: /* exp: '(' complexnum ')' */
1948#line 445 "f-exp.y"
1949 {
1950 operation_up rhs = pstate->pop ();
1951 operation_up lhs = pstate->pop ();
1953 (std::move (lhs), std::move (rhs),
1954 parse_f_type (pstate)->builtin_complex_s16);
1955 }
1956#line 1958 "f-exp.c.tmp"
1957 break;
1958
1959 case 36: /* exp: '(' type ')' exp */
1960#line 455 "f-exp.y"
1961 {
1963 (pstate->pop (), (yyvsp[-2].tval));
1964 }
1965#line 1967 "f-exp.c.tmp"
1966 break;
1967
1968 case 37: /* exp: exp '%' name */
1969#line 462 "f-exp.y"
1970 {
1972 (pstate->pop (), copy_name ((yyvsp[0].sval)));
1973 }
1974#line 1976 "f-exp.c.tmp"
1975 break;
1976
1977 case 38: /* exp: exp '%' name COMPLETE */
1978#line 469 "f-exp.y"
1979 {
1982 copy_name ((yyvsp[-1].sval)));
1984 pstate->push (operation_up (op));
1985 }
1986#line 1988 "f-exp.c.tmp"
1987 break;
1988
1989 case 39: /* exp: exp '%' COMPLETE */
1990#line 479 "f-exp.y"
1991 {
1994 "");
1996 pstate->push (operation_up (op));
1997 }
1998#line 2000 "f-exp.c.tmp"
1999 break;
2000
2001 case 40: /* exp: exp '@' exp */
2002#line 491 "f-exp.y"
2003 { pstate->wrap2<repeat_operation> (); }
2004#line 2006 "f-exp.c.tmp"
2005 break;
2006
2007 case 41: /* exp: exp STARSTAR exp */
2008#line 495 "f-exp.y"
2009 { pstate->wrap2<exp_operation> (); }
2010#line 2012 "f-exp.c.tmp"
2011 break;
2012
2013 case 42: /* exp: exp '*' exp */
2014#line 499 "f-exp.y"
2015 { pstate->wrap2<mul_operation> (); }
2016#line 2018 "f-exp.c.tmp"
2017 break;
2018
2019 case 43: /* exp: exp '/' exp */
2020#line 503 "f-exp.y"
2021 { pstate->wrap2<div_operation> (); }
2022#line 2024 "f-exp.c.tmp"
2023 break;
2024
2025 case 44: /* exp: exp '+' exp */
2026#line 507 "f-exp.y"
2027 { pstate->wrap2<add_operation> (); }
2028#line 2030 "f-exp.c.tmp"
2029 break;
2030
2031 case 45: /* exp: exp '-' exp */
2032#line 511 "f-exp.y"
2033 { pstate->wrap2<sub_operation> (); }
2034#line 2036 "f-exp.c.tmp"
2035 break;
2036
2037 case 46: /* exp: exp LSH exp */
2038#line 515 "f-exp.y"
2039 { pstate->wrap2<lsh_operation> (); }
2040#line 2042 "f-exp.c.tmp"
2041 break;
2042
2043 case 47: /* exp: exp RSH exp */
2044#line 519 "f-exp.y"
2045 { pstate->wrap2<rsh_operation> (); }
2046#line 2048 "f-exp.c.tmp"
2047 break;
2048
2049 case 48: /* exp: exp EQUAL exp */
2050#line 523 "f-exp.y"
2051 { pstate->wrap2<equal_operation> (); }
2052#line 2054 "f-exp.c.tmp"
2053 break;
2054
2055 case 49: /* exp: exp NOTEQUAL exp */
2056#line 527 "f-exp.y"
2058#line 2060 "f-exp.c.tmp"
2059 break;
2060
2061 case 50: /* exp: exp LEQ exp */
2062#line 531 "f-exp.y"
2063 { pstate->wrap2<leq_operation> (); }
2064#line 2066 "f-exp.c.tmp"
2065 break;
2066
2067 case 51: /* exp: exp GEQ exp */
2068#line 535 "f-exp.y"
2069 { pstate->wrap2<geq_operation> (); }
2070#line 2072 "f-exp.c.tmp"
2071 break;
2072
2073 case 52: /* exp: exp LESSTHAN exp */
2074#line 539 "f-exp.y"
2075 { pstate->wrap2<less_operation> (); }
2076#line 2078 "f-exp.c.tmp"
2077 break;
2078
2079 case 53: /* exp: exp GREATERTHAN exp */
2080#line 543 "f-exp.y"
2081 { pstate->wrap2<gtr_operation> (); }
2082#line 2084 "f-exp.c.tmp"
2083 break;
2084
2085 case 54: /* exp: exp '&' exp */
2086#line 547 "f-exp.y"
2088#line 2090 "f-exp.c.tmp"
2089 break;
2090
2091 case 55: /* exp: exp '^' exp */
2092#line 551 "f-exp.y"
2094#line 2096 "f-exp.c.tmp"
2095 break;
2096
2097 case 56: /* exp: exp '|' exp */
2098#line 555 "f-exp.y"
2100#line 2102 "f-exp.c.tmp"
2101 break;
2102
2103 case 57: /* exp: exp BOOL_AND exp */
2104#line 559 "f-exp.y"
2106#line 2108 "f-exp.c.tmp"
2107 break;
2108
2109 case 58: /* exp: exp BOOL_OR exp */
2110#line 564 "f-exp.y"
2112#line 2114 "f-exp.c.tmp"
2113 break;
2114
2115 case 59: /* exp: exp '=' exp */
2116#line 568 "f-exp.y"
2117 { pstate->wrap2<assign_operation> (); }
2118#line 2120 "f-exp.c.tmp"
2119 break;
2120
2121 case 60: /* exp: exp ASSIGN_MODIFY exp */
2122#line 572 "f-exp.y"
2123 {
2124 operation_up rhs = pstate->pop ();
2125 operation_up lhs = pstate->pop ();
2127 ((yyvsp[-1].opcode), std::move (lhs), std::move (rhs));
2128 }
2129#line 2131 "f-exp.c.tmp"
2130 break;
2131
2132 case 61: /* exp: INT */
2133#line 581 "f-exp.y"
2134 {
2136 ((yyvsp[0].typed_val).type, (yyvsp[0].typed_val).val);
2137 }
2138#line 2140 "f-exp.c.tmp"
2139 break;
2140
2141 case 62: /* exp: NAME_OR_INT */
2142#line 588 "f-exp.y"
2143 { f_exp_YYSTYPE val;
2144 parse_number (pstate, (yyvsp[0].ssym).stoken.ptr,
2145 (yyvsp[0].ssym).stoken.length, 0, &val);
2147 (val.typed_val.type,
2148 val.typed_val.val);
2149 }
2150#line 2152 "f-exp.c.tmp"
2151 break;
2152
2153 case 63: /* exp: FLOAT */
2154#line 598 "f-exp.y"
2155 {
2156 float_data data;
2157 std::copy (std::begin ((yyvsp[0].typed_val_float).val), std::end ((yyvsp[0].typed_val_float).val),
2158 std::begin (data));
2159 pstate->push_new<float_const_operation> ((yyvsp[0].typed_val_float).type, data);
2160 }
2161#line 2163 "f-exp.c.tmp"
2162 break;
2163
2164 case 65: /* exp: DOLLAR_VARIABLE */
2165#line 610 "f-exp.y"
2166 { pstate->push_dollar ((yyvsp[0].sval)); }
2167#line 2169 "f-exp.c.tmp"
2168 break;
2169
2170 case 66: /* exp: SIZEOF '(' type ')' */
2171#line 614 "f-exp.y"
2172 {
2173 (yyvsp[-1].tval) = check_typedef ((yyvsp[-1].tval));
2175 (parse_f_type (pstate)->builtin_integer,
2176 (yyvsp[-1].tval)->length ());
2177 }
2178#line 2180 "f-exp.c.tmp"
2179 break;
2180
2181 case 67: /* exp: BOOLEAN_LITERAL */
2182#line 623 "f-exp.y"
2183 { pstate->push_new<bool_operation> ((yyvsp[0].lval)); }
2184#line 2186 "f-exp.c.tmp"
2185 break;
2186
2187 case 68: /* exp: STRING_LITERAL */
2188#line 627 "f-exp.y"
2189 {
2191 (copy_name ((yyvsp[0].sval)));
2192 }
2193#line 2195 "f-exp.c.tmp"
2194 break;
2195
2196 case 69: /* variable: name_not_typename */
2197#line 634 "f-exp.y"
2198 { struct block_symbol sym = (yyvsp[0].ssym).sym;
2199 std::string name = copy_name ((yyvsp[0].ssym).stoken);
2200 pstate->push_symbol (name.c_str (), sym);
2201 }
2202#line 2204 "f-exp.c.tmp"
2203 break;
2204
2205 case 72: /* ptype: typebase abs_decl */
2206#line 646 "f-exp.y"
2207 {
2208 /* This is where the interesting stuff happens. */
2209 int done = 0;
2210 int array_size;
2211 struct type *follow_type = (yyvsp[-1].tval);
2212 struct type *range_type;
2213
2214 while (!done)
2215 switch (type_stack->pop ())
2216 {
2217 case tp_end:
2218 done = 1;
2219 break;
2220 case tp_pointer:
2221 follow_type = lookup_pointer_type (follow_type);
2222 break;
2223 case tp_reference:
2224 follow_type = lookup_lvalue_reference_type (follow_type);
2225 break;
2226 case tp_array:
2227 array_size = type_stack->pop_int ();
2228 if (array_size != -1)
2229 {
2230 struct type *idx_type
2231 = parse_f_type (pstate)->builtin_integer;
2232 type_allocator alloc (idx_type);
2233 range_type =
2234 create_static_range_type (alloc, idx_type,
2235 0, array_size - 1);
2236 follow_type = create_array_type (alloc,
2237 follow_type,
2238 range_type);
2239 }
2240 else
2241 follow_type = lookup_pointer_type (follow_type);
2242 break;
2243 case tp_function:
2244 follow_type = lookup_function_type (follow_type);
2245 break;
2246 case tp_kind:
2247 {
2248 int kind_val = type_stack->pop_int ();
2249 follow_type
2250 = convert_to_kind_type (follow_type, kind_val);
2251 }
2252 break;
2253 }
2254 (yyval.tval) = follow_type;
2255 }
2256#line 2258 "f-exp.c.tmp"
2257 break;
2258
2259 case 73: /* abs_decl: '*' */
2260#line 698 "f-exp.y"
2261 { type_stack->push (tp_pointer); (yyval.voidval) = 0; }
2262#line 2264 "f-exp.c.tmp"
2263 break;
2264
2265 case 74: /* abs_decl: '*' abs_decl */
2266#line 700 "f-exp.y"
2267 { type_stack->push (tp_pointer); (yyval.voidval) = (yyvsp[0].voidval); }
2268#line 2270 "f-exp.c.tmp"
2269 break;
2270
2271 case 75: /* abs_decl: '&' */
2272#line 702 "f-exp.y"
2273 { type_stack->push (tp_reference); (yyval.voidval) = 0; }
2274#line 2276 "f-exp.c.tmp"
2275 break;
2276
2277 case 76: /* abs_decl: '&' abs_decl */
2278#line 704 "f-exp.y"
2279 { type_stack->push (tp_reference); (yyval.voidval) = (yyvsp[0].voidval); }
2280#line 2282 "f-exp.c.tmp"
2281 break;
2282
2283 case 78: /* direct_abs_decl: '(' abs_decl ')' */
2284#line 709 "f-exp.y"
2285 { (yyval.voidval) = (yyvsp[-1].voidval); }
2286#line 2288 "f-exp.c.tmp"
2287 break;
2288
2289 case 79: /* direct_abs_decl: '(' KIND '=' INT ')' */
2290#line 711 "f-exp.y"
2291 { push_kind_type ((yyvsp[-1].typed_val).val, (yyvsp[-1].typed_val).type); }
2292#line 2294 "f-exp.c.tmp"
2293 break;
2294
2295 case 80: /* direct_abs_decl: '*' INT */
2296#line 713 "f-exp.y"
2297 { push_kind_type ((yyvsp[0].typed_val).val, (yyvsp[0].typed_val).type); }
2298#line 2300 "f-exp.c.tmp"
2299 break;
2300
2301 case 81: /* direct_abs_decl: direct_abs_decl func_mod */
2302#line 715 "f-exp.y"
2304#line 2306 "f-exp.c.tmp"
2305 break;
2306
2307 case 82: /* direct_abs_decl: func_mod */
2308#line 717 "f-exp.y"
2310#line 2312 "f-exp.c.tmp"
2311 break;
2312
2313 case 83: /* func_mod: '(' ')' */
2314#line 721 "f-exp.y"
2315 { (yyval.voidval) = 0; }
2316#line 2318 "f-exp.c.tmp"
2317 break;
2318
2319 case 84: /* func_mod: '(' nonempty_typelist ')' */
2320#line 723 "f-exp.y"
2321 { xfree ((yyvsp[-1].tvec)); (yyval.voidval) = 0; }
2322#line 2324 "f-exp.c.tmp"
2323 break;
2324
2325 case 85: /* typebase: TYPENAME */
2326#line 728 "f-exp.y"
2327 { (yyval.tval) = (yyvsp[0].tsym).type; }
2328#line 2330 "f-exp.c.tmp"
2329 break;
2330
2331 case 86: /* typebase: INT_S1_KEYWORD */
2332#line 730 "f-exp.y"
2333 { (yyval.tval) = parse_f_type (pstate)->builtin_integer_s1; }
2334#line 2336 "f-exp.c.tmp"
2335 break;
2336
2337 case 87: /* typebase: INT_S2_KEYWORD */
2338#line 732 "f-exp.y"
2339 { (yyval.tval) = parse_f_type (pstate)->builtin_integer_s2; }
2340#line 2342 "f-exp.c.tmp"
2341 break;
2342
2343 case 88: /* typebase: INT_KEYWORD */
2344#line 734 "f-exp.y"
2345 { (yyval.tval) = parse_f_type (pstate)->builtin_integer; }
2346#line 2348 "f-exp.c.tmp"
2347 break;
2348
2349 case 89: /* typebase: INT_S4_KEYWORD */
2350#line 736 "f-exp.y"
2351 { (yyval.tval) = parse_f_type (pstate)->builtin_integer; }
2352#line 2354 "f-exp.c.tmp"
2353 break;
2354
2355 case 90: /* typebase: INT_S8_KEYWORD */
2356#line 738 "f-exp.y"
2357 { (yyval.tval) = parse_f_type (pstate)->builtin_integer_s8; }
2358#line 2360 "f-exp.c.tmp"
2359 break;
2360
2361 case 91: /* typebase: CHARACTER */
2362#line 740 "f-exp.y"
2363 { (yyval.tval) = parse_f_type (pstate)->builtin_character; }
2364#line 2366 "f-exp.c.tmp"
2365 break;
2366
2367 case 92: /* typebase: LOGICAL_S1_KEYWORD */
2368#line 742 "f-exp.y"
2369 { (yyval.tval) = parse_f_type (pstate)->builtin_logical_s1; }
2370#line 2372 "f-exp.c.tmp"
2371 break;
2372
2373 case 93: /* typebase: LOGICAL_S2_KEYWORD */
2374#line 744 "f-exp.y"
2375 { (yyval.tval) = parse_f_type (pstate)->builtin_logical_s2; }
2376#line 2378 "f-exp.c.tmp"
2377 break;
2378
2379 case 94: /* typebase: LOGICAL_KEYWORD */
2380#line 746 "f-exp.y"
2381 { (yyval.tval) = parse_f_type (pstate)->builtin_logical; }
2382#line 2384 "f-exp.c.tmp"
2383 break;
2384
2385 case 95: /* typebase: LOGICAL_S4_KEYWORD */
2386#line 748 "f-exp.y"
2387 { (yyval.tval) = parse_f_type (pstate)->builtin_logical; }
2388#line 2390 "f-exp.c.tmp"
2389 break;
2390
2391 case 96: /* typebase: LOGICAL_S8_KEYWORD */
2392#line 750 "f-exp.y"
2393 { (yyval.tval) = parse_f_type (pstate)->builtin_logical_s8; }
2394#line 2396 "f-exp.c.tmp"
2395 break;
2396
2397 case 97: /* typebase: REAL_KEYWORD */
2398#line 752 "f-exp.y"
2399 { (yyval.tval) = parse_f_type (pstate)->builtin_real; }
2400#line 2402 "f-exp.c.tmp"
2401 break;
2402
2403 case 98: /* typebase: REAL_S4_KEYWORD */
2404#line 754 "f-exp.y"
2405 { (yyval.tval) = parse_f_type (pstate)->builtin_real; }
2406#line 2408 "f-exp.c.tmp"
2407 break;
2408
2409 case 99: /* typebase: REAL_S8_KEYWORD */
2410#line 756 "f-exp.y"
2411 { (yyval.tval) = parse_f_type (pstate)->builtin_real_s8; }
2412#line 2414 "f-exp.c.tmp"
2413 break;
2414
2415 case 100: /* typebase: REAL_S16_KEYWORD */
2416#line 758 "f-exp.y"
2417 { (yyval.tval) = parse_f_type (pstate)->builtin_real_s16; }
2418#line 2420 "f-exp.c.tmp"
2419 break;
2420
2421 case 101: /* typebase: COMPLEX_KEYWORD */
2422#line 760 "f-exp.y"
2423 { (yyval.tval) = parse_f_type (pstate)->builtin_complex; }
2424#line 2426 "f-exp.c.tmp"
2425 break;
2426
2427 case 102: /* typebase: COMPLEX_S4_KEYWORD */
2428#line 762 "f-exp.y"
2429 { (yyval.tval) = parse_f_type (pstate)->builtin_complex; }
2430#line 2432 "f-exp.c.tmp"
2431 break;
2432
2433 case 103: /* typebase: COMPLEX_S8_KEYWORD */
2434#line 764 "f-exp.y"
2435 { (yyval.tval) = parse_f_type (pstate)->builtin_complex_s8; }
2436#line 2438 "f-exp.c.tmp"
2437 break;
2438
2439 case 104: /* typebase: COMPLEX_S16_KEYWORD */
2440#line 766 "f-exp.y"
2441 { (yyval.tval) = parse_f_type (pstate)->builtin_complex_s16; }
2442#line 2444 "f-exp.c.tmp"
2443 break;
2444
2445 case 105: /* typebase: SINGLE PRECISION */
2446#line 768 "f-exp.y"
2447 { (yyval.tval) = parse_f_type (pstate)->builtin_real;}
2448#line 2450 "f-exp.c.tmp"
2449 break;
2450
2451 case 106: /* typebase: DOUBLE PRECISION */
2452#line 770 "f-exp.y"
2453 { (yyval.tval) = parse_f_type (pstate)->builtin_real_s8;}
2454#line 2456 "f-exp.c.tmp"
2455 break;
2456
2457 case 107: /* typebase: SINGLE COMPLEX_KEYWORD */
2458#line 772 "f-exp.y"
2459 { (yyval.tval) = parse_f_type (pstate)->builtin_complex;}
2460#line 2462 "f-exp.c.tmp"
2461 break;
2462
2463 case 108: /* typebase: DOUBLE COMPLEX_KEYWORD */
2464#line 774 "f-exp.y"
2465 { (yyval.tval) = parse_f_type (pstate)->builtin_complex_s8;}
2466#line 2468 "f-exp.c.tmp"
2467 break;
2468
2469 case 109: /* nonempty_typelist: type */
2470#line 779 "f-exp.y"
2471 { (yyval.tvec) = (struct type **) xmalloc (sizeof (struct type *) * 2);
2472 (yyval.ivec)[0] = 1; /* Number of types in vector */
2473 (yyval.tvec)[1] = (yyvsp[0].tval);
2474 }
2475#line 2477 "f-exp.c.tmp"
2476 break;
2477
2478 case 110: /* nonempty_typelist: nonempty_typelist ',' type */
2479#line 784 "f-exp.y"
2480 { int len = sizeof (struct type *) * (++((yyvsp[-2].ivec)[0]) + 1);
2481 (yyval.tvec) = (struct type **) xrealloc ((char *) (yyvsp[-2].tvec), len);
2482 (yyval.tvec)[(yyval.ivec)[0]] = (yyvsp[0].tval);
2483 }
2484#line 2486 "f-exp.c.tmp"
2485 break;
2486
2487 case 111: /* name: NAME */
2488#line 792 "f-exp.y"
2489 { (yyval.sval) = (yyvsp[0].ssym).stoken; }
2490#line 2492 "f-exp.c.tmp"
2491 break;
2492
2493 case 112: /* name: TYPENAME */
2494#line 794 "f-exp.y"
2495 { (yyval.sval) = (yyvsp[0].tsym).stoken; }
2496#line 2498 "f-exp.c.tmp"
2497 break;
2498
2499
2500#line 2502 "f-exp.c.tmp"
2501
2502 default: break;
2503 }
2504 /* User semantic actions sometimes alter yychar, and that requires
2505 that yytoken be updated with the new translation. We take the
2506 approach of translating immediately before every use of yytoken.
2507 One alternative is translating here after every semantic action,
2508 but that translation would be missed if the semantic action invokes
2509 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2510 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2511 incorrect destructor might then be invoked immediately. In the
2512 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2513 to an incorrect destructor call or verbose syntax error message
2514 before the lookahead is translated. */
2515 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (f_exp_yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2516
2517 YYPOPSTACK (yylen);
2518 yylen = 0;
2519
2520 *++yyvsp = yyval;
2521
2522 /* Now 'shift' the result of the reduction. Determine what state
2523 that goes to, based on the state we popped back to and the rule
2524 number reduced by. */
2525 {
2526 const int yylhs = yyr1[yyn] - YYNTOKENS;
2527 const int yyi = yypgoto[yylhs] + *yyssp;
2528 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2529 ? yytable[yyi]
2530 : yydefgoto[yylhs]);
2531 }
2532
2533 goto yynewstate;
2534
2535
2536/*--------------------------------------.
2537| yyerrlab -- here on detecting error. |
2538`--------------------------------------*/
2539yyerrlab:
2540 /* Make sure we have latest lookahead translation. See comments at
2541 user semantic actions for why this is necessary. */
2543 /* If not already recovering from an error, report this error. */
2544 if (!yyerrstatus)
2545 {
2546 ++yynerrs;
2547 yyerror (YY_("syntax error"));
2548 }
2549
2550 if (yyerrstatus == 3)
2551 {
2552 /* If just tried and failed to reuse lookahead token after an
2553 error, discard it. */
2554
2555 if (yychar <= YYEOF)
2556 {
2557 /* Return failure if at end of input. */
2558 if (yychar == YYEOF)
2559 YYABORT;
2560 }
2561 else
2562 {
2563 yydestruct ("Error: discarding",
2564 yytoken, &yylval);
2565 yychar = YYEMPTY;
2566 }
2567 }
2568
2569 /* Else will try to reuse lookahead token after shifting the error
2570 token. */
2571 goto yyerrlab1;
2572
2573
2574/*---------------------------------------------------.
2575| yyerrorlab -- error raised explicitly by YYERROR. |
2576`---------------------------------------------------*/
2577yyerrorlab:
2578 /* Pacify compilers when the user code never invokes YYERROR and the
2579 label yyerrorlab therefore never appears in user code. */
2580 if (0)
2581 YYERROR;
2582 ++yynerrs;
2583
2584 /* Do not reclaim the symbols of the rule whose action triggered
2585 this YYERROR. */
2586 YYPOPSTACK (yylen);
2587 yylen = 0;
2589 yystate = *yyssp;
2590 goto yyerrlab1;
2591
2592
2593/*-------------------------------------------------------------.
2594| yyerrlab1 -- common code for both syntax error and YYERROR. |
2595`-------------------------------------------------------------*/
2596yyerrlab1:
2597 yyerrstatus = 3; /* Each real token shifted decrements this. */
2598
2599 /* Pop stack until we find a state that shifts the error token. */
2600 for (;;)
2601 {
2602 yyn = yypact[yystate];
2603 if (!yypact_value_is_default (yyn))
2604 {
2605 yyn += YYSYMBOL_YYerror;
2606 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2607 {
2608 yyn = yytable[yyn];
2609 if (0 < yyn)
2610 break;
2611 }
2612 }
2613
2614 /* Pop the current state because it cannot handle the error token. */
2615 if (yyssp == yyss)
2616 YYABORT;
2617
2618
2619 yydestruct ("Error: popping",
2621 YYPOPSTACK (1);
2622 yystate = *yyssp;
2624 }
2625
2627 *++yyvsp = yylval;
2629
2630
2631 /* Shift the error token. */
2632 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2633
2634 yystate = yyn;
2635 goto yynewstate;
2636
2637
2638/*-------------------------------------.
2639| yyacceptlab -- YYACCEPT comes here. |
2640`-------------------------------------*/
2641yyacceptlab:
2642 yyresult = 0;
2643 goto yyreturnlab;
2644
2645
2646/*-----------------------------------.
2647| yyabortlab -- YYABORT comes here. |
2648`-----------------------------------*/
2649yyabortlab:
2650 yyresult = 1;
2651 goto yyreturnlab;
2652
2653
2654/*-----------------------------------------------------------.
2655| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2656`-----------------------------------------------------------*/
2657yyexhaustedlab:
2658 yyerror (YY_("memory exhausted"));
2659 yyresult = 2;
2660 goto yyreturnlab;
2661
2662
2663/*----------------------------------------------------------.
2664| yyreturnlab -- parsing is finished, clean up and return. |
2665`----------------------------------------------------------*/
2666yyreturnlab:
2667 if (yychar != YYEMPTY)
2668 {
2669 /* Make sure we have latest lookahead translation. See comments at
2670 user semantic actions for why this is necessary. */
2671 yytoken = YYTRANSLATE (yychar);
2672 yydestruct ("Cleanup: discarding lookahead",
2673 yytoken, &yylval);
2674 }
2675 /* Do not reclaim the symbols of the rule whose action triggered
2676 this YYABORT or YYACCEPT. */
2677 YYPOPSTACK (yylen);
2679 while (yyssp != yyss)
2680 {
2681 yydestruct ("Cleanup: popping",
2683 YYPOPSTACK (1);
2684 }
2685#ifndef yyoverflow
2686 if (yyss != yyssa)
2688#endif
2689
2690 return yyresult;
2691}
2692
2693#line 807 "f-exp.y"
2694
2695
2696/* Called to match intrinsic function calls with one argument to their
2697 respective implementation and push the operation. */
2698
2699static void
2701{
2702 switch (code)
2703 {
2704 case UNOP_ABS:
2706 break;
2707 case FORTRAN_FLOOR:
2709 break;
2710 case FORTRAN_CEILING:
2712 break;
2713 case UNOP_FORTRAN_ALLOCATED:
2715 break;
2716 case UNOP_FORTRAN_RANK:
2718 break;
2719 case UNOP_FORTRAN_SHAPE:
2721 break;
2722 case UNOP_FORTRAN_LOC:
2724 break;
2725 case FORTRAN_ASSOCIATED:
2727 break;
2728 case FORTRAN_ARRAY_SIZE:
2730 break;
2731 case FORTRAN_CMPLX:
2733 break;
2734 case FORTRAN_LBOUND:
2735 case FORTRAN_UBOUND:
2737 break;
2738 default:
2739 gdb_assert_not_reached ("unhandled intrinsic");
2740 }
2741}
2742
2743/* Called to match intrinsic function calls with two arguments to their
2744 respective implementation and push the operation. */
2745
2746static void
2748{
2749 switch (code)
2750 {
2751 case FORTRAN_FLOOR:
2752 fortran_wrap2_kind<fortran_floor_operation_2arg>
2753 (parse_f_type (pstate)->builtin_integer);
2754 break;
2755 case FORTRAN_CEILING:
2756 fortran_wrap2_kind<fortran_ceil_operation_2arg>
2757 (parse_f_type (pstate)->builtin_integer);
2758 break;
2759 case BINOP_MOD:
2761 break;
2762 case BINOP_FORTRAN_MODULO:
2764 break;
2765 case FORTRAN_CMPLX:
2767 break;
2768 case FORTRAN_ASSOCIATED:
2770 break;
2771 case FORTRAN_ARRAY_SIZE:
2773 break;
2774 case FORTRAN_LBOUND:
2775 case FORTRAN_UBOUND:
2776 {
2777 operation_up arg2 = pstate->pop ();
2778 operation_up arg1 = pstate->pop ();
2779 pstate->push_new<fortran_bound_2arg> (code, std::move (arg1),
2780 std::move (arg2));
2781 }
2782 break;
2783 default:
2784 gdb_assert_not_reached ("unhandled intrinsic");
2785 }
2786}
2787
2788/* Called to match intrinsic function calls with three arguments to their
2789 respective implementation and push the operation. */
2790
2791static void
2793{
2794 switch (code)
2795 {
2796 case FORTRAN_LBOUND:
2797 case FORTRAN_UBOUND:
2798 {
2799 operation_up kind_arg = pstate->pop ();
2800 operation_up arg2 = pstate->pop ();
2801 operation_up arg1 = pstate->pop ();
2802
2803 value *val = kind_arg->evaluate (nullptr, pstate->expout.get (),
2805 gdb_assert (val != nullptr);
2806
2807 type *follow_type
2808 = convert_to_kind_type (parse_f_type (pstate)->builtin_integer,
2809 value_as_long (val));
2810
2811 pstate->push_new<fortran_bound_3arg> (code, std::move (arg1),
2812 std::move (arg2), follow_type);
2813 }
2814 break;
2815 case FORTRAN_ARRAY_SIZE:
2816 fortran_wrap3_kind<fortran_array_size_3arg>
2817 (parse_f_type (pstate)->builtin_integer);
2818 break;
2819 case FORTRAN_CMPLX:
2820 fortran_wrap3_kind<fortran_cmplx_operation_3arg>
2821 (parse_f_type (pstate)->builtin_complex);
2822 break;
2823 default:
2824 gdb_assert_not_reached ("unhandled intrinsic");
2825 }
2826}
2827
2828/* A helper that pops two operations (similar to wrap2), evaluates the last one
2829 assuming it is a kind parameter, and wraps them in some other operation
2830 pushing it to the stack. */
2831
2832template<typename T>
2833static void
2835{
2836 operation_up kind_arg = pstate->pop ();
2837 operation_up arg = pstate->pop ();
2838
2839 value *val = kind_arg->evaluate (nullptr, pstate->expout.get (),
2841 gdb_assert (val != nullptr);
2842
2843 type *follow_type = convert_to_kind_type (base_type, value_as_long (val));
2844
2845 pstate->push_new<T> (std::move (arg), follow_type);
2846}
2847
2848/* A helper that pops three operations, evaluates the last one assuming it is a
2849 kind parameter, and wraps them in some other operation pushing it to the
2850 stack. */
2851
2852template<typename T>
2853static void
2855{
2856 operation_up kind_arg = pstate->pop ();
2857 operation_up arg2 = pstate->pop ();
2858 operation_up arg1 = pstate->pop ();
2859
2860 value *val = kind_arg->evaluate (nullptr, pstate->expout.get (),
2862 gdb_assert (val != nullptr);
2863
2864 type *follow_type = convert_to_kind_type (base_type, value_as_long (val));
2865
2866 pstate->push_new<T> (std::move (arg1), std::move (arg2), follow_type);
2867}
2868
2869/* Take care of parsing a number (anything that starts with a digit).
2870 Set yylval and return the token type; update lexptr.
2871 LEN is the number of characters in it. */
2872
2873/*** Needs some error checking for the float case ***/
2874
2875static int
2876parse_number (struct parser_state *par_state,
2877 const char *p, int len, int parsed_float, f_exp_YYSTYPE *putithere)
2878{
2879 ULONGEST n = 0;
2880 ULONGEST prevn = 0;
2881 int c;
2882 int base = input_radix;
2883 int unsigned_p = 0;
2884 int long_p = 0;
2885 ULONGEST high_bit;
2886 struct type *signed_type;
2887 struct type *unsigned_type;
2888
2889 if (parsed_float)
2890 {
2891 /* It's a float since it contains a point or an exponent. */
2892 /* [dD] is not understood as an exponent by parse_float,
2893 change it to 'e'. */
2894 char *tmp, *tmp2;
2895
2896 tmp = xstrdup (p);
2897 for (tmp2 = tmp; *tmp2; ++tmp2)
2898 if (*tmp2 == 'd' || *tmp2 == 'D')
2899 *tmp2 = 'e';
2900
2901 /* FIXME: Should this use different types? */
2902 putithere->typed_val_float.type = parse_f_type (pstate)->builtin_real_s8;
2903 bool parsed = parse_float (tmp, len,
2904 putithere->typed_val_float.type,
2905 putithere->typed_val_float.val);
2906 xfree (tmp);
2907 return parsed? FLOAT : ERROR;
2908 }
2909
2910 /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
2911 if (p[0] == '0' && len > 1)
2912 switch (p[1])
2913 {
2914 case 'x':
2915 case 'X':
2916 if (len >= 3)
2917 {
2918 p += 2;
2919 base = 16;
2920 len -= 2;
2921 }
2922 break;
2923
2924 case 't':
2925 case 'T':
2926 case 'd':
2927 case 'D':
2928 if (len >= 3)
2929 {
2930 p += 2;
2931 base = 10;
2932 len -= 2;
2933 }
2934 break;
2935
2936 default:
2937 base = 8;
2938 break;
2939 }
2940
2941 while (len-- > 0)
2942 {
2943 c = *p++;
2944 if (isupper (c))
2945 c = tolower (c);
2946 if (len == 0 && c == 'l')
2947 long_p = 1;
2948 else if (len == 0 && c == 'u')
2949 unsigned_p = 1;
2950 else
2951 {
2952 int i;
2953 if (c >= '0' && c <= '9')
2954 i = c - '0';
2955 else if (c >= 'a' && c <= 'f')
2956 i = c - 'a' + 10;
2957 else
2958 return ERROR; /* Char not a digit */
2959 if (i >= base)
2960 return ERROR; /* Invalid digit in this base */
2961 n *= base;
2962 n += i;
2963 }
2964 /* Test for overflow. */
2965 if (prevn == 0 && n == 0)
2966 ;
2967 else if (RANGE_CHECK && prevn >= n)
2968 range_error (_("Overflow on numeric constant."));
2969 prevn = n;
2970 }
2971
2972 /* If the number is too big to be an int, or it's got an l suffix
2973 then it's a long. Work out if this has to be a long by
2974 shifting right and seeing if anything remains, and the
2975 target int size is different to the target long size.
2976
2977 In the expression below, we could have tested
2978 (n >> gdbarch_int_bit (parse_gdbarch))
2979 to see if it was zero,
2980 but too many compilers warn about that, when ints and longs
2981 are the same size. So we shift it twice, with fewer bits
2982 each time, for the same result. */
2983
2984 int bits_available;
2985 if ((gdbarch_int_bit (par_state->gdbarch ())
2986 != gdbarch_long_bit (par_state->gdbarch ())
2987 && ((n >> 2)
2988 >> (gdbarch_int_bit (par_state->gdbarch ())-2))) /* Avoid
2989 shift warning */
2990 || long_p)
2991 {
2992 bits_available = gdbarch_long_bit (par_state->gdbarch ());
2993 unsigned_type = parse_type (par_state)->builtin_unsigned_long;
2994 signed_type = parse_type (par_state)->builtin_long;
2995 }
2996 else
2997 {
2998 bits_available = gdbarch_int_bit (par_state->gdbarch ());
2999 unsigned_type = parse_type (par_state)->builtin_unsigned_int;
3000 signed_type = parse_type (par_state)->builtin_int;
3001 }
3002 high_bit = ((ULONGEST)1) << (bits_available - 1);
3003
3004 if (RANGE_CHECK
3005 && ((n >> 2) >> (bits_available - 2)))
3006 range_error (_("Overflow on numeric constant."));
3007
3008 putithere->typed_val.val = n;
3009
3010 /* If the high bit of the worked out type is set then this number
3011 has to be unsigned. */
3012
3013 if (unsigned_p || (n & high_bit))
3014 putithere->typed_val.type = unsigned_type;
3015 else
3016 putithere->typed_val.type = signed_type;
3017
3018 return INT;
3019}
3020
3021/* Called to setup the type stack when we encounter a '(kind=N)' type
3022 modifier, performs some bounds checking on 'N' and then pushes this to
3023 the type stack followed by the 'tp_kind' marker. */
3024static void
3025push_kind_type (LONGEST val, struct type *type)
3026{
3027 int ival;
3028
3029 if (type->is_unsigned ())
3030 {
3031 ULONGEST uval = static_cast <ULONGEST> (val);
3032 if (uval > INT_MAX)
3033 error (_("kind value out of range"));
3034 ival = static_cast <int> (uval);
3035 }
3036 else
3037 {
3038 if (val > INT_MAX || val < 0)
3039 error (_("kind value out of range"));
3040 ival = static_cast <int> (val);
3041 }
3042
3043 type_stack->push (ival);
3045}
3046
3047/* Called when a type has a '(kind=N)' modifier after it, for example
3048 'character(kind=1)'. The BASETYPE is the type described by 'character'
3049 in our example, and KIND is the integer '1'. This function returns a
3050 new type that represents the basetype of a specific kind. */
3051static struct type *
3052convert_to_kind_type (struct type *basetype, int kind)
3053{
3054 if (basetype == parse_f_type (pstate)->builtin_character)
3055 {
3056 /* Character of kind 1 is a special case, this is the same as the
3057 base character type. */
3058 if (kind == 1)
3059 return parse_f_type (pstate)->builtin_character;
3060 }
3061 else if (basetype == parse_f_type (pstate)->builtin_complex)
3062 {
3063 if (kind == 4)
3064 return parse_f_type (pstate)->builtin_complex;
3065 else if (kind == 8)
3066 return parse_f_type (pstate)->builtin_complex_s8;
3067 else if (kind == 16)
3068 return parse_f_type (pstate)->builtin_complex_s16;
3069 }
3070 else if (basetype == parse_f_type (pstate)->builtin_real)
3071 {
3072 if (kind == 4)
3073 return parse_f_type (pstate)->builtin_real;
3074 else if (kind == 8)
3075 return parse_f_type (pstate)->builtin_real_s8;
3076 else if (kind == 16)
3077 return parse_f_type (pstate)->builtin_real_s16;
3078 }
3079 else if (basetype == parse_f_type (pstate)->builtin_logical)
3080 {
3081 if (kind == 1)
3082 return parse_f_type (pstate)->builtin_logical_s1;
3083 else if (kind == 2)
3084 return parse_f_type (pstate)->builtin_logical_s2;
3085 else if (kind == 4)
3086 return parse_f_type (pstate)->builtin_logical;
3087 else if (kind == 8)
3088 return parse_f_type (pstate)->builtin_logical_s8;
3089 }
3090 else if (basetype == parse_f_type (pstate)->builtin_integer)
3091 {
3092 if (kind == 1)
3093 return parse_f_type (pstate)->builtin_integer_s1;
3094 else if (kind == 2)
3095 return parse_f_type (pstate)->builtin_integer_s2;
3096 else if (kind == 4)
3097 return parse_f_type (pstate)->builtin_integer;
3098 else if (kind == 8)
3099 return parse_f_type (pstate)->builtin_integer_s8;
3100 }
3101
3102 error (_("unsupported kind %d for type %s"),
3103 kind, TYPE_SAFE_NAME (basetype));
3104
3105 /* Should never get here. */
3106 return nullptr;
3107}
3108
3110{
3111 /* The string to match against. */
3112 const char *oper;
3113
3114 /* The lexer token to return. */
3116
3117 /* The expression opcode to embed within the token. */
3119
3120 /* When this is true the string in OPER is matched exactly including
3121 case, when this is false OPER is matched case insensitively. */
3123};
3124
3125/* List of Fortran operators. */
3126
3127static const struct f_token fortran_operators[] =
3128{
3129 { ".and.", BOOL_AND, OP_NULL, false },
3130 { ".or.", BOOL_OR, OP_NULL, false },
3131 { ".not.", BOOL_NOT, OP_NULL, false },
3132 { ".eq.", EQUAL, OP_NULL, false },
3133 { ".eqv.", EQUAL, OP_NULL, false },
3134 { ".neqv.", NOTEQUAL, OP_NULL, false },
3135 { ".xor.", NOTEQUAL, OP_NULL, false },
3136 { "==", EQUAL, OP_NULL, false },
3137 { ".ne.", NOTEQUAL, OP_NULL, false },
3138 { "/=", NOTEQUAL, OP_NULL, false },
3139 { ".le.", LEQ, OP_NULL, false },
3140 { "<=", LEQ, OP_NULL, false },
3141 { ".ge.", GEQ, OP_NULL, false },
3142 { ">=", GEQ, OP_NULL, false },
3143 { ".gt.", GREATERTHAN, OP_NULL, false },
3144 { ">", GREATERTHAN, OP_NULL, false },
3145 { ".lt.", LESSTHAN, OP_NULL, false },
3146 { "<", LESSTHAN, OP_NULL, false },
3147 { "**", STARSTAR, BINOP_EXP, false },
3148};
3149
3150/* Holds the Fortran representation of a boolean, and the integer value we
3151 substitute in when one of the matching strings is parsed. */
3153{
3154 /* The string representing a Fortran boolean. */
3155 const char *name;
3156
3157 /* The integer value to replace it with. */
3159};
3160
3161/* The set of Fortran booleans. These are matched case insensitively. */
3162static const struct f77_boolean_val boolean_values[] =
3163{
3164 { ".true.", 1 },
3165 { ".false.", 0 }
3166};
3167
3168static const struct f_token f_intrinsics[] =
3169{
3170 /* The following correspond to actual functions in Fortran and are case
3171 insensitive. */
3172 { "kind", KIND, OP_NULL, false },
3173 { "abs", UNOP_INTRINSIC, UNOP_ABS, false },
3174 { "mod", BINOP_INTRINSIC, BINOP_MOD, false },
3175 { "floor", UNOP_OR_BINOP_INTRINSIC, FORTRAN_FLOOR, false },
3176 { "ceiling", UNOP_OR_BINOP_INTRINSIC, FORTRAN_CEILING, false },
3177 { "modulo", BINOP_INTRINSIC, BINOP_FORTRAN_MODULO, false },
3178 { "cmplx", UNOP_OR_BINOP_OR_TERNOP_INTRINSIC, FORTRAN_CMPLX, false },
3179 { "lbound", UNOP_OR_BINOP_OR_TERNOP_INTRINSIC, FORTRAN_LBOUND, false },
3180 { "ubound", UNOP_OR_BINOP_OR_TERNOP_INTRINSIC, FORTRAN_UBOUND, false },
3181 { "allocated", UNOP_INTRINSIC, UNOP_FORTRAN_ALLOCATED, false },
3182 { "associated", UNOP_OR_BINOP_INTRINSIC, FORTRAN_ASSOCIATED, false },
3183 { "rank", UNOP_INTRINSIC, UNOP_FORTRAN_RANK, false },
3184 { "size", UNOP_OR_BINOP_OR_TERNOP_INTRINSIC, FORTRAN_ARRAY_SIZE, false },
3185 { "shape", UNOP_INTRINSIC, UNOP_FORTRAN_SHAPE, false },
3186 { "loc", UNOP_INTRINSIC, UNOP_FORTRAN_LOC, false },
3187 { "sizeof", SIZEOF, OP_NULL, false },
3188};
3189
3190static const f_token f_keywords[] =
3191{
3192 /* Historically these have always been lowercase only in GDB. */
3193 { "character", CHARACTER, OP_NULL, true },
3194 { "complex", COMPLEX_KEYWORD, OP_NULL, true },
3195 { "complex_4", COMPLEX_S4_KEYWORD, OP_NULL, true },
3196 { "complex_8", COMPLEX_S8_KEYWORD, OP_NULL, true },
3197 { "complex_16", COMPLEX_S16_KEYWORD, OP_NULL, true },
3198 { "integer_1", INT_S1_KEYWORD, OP_NULL, true },
3199 { "integer_2", INT_S2_KEYWORD, OP_NULL, true },
3200 { "integer_4", INT_S4_KEYWORD, OP_NULL, true },
3201 { "integer", INT_KEYWORD, OP_NULL, true },
3202 { "integer_8", INT_S8_KEYWORD, OP_NULL, true },
3203 { "logical_1", LOGICAL_S1_KEYWORD, OP_NULL, true },
3204 { "logical_2", LOGICAL_S2_KEYWORD, OP_NULL, true },
3205 { "logical", LOGICAL_KEYWORD, OP_NULL, true },
3206 { "logical_4", LOGICAL_S4_KEYWORD, OP_NULL, true },
3207 { "logical_8", LOGICAL_S8_KEYWORD, OP_NULL, true },
3208 { "real", REAL_KEYWORD, OP_NULL, true },
3209 { "real_4", REAL_S4_KEYWORD, OP_NULL, true },
3210 { "real_8", REAL_S8_KEYWORD, OP_NULL, true },
3211 { "real_16", REAL_S16_KEYWORD, OP_NULL, true },
3212 { "single", SINGLE, OP_NULL, true },
3213 { "double", DOUBLE, OP_NULL, true },
3214 { "precision", PRECISION, OP_NULL, true },
3215};
3216
3217/* Implementation of a dynamically expandable buffer for processing input
3218 characters acquired through lexptr and building a value to return in
3219 yylval. Ripped off from ch-exp.y */
3220
3221static char *tempbuf; /* Current buffer contents */
3222static int tempbufsize; /* Size of allocated buffer */
3223static int tempbufindex; /* Current index into buffer */
3224
3225#define GROWBY_MIN_SIZE 64 /* Minimum amount to grow buffer by */
3226
3227#define CHECKBUF(size) \
3228 do { \
3229 if (tempbufindex + (size) >= tempbufsize) \
3230 { \
3231 growbuf_by_size (size); \
3232 } \
3233 } while (0);
3234
3235
3236/* Grow the static temp buffer if necessary, including allocating the
3237 first one on demand. */
3238
3239static void
3241{
3242 int growby;
3243
3244 growby = std::max (count, GROWBY_MIN_SIZE);
3245 tempbufsize += growby;
3246 if (tempbuf == NULL)
3247 tempbuf = (char *) xmalloc (tempbufsize);
3248 else
3249 tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
3250}
3251
3252/* Blatantly ripped off from ch-exp.y. This routine recognizes F77
3253 string-literals.
3254
3255 Recognize a string literal. A string literal is a nonzero sequence
3256 of characters enclosed in matching single quotes, except that
3257 a single character inside single quotes is a character literal, which
3258 we reject as a string literal. To embed the terminator character inside
3259 a string, it is simply doubled (I.E. 'this''is''one''string') */
3260
3261static int
3263{
3264 const char *tokptr = pstate->lexptr;
3265
3266 for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
3267 {
3268 CHECKBUF (1);
3269 if (*tokptr == *pstate->lexptr)
3270 {
3271 if (*(tokptr + 1) == *pstate->lexptr)
3272 tokptr++;
3273 else
3274 break;
3275 }
3276 tempbuf[tempbufindex++] = *tokptr;
3277 }
3278 if (*tokptr == '\0' /* no terminator */
3279 || tempbufindex == 0) /* no string */
3280 return 0;
3281 else
3282 {
3283 tempbuf[tempbufindex] = '\0';
3286 pstate->lexptr = ++tokptr;
3287 return STRING_LITERAL;
3288 }
3289}
3290
3291/* This is set if a NAME token appeared at the very end of the input
3292 string, with no whitespace separating the name from the EOF. This
3293 is used only when parsing to do field name completion. */
3295
3296/* This is set if the previously-returned token was a structure
3297 operator '%'. */
3299
3300/* Read one token, getting characters through lexptr. */
3301
3302static int
3303yylex (void)
3304{
3305 int c;
3306 int namelen;
3307 unsigned int token;
3308 const char *tokstart;
3309 bool saw_structop = last_was_structop;
3310
3311 last_was_structop = false;
3312
3313 retry:
3314
3316
3317 tokstart = pstate->lexptr;
3318
3319 /* First of all, let us make sure we are not dealing with the
3320 special tokens .true. and .false. which evaluate to 1 and 0. */
3321
3322 if (*pstate->lexptr == '.')
3323 {
3324 for (const auto &candidate : boolean_values)
3325 {
3326 if (strncasecmp (tokstart, candidate.name,
3327 strlen (candidate.name)) == 0)
3328 {
3329 pstate->lexptr += strlen (candidate.name);
3330 yylval.lval = candidate.value;
3331 return BOOLEAN_LITERAL;
3332 }
3333 }
3334 }
3335
3336 /* See if it is a Fortran operator. */
3337 for (const auto &candidate : fortran_operators)
3338 if (strncasecmp (tokstart, candidate.oper,
3339 strlen (candidate.oper)) == 0)
3340 {
3341 gdb_assert (!candidate.case_sensitive);
3342 pstate->lexptr += strlen (candidate.oper);
3343 yylval.opcode = candidate.opcode;
3344 return candidate.token;
3345 }
3346
3347 switch (c = *tokstart)
3348 {
3349 case 0:
3350 if (saw_name_at_eof)
3351 {
3352 saw_name_at_eof = false;
3353 return COMPLETE;
3354 }
3355 else if (pstate->parse_completion && saw_structop)
3356 return COMPLETE;
3357 return 0;
3358
3359 case ' ':
3360 case '\t':
3361 case '\n':
3362 pstate->lexptr++;
3363 goto retry;
3364
3365 case '\'':
3367 if (token != 0)
3368 return (token);
3369 break;
3370
3371 case '(':
3372 paren_depth++;
3373 pstate->lexptr++;
3374 return c;
3375
3376 case ')':
3377 if (paren_depth == 0)
3378 return 0;
3379 paren_depth--;
3380 pstate->lexptr++;
3381 return c;
3382
3383 case ',':
3384 if (pstate->comma_terminates && paren_depth == 0)
3385 return 0;
3386 pstate->lexptr++;
3387 return c;
3388
3389 case '.':
3390 /* Might be a floating point number. */
3391 if (pstate->lexptr[1] < '0' || pstate->lexptr[1] > '9')
3392 goto symbol; /* Nope, must be a symbol. */
3393 /* FALL THRU. */
3394
3395 case '0':
3396 case '1':
3397 case '2':
3398 case '3':
3399 case '4':
3400 case '5':
3401 case '6':
3402 case '7':
3403 case '8':
3404 case '9':
3405 {
3406 /* It's a number. */
3407 int got_dot = 0, got_e = 0, got_d = 0, toktype;
3408 const char *p = tokstart;
3409 int hex = input_radix > 10;
3410
3411 if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
3412 {
3413 p += 2;
3414 hex = 1;
3415 }
3416 else if (c == '0' && (p[1]=='t' || p[1]=='T'
3417 || p[1]=='d' || p[1]=='D'))
3418 {
3419 p += 2;
3420 hex = 0;
3421 }
3422
3423 for (;; ++p)
3424 {
3425 if (!hex && !got_e && (*p == 'e' || *p == 'E'))
3426 got_dot = got_e = 1;
3427 else if (!hex && !got_d && (*p == 'd' || *p == 'D'))
3428 got_dot = got_d = 1;
3429 else if (!hex && !got_dot && *p == '.')
3430 got_dot = 1;
3431 else if (((got_e && (p[-1] == 'e' || p[-1] == 'E'))
3432 || (got_d && (p[-1] == 'd' || p[-1] == 'D')))
3433 && (*p == '-' || *p == '+'))
3434 /* This is the sign of the exponent, not the end of the
3435 number. */
3436 continue;
3437 /* We will take any letters or digits. parse_number will
3438 complain if past the radix, or if L or U are not final. */
3439 else if ((*p < '0' || *p > '9')
3440 && ((*p < 'a' || *p > 'z')
3441 && (*p < 'A' || *p > 'Z')))
3442 break;
3443 }
3444 toktype = parse_number (pstate, tokstart, p - tokstart,
3445 got_dot|got_e|got_d,
3446 &yylval);
3447 if (toktype == ERROR)
3448 {
3449 char *err_copy = (char *) alloca (p - tokstart + 1);
3450
3451 memcpy (err_copy, tokstart, p - tokstart);
3452 err_copy[p - tokstart] = 0;
3453 error (_("Invalid number \"%s\"."), err_copy);
3454 }
3455 pstate->lexptr = p;
3456 return toktype;
3457 }
3458
3459 case '%':
3460 last_was_structop = true;
3461 /* Fall through. */
3462 case '+':
3463 case '-':
3464 case '*':
3465 case '/':
3466 case '|':
3467 case '&':
3468 case '^':
3469 case '~':
3470 case '!':
3471 case '@':
3472 case '<':
3473 case '>':
3474 case '[':
3475 case ']':
3476 case '?':
3477 case ':':
3478 case '=':
3479 case '{':
3480 case '}':
3481 symbol:
3482 pstate->lexptr++;
3483 return c;
3484 }
3485
3486 if (!(c == '_' || c == '$' || c ==':'
3487 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
3488 /* We must have come across a bad character (e.g. ';'). */
3489 error (_("Invalid character '%c' in expression."), c);
3490
3491 namelen = 0;
3492 for (c = tokstart[namelen];
3493 (c == '_' || c == '$' || c == ':' || (c >= '0' && c <= '9')
3494 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
3495 c = tokstart[++namelen]);
3496
3497 /* The token "if" terminates the expression and is NOT
3498 removed from the input stream. */
3499
3500 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
3501 return 0;
3502
3503 pstate->lexptr += namelen;
3504
3505 /* Catch specific keywords. */
3506
3507 for (const auto &keyword : f_keywords)
3508 if (strlen (keyword.oper) == namelen
3509 && ((!keyword.case_sensitive
3510 && strncasecmp (tokstart, keyword.oper, namelen) == 0)
3511 || (keyword.case_sensitive
3512 && strncmp (tokstart, keyword.oper, namelen) == 0)))
3513 {
3514 yylval.opcode = keyword.opcode;
3515 return keyword.token;
3516 }
3517
3518 yylval.sval.ptr = tokstart;
3519 yylval.sval.length = namelen;
3520
3521 if (*tokstart == '$')
3522 return DOLLAR_VARIABLE;
3523
3524 /* Use token-type TYPENAME for symbols that happen to be defined
3525 currently as names of types; NAME for other symbols.
3526 The caller is not constrained to care about the distinction. */
3527 {
3528 std::string tmp = copy_name (yylval.sval);
3529 struct block_symbol result;
3530 const domain_enum lookup_domains[] =
3531 {
3533 VAR_DOMAIN,
3535 };
3536 int hextype;
3537
3538 for (const auto &domain : lookup_domains)
3539 {
3540 result = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
3541 domain, NULL);
3542 if (result.symbol && result.symbol->aclass () == LOC_TYPEDEF)
3543 {
3544 yylval.tsym.type = result.symbol->type ();
3545 return TYPENAME;
3546 }
3547
3548 if (result.symbol)
3549 break;
3550 }
3551
3554 pstate->gdbarch (), tmp.c_str ());
3555 if (yylval.tsym.type != NULL)
3556 return TYPENAME;
3557
3558 /* This is post the symbol search as symbols can hide intrinsics. Also,
3559 give Fortran intrinsics priority over C symbols. This prevents
3560 non-Fortran symbols from hiding intrinsics, for example abs. */
3561 if (!result.symbol || result.symbol->language () != language_fortran)
3562 for (const auto &intrinsic : f_intrinsics)
3563 {
3564 gdb_assert (!intrinsic.case_sensitive);
3565 if (strlen (intrinsic.oper) == namelen
3566 && strncasecmp (tokstart, intrinsic.oper, namelen) == 0)
3567 {
3568 yylval.opcode = intrinsic.opcode;
3569 return intrinsic.token;
3570 }
3571 }
3572
3573 /* Input names that aren't symbols but ARE valid hex numbers,
3574 when the input radix permits them, can be names or numbers
3575 depending on the parse. Note we support radixes > 16 here. */
3576 if (!result.symbol
3577 && ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10)
3578 || (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
3579 {
3580 f_exp_YYSTYPE newlval; /* Its value is ignored. */
3581 hextype = parse_number (pstate, tokstart, namelen, 0, &newlval);
3582 if (hextype == INT)
3583 {
3584 yylval.ssym.sym = result;
3586 return NAME_OR_INT;
3587 }
3588 }
3589
3590 if (pstate->parse_completion && *pstate->lexptr == '\0')
3591 saw_name_at_eof = true;
3592
3593 /* Any other kind of symbol */
3594 yylval.ssym.sym = result;
3596 return NAME;
3597 }
3598}
3599
3600int
3601f_language::parser (struct parser_state *par_state) const
3602{
3603 /* Setting up the parser state. */
3604 scoped_restore pstate_restore = make_scoped_restore (&pstate);
3605 scoped_restore restore_yydebug = make_scoped_restore (&yydebug,
3606 par_state->debug);
3607 gdb_assert (par_state != NULL);
3608 pstate = par_state;
3609 last_was_structop = false;
3610 saw_name_at_eof = false;
3611 paren_depth = 0;
3612
3613 struct type_stack stack;
3614 scoped_restore restore_type_stack = make_scoped_restore (&type_stack,
3615 &stack);
3616
3617 int result = yyparse ();
3618 if (!result)
3620 return result;
3621}
3622
3623static void
3624yyerror (const char *msg)
3625{
3626 if (pstate->prev_lexptr)
3628
3629 error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
3630}
const char *const name
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
int code
Definition ada-lex.l:670
void * xrealloc(void *ptr, size_t size)
Definition alloc.c:65
static bool last_was_structop
Definition c-exp.c:5288
static int saw_name_at_eof
Definition c-exp.c:5284
int parser(struct parser_state *ps) const override
Definition f-exp.c:3601
unsigned input_radix
Definition valprint.c:186
@ language_fortran
Definition defs.h:219
exp_opcode
Definition expression.h:45
@ EVAL_AVOID_SIDE_EFFECTS
Definition expression.h:58
@ RANGE_LOW_BOUND_DEFAULT
Definition expression.h:376
@ RANGE_HIGH_BOUND_DEFAULT
Definition expression.h:379
@ RANGE_STANDARD
Definition expression.h:373
@ RANGE_HAS_STRIDE
Definition expression.h:385
#define INT_S4_KEYWORD
Definition f-exp.c:248
#define BINOP_INTRINSIC
Definition f-exp.c:273
#define BOOL_NOT
Definition f-exp.c:265
static void wrap_ternop_intrinsic(exp_opcode opcode)
Definition f-exp.c:2792
#define LEQ
Definition f-exp.c:281
#define DOLLAR_VARIABLE
Definition f-exp.c:270
#define REAL_S8_KEYWORD
Definition f-exp.c:257
f_exp_yysymbol_kind_t
Definition f-exp.c:334
@ YYSYMBOL_type_exp
Definition f-exp.c:410
@ YYSYMBOL_68_
Definition f-exp.c:404
@ YYSYMBOL_complexnum
Definition f-exp.c:417
@ YYSYMBOL_TYPENAME
Definition f-exp.c:344
@ YYSYMBOL_YYUNDEF
Definition f-exp.c:338
@ YYSYMBOL_name_not_typename
Definition f-exp.c:427
@ YYSYMBOL_71_
Definition f-exp.c:407
@ YYSYMBOL_DOUBLE
Definition f-exp.c:372
@ YYSYMBOL_NAME_OR_INT
Definition f-exp.c:346
@ YYSYMBOL_ASSIGN_MODIFY
Definition f-exp.c:376
@ YYSYMBOL_STRING_LITERAL
Definition f-exp.c:341
@ YYSYMBOL_arglist
Definition f-exp.c:415
@ YYSYMBOL_47_
Definition f-exp.c:383
@ YYSYMBOL_INT
Definition f-exp.c:339
@ YYSYMBOL_60_
Definition f-exp.c:396
@ YYSYMBOL_50_
Definition f-exp.c:386
@ YYSYMBOL_76_1
Definition f-exp.c:412
@ YYSYMBOL_INT_KEYWORD
Definition f-exp.c:352
@ YYSYMBOL_NOTEQUAL
Definition f-exp.c:389
@ YYSYMBOL_LOGICAL_KEYWORD
Definition f-exp.c:357
@ YYSYMBOL_SIZEOF
Definition f-exp.c:347
@ YYSYMBOL_UNARY
Definition f-exp.c:403
@ YYSYMBOL_LEQ
Definition f-exp.c:392
@ YYSYMBOL_YYerror
Definition f-exp.c:337
@ YYSYMBOL_UNOP_OR_BINOP_INTRINSIC
Definition f-exp.c:379
@ YYSYMBOL_GEQ
Definition f-exp.c:393
@ YYSYMBOL_start
Definition f-exp.c:409
@ YYSYMBOL_BOOL_NOT
Definition f-exp.c:370
@ YYSYMBOL_exp
Definition f-exp.c:411
@ YYSYMBOL_type
Definition f-exp.c:419
@ YYSYMBOL_49_
Definition f-exp.c:385
@ YYSYMBOL_INT_S8_KEYWORD
Definition f-exp.c:354
@ YYSYMBOL_SINGLE
Definition f-exp.c:371
@ YYSYMBOL_PRECISION
Definition f-exp.c:373
@ YYSYMBOL_COMPLEX_S16_KEYWORD
Definition f-exp.c:367
@ YYSYMBOL_REAL_S8_KEYWORD
Definition f-exp.c:362
@ YYSYMBOL_REAL_S4_KEYWORD
Definition f-exp.c:361
@ YYSYMBOL_COMPLETE
Definition f-exp.c:345
@ YYSYMBOL_STARSTAR
Definition f-exp.c:401
@ YYSYMBOL_COMPLEX_KEYWORD
Definition f-exp.c:364
@ YYSYMBOL_63_
Definition f-exp.c:399
@ YYSYMBOL_typebase
Definition f-exp.c:424
@ YYSYMBOL_BOOL_OR
Definition f-exp.c:369
@ YYSYMBOL_BOOL_AND
Definition f-exp.c:368
@ YYSYMBOL_direct_abs_decl
Definition f-exp.c:422
@ YYSYMBOL_51_
Definition f-exp.c:387
@ YYSYMBOL_REAL_S16_KEYWORD
Definition f-exp.c:363
@ YYSYMBOL_LOGICAL_S1_KEYWORD
Definition f-exp.c:355
@ YYSYMBOL_LSH
Definition f-exp.c:394
@ YYSYMBOL_48_
Definition f-exp.c:384
@ YYSYMBOL_REAL_KEYWORD
Definition f-exp.c:360
@ YYSYMBOL_61_
Definition f-exp.c:397
@ YYSYMBOL_UNOP_INTRINSIC
Definition f-exp.c:377
@ YYSYMBOL_INT_S2_KEYWORD
Definition f-exp.c:351
@ YYSYMBOL_INT_S4_KEYWORD
Definition f-exp.c:353
@ YYSYMBOL_BOOLEAN_LITERAL
Definition f-exp.c:342
@ YYSYMBOL_64_
Definition f-exp.c:400
@ YYSYMBOL_70_
Definition f-exp.c:406
@ YYSYMBOL_RSH
Definition f-exp.c:395
@ YYSYMBOL_KIND
Definition f-exp.c:348
@ YYSYMBOL_name
Definition f-exp.c:426
@ YYSYMBOL_LOGICAL_S4_KEYWORD
Definition f-exp.c:358
@ YYSYMBOL_YYACCEPT
Definition f-exp.c:408
@ YYSYMBOL_COMPLEX_S4_KEYWORD
Definition f-exp.c:365
@ YYSYMBOL_COMPLEX_S8_KEYWORD
Definition f-exp.c:366
@ YYSYMBOL_subrange
Definition f-exp.c:416
@ YYSYMBOL_BINOP_INTRINSIC
Definition f-exp.c:378
@ YYSYMBOL_78_3
Definition f-exp.c:414
@ YYSYMBOL_ERROR
Definition f-exp.c:349
@ YYSYMBOL_INT_S1_KEYWORD
Definition f-exp.c:350
@ YYSYMBOL_YYEOF
Definition f-exp.c:336
@ YYSYMBOL_ABOVE_COMMA
Definition f-exp.c:382
@ YYSYMBOL_62_
Definition f-exp.c:398
@ YYSYMBOL_DOLLAR_VARIABLE
Definition f-exp.c:375
@ YYSYMBOL_nonempty_typelist
Definition f-exp.c:425
@ YYSYMBOL_LOGICAL_S8_KEYWORD
Definition f-exp.c:359
@ YYSYMBOL_variable
Definition f-exp.c:418
@ YYSYMBOL_YYEMPTY
Definition f-exp.c:335
@ YYSYMBOL_ptype
Definition f-exp.c:420
@ YYSYMBOL_EQUAL
Definition f-exp.c:388
@ YYSYMBOL_abs_decl
Definition f-exp.c:421
@ YYSYMBOL_LOGICAL_S2_KEYWORD
Definition f-exp.c:356
@ YYSYMBOL_69_
Definition f-exp.c:405
@ YYSYMBOL_func_mod
Definition f-exp.c:423
@ YYSYMBOL_77_2
Definition f-exp.c:413
@ YYSYMBOL_GREATERTHAN
Definition f-exp.c:391
@ YYSYMBOL_66_
Definition f-exp.c:402
@ YYSYMBOL_FLOAT
Definition f-exp.c:340
@ YYSYMBOL_NAME
Definition f-exp.c:343
@ YYSYMBOL_LESSTHAN
Definition f-exp.c:390
@ YYSYMBOL_45_
Definition f-exp.c:381
@ YYSYMBOL_UNOP_OR_BINOP_OR_TERNOP_INTRINSIC
Definition f-exp.c:380
@ YYSYMBOL_CHARACTER
Definition f-exp.c:374
int yynerrs
Definition f-exp.c:1420
#define BOOL_AND
Definition f-exp.c:263
#define CHARACTER
Definition f-exp.c:269
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition f-exp.c:611
#define YYMAXDEPTH
Definition f-exp.c:1387
#define NOTEQUAL
Definition f-exp.c:278
#define INT_S2_KEYWORD
Definition f-exp.c:246
#define GREATERTHAN
Definition f-exp.c:280
#define TYPENAME
Definition f-exp.c:239
#define COMPLEX_S16_KEYWORD
Definition f-exp.c:262
#define YYSTACK_FREE
Definition f-exp.c:672
#define LOGICAL_S2_KEYWORD
Definition f-exp.c:251
@ YYENOMEM
Definition f-exp.c:1212
static const yytype_int8 yytranslate[]
Definition f-exp.c:786
#define EQUAL
Definition f-exp.c:277
#define REAL_S16_KEYWORD
Definition f-exp.c:258
#define LOGICAL_S1_KEYWORD
Definition f-exp.c:250
#define LOGICAL_KEYWORD
Definition f-exp.c:252
#define YY_ASSERT(E)
Definition f-exp.c:631
#define YY_(Msgid)
Definition f-exp.c:565
static struct type_stack * type_stack
Definition f-exp.c:102
#define RSH
Definition f-exp.c:284
#define YYNOMEM
Definition f-exp.c:1220
#define SIZEOF
Definition f-exp.c:242
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition f-exp.c:612
static void wrap_binop_intrinsic(exp_opcode opcode)
Definition f-exp.c:2747
static const yytype_int8 yydefact[]
Definition f-exp.c:918
#define YYNSTATES
Definition f-exp.c:771
#define YY_IGNORE_USELESS_CAST_END
Definition f-exp.c:627
short yytype_int16
Definition f-exp.c:476
static const char * yysymbol_name(f_exp_yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
Definition f-exp.c:874
#define KIND
Definition f-exp.c:243
#define STRING_LITERAL
Definition f-exp.c:236
#define INT_S8_KEYWORD
Definition f-exp.c:249
void * xmalloc(YYSIZE_T)
static int tempbufsize
Definition f-exp.c:3222
#define YYEOF
Definition f-exp.c:231
static int tempbufindex
Definition f-exp.c:3223
#define YYABORT
Definition f-exp.c:1218
#define COMPLEX_S8_KEYWORD
Definition f-exp.c:261
static const yytype_int16 yyrline[]
Definition f-exp.c:824
#define COMPLEX_KEYWORD
Definition f-exp.c:259
#define BOOL_OR
Definition f-exp.c:264
#define YYSTACK_BYTES(N)
Definition f-exp.c:715
static char * tempbuf
Definition f-exp.c:3221
yytype_uint8 yy_state_t
Definition f-exp.c:552
#define NAME
Definition f-exp.c:238
#define YY_REDUCE_PRINT(Rule)
Definition f-exp.c:1357
#define UNOP_OR_BINOP_OR_TERNOP_INTRINSIC
Definition f-exp.c:275
#define COMPLETE
Definition f-exp.c:240
#define GROWBY_MIN_SIZE
Definition f-exp.c:3225
#define YY_CAST(Type, Val)
Definition f-exp.c:139
#define ABOVE_COMMA
Definition f-exp.c:276
#define UNOP_INTRINSIC
Definition f-exp.c:272
static struct parser_state * pstate
Definition f-exp.c:96
static const yytype_int16 yypact[]
Definition f-exp.c:892
static const yytype_uint8 yydefgoto[]
Definition f-exp.c:949
#define YYerror
Definition f-exp.c:232
#define YYUNDEF
Definition f-exp.c:233
static const f_token f_keywords[]
Definition f-exp.c:3190
static void wrap_unop_intrinsic(exp_opcode opcode)
Definition f-exp.c:2700
#define YYFINAL
Definition f-exp.c:760
#define LSH
Definition f-exp.c:283
static int yylex(void)
Definition f-exp.c:3303
#define YY_ACCESSING_SYMBOL(State)
Definition f-exp.c:842
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition f-exp.c:1264
static int parse_number(struct parser_state *, const char *, int, int, f_exp_YYSTYPE *)
Definition f-exp.c:2876
static void growbuf_by_size(int)
Definition f-exp.c:3240
#define YYNTOKENS
Definition f-exp.c:765
#define STARSTAR
Definition f-exp.c:285
unsigned char yytype_uint8
Definition f-exp.c:497
#define YY_STACK_PRINT(Bottom, Top)
Definition f-exp.c:1326
#define INT_S1_KEYWORD
Definition f-exp.c:245
#define YYSIZE_T
Definition f-exp.c:538
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition f-exp.c:626
#define parse_type(ps)
Definition f-exp.c:85
static const struct f77_boolean_val boolean_values[]
Definition f-exp.c:3162
int yyparse(void)
Definition f-exp.c:1430
#define LOGICAL_S4_KEYWORD
Definition f-exp.c:253
#define DOUBLE
Definition f-exp.c:267
static const yytype_int8 yyr2[]
Definition f-exp.c:1195
#define COMPLEX_S4_KEYWORD
Definition f-exp.c:260
#define ERROR
Definition f-exp.c:244
static const struct f_token fortran_operators[]
Definition f-exp.c:3127
static void yy_symbol_value_print(FILE *yyo, f_exp_yysymbol_kind_t yykind, f_exp_YYSTYPE const *const yyvaluep)
Definition f-exp.c:1281
#define YYPTRDIFF_T
Definition f-exp.c:524
static int paren_depth
Definition f-exp.c:99
#define UNOP_OR_BINOP_INTRINSIC
Definition f-exp.c:274
f_exp_YYSTYPE yylval
Definition f-exp.c:1418
#define REAL_S4_KEYWORD
Definition f-exp.c:256
#define NAME_OR_INT
Definition f-exp.c:241
#define PRECISION
Definition f-exp.c:268
int yychar
Definition f-exp.c:1415
#define ASSIGN_MODIFY
Definition f-exp.c:271
#define GEQ
Definition f-exp.c:282
#define parse_f_type(ps)
Definition f-exp.c:86
#define YY_NULLPTRPTR
Definition f-exp.c:151
#define BOOLEAN_LITERAL
Definition f-exp.c:237
static bool last_was_structop
Definition f-exp.c:3298
#define YYACCEPT
Definition f-exp.c:1217
#define yytable_value_is_error(Yyn)
Definition f-exp.c:887
static bool saw_name_at_eof
Definition f-exp.c:3294
static const struct f_token f_intrinsics[]
Definition f-exp.c:3168
#define YYTRANSLATE(YYX)
Definition f-exp.c:779
static const yytype_int8 yystos[]
Definition f-exp.c:1154
static void yy_symbol_print(FILE *yyo, f_exp_yysymbol_kind_t yykind, f_exp_YYSTYPE const *const yyvaluep)
Definition f-exp.c:1299
#define SINGLE
Definition f-exp.c:266
#define UNARY
Definition f-exp.c:286
int yydebug
Definition f-exp.c:1365
#define YY_ATTRIBUTE_UNUSED
Definition f-exp.c:582
static const char *const yytname[]
Definition f-exp.c:851
#define INT_KEYWORD
Definition f-exp.c:247
static const yytype_int8 yypgoto[]
Definition f-exp.c:942
static void fortran_wrap3_kind(type *base_type)
Definition f-exp.c:2854
static const yytype_int8 yyr1[]
Definition f-exp.c:1178
#define LESSTHAN
Definition f-exp.c:279
enum yytokentype yytoken_kind_t
Definition f-exp.c:227
static struct type * convert_to_kind_type(struct type *basetype, int kind)
Definition f-exp.c:3052
static void fortran_wrap2_kind(type *base_type)
Definition f-exp.c:2834
#define LOGICAL_S8_KEYWORD
Definition f-exp.c:254
static int match_string_literal(void)
Definition f-exp.c:3262
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition f-exp.c:555
unsigned short yytype_uint16
Definition f-exp.c:508
#define YYEMPTY
Definition f-exp.c:230
#define YYLAST
Definition f-exp.c:762
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition f-exp.c:726
#define FLOAT
Definition f-exp.c:235
#define yypact_value_is_default(Yyn)
Definition f-exp.c:882
static void yydestruct(const char *yymsg, f_exp_yysymbol_kind_t yykind, f_exp_YYSTYPE *yyvaluep)
Definition f-exp.c:1400
static void push_kind_type(LONGEST val, struct type *type)
Definition f-exp.c:3025
#define YYINITDEPTH
Definition f-exp.c:1376
static const yytype_uint8 yytable[]
Definition f-exp.c:958
#define REAL_KEYWORD
Definition f-exp.c:255
signed char yytype_int8
Definition f-exp.c:468
#define CHECKBUF(size)
Definition f-exp.c:3227
#define YYERROR
Definition f-exp.c:1219
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
Definition f-exp.c:1315
#define YYSIZEOF(X)
Definition f-exp.c:548
static const yytype_int16 yycheck[]
Definition f-exp.c:1055
#define YYSTACK_ALLOC
Definition f-exp.c:671
#define YYDPRINTF(Args)
Definition f-exp.c:1255
static void yy_reduce_print(yy_state_t *yyssp, f_exp_YYSTYPE *yyvsp, int yyrule)
Definition f-exp.c:1338
void xfree(void *)
#define YY_USE(E)
Definition f-exp.c:588
#define INT
Definition f-exp.c:234
int gdbarch_int_bit(struct gdbarch *gdbarch)
Definition gdbarch.c:1449
int gdbarch_long_bit(struct gdbarch *gdbarch)
Definition gdbarch.c:1466
struct type * lookup_pointer_type(struct type *type)
Definition gdbtypes.c:430
struct type * create_static_range_type(type_allocator &alloc, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
Definition gdbtypes.c:1019
struct type * lookup_lvalue_reference_type(struct type *type)
Definition gdbtypes.c:518
struct type * lookup_function_type(struct type *type)
Definition gdbtypes.c:567
struct type * create_array_type(type_allocator &alloc, struct type *element_type, struct type *range_type)
Definition gdbtypes.c:1388
struct type * check_typedef(struct type *type)
Definition gdbtypes.c:2966
#define TYPE_SAFE_NAME(type)
Definition gdbtypes.h:2060
void range_error(const char *string,...)
Definition language.c:396
struct type * language_lookup_primitive_type(const struct language_defn *la, struct gdbarch *gdbarch, const char *name)
Definition language.c:1006
#define RANGE_CHECK
Definition language.h:768
int token
Definition m2-exp.c:2422
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
std::string copy_name(struct stoken token)
Definition parse.c:319
Definition 1.cc:26
struct symbol * symbol
Definition symtab.h:1533
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
expression_up expout
Definition parser-defs.h:80
const char * name
Definition f-exp.c:3155
const char * oper
Definition f-exp.c:3112
bool case_sensitive
Definition f-exp.c:3122
int token
Definition f-exp.c:3115
enum exp_opcode opcode
Definition f-exp.c:3118
enum language language() const
Definition symtab.h:502
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)
bool parse_completion
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()
bool comma_terminates
expr::operation_up pop()
void push(expr::operation_up &&op)
const char * lexptr
void mark_struct_expression(expr::structop_base_operation *op)
Definition parse.c:101
int length
const char * ptr
address_class aclass() const
Definition symtab.h:1274
struct type * type() const
Definition symtab.h:1331
int is_a_field_of_this
struct block_symbol sym
struct type * type
void push(enum type_pieces tp)
Definition type-stack.h:83
enum type_pieces pop()
Definition type-stack.h:119
int pop_int()
Definition type-stack.h:128
bool is_unsigned() const
Definition gdbtypes.h:1100
Definition value.h:130
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
@ LOC_TYPEDEF
Definition symtab.h:1018
domain_enum
Definition symtab.h:900
@ VAR_DOMAIN
Definition symtab.h:910
@ STRUCT_DOMAIN
Definition symtab.h:916
@ MODULE_DOMAIN
Definition symtab.h:920
@ tp_function
Definition type-stack.h:38
@ tp_kind
Definition type-stack.h:46
@ tp_array
Definition type-stack.h:37
@ tp_pointer
Definition type-stack.h:34
@ tp_reference
Definition type-stack.h:35
@ tp_end
Definition type-stack.h:33
enum exp_opcode opcode
Definition f-exp.c:309
struct internalvar * ivar
Definition f-exp.c:310
struct f_exp_YYSTYPE::@56 typed_val
LONGEST lval
Definition f-exp.c:294
struct f_exp_YYSTYPE::@57 typed_val_float
struct ttype tsym
Definition f-exp.c:306
struct stoken sval
Definition f-exp.c:305
int voidval
Definition f-exp.c:308
LONGEST val
Definition f-exp.c:296
struct type ** tvec
Definition f-exp.c:312
struct type * tval
Definition f-exp.c:304
struct symtoken ssym
Definition f-exp.c:307
int * ivec
Definition f-exp.c:313
struct symbol * sym
Definition f-exp.c:303
struct type * type
Definition f-exp.c:297
f_exp_YYSTYPE yyvs_alloc
Definition f-exp.c:707
yy_state_t yyss_alloc
Definition f-exp.c:706
LONGEST value_as_long(struct value *val)
Definition value.c:2554
#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 yydebug
Definition yy-remap.h:48
#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