OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [f-exp.c] - Blame information for rev 476

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.