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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.3/] [gdb/] [m2-exp.tab.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
 
2
/*  A Bison parser, made from m2-exp.y
3
 by  GNU Bison version 1.27
4
  */
5
 
6
#define YYBISON 1  /* Identify Bison output.  */
7
 
8
#define INT     257
9
#define HEX     258
10
#define ERROR   259
11
#define UINT    260
12
#define M2_TRUE 261
13
#define M2_FALSE        262
14
#define CHAR    263
15
#define FLOAT   264
16
#define STRING  265
17
#define NAME    266
18
#define BLOCKNAME       267
19
#define IDENT   268
20
#define VARNAME 269
21
#define TYPENAME        270
22
#define SIZE    271
23
#define CAP     272
24
#define ORD     273
25
#define HIGH    274
26
#define ABS     275
27
#define MIN_FUNC        276
28
#define MAX_FUNC        277
29
#define FLOAT_FUNC      278
30
#define VAL     279
31
#define CHR     280
32
#define ODD     281
33
#define TRUNC   282
34
#define INC     283
35
#define DEC     284
36
#define INCL    285
37
#define EXCL    286
38
#define COLONCOLON      287
39
#define INTERNAL_VAR    288
40
#define ABOVE_COMMA     289
41
#define ASSIGN  290
42
#define LEQ     291
43
#define GEQ     292
44
#define NOTEQUAL        293
45
#define IN      294
46
#define OROR    295
47
#define LOGICAL_AND     296
48
#define DIV     297
49
#define MOD     298
50
#define UNARY   299
51
#define DOT     300
52
#define NOT     301
53
#define QID     302
54
 
55
#line 41 "m2-exp.y"
56
 
57
 
58
#include "defs.h"
59
#include "gdb_string.h"
60
#include "expression.h"
61
#include "language.h"
62
#include "value.h"
63
#include "parser-defs.h"
64
#include "m2-lang.h"
65
#include "bfd.h" /* Required by objfiles.h.  */
66
#include "symfile.h" /* Required by objfiles.h.  */
67
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
68
 
69
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
70
   as well as gratuitiously global symbol names, so we can have multiple
71
   yacc generated parsers in gdb.  Note that these are only the variables
72
   produced by yacc.  If other parser generators (bison, byacc, etc) produce
73
   additional global names that conflict at link time, then those parser
74
   generators need to be fixed instead of adding those names to this list. */
75
 
76
#define yymaxdepth m2_maxdepth
77
#define yyparse m2_parse
78
#define yylex   m2_lex
79
#define yyerror m2_error
80
#define yylval  m2_lval
81
#define yychar  m2_char
82
#define yydebug m2_debug
83
#define yypact  m2_pact
84
#define yyr1    m2_r1
85
#define yyr2    m2_r2
86
#define yydef   m2_def
87
#define yychk   m2_chk
88
#define yypgo   m2_pgo
89
#define yyact   m2_act
90
#define yyexca  m2_exca
91
#define yyerrflag m2_errflag
92
#define yynerrs m2_nerrs
93
#define yyps    m2_ps
94
#define yypv    m2_pv
95
#define yys     m2_s
96
#define yy_yys  m2_yys
97
#define yystate m2_state
98
#define yytmp   m2_tmp
99
#define yyv     m2_v
100
#define yy_yyv  m2_yyv
101
#define yyval   m2_val
102
#define yylloc  m2_lloc
103
#define yyreds  m2_reds         /* With YYDEBUG defined */
104
#define yytoks  m2_toks         /* With YYDEBUG defined */
105
#define yyname  m2_name         /* With YYDEBUG defined */
106
#define yyrule  m2_rule         /* With YYDEBUG defined */
107
#define yylhs   m2_yylhs
108
#define yylen   m2_yylen
109
#define yydefred m2_yydefred
110
#define yydgoto m2_yydgoto
111
#define yysindex m2_yysindex
112
#define yyrindex m2_yyrindex
113
#define yygindex m2_yygindex
114
#define yytable  m2_yytable
115
#define yycheck  m2_yycheck
116
 
117
#ifndef YYDEBUG
118
#define YYDEBUG 1               /* Default to yydebug support */
119
#endif
120
 
121
#define YYFPRINTF parser_fprintf
122
 
123
int yyparse (void);
124
 
125
static int yylex (void);
126
 
127
void yyerror (char *);
128
 
129
#if 0
130
static char *make_qualname (char *, char *);
131
#endif
132
 
133
static int parse_number (int);
134
 
135
/* The sign of the number being parsed. */
136
static int number_sign = 1;
137
 
138
/* The block that the module specified by the qualifer on an identifer is
139
   contained in, */
140
#if 0
141
static struct block *modblock=0;
142
#endif
143
 
144
 
145
#line 135 "m2-exp.y"
146
typedef union
147
  {
148
    LONGEST lval;
149
    ULONGEST ulval;
150
    DOUBLEST dval;
151
    struct symbol *sym;
152
    struct type *tval;
153
    struct stoken sval;
154
    int voidval;
155
    struct block *bval;
156
    enum exp_opcode opcode;
157
    struct internalvar *ivar;
158
 
159
    struct type **tvec;
160
    int *ivec;
161
  } YYSTYPE;
162
#include <stdio.h>
163
 
164
#ifndef __cplusplus
165
#ifndef __STDC__
166
#define const
167
#endif
168
#endif
169
 
170
 
171
 
172
#define YYFINAL         181
173
#define YYFLAG          -32768
174
#define YYNTBASE        68
175
 
176
#define YYTRANSLATE(x) ((unsigned)(x) <= 302 ? yytranslate[x] : 82)
177
 
178
static const char yytranslate[] = {     0,
179
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
180
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
181
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
182
     2,     2,     2,     2,    44,     2,     2,    48,     2,    60,
183
    64,    52,    50,    35,    51,     2,    53,     2,     2,     2,
184
     2,     2,     2,     2,     2,     2,     2,     2,     2,    38,
185
    42,    39,     2,    49,     2,     2,     2,     2,     2,     2,
186
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
187
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
188
    59,     2,    67,    57,     2,     2,     2,     2,     2,     2,
189
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
190
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
191
     2,     2,    65,     2,    66,    62,     2,     2,     2,     2,
192
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
193
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
194
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
195
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
196
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
197
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
198
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
199
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
200
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
201
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
202
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
203
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
204
     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
205
     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
206
    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
207
    27,    28,    29,    30,    31,    32,    33,    34,    36,    37,
208
    40,    41,    43,    45,    46,    47,    54,    55,    56,    58,
209
    61,    63
210
};
211
 
212
#if YYDEBUG != 0
213
static const short yyprhs[] = {     0,
214
     0,     2,     4,     6,     9,    10,    14,    17,    20,    22,
215
    24,    29,    34,    39,    44,    49,    54,    59,    66,    71,
216
    76,    81,    84,    89,    96,   101,   108,   112,   114,   118,
217
   125,   132,   136,   141,   142,   148,   149,   155,   156,   158,
218
   162,   164,   168,   173,   178,   182,   186,   190,   194,   198,
219
   202,   206,   210,   214,   218,   222,   226,   230,   234,   238,
220
   242,   246,   250,   252,   254,   256,   258,   260,   262,   264,
221
   269,   271,   273,   275,   279,   281,   283,   287,   289
222
};
223
 
224
static const short yyrhs[] = {    70,
225
     0,    69,     0,    81,     0,    70,    57,     0,     0,    51,
226
    71,    70,     0,    50,    70,     0,    72,    70,     0,    61,
227
     0,    62,     0,    18,    60,    70,    64,     0,    19,    60,
228
    70,    64,     0,    21,    60,    70,    64,     0,    20,    60,
229
    70,    64,     0,    22,    60,    81,    64,     0,    23,    60,
230
    81,    64,     0,    24,    60,    70,    64,     0,    25,    60,
231
    81,    35,    70,    64,     0,    26,    60,    70,    64,     0,
232
    27,    60,    70,    64,     0,    28,    60,    70,    64,     0,
233
    17,    70,     0,    29,    60,    70,    64,     0,    29,    60,
234
    70,    35,    70,    64,     0,    30,    60,    70,    64,     0,
235
    30,    60,    70,    35,    70,    64,     0,    70,    58,    12,
236
     0,    73,     0,    70,    45,    73,     0,    31,    60,    70,
237
    35,    70,    64,     0,    32,    60,    70,    35,    70,    64,
238
     0,    65,    76,    66,     0,    81,    65,    76,    66,     0,
239
     0,    70,    59,    74,    77,    67,     0,     0,    70,    60,
240
    75,    76,    64,     0,     0,    70,     0,    76,    35,    70,
241
     0,    70,     0,    77,    35,    70,     0,    65,    81,    66,
242
    70,     0,    81,    60,    70,    64,     0,    60,    70,    64,
243
     0,    70,    49,    70,     0,    70,    52,    70,     0,    70,
244
    53,    70,     0,    70,    54,    70,     0,    70,    55,    70,
245
     0,    70,    50,    70,     0,    70,    51,    70,     0,    70,
246
    42,    70,     0,    70,    43,    70,     0,    70,    44,    70,
247
     0,    70,    40,    70,     0,    70,    41,    70,     0,    70,
248
    38,    70,     0,    70,    39,    70,     0,    70,    47,    70,
249
     0,    70,    46,    70,     0,    70,    37,    70,     0,     7,
250
     0,     8,     0,     3,     0,     6,     0,     9,     0,    10,
251
     0,    80,     0,    17,    60,    81,    64,     0,    11,     0,
252
    79,     0,    13,     0,    78,    33,    13,     0,    79,     0,
253
    34,     0,    78,    33,    12,     0,    12,     0,    16,     0
254
};
255
 
256
#endif
257
 
258
#if YYDEBUG != 0
259
static const short yyrline[] = { 0,
260
   204,   205,   208,   217,   221,   223,   228,   232,   236,   237,
261
   240,   244,   248,   252,   256,   262,   268,   272,   278,   282,
262
   286,   290,   295,   299,   305,   309,   315,   321,   324,   328,
263
   332,   336,   338,   344,   349,   355,   359,   365,   368,   372,
264
   377,   382,   387,   393,   399,   407,   411,   415,   419,   423,
265
   427,   431,   435,   439,   441,   445,   449,   453,   457,   461,
266
   465,   469,   476,   482,   488,   495,   504,   512,   519,   522,
267
   529,   536,   540,   549,   561,   569,   573,   589,   640
268
};
269
#endif
270
 
271
 
272
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
273
 
274
static const char * const yytname[] = {   "$","error","$undefined.","INT","HEX",
275
"ERROR","UINT","M2_TRUE","M2_FALSE","CHAR","FLOAT","STRING","NAME","BLOCKNAME",
276
"IDENT","VARNAME","TYPENAME","SIZE","CAP","ORD","HIGH","ABS","MIN_FUNC","MAX_FUNC",
277
"FLOAT_FUNC","VAL","CHR","ODD","TRUNC","INC","DEC","INCL","EXCL","COLONCOLON",
278
"INTERNAL_VAR","','","ABOVE_COMMA","ASSIGN","'<'","'>'","LEQ","GEQ","'='","NOTEQUAL",
279
"'#'","IN","OROR","LOGICAL_AND","'&'","'@'","'+'","'-'","'*'","'/'","DIV","MOD",
280
"UNARY","'^'","DOT","'['","'('","NOT","'~'","QID","')'","'{'","'}'","']'","start",
281
"type_exp","exp","@1","not_exp","set","@2","@3","arglist","non_empty_arglist",
282
"block","fblock","variable","type", NULL
283
};
284
#endif
285
 
286
static const short yyr1[] = {     0,
287
    68,    68,    69,    70,    71,    70,    70,    70,    72,    72,
288
    70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
289
    70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
290
    70,    73,    73,    74,    70,    75,    70,    76,    76,    76,
291
    77,    77,    70,    70,    70,    70,    70,    70,    70,    70,
292
    70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
293
    70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
294
    70,    78,    79,    79,    80,    80,    80,    80,    81
295
};
296
 
297
static const short yyr2[] = {     0,
298
     1,     1,     1,     2,     0,     3,     2,     2,     1,     1,
299
     4,     4,     4,     4,     4,     4,     4,     6,     4,     4,
300
     4,     2,     4,     6,     4,     6,     3,     1,     3,     6,
301
     6,     3,     4,     0,     5,     0,     5,     0,     1,     3,
302
     1,     3,     4,     4,     3,     3,     3,     3,     3,     3,
303
     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
304
     3,     3,     1,     1,     1,     1,     1,     1,     1,     4,
305
     1,     1,     1,     3,     1,     1,     3,     1,     1
306
};
307
 
308
static const short yydefact[] = {     0,
309
    65,    66,    63,    64,    67,    68,    71,    78,    73,    79,
310
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
311
     0,     0,     0,     0,     0,     0,    76,     0,     5,     0,
312
     9,    10,    38,     2,     1,     0,    28,     0,    75,    69,
313
     3,     0,    22,     0,     0,     0,     0,     0,     0,     0,
314
     0,     0,     0,     0,     0,     0,     0,     0,     0,     7,
315
     0,     0,    39,     0,     0,     0,     0,     0,     0,     0,
316
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
317
     0,     0,     0,     4,     0,    34,    36,     8,     0,     0,
318
    38,     0,     0,     0,     0,     0,     0,     0,     0,     0,
319
     0,     0,     0,     0,     0,     0,     0,     6,    45,     0,
320
    32,     0,    62,    58,    59,    56,    57,    53,    54,    55,
321
    38,    29,     0,    61,    60,    46,    51,    52,    47,    48,
322
    49,    50,    27,     0,    38,    77,    74,     0,     0,    70,
323
    11,    12,    14,    13,    15,    16,    17,     0,    19,    20,
324
    21,     0,    23,     0,    25,     0,     0,    40,    43,    41,
325
     0,     0,    44,    33,     0,     0,     0,     0,     0,     0,
326
    35,    37,    18,    24,    26,    30,    31,    42,     0,     0,
327
 
328
};
329
 
330
static const short yydefgoto[] = {   179,
331
    34,    63,    61,    36,    37,   134,   135,    64,   161,    38,
332
    39,    40,    44
333
};
334
 
335
static const short yypact[] = {   155,
336
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
337
   215,   -27,   -22,   -20,   -19,    14,    24,    26,    27,    28,
338
    29,    31,    32,    33,    35,    36,-32768,   155,-32768,   155,
339
-32768,-32768,   155,-32768,   742,   155,-32768,    -6,    -4,-32768,
340
   -34,   155,     5,   -34,   155,   155,   155,   155,    44,    44,
341
   155,    44,   155,   155,   155,   155,   155,   155,   155,     5,
342
   155,   272,   742,   -31,   -41,   155,   155,   155,   155,   155,
343
   155,   155,   155,   -15,   155,   155,   155,   155,   155,   155,
344
   155,   155,   155,-32768,    85,-32768,-32768,     5,    -5,   155,
345
   155,   -21,   300,   328,   356,   384,    34,    39,   412,    64,
346
   440,   468,   496,    78,   244,   692,   718,     5,-32768,   155,
347
-32768,   155,   766,   -37,   -37,   -37,   -37,   -37,   -37,   -37,
348
   155,-32768,    40,   141,   201,   777,   786,   786,     5,     5,
349
     5,     5,-32768,   155,   155,-32768,-32768,   524,   -29,-32768,
350
-32768,-32768,-32768,-32768,-32768,-32768,-32768,   155,-32768,-32768,
351
-32768,   155,-32768,   155,-32768,   155,   155,   742,     5,   742,
352
   -33,   -32,-32768,-32768,   552,   580,   608,   636,   664,   155,
353
-32768,-32768,-32768,-32768,-32768,-32768,-32768,   742,   100,   106,
354
-32768
355
};
356
 
357
static const short yypgoto[] = {-32768,
358
-32768,     0,-32768,-32768,    37,-32768,-32768,   -86,-32768,-32768,
359
-32768,-32768,    52
360
};
361
 
362
 
363
#define YYLAST          846
364
 
365
 
366
static const short yytable[] = {    35,
367
    10,   170,   110,   110,   139,   110,   136,   137,    75,    76,
368
    43,    77,    78,    79,    80,    81,    82,    83,    90,    84,
369
    85,    86,    87,    91,   112,    90,    89,    60,   -72,    62,
370
    91,   172,    45,   171,   111,    88,   164,    46,    90,    47,
371
    48,    62,   140,    91,    93,    94,    95,    96,   162,   121,
372
    99,    41,   101,   102,   103,   104,   105,   106,   107,    10,
373
   108,    84,    85,    86,    87,   113,   114,   115,   116,   117,
374
   118,   119,   120,    49,   124,   125,   126,   127,   128,   129,
375
   130,   131,   132,    50,    65,    51,    52,    53,    54,   138,
376
    55,    56,    57,    92,    58,    59,   133,   145,   148,   180,
377
    97,    98,   146,   100,    91,   181,     0,     0,     0,   158,
378
   122,   159,   152,     0,    66,    67,    68,    69,    70,    71,
379
    72,    73,    74,    75,    76,   123,    77,    78,    79,    80,
380
    81,    82,    83,   160,    84,    85,    86,    87,     0,     0,
381
     0,   153,     0,     0,     0,     0,     0,   165,     0,     0,
382
     0,   166,     0,   167,     0,   168,   169,     1,     0,     0,
383
     2,     3,     4,     5,     6,     7,     8,     9,     0,   178,
384
    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
385
    20,    21,    22,    23,    24,    25,    26,    76,    27,    77,
386
    78,    79,    80,    81,    82,    83,     0,    84,    85,    86,
387
    87,     0,     0,     0,    28,    29,     0,     0,     0,     0,
388
     0,     0,     0,     0,    30,    31,    32,     1,     0,    33,
389
     2,     3,     4,     5,     6,     7,     8,     9,     0,     0,
390
    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
391
    20,    21,    22,    23,    24,    25,    26,     0,    27,    77,
392
    78,    79,    80,    81,    82,    83,     0,    84,    85,    86,
393
    87,     0,     0,     0,    28,    29,     0,     0,     0,     0,
394
     0,     0,     0,     0,    42,    31,    32,     0,   154,    33,
395
    66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
396
    76,     0,    77,    78,    79,    80,    81,    82,    83,     0,
397
    84,    85,    86,    87,     0,     0,     0,   155,    66,    67,
398
    68,    69,    70,    71,    72,    73,    74,    75,    76,     0,
399
    77,    78,    79,    80,    81,    82,    83,     0,    84,    85,
400
    86,    87,     0,     0,     0,   109,    66,    67,    68,    69,
401
    70,    71,    72,    73,    74,    75,    76,     0,    77,    78,
402
    79,    80,    81,    82,    83,     0,    84,    85,    86,    87,
403
     0,     0,     0,   141,    66,    67,    68,    69,    70,    71,
404
    72,    73,    74,    75,    76,     0,    77,    78,    79,    80,
405
    81,    82,    83,     0,    84,    85,    86,    87,     0,     0,
406
     0,   142,    66,    67,    68,    69,    70,    71,    72,    73,
407
    74,    75,    76,     0,    77,    78,    79,    80,    81,    82,
408
    83,     0,    84,    85,    86,    87,     0,     0,     0,   143,
409
    66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
410
    76,     0,    77,    78,    79,    80,    81,    82,    83,     0,
411
    84,    85,    86,    87,     0,     0,     0,   144,    66,    67,
412
    68,    69,    70,    71,    72,    73,    74,    75,    76,     0,
413
    77,    78,    79,    80,    81,    82,    83,     0,    84,    85,
414
    86,    87,     0,     0,     0,   147,    66,    67,    68,    69,
415
    70,    71,    72,    73,    74,    75,    76,     0,    77,    78,
416
    79,    80,    81,    82,    83,     0,    84,    85,    86,    87,
417
     0,     0,     0,   149,    66,    67,    68,    69,    70,    71,
418
    72,    73,    74,    75,    76,     0,    77,    78,    79,    80,
419
    81,    82,    83,     0,    84,    85,    86,    87,     0,     0,
420
     0,   150,    66,    67,    68,    69,    70,    71,    72,    73,
421
    74,    75,    76,     0,    77,    78,    79,    80,    81,    82,
422
    83,     0,    84,    85,    86,    87,     0,     0,     0,   151,
423
    66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
424
    76,     0,    77,    78,    79,    80,    81,    82,    83,     0,
425
    84,    85,    86,    87,     0,     0,     0,   163,    66,    67,
426
    68,    69,    70,    71,    72,    73,    74,    75,    76,     0,
427
    77,    78,    79,    80,    81,    82,    83,     0,    84,    85,
428
    86,    87,     0,     0,     0,   173,    66,    67,    68,    69,
429
    70,    71,    72,    73,    74,    75,    76,     0,    77,    78,
430
    79,    80,    81,    82,    83,     0,    84,    85,    86,    87,
431
     0,     0,     0,   174,    66,    67,    68,    69,    70,    71,
432
    72,    73,    74,    75,    76,     0,    77,    78,    79,    80,
433
    81,    82,    83,     0,    84,    85,    86,    87,     0,     0,
434
     0,   175,    66,    67,    68,    69,    70,    71,    72,    73,
435
    74,    75,    76,     0,    77,    78,    79,    80,    81,    82,
436
    83,     0,    84,    85,    86,    87,     0,     0,     0,   176,
437
    66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
438
    76,     0,    77,    78,    79,    80,    81,    82,    83,     0,
439
    84,    85,    86,    87,     0,     0,   156,   177,    66,    67,
440
    68,    69,    70,    71,    72,    73,    74,    75,    76,     0,
441
    77,    78,    79,    80,    81,    82,    83,     0,    84,    85,
442
    86,    87,   157,     0,    66,    67,    68,    69,    70,    71,
443
    72,    73,    74,    75,    76,     0,    77,    78,    79,    80,
444
    81,    82,    83,     0,    84,    85,    86,    87,    66,    67,
445
    68,    69,    70,    71,    72,    73,    74,    75,    76,     0,
446
    77,    78,    79,    80,    81,    82,    83,     0,    84,    85,
447
    86,    87,-32768,    67,    68,    69,    70,    71,    72,    73,
448
    74,    75,    76,     0,    77,    78,    79,    80,    81,    82,
449
    83,     0,    84,    85,    86,    87,    78,    79,    80,    81,
450
    82,    83,     0,    84,    85,    86,    87,    80,    81,    82,
451
    83,     0,    84,    85,    86,    87
452
};
453
 
454
static const short yycheck[] = {     0,
455
    16,    35,    35,    35,    91,    35,    12,    13,    46,    47,
456
    11,    49,    50,    51,    52,    53,    54,    55,    60,    57,
457
    58,    59,    60,    65,    66,    60,    33,    28,    33,    30,
458
    65,    64,    60,    67,    66,    36,    66,    60,    60,    60,
459
    60,    42,    64,    65,    45,    46,    47,    48,   135,    65,
460
    51,     0,    53,    54,    55,    56,    57,    58,    59,    16,
461
    61,    57,    58,    59,    60,    66,    67,    68,    69,    70,
462
    71,    72,    73,    60,    75,    76,    77,    78,    79,    80,
463
    81,    82,    83,    60,    33,    60,    60,    60,    60,    90,
464
    60,    60,    60,    42,    60,    60,    12,    64,    35,     0,
465
    49,    50,    64,    52,    65,     0,    -1,    -1,    -1,   110,
466
    74,   112,    35,    -1,    37,    38,    39,    40,    41,    42,
467
    43,    44,    45,    46,    47,    74,    49,    50,    51,    52,
468
    53,    54,    55,   134,    57,    58,    59,    60,    -1,    -1,
469
    -1,    64,    -1,    -1,    -1,    -1,    -1,   148,    -1,    -1,
470
    -1,   152,    -1,   154,    -1,   156,   157,     3,    -1,    -1,
471
     6,     7,     8,     9,    10,    11,    12,    13,    -1,   170,
472
    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
473
    26,    27,    28,    29,    30,    31,    32,    47,    34,    49,
474
    50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
475
    60,    -1,    -1,    -1,    50,    51,    -1,    -1,    -1,    -1,
476
    -1,    -1,    -1,    -1,    60,    61,    62,     3,    -1,    65,
477
     6,     7,     8,     9,    10,    11,    12,    13,    -1,    -1,
478
    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
479
    26,    27,    28,    29,    30,    31,    32,    -1,    34,    49,
480
    50,    51,    52,    53,    54,    55,    -1,    57,    58,    59,
481
    60,    -1,    -1,    -1,    50,    51,    -1,    -1,    -1,    -1,
482
    -1,    -1,    -1,    -1,    60,    61,    62,    -1,    35,    65,
483
    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
484
    47,    -1,    49,    50,    51,    52,    53,    54,    55,    -1,
485
    57,    58,    59,    60,    -1,    -1,    -1,    64,    37,    38,
486
    39,    40,    41,    42,    43,    44,    45,    46,    47,    -1,
487
    49,    50,    51,    52,    53,    54,    55,    -1,    57,    58,
488
    59,    60,    -1,    -1,    -1,    64,    37,    38,    39,    40,
489
    41,    42,    43,    44,    45,    46,    47,    -1,    49,    50,
490
    51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
491
    -1,    -1,    -1,    64,    37,    38,    39,    40,    41,    42,
492
    43,    44,    45,    46,    47,    -1,    49,    50,    51,    52,
493
    53,    54,    55,    -1,    57,    58,    59,    60,    -1,    -1,
494
    -1,    64,    37,    38,    39,    40,    41,    42,    43,    44,
495
    45,    46,    47,    -1,    49,    50,    51,    52,    53,    54,
496
    55,    -1,    57,    58,    59,    60,    -1,    -1,    -1,    64,
497
    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
498
    47,    -1,    49,    50,    51,    52,    53,    54,    55,    -1,
499
    57,    58,    59,    60,    -1,    -1,    -1,    64,    37,    38,
500
    39,    40,    41,    42,    43,    44,    45,    46,    47,    -1,
501
    49,    50,    51,    52,    53,    54,    55,    -1,    57,    58,
502
    59,    60,    -1,    -1,    -1,    64,    37,    38,    39,    40,
503
    41,    42,    43,    44,    45,    46,    47,    -1,    49,    50,
504
    51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
505
    -1,    -1,    -1,    64,    37,    38,    39,    40,    41,    42,
506
    43,    44,    45,    46,    47,    -1,    49,    50,    51,    52,
507
    53,    54,    55,    -1,    57,    58,    59,    60,    -1,    -1,
508
    -1,    64,    37,    38,    39,    40,    41,    42,    43,    44,
509
    45,    46,    47,    -1,    49,    50,    51,    52,    53,    54,
510
    55,    -1,    57,    58,    59,    60,    -1,    -1,    -1,    64,
511
    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
512
    47,    -1,    49,    50,    51,    52,    53,    54,    55,    -1,
513
    57,    58,    59,    60,    -1,    -1,    -1,    64,    37,    38,
514
    39,    40,    41,    42,    43,    44,    45,    46,    47,    -1,
515
    49,    50,    51,    52,    53,    54,    55,    -1,    57,    58,
516
    59,    60,    -1,    -1,    -1,    64,    37,    38,    39,    40,
517
    41,    42,    43,    44,    45,    46,    47,    -1,    49,    50,
518
    51,    52,    53,    54,    55,    -1,    57,    58,    59,    60,
519
    -1,    -1,    -1,    64,    37,    38,    39,    40,    41,    42,
520
    43,    44,    45,    46,    47,    -1,    49,    50,    51,    52,
521
    53,    54,    55,    -1,    57,    58,    59,    60,    -1,    -1,
522
    -1,    64,    37,    38,    39,    40,    41,    42,    43,    44,
523
    45,    46,    47,    -1,    49,    50,    51,    52,    53,    54,
524
    55,    -1,    57,    58,    59,    60,    -1,    -1,    -1,    64,
525
    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
526
    47,    -1,    49,    50,    51,    52,    53,    54,    55,    -1,
527
    57,    58,    59,    60,    -1,    -1,    35,    64,    37,    38,
528
    39,    40,    41,    42,    43,    44,    45,    46,    47,    -1,
529
    49,    50,    51,    52,    53,    54,    55,    -1,    57,    58,
530
    59,    60,    35,    -1,    37,    38,    39,    40,    41,    42,
531
    43,    44,    45,    46,    47,    -1,    49,    50,    51,    52,
532
    53,    54,    55,    -1,    57,    58,    59,    60,    37,    38,
533
    39,    40,    41,    42,    43,    44,    45,    46,    47,    -1,
534
    49,    50,    51,    52,    53,    54,    55,    -1,    57,    58,
535
    59,    60,    37,    38,    39,    40,    41,    42,    43,    44,
536
    45,    46,    47,    -1,    49,    50,    51,    52,    53,    54,
537
    55,    -1,    57,    58,    59,    60,    50,    51,    52,    53,
538
    54,    55,    -1,    57,    58,    59,    60,    52,    53,    54,
539
    55,    -1,    57,    58,    59,    60
540
};
541
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
542
#line 3 "/usr/lib/bison.simple"
543
/* This file comes from bison-1.27.  */
544
 
545
/* Skeleton output parser for bison,
546
   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
547
 
548
   This program is free software; you can redistribute it and/or modify
549
   it under the terms of the GNU General Public License as published by
550
   the Free Software Foundation; either version 2, or (at your option)
551
   any later version.
552
 
553
   This program is distributed in the hope that it will be useful,
554
   but WITHOUT ANY WARRANTY; without even the implied warranty of
555
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
556
   GNU General Public License for more details.
557
 
558
   You should have received a copy of the GNU General Public License
559
   along with this program; if not, write to the Free Software
560
   Foundation, Inc., 59 Temple Place - Suite 330,
561
   Boston, MA 02111-1307, USA.  */
562
 
563
/* As a special exception, when this file is copied by Bison into a
564
   Bison output file, you may use that output file without restriction.
565
   This special exception was added by the Free Software Foundation
566
   in version 1.24 of Bison.  */
567
 
568
/* This is the parser code that is written into each bison parser
569
  when the %semantic_parser declaration is not specified in the grammar.
570
  It was written by Richard Stallman by simplifying the hairy parser
571
  used when %semantic_parser is specified.  */
572
 
573
#ifndef YYSTACK_USE_ALLOCA
574
#ifdef alloca
575
#define YYSTACK_USE_ALLOCA
576
#else /* alloca not defined */
577
#ifdef __GNUC__
578
#define YYSTACK_USE_ALLOCA
579
#define alloca __builtin_alloca
580
#else /* not GNU C.  */
581
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
582
#define YYSTACK_USE_ALLOCA
583
#include <alloca.h>
584
#else /* not sparc */
585
/* We think this test detects Watcom and Microsoft C.  */
586
/* This used to test MSDOS, but that is a bad idea
587
   since that symbol is in the user namespace.  */
588
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
589
#if 0 /* No need for xmalloc.h, which pollutes the namespace;
590
         instead, just don't use alloca.  */
591
#endif
592
#else /* not MSDOS, or __TURBOC__ */
593
#if defined(_AIX)
594
/* I don't know what this was needed for, but it pollutes the namespace.
595
   So I turned it off.   rms, 2 May 1997.  */
596
 #pragma alloca
597
#define YYSTACK_USE_ALLOCA
598
#else /* not MSDOS, or __TURBOC__, or _AIX */
599
#if 0
600
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
601
                 and on HPUX 10.  Eventually we can turn this on.  */
602
#define YYSTACK_USE_ALLOCA
603
#define alloca __builtin_alloca
604
#endif /* __hpux */
605
#endif
606
#endif /* not _AIX */
607
#endif /* not MSDOS, or __TURBOC__ */
608
#endif /* not sparc */
609
#endif /* not GNU C */
610
#endif /* alloca not defined */
611
#endif /* YYSTACK_USE_ALLOCA not defined */
612
 
613
#ifdef YYSTACK_USE_ALLOCA
614
#define YYSTACK_ALLOC alloca
615
#else
616
#define YYSTACK_ALLOC xmalloc
617
#endif
618
 
619
/* Note: there must be only one dollar sign in this file.
620
   It is replaced by the list of actions, each action
621
   as one case of the switch.  */
622
 
623
#define yyerrok         (yyerrstatus = 0)
624
#define yyclearin       (yychar = YYEMPTY)
625
#define YYEMPTY         -2
626
#define YYEOF           0
627
#define YYACCEPT        goto yyacceptlab
628
#define YYABORT         goto yyabortlab
629
#define YYERROR         goto yyerrlab1
630
/* Like YYERROR except do call yyerror.
631
   This remains here temporarily to ease the
632
   transition to the new meaning of YYERROR, for GCC.
633
   Once GCC version 2 has supplanted version 1, this can go.  */
634
#define YYFAIL          goto yyerrlab
635
#define YYRECOVERING()  (!!yyerrstatus)
636
#define YYBACKUP(token, value) \
637
do                                                              \
638
  if (yychar == YYEMPTY && yylen == 1)                          \
639
    { yychar = (token), yylval = (value);                       \
640
      yychar1 = YYTRANSLATE (yychar);                           \
641
      YYPOPSTACK;                                               \
642
      goto yybackup;                                            \
643
    }                                                           \
644
  else                                                          \
645
    { yyerror ("syntax error: cannot back up"); YYERROR; }      \
646
while (0)
647
 
648
#define YYTERROR        1
649
#define YYERRCODE       256
650
 
651
#ifndef YYPURE
652
#define YYLEX           yylex()
653
#endif
654
 
655
#ifdef YYPURE
656
#ifdef YYLSP_NEEDED
657
#ifdef YYLEX_PARAM
658
#define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
659
#else
660
#define YYLEX           yylex(&yylval, &yylloc)
661
#endif
662
#else /* not YYLSP_NEEDED */
663
#ifdef YYLEX_PARAM
664
#define YYLEX           yylex(&yylval, YYLEX_PARAM)
665
#else
666
#define YYLEX           yylex(&yylval)
667
#endif
668
#endif /* not YYLSP_NEEDED */
669
#endif
670
 
671
/* If nonreentrant, generate the variables here */
672
 
673
#ifndef YYPURE
674
 
675
int     yychar;                 /*  the lookahead symbol                */
676
YYSTYPE yylval;                 /*  the semantic value of the           */
677
                                /*  lookahead symbol                    */
678
 
679
#ifdef YYLSP_NEEDED
680
YYLTYPE yylloc;                 /*  location data for the lookahead     */
681
                                /*  symbol                              */
682
#endif
683
 
684
int yynerrs;                    /*  number of parse errors so far       */
685
#endif  /* not YYPURE */
686
 
687
#if YYDEBUG != 0
688
int yydebug;                    /*  nonzero means print parse trace     */
689
/* Since this is uninitialized, it does not stop multiple parsers
690
   from coexisting.  */
691
#endif
692
 
693
/*  YYINITDEPTH indicates the initial size of the parser's stacks       */
694
 
695
#ifndef YYINITDEPTH
696
#define YYINITDEPTH 200
697
#endif
698
 
699
/*  YYMAXDEPTH is the maximum size the stacks can grow to
700
    (effective only if the built-in stack extension method is used).  */
701
 
702
#if YYMAXDEPTH == 0
703
#undef YYMAXDEPTH
704
#endif
705
 
706
#ifndef YYMAXDEPTH
707
#define YYMAXDEPTH 10000
708
#endif
709
 
710
/* Define __yy_memcpy.  Note that the size argument
711
   should be passed with type unsigned int, because that is what the non-GCC
712
   definitions require.  With GCC, __builtin_memcpy takes an arg
713
   of type size_t, but it can handle unsigned int.  */
714
 
715
#if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
716
#define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
717
#else                           /* not GNU C or C++ */
718
#ifndef __cplusplus
719
 
720
/* This is the most reliable way to avoid incompatibilities
721
   in available built-in functions on various systems.  */
722
static void
723
__yy_memcpy (to, from, count)
724
     char *to;
725
     char *from;
726
     unsigned int count;
727
{
728
  register char *f = from;
729
  register char *t = to;
730
  register int i = count;
731
 
732
  while (i-- > 0)
733
    *t++ = *f++;
734
}
735
 
736
#else /* __cplusplus */
737
 
738
/* This is the most reliable way to avoid incompatibilities
739
   in available built-in functions on various systems.  */
740
static void
741
__yy_memcpy (char *to, char *from, unsigned int count)
742
{
743
  register char *t = to;
744
  register char *f = from;
745
  register int i = count;
746
 
747
  while (i-- > 0)
748
    *t++ = *f++;
749
}
750
 
751
#endif
752
#endif
753
 
754
#line 216 "/usr/lib/bison.simple"
755
 
756
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
757
   into yyparse.  The argument should have type void *.
758
   It should actually point to an object.
759
   Grammar actions can access the variable by casting it
760
   to the proper pointer type.  */
761
 
762
#ifdef YYPARSE_PARAM
763
#ifdef __cplusplus
764
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
765
#define YYPARSE_PARAM_DECL
766
#else /* not __cplusplus */
767
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
768
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
769
#endif /* not __cplusplus */
770
#else /* not YYPARSE_PARAM */
771
#define YYPARSE_PARAM_ARG
772
#define YYPARSE_PARAM_DECL
773
#endif /* not YYPARSE_PARAM */
774
 
775
/* Prevent warning if -Wstrict-prototypes.  */
776
#ifdef __GNUC__
777
#ifdef YYPARSE_PARAM
778
int yyparse (void *);
779
#else
780
int yyparse (void);
781
#endif
782
#endif
783
 
784
int
785
yyparse(YYPARSE_PARAM_ARG)
786
     YYPARSE_PARAM_DECL
787
{
788
  register int yystate;
789
  register int yyn;
790
  register short *yyssp;
791
  register YYSTYPE *yyvsp;
792
  int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
793
  int yychar1 = 0;               /*  lookahead token as an internal (translated) token number */
794
 
795
  short yyssa[YYINITDEPTH];     /*  the state stack                     */
796
  YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
797
 
798
  short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
799
  YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to xreallocate them elsewhere */
800
 
801
#ifdef YYLSP_NEEDED
802
  YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
803
  YYLTYPE *yyls = yylsa;
804
  YYLTYPE *yylsp;
805
 
806
#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
807
#else
808
#define YYPOPSTACK   (yyvsp--, yyssp--)
809
#endif
810
 
811
  int yystacksize = YYINITDEPTH;
812
  int yyfree_stacks = 0;
813
 
814
#ifdef YYPURE
815
  int yychar;
816
  YYSTYPE yylval;
817
  int yynerrs;
818
#ifdef YYLSP_NEEDED
819
  YYLTYPE yylloc;
820
#endif
821
#endif
822
 
823
  YYSTYPE yyval;                /*  the variable used to return         */
824
                                /*  semantic values from the action     */
825
                                /*  routines                            */
826
 
827
  int yylen;
828
 
829
#if YYDEBUG != 0
830
  if (yydebug)
831
    fprintf(stderr, "Starting parse\n");
832
#endif
833
 
834
  yystate = 0;
835
  yyerrstatus = 0;
836
  yynerrs = 0;
837
  yychar = YYEMPTY;             /* Cause a token to be read.  */
838
 
839
  /* Initialize stack pointers.
840
     Waste one element of value and location stack
841
     so that they stay on the same level as the state stack.
842
     The wasted elements are never initialized.  */
843
 
844
  yyssp = yyss - 1;
845
  yyvsp = yyvs;
846
#ifdef YYLSP_NEEDED
847
  yylsp = yyls;
848
#endif
849
 
850
/* Push a new state, which is found in  yystate  .  */
851
/* In all cases, when you get here, the value and location stacks
852
   have just been pushed. so pushing a state here evens the stacks.  */
853
yynewstate:
854
 
855
  *++yyssp = yystate;
856
 
857
  if (yyssp >= yyss + yystacksize - 1)
858
    {
859
      /* Give user a chance to xreallocate the stack */
860
      /* Use copies of these so that the &'s don't force the real ones into memory. */
861
      YYSTYPE *yyvs1 = yyvs;
862
      short *yyss1 = yyss;
863
#ifdef YYLSP_NEEDED
864
      YYLTYPE *yyls1 = yyls;
865
#endif
866
 
867
      /* Get the current used size of the three stacks, in elements.  */
868
      int size = yyssp - yyss + 1;
869
 
870
#ifdef yyoverflow
871
      /* Each stack pointer address is followed by the size of
872
         the data in use in that stack, in bytes.  */
873
#ifdef YYLSP_NEEDED
874
      /* This used to be a conditional around just the two extra args,
875
         but that might be undefined if yyoverflow is a macro.  */
876
      yyoverflow("parser stack overflow",
877
                 &yyss1, size * sizeof (*yyssp),
878
                 &yyvs1, size * sizeof (*yyvsp),
879
                 &yyls1, size * sizeof (*yylsp),
880
                 &yystacksize);
881
#else
882
      yyoverflow("parser stack overflow",
883
                 &yyss1, size * sizeof (*yyssp),
884
                 &yyvs1, size * sizeof (*yyvsp),
885
                 &yystacksize);
886
#endif
887
 
888
      yyss = yyss1; yyvs = yyvs1;
889
#ifdef YYLSP_NEEDED
890
      yyls = yyls1;
891
#endif
892
#else /* no yyoverflow */
893
      /* Extend the stack our own way.  */
894
      if (yystacksize >= YYMAXDEPTH)
895
        {
896
          yyerror("parser stack overflow");
897
          if (yyfree_stacks)
898
            {
899
              free (yyss);
900
              free (yyvs);
901
#ifdef YYLSP_NEEDED
902
              free (yyls);
903
#endif
904
            }
905
          return 2;
906
        }
907
      yystacksize *= 2;
908
      if (yystacksize > YYMAXDEPTH)
909
        yystacksize = YYMAXDEPTH;
910
#ifndef YYSTACK_USE_ALLOCA
911
      yyfree_stacks = 1;
912
#endif
913
      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
914
      __yy_memcpy ((char *)yyss, (char *)yyss1,
915
                   size * (unsigned int) sizeof (*yyssp));
916
      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
917
      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
918
                   size * (unsigned int) sizeof (*yyvsp));
919
#ifdef YYLSP_NEEDED
920
      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
921
      __yy_memcpy ((char *)yyls, (char *)yyls1,
922
                   size * (unsigned int) sizeof (*yylsp));
923
#endif
924
#endif /* no yyoverflow */
925
 
926
      yyssp = yyss + size - 1;
927
      yyvsp = yyvs + size - 1;
928
#ifdef YYLSP_NEEDED
929
      yylsp = yyls + size - 1;
930
#endif
931
 
932
#if YYDEBUG != 0
933
      if (yydebug)
934
        fprintf(stderr, "Stack size increased to %d\n", yystacksize);
935
#endif
936
 
937
      if (yyssp >= yyss + yystacksize - 1)
938
        YYABORT;
939
    }
940
 
941
#if YYDEBUG != 0
942
  if (yydebug)
943
    fprintf(stderr, "Entering state %d\n", yystate);
944
#endif
945
 
946
  goto yybackup;
947
 yybackup:
948
 
949
/* Do appropriate processing given the current state.  */
950
/* Read a lookahead token if we need one and don't already have one.  */
951
/* yyresume: */
952
 
953
  /* First try to decide what to do without reference to lookahead token.  */
954
 
955
  yyn = yypact[yystate];
956
  if (yyn == YYFLAG)
957
    goto yydefault;
958
 
959
  /* Not known => get a lookahead token if don't already have one.  */
960
 
961
  /* yychar is either YYEMPTY or YYEOF
962
     or a valid token in external form.  */
963
 
964
  if (yychar == YYEMPTY)
965
    {
966
#if YYDEBUG != 0
967
      if (yydebug)
968
        fprintf(stderr, "Reading a token: ");
969
#endif
970
      yychar = YYLEX;
971
    }
972
 
973
  /* Convert token to internal form (in yychar1) for indexing tables with */
974
 
975
  if (yychar <= 0)               /* This means end of input. */
976
    {
977
      yychar1 = 0;
978
      yychar = YYEOF;           /* Don't call YYLEX any more */
979
 
980
#if YYDEBUG != 0
981
      if (yydebug)
982
        fprintf(stderr, "Now at end of input.\n");
983
#endif
984
    }
985
  else
986
    {
987
      yychar1 = YYTRANSLATE(yychar);
988
 
989
#if YYDEBUG != 0
990
      if (yydebug)
991
        {
992
          fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
993
          /* Give the individual parser a way to print the precise meaning
994
             of a token, for further debugging info.  */
995
#ifdef YYPRINT
996
          YYPRINT (stderr, yychar, yylval);
997
#endif
998
          fprintf (stderr, ")\n");
999
        }
1000
#endif
1001
    }
1002
 
1003
  yyn += yychar1;
1004
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1005
    goto yydefault;
1006
 
1007
  yyn = yytable[yyn];
1008
 
1009
  /* yyn is what to do for this token type in this state.
1010
     Negative => reduce, -yyn is rule number.
1011
     Positive => shift, yyn is new state.
1012
       New state is final state => don't bother to shift,
1013
       just return success.
1014
     0, or most negative number => error.  */
1015
 
1016
  if (yyn < 0)
1017
    {
1018
      if (yyn == YYFLAG)
1019
        goto yyerrlab;
1020
      yyn = -yyn;
1021
      goto yyreduce;
1022
    }
1023
  else if (yyn == 0)
1024
    goto yyerrlab;
1025
 
1026
  if (yyn == YYFINAL)
1027
    YYACCEPT;
1028
 
1029
  /* Shift the lookahead token.  */
1030
 
1031
#if YYDEBUG != 0
1032
  if (yydebug)
1033
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1034
#endif
1035
 
1036
  /* Discard the token being shifted unless it is eof.  */
1037
  if (yychar != YYEOF)
1038
    yychar = YYEMPTY;
1039
 
1040
  *++yyvsp = yylval;
1041
#ifdef YYLSP_NEEDED
1042
  *++yylsp = yylloc;
1043
#endif
1044
 
1045
  /* count tokens shifted since error; after three, turn off error status.  */
1046
  if (yyerrstatus) yyerrstatus--;
1047
 
1048
  yystate = yyn;
1049
  goto yynewstate;
1050
 
1051
/* Do the default action for the current state.  */
1052
yydefault:
1053
 
1054
  yyn = yydefact[yystate];
1055
  if (yyn == 0)
1056
    goto yyerrlab;
1057
 
1058
/* Do a reduction.  yyn is the number of a rule to reduce with.  */
1059
yyreduce:
1060
  yylen = yyr2[yyn];
1061
  if (yylen > 0)
1062
    yyval = yyvsp[1-yylen]; /* implement default value of the action */
1063
 
1064
#if YYDEBUG != 0
1065
  if (yydebug)
1066
    {
1067
      int i;
1068
 
1069
      fprintf (stderr, "Reducing via rule %d (line %d), ",
1070
               yyn, yyrline[yyn]);
1071
 
1072
      /* Print the symbols being reduced, and their result.  */
1073
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1074
        fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1075
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1076
    }
1077
#endif
1078
 
1079
 
1080
  switch (yyn) {
1081
 
1082
case 3:
1083
#line 209 "m2-exp.y"
1084
{ write_exp_elt_opcode(OP_TYPE);
1085
                  write_exp_elt_type(yyvsp[0].tval);
1086
                  write_exp_elt_opcode(OP_TYPE);
1087
                ;
1088
    break;}
1089
case 4:
1090
#line 218 "m2-exp.y"
1091
{ write_exp_elt_opcode (UNOP_IND); ;
1092
    break;}
1093
case 5:
1094
#line 222 "m2-exp.y"
1095
{ number_sign = -1; ;
1096
    break;}
1097
case 6:
1098
#line 224 "m2-exp.y"
1099
{ number_sign = 1;
1100
                          write_exp_elt_opcode (UNOP_NEG); ;
1101
    break;}
1102
case 7:
1103
#line 229 "m2-exp.y"
1104
{ write_exp_elt_opcode(UNOP_PLUS); ;
1105
    break;}
1106
case 8:
1107
#line 233 "m2-exp.y"
1108
{ write_exp_elt_opcode (UNOP_LOGICAL_NOT); ;
1109
    break;}
1110
case 11:
1111
#line 241 "m2-exp.y"
1112
{ write_exp_elt_opcode (UNOP_CAP); ;
1113
    break;}
1114
case 12:
1115
#line 245 "m2-exp.y"
1116
{ write_exp_elt_opcode (UNOP_ORD); ;
1117
    break;}
1118
case 13:
1119
#line 249 "m2-exp.y"
1120
{ write_exp_elt_opcode (UNOP_ABS); ;
1121
    break;}
1122
case 14:
1123
#line 253 "m2-exp.y"
1124
{ write_exp_elt_opcode (UNOP_HIGH); ;
1125
    break;}
1126
case 15:
1127
#line 257 "m2-exp.y"
1128
{ write_exp_elt_opcode (UNOP_MIN);
1129
                          write_exp_elt_type (yyvsp[-1].tval);
1130
                          write_exp_elt_opcode (UNOP_MIN); ;
1131
    break;}
1132
case 16:
1133
#line 263 "m2-exp.y"
1134
{ write_exp_elt_opcode (UNOP_MAX);
1135
                          write_exp_elt_type (yyvsp[-1].tval);
1136
                          write_exp_elt_opcode (UNOP_MIN); ;
1137
    break;}
1138
case 17:
1139
#line 269 "m2-exp.y"
1140
{ write_exp_elt_opcode (UNOP_FLOAT); ;
1141
    break;}
1142
case 18:
1143
#line 273 "m2-exp.y"
1144
{ write_exp_elt_opcode (BINOP_VAL);
1145
                          write_exp_elt_type (yyvsp[-3].tval);
1146
                          write_exp_elt_opcode (BINOP_VAL); ;
1147
    break;}
1148
case 19:
1149
#line 279 "m2-exp.y"
1150
{ write_exp_elt_opcode (UNOP_CHR); ;
1151
    break;}
1152
case 20:
1153
#line 283 "m2-exp.y"
1154
{ write_exp_elt_opcode (UNOP_ODD); ;
1155
    break;}
1156
case 21:
1157
#line 287 "m2-exp.y"
1158
{ write_exp_elt_opcode (UNOP_TRUNC); ;
1159
    break;}
1160
case 22:
1161
#line 291 "m2-exp.y"
1162
{ write_exp_elt_opcode (UNOP_SIZEOF); ;
1163
    break;}
1164
case 23:
1165
#line 296 "m2-exp.y"
1166
{ write_exp_elt_opcode(UNOP_PREINCREMENT); ;
1167
    break;}
1168
case 24:
1169
#line 300 "m2-exp.y"
1170
{ write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
1171
                          write_exp_elt_opcode(BINOP_ADD);
1172
                          write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); ;
1173
    break;}
1174
case 25:
1175
#line 306 "m2-exp.y"
1176
{ write_exp_elt_opcode(UNOP_PREDECREMENT);;
1177
    break;}
1178
case 26:
1179
#line 310 "m2-exp.y"
1180
{ write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
1181
                          write_exp_elt_opcode(BINOP_SUB);
1182
                          write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); ;
1183
    break;}
