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

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [gdb-5.0/] [gdb/] [m2-exp.tab.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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