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

Subversion Repositories or1k

[/] [or1k/] [tags/] [VER_5_3/] [gdb-5.3/] [gdb/] [ada-exp.tab.c] - Blame information for rev 1778

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

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

powered by: WebSVN 2.1.0

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