1184
case 27:
1185
#line 316 "m2-exp.y"
1186
{ write_exp_elt_opcode (STRUCTOP_STRUCT);
1187
                          write_exp_string (yyvsp[0].sval);
1188
                          write_exp_elt_opcode (STRUCTOP_STRUCT); ;
1189
    break;}
1190
case 29:
1191
#line 325 "m2-exp.y"
1192
{ error("Sets are not implemented.");;
1193
    break;}
1194
case 30:
1195
#line 329 "m2-exp.y"
1196
{ error("Sets are not implemented.");;
1197
    break;}
1198
case 31:
1199
#line 333 "m2-exp.y"
1200
{ error("Sets are not implemented.");;
1201
    break;}
1202
case 32:
1203
#line 337 "m2-exp.y"
1204
{ error("Sets are not implemented.");;
1205
    break;}
1206
case 33:
1207
#line 339 "m2-exp.y"
1208
{ error("Sets are not implemented.");;
1209
    break;}
1210
case 34:
1211
#line 348 "m2-exp.y"
1212
{ start_arglist(); ;
1213
    break;}
1214
case 35:
1215
#line 350 "m2-exp.y"
1216
{ write_exp_elt_opcode (MULTI_SUBSCRIPT);
1217
                          write_exp_elt_longcst ((LONGEST) end_arglist());
1218
                          write_exp_elt_opcode (MULTI_SUBSCRIPT); ;
1219
    break;}
