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