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

Subversion Repositories openrisc_me

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

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

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

powered by: WebSVN 2.1.0

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