1220
case 36:
1221
#line 358 "m2-exp.y"
1222
{ start_arglist (); ;
1223
    break;}
1224
case 37:
1225
#line 360 "m2-exp.y"
1226
{ write_exp_elt_opcode (OP_FUNCALL);
1227
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
1228
                          write_exp_elt_opcode (OP_FUNCALL); ;
1229
    break;}
1230
case 39:
1231
#line 369 "m2-exp.y"
1232
{ arglist_len = 1; ;
1233
    break;}
1234
case 40:
1235
#line 373 "m2-exp.y"
1236
{ arglist_len++; ;
1237
    break;}
1238
case 41:
1239
#line 378 "m2-exp.y"
1240
{ arglist_len = 1; ;
1241
    break;}
1242
case 42:
1243
#line 383 "m2-exp.y"
1244
{ arglist_len++; ;
1245
    break;}
1246
case 43:
1247
#line 388 "m2-exp.y"
1248
{ write_exp_elt_opcode (UNOP_MEMVAL);
1249
                          write_exp_elt_type (yyvsp[-2].tval);
1250
                          write_exp_elt_opcode (UNOP_MEMVAL); ;
1251
    break;}
1252
case 44:
1253
#line 394 "m2-exp.y"
1254
{ write_exp_elt_opcode (UNOP_CAST);
1255
                          write_exp_elt_type (yyvsp[-3].tval);
1256
                          write_exp_elt_opcode (UNOP_CAST); ;
1257
    break;}
1258
case 45:
1259
#line 400 "m2-exp.y"
1260
{ ;
1261
    break;}
1262
case 46:
1263
#line 408 "m2-exp.y"
1264
{ write_exp_elt_opcode (BINOP_REPEAT); ;
1265
    break;}
1266
case 47:
1267
#line 412 "m2-exp.y"
1268
{ write_exp_elt_opcode (BINOP_MUL); ;
1269
    break;}
1270
case 48:
1271
#line 416 "m2-exp.y"
1272
{ write_exp_elt_opcode (BINOP_DIV); ;
1273
    break;}
1274
case 49:
1275
#line 420 "m2-exp.y"
1276
{ write_exp_elt_opcode (BINOP_INTDIV); ;
1277
    break;}
1278
case 50:
1279
#line 424 "m2-exp.y"
1280
{ write_exp_elt_opcode (BINOP_REM); ;
1281
    break;}
1282
case 51:
1283
#line 428 "m2-exp.y"
1284
{ write_exp_elt_opcode (BINOP_ADD); ;
1285
    break;}
1286
case 52:
1287
#line 432 "m2-exp.y"
1288
{ write_exp_elt_opcode (BINOP_SUB); ;
1289
    break;}
1290
case 53:
1291
#line 436 "m2-exp.y"
1292
{ write_exp_elt_opcode (BINOP_EQUAL); ;
1293
    break;}
1294
case 54:
1295
#line 440 "m2-exp.y"
1296
{ write_exp_elt_opcode (BINOP_NOTEQUAL); ;
1297
    break;}
1298
case 55:
1299
#line 442 "m2-exp.y"
1300
{ write_exp_elt_opcode (BINOP_NOTEQUAL); ;
1301
    break;}
1302
case 56:
1303
#line 446 "m2-exp.y"
1304
{ write_exp_elt_opcode (BINOP_LEQ); ;
1305
    break;}
1306
case 57:
1307
#line 450 "m2-exp.y"
1308
{ write_exp_elt_opcode (BINOP_GEQ); ;
1309
    break;}
1310
case 58:
1311
#line 454 "m2-exp.y"
1312
{ write_exp_elt_opcode (BINOP_LESS); ;
1313
    break;}
1314
case 59:
1315
#line 458 "m2-exp.y"
1316
{ write_exp_elt_opcode (BINOP_GTR); ;
1317
    break;}
1318
case 60:
1319
#line 462 "m2-exp.y"
1320
{ write_exp_elt_opcode (BINOP_LOGICAL_AND); ;
1321
    break;}
1322
case 61:
1323
#line 466 "m2-exp.y"
1324
{ write_exp_elt_opcode (BINOP_LOGICAL_OR); ;
1325
    break;}
1326
case 62:
1327
#line 470 "m2-exp.y"
1328
{ write_exp_elt_opcode (BINOP_ASSIGN); ;
1329
    break;}
1330
case 63:
1331
#line 477 "m2-exp.y"
1332
{ write_exp_elt_opcode (OP_BOOL);
1333
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1334
                          write_exp_elt_opcode (OP_BOOL); ;
1335
    break;}
1336
case 64:
1337
#line 483 "m2-exp.y"
1338
{ write_exp_elt_opcode (OP_BOOL);
1339
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1340
                          write_exp_elt_opcode (OP_BOOL); ;
1341
    break;}
1342
case 65:
1343
#line 489 "m2-exp.y"
1344
{ write_exp_elt_opcode (OP_LONG);
1345
                          write_exp_elt_type (builtin_type_m2_int);
1346
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1347
                          write_exp_elt_opcode (OP_LONG); ;
1348
    break;}
1349
case 66:
1350
#line 496 "m2-exp.y"
1351
{
1352
                          write_exp_elt_opcode (OP_LONG);
1353
                          write_exp_elt_type (builtin_type_m2_card);
1354
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1355
                          write_exp_elt_opcode (OP_LONG);
1356
                        ;
1357
    break;}
1358
case 67:
1359
#line 505 "m2-exp.y"
1360
{ write_exp_elt_opcode (OP_LONG);
1361
                          write_exp_elt_type (builtin_type_m2_char);
1362
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].ulval);
1363
                          write_exp_elt_opcode (OP_LONG); ;
1364
    break;}
1365
case 68:
1366
#line 513 "m2-exp.y"
1367
{ write_exp_elt_opcode (OP_DOUBLE);
1368
                          write_exp_elt_type (builtin_type_m2_real);
1369
                          write_exp_elt_dblcst (yyvsp[0].dval);
1370
                          write_exp_elt_opcode (OP_DOUBLE); ;
1371
    break;}
1372
case 70:
1373
#line 523 "m2-exp.y"
1374
{ write_exp_elt_opcode (OP_LONG);
1375
                          write_exp_elt_type (builtin_type_int);
1376
                          write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1377
                          write_exp_elt_opcode (OP_LONG); ;
1378
    break;}
1379
case 71:
1380
#line 530 "m2-exp.y"
1381
{ write_exp_elt_opcode (OP_M2_STRING);
1382
                          write_exp_string (yyvsp[0].sval);
1383
                          write_exp_elt_opcode (OP_M2_STRING); ;
1384
    break;}
1385
case 72:
1386
#line 537 "m2-exp.y"
1387
{ yyval.bval = SYMBOL_BLOCK_VALUE(yyvsp[0].sym); ;
1388
    break;}
1389
case 73:
1390
#line 541 "m2-exp.y"
1391
{ struct symbol *sym
1392
                            = lookup_symbol (copy_name (yyvsp[0].sval), expression_context_block,
1393
                                             VAR_NAMESPACE, 0, NULL);
1394
                          yyval.sym = sym;;
1395
    break;}
1396
case 74:
1397
#line 550 "m2-exp.y"
1398
{ struct symbol *tem
1399
                            = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1400
                                             VAR_NAMESPACE, 0, NULL);
1401
                          if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1402
                            error ("No function \"%s\" in specified context.",
1403
                                   copy_name (yyvsp[0].sval));
1404
                          yyval.sym = tem;
1405
                        ;
1406
    break;}
1407
case 75:
1408
#line 562 "m2-exp.y"
1409
{ write_exp_elt_opcode(OP_VAR_VALUE);
1410
                          write_exp_elt_block (NULL);
1411
                          write_exp_elt_sym (yyvsp[0].sym);
1412
                          write_exp_elt_opcode (OP_VAR_VALUE); ;
1413
    break;}
1414
case 77:
1415
#line 574 "m2-exp.y"
1416
{ struct symbol *sym;
1417
                          sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1418
                                               VAR_NAMESPACE, 0, NULL);
1419
                          if (sym == 0)
1420
                            error ("No symbol \"%s\" in specified context.",
1421
                                   copy_name (yyvsp[0].sval));
1422
 
1423
                          write_exp_elt_opcode (OP_VAR_VALUE);
1424
                          /* block_found is set by lookup_symbol.  */
1425
                          write_exp_elt_block (block_found);
1426
                          write_exp_elt_sym (sym);
1427
                          write_exp_elt_opcode (OP_VAR_VALUE); ;
1428
    break;}
1429
case 78:
1430
#line 590 "m2-exp.y"
1431
{ struct symbol *sym;
1432
                          int is_a_field_of_this;
1433
 
1434
                          sym = lookup_symbol (copy_name (yyvsp[0].sval),
1435
                                               expression_context_block,
1436
                                               VAR_NAMESPACE,
1437
                                               &is_a_field_of_this,
1438
                                               NULL);
1439
                          if (sym)
1440
                            {
1441
                              if (symbol_read_needs_frame (sym))
1442
                                {
1443
                                  if (innermost_block == 0 ||
1444
                                      contained_in (block_found,
1445
                                                    innermost_block))
1446
                                    innermost_block = block_found;
1447
                                }
1448
 
1449
                              write_exp_elt_opcode (OP_VAR_VALUE);
1450
                              /* We want to use the selected frame, not
1451
                                 another more inner frame which happens to
1452
                                 be in the same block.  */
1453
                              write_exp_elt_block (NULL);
1454
                              write_exp_elt_sym (sym);
1455
                              write_exp_elt_opcode (OP_VAR_VALUE);
1456
                            }
1457
                          else
1458
                            {
1459
                              struct minimal_symbol *msymbol;
1460
                              register char *arg = copy_name (yyvsp[0].sval);
1461
 
1462
                              msymbol =
1463
                                lookup_minimal_symbol (arg, NULL, NULL);
1464
                              if (msymbol != NULL)
1465
                                {
1466
                                  write_exp_msymbol
1467
                                    (msymbol,
1468
                                     lookup_function_type (builtin_type_int),
1469
                                     builtin_type_int);
1470
                                }
1471
                              else if (!have_full_symbols () && !have_partial_symbols ())
1472
                                error ("No symbol table is loaded.  Use the \"symbol-file\" command.");
1473
                              else
1474
                                error ("No symbol \"%s\" in current context.",
1475
                                       copy_name (yyvsp[0].sval));
1476
                            }
1477
                        ;
1478
    break;}
1479
case 79:
1480
#line 641 "m2-exp.y"
1481
{ yyval.tval = lookup_typename (copy_name (yyvsp[0].sval),
1482
                                                expression_context_block, 0); ;
1483
    break;}
1484
}
1485
   /* the action file gets copied in in place of this dollarsign */
1486
#line 542 "/usr/lib/bison.simple"
1487
 
1488
  yyvsp -= yylen;
1489
  yyssp -= yylen;
1490
#ifdef YYLSP_NEEDED
1491
  yylsp -= yylen;
1492
#endif
1493
 
1494
#if YYDEBUG != 0
1495
  if (yydebug)
1496
    {
1497
      short *ssp1 = yyss - 1;
1498
      fprintf (stderr, "state stack now");
1499
      while (ssp1 != yyssp)
1500
        fprintf (stderr, " %d", *++ssp1);
1501
      fprintf (stderr, "\n");
1502
    }
1503
#endif
1504
 
1505
  *++yyvsp = yyval;
1506
 
1507
#ifdef YYLSP_NEEDED
1508
  yylsp++;
1509
  if (yylen == 0)
1510
    {
1511
      yylsp->first_line = yylloc.first_line;
1512
      yylsp->first_column = yylloc.first_column;
1513
      yylsp->last_line = (yylsp-1)->last_line;
1514
      yylsp->last_column = (yylsp-1)->last_column;
1515
      yylsp->text = 0;
1516
    }
1517
  else
1518
    {
1519
      yylsp->last_line = (yylsp+yylen-1)->last_line;
1520
      yylsp->last_column = (yylsp+yylen-1)->last_column;
1521
    }
1522
#endif
1523
 
1524
  /* Now "shift" the result of the reduction.
1525
     Determine what state that goes to,
1526
     based on the state we popped back to
1527
     and the rule number reduced by.  */
1528
 
1529
  yyn = yyr1[yyn];
1530
 
1531
  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1532
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1533
    yystate = yytable[yystate];
1534
  else
1535
    yystate = yydefgoto[yyn - YYNTBASE];
1536
 
1537
  goto yynewstate;
1538
 
1539
yyerrlab:   /* here on detecting error */
1540
 
1541
  if (! yyerrstatus)
1542
    /* If not already recovering from an error, report this error.  */
1543
    {
1544
      ++yynerrs;
1545
 
1546
#ifdef YYERROR_VERBOSE
1547
      yyn = yypact[yystate];
1548
 
1549
      if (yyn > YYFLAG && yyn < YYLAST)
1550
        {
1551
          int size = 0;
1552
          char *msg;
1553
          int x, count;
1554
 
1555
          count = 0;
1556
          /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
1557
          for (x = (yyn < 0 ? -yyn : 0);
1558
               x < (sizeof(yytname) / sizeof(char *)); x++)
1559
            if (yycheck[x + yyn] == x)
1560
              size += strlen(yytname[x]) + 15, count++;
1561
          msg = (char *) xmalloc(size + 15);
1562
          if (msg != 0)
1563
            {
1564
              strcpy(msg, "parse error");
1565
 
1566
              if (count < 5)
1567
                {
1568
                  count = 0;
1569
                  for (x = (yyn < 0 ? -yyn : 0);
1570
                       x < (sizeof(yytname) / sizeof(char *)); x++)
1571
                    if (yycheck[x + yyn] == x)
1572
                      {
1573
                        strcat(msg, count == 0 ? ", expecting `" : " or `");
1574
                        strcat(msg, yytname[x]);
1575
                        strcat(msg, "'");
1576
                        count++;
1577
                      }
1578
                }
1579
              yyerror(msg);
1580
              free(msg);
1581
            }
1582
          else
1583
            yyerror ("parse error; also virtual memory exceeded");
1584
        }
1585
      else
1586
#endif /* YYERROR_VERBOSE */
1587
        yyerror("parse error");
1588
    }
1589
 
1590
  goto yyerrlab1;
1591
yyerrlab1:   /* here on error raised explicitly by an action */
1592
 
1593
  if (yyerrstatus == 3)
1594
    {
1595
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
1596
 
1597
      /* return failure if at end of input */
1598
      if (yychar == YYEOF)
1599
        YYABORT;
1600
 
1601
#if YYDEBUG != 0
1602
      if (yydebug)
1603
        fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1604
#endif
1605
 
1606
      yychar = YYEMPTY;
1607
    }
1608
 
1609
  /* Else will try to reuse lookahead token
1610
     after shifting the error token.  */
1611
 
1612
  yyerrstatus = 3;              /* Each real token shifted decrements this */
1613
 
1614
  goto yyerrhandle;
1615
 
1616
yyerrdefault:  /* current state does not do anything special for the error token. */
1617
 
1618
#if 0
1619
  /* This is wrong; only states that explicitly want error tokens
1620
     should shift them.  */
1621
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
1622
  if (yyn) goto yydefault;
1623
#endif
1624
 
1625
yyerrpop:   /* pop the current state because it cannot handle the error token */
1626
 
1627
  if (yyssp == yyss) YYABORT;
1628
  yyvsp--;
1629
  yystate = *--yyssp;
1630
#ifdef YYLSP_NEEDED
1631
  yylsp--;
1632
#endif
1633
 
1634
#if YYDEBUG != 0
1635
  if (yydebug)
1636
    {
1637
      short *ssp1 = yyss - 1;
1638
      fprintf (stderr, "Error: state stack now");
1639
      while (ssp1 != yyssp)
1640
        fprintf (stderr, " %d", *++ssp1);
1641
      fprintf (stderr, "\n");
1642
    }
1643
#endif
1644
 
1645
yyerrhandle:
1646
 
1647
  yyn = yypact[yystate];
1648
  if (yyn == YYFLAG)
1649
    goto yyerrdefault;
1650
 
1651
  yyn += YYTERROR;
1652
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1653
    goto yyerrdefault;
1654
 
1655
  yyn = yytable[yyn];
1656
  if (yyn < 0)
1657
    {
1658
      if (yyn == YYFLAG)
1659
        goto yyerrpop;
1660
      yyn = -yyn;
1661
      goto yyreduce;
1662
    }
1663
  else if (yyn == 0)
1664
    goto yyerrpop;
1665
 
1666
  if (yyn == YYFINAL)
1667
    YYACCEPT;
1668
 
1669
#if YYDEBUG != 0
1670
  if (yydebug)
1671
    fprintf(stderr, "Shifting error token, ");
1672
#endif
1673
 
1674
  *++yyvsp = yylval;
1675
#ifdef YYLSP_NEEDED
1676
  *++yylsp = yylloc;
1677
#endif
1678
 
1679
  yystate = yyn;
1680
  goto yynewstate;
1681
 
1682
 yyacceptlab:
1683
  /* YYACCEPT comes here.  */
1684
  if (yyfree_stacks)
1685
    {
1686
      free (yyss);
1687
      free (yyvs);
1688
#ifdef YYLSP_NEEDED
1689
      free (yyls);
1690
#endif
1691
    }
1692
  return 0;
1693
 
1694
 yyabortlab:
1695
  /* YYABORT comes here.  */
1696
  if (yyfree_stacks)
1697
    {
1698
      free (yyss);
1699
      free (yyvs);
1700
#ifdef YYLSP_NEEDED
1701
      free (yyls);
1702
#endif
1703
    }
1704
  return 1;
1705
}
1706
#line 646 "m2-exp.y"
1707
 
1708
 
1709
#if 0  /* FIXME! */
1710
int
1711
overflow(a,b)
1712
   long a,b;
1713
{
1714
   return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
1715
}
1716
 
1717
int
1718
uoverflow(a,b)
1719
   unsigned long a,b;
1720
{
1721
   return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
1722
}
1723
#endif /* FIXME */
1724
 
1725
/* Take care of parsing a number (anything that starts with a digit).
1726
   Set yylval and return the token type; update lexptr.
1727
   LEN is the number of characters in it.  */
1728
 
1729
/*** Needs some error checking for the float case ***/
1730
 
1731
static int
1732
parse_number (olen)
1733
     int olen;
1734
{
1735
  register char *p = lexptr;
1736
  register LONGEST n = 0;
1737
  register LONGEST prevn = 0;
1738
  register int c,i,ischar=0;
1739
  register int base = input_radix;
1740
  register int len = olen;
1741
  int unsigned_p = number_sign == 1 ? 1 : 0;
1742
 
1743
  if(p[len-1] == 'H')
1744
  {
1745
     base = 16;
1746
     len--;
1747
  }
1748
  else if(p[len-1] == 'C' || p[len-1] == 'B')
1749
  {
1750
     base = 8;
1751
     ischar = p[len-1] == 'C';
1752
     len--;
1753
  }
1754
 
1755
  /* Scan the number */
1756
  for (c = 0; c < len; c++)
1757
  {
1758
    if (p[c] == '.' && base == 10)
1759
      {
1760
        /* It's a float since it contains a point.  */
1761
        yylval.dval = atof (p);
1762
        lexptr += len;
1763
        return FLOAT;
1764
      }
1765
    if (p[c] == '.' && base != 10)
1766
       error("Floating point numbers must be base 10.");
1767
    if (base == 10 && (p[c] < '0' || p[c] > '9'))
1768
       error("Invalid digit \'%c\' in number.",p[c]);
1769
 }
1770
 
1771
  while (len-- > 0)
1772
    {
1773
      c = *p++;
1774
      n *= base;
1775
      if( base == 8 && (c == '8' || c == '9'))
1776
         error("Invalid digit \'%c\' in octal number.",c);
1777
      if (c >= '0' && c <= '9')
1778
        i = c - '0';
1779
      else
1780
        {
1781
          if (base == 16 && c >= 'A' && c <= 'F')
1782
            i = c - 'A' + 10;
1783
          else
1784
             return ERROR;
1785
        }
1786
      n+=i;
1787
      if(i >= base)
1788
         return ERROR;
1789
      if(!unsigned_p && number_sign == 1 && (prevn >= n))
1790
         unsigned_p=1;          /* Try something unsigned */
1791
      /* Don't do the range check if n==i and i==0, since that special
1792
         case will give an overflow error. */
1793
      if(RANGE_CHECK && n!=i && i)
1794
      {
1795
         if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
1796
            ((!unsigned_p && number_sign==-1) && -prevn <= -n))
1797
            range_error("Overflow on numeric constant.");
1798
      }
1799
         prevn=n;
1800
    }
1801
 
1802
  lexptr = p;
1803
  if(*p == 'B' || *p == 'C' || *p == 'H')
1804
     lexptr++;                  /* Advance past B,C or H */
1805
 
1806
  if (ischar)
1807
  {
1808
     yylval.ulval = n;
1809
     return CHAR;
1810
  }
1811
  else if ( unsigned_p && number_sign == 1)
1812
  {
1813
     yylval.ulval = n;
1814
     return UINT;
1815
  }
1816
  else if((unsigned_p && (n<0))) {
1817
     range_error("Overflow on numeric constant -- number too large.");
1818
     /* But, this can return if range_check == range_warn.  */
1819
  }
1820
  yylval.lval = n;
1821
  return INT;
1822
}
1823
 
1824
 
1825
/* Some tokens */
1826
 
1827
static struct
1828
{
1829
   char name[2];
1830
   int token;
1831
} tokentab2[] =
1832
{
1833
    { {'<', '>'},    NOTEQUAL   },
1834
    { {':', '='},    ASSIGN     },
1835
    { {'<', '='},    LEQ        },
1836
    { {'>', '='},    GEQ        },
1837
    { {':', ':'},    COLONCOLON },
1838
 
1839
};
1840
 
1841
/* Some specific keywords */
1842
 
1843
struct keyword {
1844
   char keyw[10];
1845
   int token;
1846
};
1847
 
1848
static struct keyword keytab[] =
1849
{
1850
    {"OR" ,   OROR       },
1851
    {"IN",    IN         },/* Note space after IN */
1852
    {"AND",   LOGICAL_AND},
1853
    {"ABS",   ABS        },
1854
    {"CHR",   CHR        },
1855
    {"DEC",   DEC        },
1856
    {"NOT",   NOT        },
1857
    {"DIV",   DIV        },
1858
    {"INC",   INC        },
1859
    {"MAX",   MAX_FUNC   },
1860
    {"MIN",   MIN_FUNC   },
1861
    {"MOD",   MOD        },
1862
    {"ODD",   ODD        },
1863
    {"CAP",   CAP        },
1864
    {"ORD",   ORD        },
1865
    {"VAL",   VAL        },
1866
    {"EXCL",  EXCL       },
1867
    {"HIGH",  HIGH       },
1868
    {"INCL",  INCL       },
1869
    {"SIZE",  SIZE       },
1870
    {"FLOAT", FLOAT_FUNC },
1871
    {"TRUNC", TRUNC      },
1872
};
1873
 
1874
 
1875
/* Read one token, getting characters through lexptr.  */
1876
 
1877
/* This is where we will check to make sure that the language and the operators used are
1878
   compatible  */
1879
 
1880
static int
1881
yylex ()
1882
{
1883
  register int c;
1884
  register int namelen;
1885
  register int i;
1886
  register char *tokstart;
1887
  register char quote;
1888
 
1889
 retry:
1890
 
1891
  prev_lexptr = lexptr;
1892
 
1893
  tokstart = lexptr;
1894
 
1895
 
1896
  /* See if it is a special token of length 2 */
1897
  for( i = 0 ; i < (int) (sizeof tokentab2 / sizeof tokentab2[0]) ; i++)
1898
     if(STREQN(tokentab2[i].name, tokstart, 2))
1899
     {
1900
        lexptr += 2;
1901
        return tokentab2[i].token;
1902
     }
1903
 
1904
  switch (c = *tokstart)
1905
    {
1906
    case 0:
1907
      return 0;
1908
 
1909
    case ' ':
1910
    case '\t':
1911
    case '\n':
1912
      lexptr++;
1913
      goto retry;
1914
 
1915
    case '(':
1916
      paren_depth++;
1917
      lexptr++;
1918
      return c;
1919
 
1920
    case ')':
1921
      if (paren_depth == 0)
1922
        return 0;
1923
      paren_depth--;
1924
      lexptr++;
1925
      return c;
1926
 
1927
    case ',':
1928
      if (comma_terminates && paren_depth == 0)
1929
        return 0;
1930
      lexptr++;
1931
      return c;
1932
 
1933
    case '.':
1934
      /* Might be a floating point number.  */
1935
      if (lexptr[1] >= '0' && lexptr[1] <= '9')
1936
        break;                  /* Falls into number code.  */
1937
      else
1938
      {
1939
         lexptr++;
1940
         return DOT;
1941
      }
1942
 
1943
/* These are character tokens that appear as-is in the YACC grammar */
1944
    case '+':
1945
    case '-':
1946
    case '*':
1947
    case '/':
1948
    case '^':
1949
    case '<':
1950
    case '>':
1951
    case '[':
1952
    case ']':
1953
    case '=':
1954
    case '{':
1955
    case '}':
1956
    case '#':
1957
    case '@':
1958
    case '~':
1959
    case '&':
1960
      lexptr++;
1961
      return c;
1962
 
1963
    case '\'' :
1964
    case '"':
1965
      quote = c;
1966
      for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
1967
        if (c == '\\')
1968
          {
1969
            c = tokstart[++namelen];
1970
            if (c >= '0' && c <= '9')
1971
              {
1972
                c = tokstart[++namelen];
1973
                if (c >= '0' && c <= '9')
1974
                  c = tokstart[++namelen];
1975
              }
1976
          }
1977
      if(c != quote)
1978
         error("Unterminated string or character constant.");
1979
      yylval.sval.ptr = tokstart + 1;
1980
      yylval.sval.length = namelen - 1;
1981
      lexptr += namelen + 1;
1982
 
1983
      if(namelen == 2)          /* Single character */
1984
      {
1985
           yylval.ulval = tokstart[1];
1986
           return CHAR;
1987
      }
1988
      else
1989
         return STRING;
1990
    }
1991
 
1992
  /* Is it a number?  */
1993
  /* Note:  We have already dealt with the case of the token '.'.
1994
     See case '.' above.  */
1995
  if ((c >= '0' && c <= '9'))
1996
    {
1997
      /* It's a number.  */
1998
      int got_dot = 0, got_e = 0;
1999
      register char *p = tokstart;
2000
      int toktype;
2001
 
2002
      for (++p ;; ++p)
2003
        {
2004
          if (!got_e && (*p == 'e' || *p == 'E'))
2005
            got_dot = got_e = 1;
2006
          else if (!got_dot && *p == '.')
2007
            got_dot = 1;
2008
          else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2009
                   && (*p == '-' || *p == '+'))
2010
            /* This is the sign of the exponent, not the end of the
2011
               number.  */
2012
            continue;
2013
          else if ((*p < '0' || *p > '9') &&
2014
                   (*p < 'A' || *p > 'F') &&
2015
                   (*p != 'H'))  /* Modula-2 hexadecimal number */
2016
            break;
2017
        }
2018
        toktype = parse_number (p - tokstart);
2019
        if (toktype == ERROR)
2020
          {
2021
            char *err_copy = (char *) alloca (p - tokstart + 1);
2022
 
2023
            memcpy (err_copy, tokstart, p - tokstart);
2024
            err_copy[p - tokstart] = 0;
2025
            error ("Invalid number \"%s\".", err_copy);
2026
          }
2027
        lexptr = p;
2028
        return toktype;
2029
    }
2030
 
2031
  if (!(c == '_' || c == '$'
2032
        || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2033
    /* We must have come across a bad character (e.g. ';').  */
2034
    error ("Invalid character '%c' in expression.", c);
2035
 
2036
  /* It's a name.  See how long it is.  */
2037
  namelen = 0;
2038
  for (c = tokstart[namelen];
2039
       (c == '_' || c == '$' || (c >= '0' && c <= '9')
2040
        || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
2041
       c = tokstart[++namelen])
2042
    ;
2043
 
2044
  /* The token "if" terminates the expression and is NOT
2045
     removed from the input stream.  */
2046
  if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2047
    {
2048
      return 0;
2049
    }
2050
 
2051
  lexptr += namelen;
2052
 
2053
  /*  Lookup special keywords */
2054
  for(i = 0 ; i < (int) (sizeof(keytab) / sizeof(keytab[0])) ; i++)
2055
     if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
2056
           return keytab[i].token;
2057
 
2058
  yylval.sval.ptr = tokstart;
2059
  yylval.sval.length = namelen;
2060
 
2061
  if (*tokstart == '$')
2062
    {
2063
      write_dollar_variable (yylval.sval);
2064
      return INTERNAL_VAR;
2065
    }
2066
 
2067
  /* Use token-type BLOCKNAME for symbols that happen to be defined as
2068
     functions.  If this is not so, then ...
2069
     Use token-type TYPENAME for symbols that happen to be defined
2070
     currently as names of types; NAME for other symbols.
2071
     The caller is not constrained to care about the distinction.  */
2072
 {
2073
 
2074
 
2075
    char *tmp = copy_name (yylval.sval);
2076
    struct symbol *sym;
2077
 
2078
    if (lookup_partial_symtab (tmp))
2079
      return BLOCKNAME;
2080
    sym = lookup_symbol (tmp, expression_context_block,
2081
                         VAR_NAMESPACE, 0, NULL);
2082
    if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
2083
      return BLOCKNAME;
2084
    if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
2085
      return TYPENAME;
2086
 
2087
    if(sym)
2088
    {
2089
       switch(sym->aclass)
2090
       {
2091
       case LOC_STATIC:
2092
       case LOC_REGISTER:
2093
       case LOC_ARG:
2094
       case LOC_REF_ARG:
2095
       case LOC_REGPARM:
2096
       case LOC_REGPARM_ADDR:
2097
       case LOC_LOCAL:
2098
       case LOC_LOCAL_ARG:
2099
       case LOC_BASEREG:
2100
       case LOC_BASEREG_ARG:
2101
       case LOC_CONST:
2102
       case LOC_CONST_BYTES:
2103
       case LOC_OPTIMIZED_OUT:
2104
          return NAME;
2105
 
2106
       case LOC_TYPEDEF:
2107
          return TYPENAME;
2108
 
2109
       case LOC_BLOCK:
2110
          return BLOCKNAME;
2111
 
2112
       case LOC_UNDEF:
2113
          error("internal:  Undefined class in m2lex()");
2114
 
2115
       case LOC_LABEL:
2116
       case LOC_UNRESOLVED:
2117
          error("internal:  Unforseen case in m2lex()");
2118
 
2119
       default:
2120
          error ("unhandled token in m2lex()");
2121
          break;
2122
       }
2123
    }
2124
    else
2125
    {
2126
       /* Built-in BOOLEAN type.  This is sort of a hack. */
2127
       if(STREQN(tokstart,"TRUE",4))
2128
       {
2129
          yylval.ulval = 1;
2130
          return M2_TRUE;
2131
       }
2132
       else if(STREQN(tokstart,"FALSE",5))
2133
       {
2134
          yylval.ulval = 0;
2135
          return M2_FALSE;
2136
       }
2137
    }
2138
 
2139
    /* Must be another type of name... */
2140
    return NAME;
2141
 }
2142
}
2143
 
2144
#if 0           /* Unused */
2145
static char *
2146
make_qualname(mod,ident)
2147
   char *mod, *ident;
2148
{
2149
   char *new = xmalloc(strlen(mod)+strlen(ident)+2);
2150
 
2151
   strcpy(new,mod);
2152
   strcat(new,".");
2153
   strcat(new,ident);
2154
   return new;
2155
}
2156
#endif  /* 0 */
2157
 
2158
void
2159
yyerror (msg)
2160
     char *msg;
2161
{
2162
  if (prev_lexptr)
2163
    lexptr = prev_lexptr;
2164
 
2165
  error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
2166
}

powered by: WebSVN 2.1.0

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