1130803Smarcel/* A Bison parser, made by GNU Bison 1.875.  */
2130803Smarcel
3130803Smarcel/* Skeleton parser for Yacc-like parsing with Bison,
4130803Smarcel   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5130803Smarcel
6130803Smarcel   This program is free software; you can redistribute it and/or modify
7130803Smarcel   it under the terms of the GNU General Public License as published by
8130803Smarcel   the Free Software Foundation; either version 2, or (at your option)
9130803Smarcel   any later version.
10130803Smarcel
11130803Smarcel   This program is distributed in the hope that it will be useful,
12130803Smarcel   but WITHOUT ANY WARRANTY; without even the implied warranty of
13130803Smarcel   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14130803Smarcel   GNU General Public License for more details.
15130803Smarcel
16130803Smarcel   You should have received a copy of the GNU General Public License
17130803Smarcel   along with this program; if not, write to the Free Software
18130803Smarcel   Foundation, Inc., 59 Temple Place - Suite 330,
19130803Smarcel   Boston, MA 02111-1307, USA.  */
20130803Smarcel
21130803Smarcel/* As a special exception, when this file is copied by Bison into a
22130803Smarcel   Bison output file, you may use that output file without restriction.
23130803Smarcel   This special exception was added by the Free Software Foundation
24130803Smarcel   in version 1.24 of Bison.  */
25130803Smarcel
26130803Smarcel/* Written by Richard Stallman by simplifying the original so called
27130803Smarcel   ``semantic'' parser.  */
28130803Smarcel
29130803Smarcel/* All symbols defined below should begin with yy or YY, to avoid
30130803Smarcel   infringing on user name space.  This should be done even for local
31130803Smarcel   variables, as they might otherwise be expanded by user macros.
32130803Smarcel   There are some unavoidable exceptions within include files to
33130803Smarcel   define necessary library symbols; they are noted "INFRINGES ON
34130803Smarcel   USER NAME SPACE" below.  */
35130803Smarcel
36130803Smarcel/* Identify Bison output.  */
37130803Smarcel#define YYBISON 1
38130803Smarcel
39130803Smarcel/* Skeleton name.  */
40130803Smarcel#define YYSKELETON_NAME "yacc.c"
41130803Smarcel
42130803Smarcel/* Pure parsers.  */
43130803Smarcel#define YYPURE 0
44130803Smarcel
45130803Smarcel/* Using locations.  */
46130803Smarcel#define YYLSP_NEEDED 0
47130803Smarcel
48130803Smarcel
49130803Smarcel
50130803Smarcel/* Tokens.  */
51130803Smarcel#ifndef YYTOKENTYPE
52130803Smarcel# define YYTOKENTYPE
53130803Smarcel   /* Put the tokens into the symbol table, so that GDB and other debuggers
54130803Smarcel      know about them.  */
55130803Smarcel   enum yytokentype {
56130803Smarcel     INT = 258,
57130803Smarcel     NULL_PTR = 259,
58130803Smarcel     CHARLIT = 260,
59130803Smarcel     FLOAT = 261,
60130803Smarcel     TYPENAME = 262,
61130803Smarcel     BLOCKNAME = 263,
62130803Smarcel     STRING = 264,
63130803Smarcel     NAME = 265,
64130803Smarcel     DOT_ID = 266,
65130803Smarcel     OBJECT_RENAMING = 267,
66130803Smarcel     DOT_ALL = 268,
67130803Smarcel     LAST = 269,
68130803Smarcel     REGNAME = 270,
69130803Smarcel     INTERNAL_VARIABLE = 271,
70130803Smarcel     ASSIGN = 272,
71130803Smarcel     ELSE = 273,
72130803Smarcel     THEN = 274,
73130803Smarcel     XOR = 275,
74130803Smarcel     OR = 276,
75130803Smarcel     _AND_ = 277,
76130803Smarcel     DOTDOT = 278,
77130803Smarcel     IN = 279,
78130803Smarcel     GEQ = 280,
79130803Smarcel     LEQ = 281,
80130803Smarcel     NOTEQUAL = 282,
81130803Smarcel     UNARY = 283,
82130803Smarcel     REM = 284,
83130803Smarcel     MOD = 285,
84130803Smarcel     NOT = 286,
85130803Smarcel     ABS = 287,
86130803Smarcel     STARSTAR = 288,
87130803Smarcel     TICK_LENGTH = 289,
88130803Smarcel     TICK_LAST = 290,
89130803Smarcel     TICK_FIRST = 291,
90130803Smarcel     TICK_ADDRESS = 292,
91130803Smarcel     TICK_ACCESS = 293,
92130803Smarcel     TICK_MODULUS = 294,
93130803Smarcel     TICK_MIN = 295,
94130803Smarcel     TICK_MAX = 296,
95130803Smarcel     TICK_VAL = 297,
96130803Smarcel     TICK_TAG = 298,
97130803Smarcel     TICK_SIZE = 299,
98130803Smarcel     TICK_RANGE = 300,
99130803Smarcel     TICK_POS = 301,
100130803Smarcel     ARROW = 302,
101130803Smarcel     NEW = 303
102130803Smarcel   };
103130803Smarcel#endif
104130803Smarcel#define INT 258
105130803Smarcel#define NULL_PTR 259
106130803Smarcel#define CHARLIT 260
107130803Smarcel#define FLOAT 261
108130803Smarcel#define TYPENAME 262
109130803Smarcel#define BLOCKNAME 263
110130803Smarcel#define STRING 264
111130803Smarcel#define NAME 265
112130803Smarcel#define DOT_ID 266
113130803Smarcel#define OBJECT_RENAMING 267
114130803Smarcel#define DOT_ALL 268
115130803Smarcel#define LAST 269
116130803Smarcel#define REGNAME 270
117130803Smarcel#define INTERNAL_VARIABLE 271
118130803Smarcel#define ASSIGN 272
119130803Smarcel#define ELSE 273
120130803Smarcel#define THEN 274
121130803Smarcel#define XOR 275
122130803Smarcel#define OR 276
123130803Smarcel#define _AND_ 277
124130803Smarcel#define DOTDOT 278
125130803Smarcel#define IN 279
126130803Smarcel#define GEQ 280
127130803Smarcel#define LEQ 281
128130803Smarcel#define NOTEQUAL 282
129130803Smarcel#define UNARY 283
130130803Smarcel#define REM 284
131130803Smarcel#define MOD 285
132130803Smarcel#define NOT 286
133130803Smarcel#define ABS 287
134130803Smarcel#define STARSTAR 288
135130803Smarcel#define TICK_LENGTH 289
136130803Smarcel#define TICK_LAST 290
137130803Smarcel#define TICK_FIRST 291
138130803Smarcel#define TICK_ADDRESS 292
139130803Smarcel#define TICK_ACCESS 293
140130803Smarcel#define TICK_MODULUS 294
141130803Smarcel#define TICK_MIN 295
142130803Smarcel#define TICK_MAX 296
143130803Smarcel#define TICK_VAL 297
144130803Smarcel#define TICK_TAG 298
145130803Smarcel#define TICK_SIZE 299
146130803Smarcel#define TICK_RANGE 300
147130803Smarcel#define TICK_POS 301
148130803Smarcel#define ARROW 302
149130803Smarcel#define NEW 303
150130803Smarcel
151130803Smarcel
152130803Smarcel
153130803Smarcel
154130803Smarcel/* Copy the first part of user declarations.  */
155130803Smarcel#line 38 "ada-exp.y"
156130803Smarcel
157130803Smarcel
158130803Smarcel#include "defs.h"
159130803Smarcel#include <string.h>
160130803Smarcel#include <ctype.h>
161130803Smarcel#include "expression.h"
162130803Smarcel#include "value.h"
163130803Smarcel#include "parser-defs.h"
164130803Smarcel#include "language.h"
165130803Smarcel#include "ada-lang.h"
166130803Smarcel#include "bfd.h" /* Required by objfiles.h.  */
167130803Smarcel#include "symfile.h" /* Required by objfiles.h.  */
168130803Smarcel#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
169130803Smarcel#include "frame.h"
170130803Smarcel#include "block.h"
171130803Smarcel
172130803Smarcel/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
173130803Smarcel   as well as gratuitiously global symbol names, so we can have multiple
174130803Smarcel   yacc generated parsers in gdb.  These are only the variables
175130803Smarcel   produced by yacc.  If other parser generators (bison, byacc, etc) produce
176130803Smarcel   additional global names that conflict at link time, then those parser
177130803Smarcel   generators need to be fixed instead of adding those names to this list. */
178130803Smarcel
179130803Smarcel/* NOTE: This is clumsy, especially since BISON and FLEX provide --prefix
180130803Smarcel   options.  I presume we are maintaining it to accommodate systems
181130803Smarcel   without BISON?  (PNH) */
182130803Smarcel
183130803Smarcel#define	yymaxdepth ada_maxdepth
184130803Smarcel#define	yyparse	_ada_parse	/* ada_parse calls this after  initialization */
185130803Smarcel#define	yylex	ada_lex
186130803Smarcel#define	yyerror	ada_error
187130803Smarcel#define	yylval	ada_lval
188130803Smarcel#define	yychar	ada_char
189130803Smarcel#define	yydebug	ada_debug
190130803Smarcel#define	yypact	ada_pact
191130803Smarcel#define	yyr1	ada_r1
192130803Smarcel#define	yyr2	ada_r2
193130803Smarcel#define	yydef	ada_def
194130803Smarcel#define	yychk	ada_chk
195130803Smarcel#define	yypgo	ada_pgo
196130803Smarcel#define	yyact	ada_act
197130803Smarcel#define	yyexca	ada_exca
198130803Smarcel#define yyerrflag ada_errflag
199130803Smarcel#define yynerrs	ada_nerrs
200130803Smarcel#define	yyps	ada_ps
201130803Smarcel#define	yypv	ada_pv
202130803Smarcel#define	yys	ada_s
203130803Smarcel#define	yy_yys	ada_yys
204130803Smarcel#define	yystate	ada_state
205130803Smarcel#define	yytmp	ada_tmp
206130803Smarcel#define	yyv	ada_v
207130803Smarcel#define	yy_yyv	ada_yyv
208130803Smarcel#define	yyval	ada_val
209130803Smarcel#define	yylloc	ada_lloc
210130803Smarcel#define yyreds	ada_reds		/* With YYDEBUG defined */
211130803Smarcel#define yytoks	ada_toks		/* With YYDEBUG defined */
212130803Smarcel#define yyname	ada_name		/* With YYDEBUG defined */
213130803Smarcel#define yyrule	ada_rule		/* With YYDEBUG defined */
214130803Smarcel
215130803Smarcel#ifndef YYDEBUG
216130803Smarcel#define	YYDEBUG	1		/* Default to yydebug support */
217130803Smarcel#endif
218130803Smarcel
219130803Smarcel#define YYFPRINTF parser_fprintf
220130803Smarcel
221130803Smarcelstruct name_info {
222130803Smarcel  struct symbol* sym;
223130803Smarcel  struct minimal_symbol* msym;
224130803Smarcel  struct block* block;
225130803Smarcel  struct stoken stoken;
226130803Smarcel};
227130803Smarcel
228130803Smarcel/* If expression is in the context of TYPE'(...), then TYPE, else
229130803Smarcel * NULL. */
230130803Smarcelstatic struct type* type_qualifier;
231130803Smarcel
232130803Smarcelint yyparse (void);
233130803Smarcel
234130803Smarcelstatic int yylex (void);
235130803Smarcel
236130803Smarcelvoid yyerror (char *);
237130803Smarcel
238130803Smarcelstatic struct stoken string_to_operator (struct stoken);
239130803Smarcel
240130803Smarcelstatic void write_attribute_call0 (enum ada_attribute);
241130803Smarcel
242130803Smarcelstatic void write_attribute_call1 (enum ada_attribute, LONGEST);
243130803Smarcel
244130803Smarcelstatic void write_attribute_calln (enum ada_attribute, int);
245130803Smarcel
246130803Smarcelstatic void write_object_renaming (struct block*, struct symbol*);
247130803Smarcel
248130803Smarcelstatic void write_var_from_name (struct block*, struct name_info);
249130803Smarcel
250130803Smarcelstatic LONGEST
251130803Smarcelconvert_char_literal (struct type*, LONGEST);
252130803Smarcel
253130803Smarcel
254130803Smarcel/* Enabling traces.  */
255130803Smarcel#ifndef YYDEBUG
256130803Smarcel# define YYDEBUG 0
257130803Smarcel#endif
258130803Smarcel
259130803Smarcel/* Enabling verbose error messages.  */
260130803Smarcel#ifdef YYERROR_VERBOSE
261130803Smarcel# undef YYERROR_VERBOSE
262130803Smarcel# define YYERROR_VERBOSE 1
263130803Smarcel#else
264130803Smarcel# define YYERROR_VERBOSE 0
265130803Smarcel#endif
266130803Smarcel
267130803Smarcel#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
268130803Smarcel#line 137 "ada-exp.y"
269130803Smarceltypedef union YYSTYPE {
270130803Smarcel    LONGEST lval;
271130803Smarcel    struct {
272130803Smarcel      LONGEST val;
273130803Smarcel      struct type *type;
274130803Smarcel    } typed_val;
275130803Smarcel    struct {
276130803Smarcel      DOUBLEST dval;
277130803Smarcel      struct type *type;
278130803Smarcel    } typed_val_float;
279130803Smarcel    struct type *tval;
280130803Smarcel    struct stoken sval;
281130803Smarcel    struct name_info ssym;
282130803Smarcel    int voidval;
283130803Smarcel    struct block *bval;
284130803Smarcel    struct internalvar *ivar;
285130803Smarcel
286130803Smarcel  } YYSTYPE;
287130803Smarcel/* Line 191 of yacc.c.  */
288130803Smarcel# define yystype YYSTYPE /* obsolescent; will be withdrawn */
289130803Smarcel# define YYSTYPE_IS_DECLARED 1
290130803Smarcel# define YYSTYPE_IS_TRIVIAL 1
291130803Smarcel#endif
292130803Smarcel
293130803Smarcel
294130803Smarcel
295130803Smarcel/* Copy the second part of user declarations.  */
296130803Smarcel
297130803Smarcel
298130803Smarcel/* Line 214 of yacc.c.  */
299130803Smarcel
300130803Smarcel#if ! defined (yyoverflow) || YYERROR_VERBOSE
301130803Smarcel
302130803Smarcel/* The parser invokes alloca or xmalloc; define the necessary symbols.  */
303130803Smarcel
304130803Smarcel# if YYSTACK_USE_ALLOCA
305130803Smarcel#  define YYSTACK_ALLOC alloca
306130803Smarcel# else
307130803Smarcel#  ifndef YYSTACK_USE_ALLOCA
308130803Smarcel#   if defined (alloca) || defined (_ALLOCA_H)
309130803Smarcel#    define YYSTACK_ALLOC alloca
310130803Smarcel#   else
311130803Smarcel#    ifdef __GNUC__
312130803Smarcel#     define YYSTACK_ALLOC __builtin_alloca
313130803Smarcel#    endif
314130803Smarcel#   endif
315130803Smarcel#  endif
316130803Smarcel# endif
317130803Smarcel
318130803Smarcel# ifdef YYSTACK_ALLOC
319130803Smarcel   /* Pacify GCC's `empty if-body' warning. */
320130803Smarcel#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
321130803Smarcel# else
322130803Smarcel#  if defined (__STDC__) || defined (__cplusplus)
323130803Smarcel#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
324130803Smarcel#   define YYSIZE_T size_t
325130803Smarcel#  endif
326130803Smarcel#  define YYSTACK_ALLOC xmalloc
327130803Smarcel#  define YYSTACK_FREE free
328130803Smarcel# endif
329130803Smarcel#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
330130803Smarcel
331130803Smarcel
332130803Smarcel#if (! defined (yyoverflow) \
333130803Smarcel     && (! defined (__cplusplus) \
334130803Smarcel	 || (YYSTYPE_IS_TRIVIAL)))
335130803Smarcel
336130803Smarcel/* A type that is properly aligned for any stack member.  */
337130803Smarcelunion yyalloc
338130803Smarcel{
339130803Smarcel  short yyss;
340130803Smarcel  YYSTYPE yyvs;
341130803Smarcel  };
342130803Smarcel
343130803Smarcel/* The size of the maximum gap between one aligned stack and the next.  */
344130803Smarcel# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
345130803Smarcel
346130803Smarcel/* The size of an array large to enough to hold all stacks, each with
347130803Smarcel   N elements.  */
348130803Smarcel# define YYSTACK_BYTES(N) \
349130803Smarcel     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
350130803Smarcel      + YYSTACK_GAP_MAXIMUM)
351130803Smarcel
352130803Smarcel/* Copy COUNT objects from FROM to TO.  The source and destination do
353130803Smarcel   not overlap.  */
354130803Smarcel# ifndef YYCOPY
355130803Smarcel#  if 1 < __GNUC__
356130803Smarcel#   define YYCOPY(To, From, Count) \
357130803Smarcel      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
358130803Smarcel#  else
359130803Smarcel#   define YYCOPY(To, From, Count)		\
360130803Smarcel      do					\
361130803Smarcel	{					\
362130803Smarcel	  register YYSIZE_T yyi;		\
363130803Smarcel	  for (yyi = 0; yyi < (Count); yyi++)	\
364130803Smarcel	    (To)[yyi] = (From)[yyi];		\
365130803Smarcel	}					\
366130803Smarcel      while (0)
367130803Smarcel#  endif
368130803Smarcel# endif
369130803Smarcel
370130803Smarcel/* Relocate STACK from its old location to the new one.  The
371130803Smarcel   local variables YYSIZE and YYSTACKSIZE give the old and new number of
372130803Smarcel   elements in the stack, and YYPTR gives the new location of the
373130803Smarcel   stack.  Advance YYPTR to a properly aligned location for the next
374130803Smarcel   stack.  */
375130803Smarcel# define YYSTACK_RELOCATE(Stack)					\
376130803Smarcel    do									\
377130803Smarcel      {									\
378130803Smarcel	YYSIZE_T yynewbytes;						\
379130803Smarcel	YYCOPY (&yyptr->Stack, Stack, yysize);				\
380130803Smarcel	Stack = &yyptr->Stack;						\
381130803Smarcel	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
382130803Smarcel	yyptr += yynewbytes / sizeof (*yyptr);				\
383130803Smarcel      }									\
384130803Smarcel    while (0)
385130803Smarcel
386130803Smarcel#endif
387130803Smarcel
388130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
389130803Smarcel   typedef signed char yysigned_char;
390130803Smarcel#else
391130803Smarcel   typedef short yysigned_char;
392130803Smarcel#endif
393130803Smarcel
394130803Smarcel/* YYFINAL -- State number of the termination state. */
395130803Smarcel#define YYFINAL  44
396130803Smarcel/* YYLAST -- Last index in YYTABLE.  */
397130803Smarcel#define YYLAST   1067
398130803Smarcel
399130803Smarcel/* YYNTOKENS -- Number of terminals. */
400130803Smarcel#define YYNTOKENS  68
401130803Smarcel/* YYNNTS -- Number of nonterminals. */
402130803Smarcel#define YYNNTS  15
403130803Smarcel/* YYNRULES -- Number of rules. */
404130803Smarcel#define YYNRULES  98
405130803Smarcel/* YYNRULES -- Number of states. */
406130803Smarcel#define YYNSTATES  184
407130803Smarcel
408130803Smarcel/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
409130803Smarcel#define YYUNDEFTOK  2
410130803Smarcel#define YYMAXUTOK   303
411130803Smarcel
412130803Smarcel#define YYTRANSLATE(YYX) 						\
413130803Smarcel  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
414130803Smarcel
415130803Smarcel/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
416130803Smarcelstatic const unsigned char yytranslate[] =
417130803Smarcel{
418130803Smarcel       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
419130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
420130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
421130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,    34,    63,
422130803Smarcel      57,    62,    36,    32,    64,    33,    56,    37,     2,     2,
423130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,    61,
424130803Smarcel      24,    23,    25,     2,    31,     2,     2,     2,     2,     2,
425130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
426130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
427130803Smarcel       2,    58,     2,    67,     2,     2,     2,     2,     2,     2,
428130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
429130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
430130803Smarcel       2,     2,     2,    65,     2,    66,     2,     2,     2,     2,
431130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
432130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
433130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
434130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
435130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
436130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
437130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
438130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
439130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
441130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
442130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
443130803Smarcel       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
444130803Smarcel       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
445130803Smarcel      15,    16,    17,    18,    19,    20,    21,    22,    26,    27,
446130803Smarcel      28,    29,    30,    35,    38,    39,    40,    41,    42,    43,
447130803Smarcel      44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
448130803Smarcel      54,    55,    59,    60
449130803Smarcel};
450130803Smarcel
451130803Smarcel#if YYDEBUG
452130803Smarcel/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
453130803Smarcel   YYRHS.  */
454130803Smarcelstatic const unsigned short yyprhs[] =
455130803Smarcel{
456130803Smarcel       0,     0,     3,     5,     7,     9,    13,    16,    19,    24,
457130803Smarcel      29,    30,    38,    39,    46,    50,    52,    54,    56,    58,
458130803Smarcel      60,    64,    67,    70,    73,    76,    77,    79,    83,    87,
459130803Smarcel      93,    98,   102,   106,   110,   114,   118,   122,   126,   130,
460130803Smarcel     134,   138,   142,   146,   152,   158,   162,   169,   176,   181,
461130803Smarcel     185,   189,   193,   197,   202,   206,   211,   215,   218,   221,
462130803Smarcel     225,   229,   233,   236,   239,   247,   255,   261,   265,   269,
463130803Smarcel     273,   279,   282,   283,   287,   289,   291,   292,   294,   296,
464130803Smarcel     298,   300,   302,   305,   307,   310,   312,   315,   317,   319,
465130803Smarcel     321,   323,   326,   328,   331,   334,   338,   341,   344
466130803Smarcel};
467130803Smarcel
468130803Smarcel/* YYRHS -- A `-1'-separated list of the rules' RHS. */
469130803Smarcelstatic const yysigned_char yyrhs[] =
470130803Smarcel{
471130803Smarcel      69,     0,    -1,    70,    -1,    82,    -1,    74,    -1,    70,
472130803Smarcel      61,    74,    -1,    71,    13,    -1,    71,    11,    -1,    71,
473130803Smarcel      57,    75,    62,    -1,    82,    57,    74,    62,    -1,    -1,
474130803Smarcel      82,    63,    73,    72,    57,    74,    62,    -1,    -1,    71,
475130803Smarcel      57,    74,    26,    74,    62,    -1,    57,    70,    62,    -1,
476130803Smarcel      79,    -1,    15,    -1,    16,    -1,    71,    -1,    14,    -1,
477130803Smarcel      74,    17,    74,    -1,    33,    74,    -1,    32,    74,    -1,
478130803Smarcel      40,    74,    -1,    41,    74,    -1,    -1,    74,    -1,    80,
479130803Smarcel      59,    74,    -1,    75,    64,    74,    -1,    75,    64,    80,
480130803Smarcel      59,    74,    -1,    65,    82,    66,    74,    -1,    74,    42,
481130803Smarcel      74,    -1,    74,    36,    74,    -1,    74,    37,    74,    -1,
482130803Smarcel      74,    38,    74,    -1,    74,    39,    74,    -1,    74,    31,
483130803Smarcel      74,    -1,    74,    32,    74,    -1,    74,    34,    74,    -1,
484130803Smarcel      74,    33,    74,    -1,    74,    23,    74,    -1,    74,    30,
485130803Smarcel      74,    -1,    74,    29,    74,    -1,    74,    27,    74,    26,
486130803Smarcel      74,    -1,    74,    27,    74,    54,    76,    -1,    74,    27,
487130803Smarcel       7,    -1,    74,    40,    27,    74,    26,    74,    -1,    74,
488130803Smarcel      40,    27,    74,    54,    76,    -1,    74,    40,    27,     7,
489130803Smarcel      -1,    74,    28,    74,    -1,    74,    24,    74,    -1,    74,
490130803Smarcel      25,    74,    -1,    74,    22,    74,    -1,    74,    22,    19,
491130803Smarcel      74,    -1,    74,    21,    74,    -1,    74,    21,    18,    74,
492130803Smarcel      -1,    74,    20,    74,    -1,    71,    47,    -1,    71,    46,
493130803Smarcel      -1,    71,    45,    76,    -1,    71,    44,    76,    -1,    71,
494130803Smarcel      43,    76,    -1,    71,    53,    -1,    71,    52,    -1,    78,
495130803Smarcel      49,    57,    74,    64,    74,    62,    -1,    78,    50,    57,
496130803Smarcel      74,    64,    74,    62,    -1,    78,    55,    57,    74,    62,
497130803Smarcel      -1,    77,    45,    76,    -1,    77,    44,    76,    -1,    77,
498130803Smarcel      43,    76,    -1,    77,    51,    57,    74,    62,    -1,    77,
499130803Smarcel      48,    -1,    -1,    57,     3,    62,    -1,     7,    -1,    77,
500130803Smarcel      -1,    -1,     3,    -1,     5,    -1,     6,    -1,     4,    -1,
501130803Smarcel       9,    -1,    60,     7,    -1,    10,    -1,    81,    10,    -1,
502130803Smarcel      12,    -1,    81,    12,    -1,    10,    -1,     7,    -1,    12,
503130803Smarcel      -1,     8,    -1,    81,     8,    -1,     7,    -1,    81,     7,
504130803Smarcel      -1,     7,    47,    -1,    81,     7,    47,    -1,    36,    74,
505130803Smarcel      -1,    34,    74,    -1,    74,    58,    74,    67,    -1
506130803Smarcel};
507130803Smarcel
508130803Smarcel/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
509130803Smarcelstatic const unsigned short yyrline[] =
510130803Smarcel{
511130803Smarcel       0,   208,   208,   209,   215,   216,   221,   225,   232,   240,
512130803Smarcel     248,   248,   259,   263,   267,   270,   273,   280,   288,   291,
513130803Smarcel     298,   302,   306,   310,   314,   318,   321,   323,   325,   327,
514130803Smarcel     331,   341,   345,   349,   353,   357,   361,   365,   369,   373,
515130803Smarcel     377,   381,   385,   389,   393,   399,   406,   411,   419,   429,
516130803Smarcel     433,   437,   441,   445,   449,   453,   457,   461,   463,   469,
517130803Smarcel     471,   473,   475,   477,   479,   481,   483,   485,   487,   489,
518130803Smarcel     491,   493,   497,   499,   504,   511,   513,   519,   527,   539,
519130803Smarcel     547,   555,   582,   586,   587,   589,   590,   594,   595,   596,
520130803Smarcel     599,   601,   606,   607,   608,   610,   617,   619,   621
521130803Smarcel};
522130803Smarcel#endif
523130803Smarcel
524130803Smarcel#if YYDEBUG || YYERROR_VERBOSE
525130803Smarcel/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
526130803Smarcel   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
527130803Smarcelstatic const char *const yytname[] =
528130803Smarcel{
529130803Smarcel  "$end", "error", "$undefined", "INT", "NULL_PTR", "CHARLIT", "FLOAT",
530130803Smarcel  "TYPENAME", "BLOCKNAME", "STRING", "NAME", "DOT_ID", "OBJECT_RENAMING",
531130803Smarcel  "DOT_ALL", "LAST", "REGNAME", "INTERNAL_VARIABLE", "ASSIGN", "ELSE",
532130803Smarcel  "THEN", "XOR", "OR", "_AND_", "'='", "'<'", "'>'", "DOTDOT", "IN",
533130803Smarcel  "GEQ", "LEQ", "NOTEQUAL", "'@'", "'+'", "'-'", "'&'", "UNARY", "'*'",
534130803Smarcel  "'/'", "REM", "MOD", "NOT", "ABS", "STARSTAR", "TICK_LENGTH",
535130803Smarcel  "TICK_LAST", "TICK_FIRST", "TICK_ADDRESS", "TICK_ACCESS",
536130803Smarcel  "TICK_MODULUS", "TICK_MIN", "TICK_MAX", "TICK_VAL", "TICK_TAG",
537130803Smarcel  "TICK_SIZE", "TICK_RANGE", "TICK_POS", "'.'", "'('", "'['", "ARROW",
538130803Smarcel  "NEW", "';'", "')'", "'''", "','", "'{'", "'}'", "']'", "$accept",
539130803Smarcel  "start", "exp1", "simple_exp", "@1", "save_qualifier", "exp", "arglist",
540130803Smarcel  "tick_arglist", "type_prefix", "opt_type_prefix", "variable",
541130803Smarcel  "any_name", "block", "type", 0
542130803Smarcel};
543130803Smarcel#endif
544130803Smarcel
545130803Smarcel# ifdef YYPRINT
546130803Smarcel/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
547130803Smarcel   token YYLEX-NUM.  */
548130803Smarcelstatic const unsigned short yytoknum[] =
549130803Smarcel{
550130803Smarcel       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
551130803Smarcel     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
552130803Smarcel     275,   276,   277,    61,    60,    62,   278,   279,   280,   281,
553130803Smarcel     282,    64,    43,    45,    38,   283,    42,    47,   284,   285,
554130803Smarcel     286,   287,   288,   289,   290,   291,   292,   293,   294,   295,
555130803Smarcel     296,   297,   298,   299,   300,   301,    46,    40,    91,   302,
556130803Smarcel     303,    59,    41,    39,    44,   123,   125,    93
557130803Smarcel};
558130803Smarcel# endif
559130803Smarcel
560130803Smarcel/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
561130803Smarcelstatic const unsigned char yyr1[] =
562130803Smarcel{
563130803Smarcel       0,    68,    69,    69,    70,    70,    71,    71,    71,    71,
564130803Smarcel      72,    71,    73,    71,    71,    71,    71,    71,    74,    71,
565130803Smarcel      74,    74,    74,    74,    74,    75,    75,    75,    75,    75,
566130803Smarcel      74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
567130803Smarcel      74,    74,    74,    74,    74,    74,    74,    74,    74,    74,
568130803Smarcel      74,    74,    74,    74,    74,    74,    74,    71,    71,    71,
569130803Smarcel      71,    71,    71,    71,    71,    71,    71,    71,    71,    71,
570130803Smarcel      71,    71,    76,    76,    77,    78,    78,    74,    74,    74,
571130803Smarcel      74,    74,    74,    79,    79,    79,    79,    80,    80,    80,
572130803Smarcel      81,    81,    82,    82,    82,    82,    74,    74,    74
573130803Smarcel};
574130803Smarcel
575130803Smarcel/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
576130803Smarcelstatic const unsigned char yyr2[] =
577130803Smarcel{
578130803Smarcel       0,     2,     1,     1,     1,     3,     2,     2,     4,     4,
579130803Smarcel       0,     7,     0,     6,     3,     1,     1,     1,     1,     1,
580130803Smarcel       3,     2,     2,     2,     2,     0,     1,     3,     3,     5,
581130803Smarcel       4,     3,     3,     3,     3,     3,     3,     3,     3,     3,
582130803Smarcel       3,     3,     3,     5,     5,     3,     6,     6,     4,     3,
583130803Smarcel       3,     3,     3,     4,     3,     4,     3,     2,     2,     3,
584130803Smarcel       3,     3,     2,     2,     7,     7,     5,     3,     3,     3,
585130803Smarcel       5,     2,     0,     3,     1,     1,     0,     1,     1,     1,
586130803Smarcel       1,     1,     2,     1,     2,     1,     2,     1,     1,     1,
587130803Smarcel       1,     2,     1,     2,     2,     3,     2,     2,     4
588130803Smarcel};
589130803Smarcel
590130803Smarcel/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
591130803Smarcel   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
592130803Smarcel   means the default is an error.  */
593130803Smarcelstatic const unsigned char yydefact[] =
594130803Smarcel{
595130803Smarcel      76,    77,    80,    78,    79,    74,    90,    81,    83,    85,
596130803Smarcel      19,    16,    17,    76,    76,    76,    76,    76,    76,    76,
597130803Smarcel       0,     0,     0,     2,    18,     4,    75,     0,    15,     0,
598130803Smarcel       3,    94,    22,     0,    21,    97,    96,    23,    24,     0,
599130803Smarcel      82,    92,     0,     0,     1,    76,     7,     6,    72,    72,
600130803Smarcel      72,    58,    57,    63,    62,    76,    76,    76,    76,    76,
601130803Smarcel      76,    76,    76,    76,    76,    76,    76,    76,    76,    76,
602130803Smarcel      76,    76,    76,    76,    76,     0,    76,    76,    72,    72,
603130803Smarcel      72,    71,     0,     0,     0,     0,    93,    91,    84,    86,
604130803Smarcel      76,    12,    14,    76,     5,     0,    61,    60,    59,    74,
605130803Smarcel      83,    85,    26,     0,     0,    20,    56,    76,    54,    76,
606130803Smarcel      52,    40,    50,    51,    45,     0,    49,    42,    41,    36,
607130803Smarcel      37,    39,    38,    32,    33,    34,    35,    76,    31,     0,
608130803Smarcel      69,    68,    67,    76,    76,    76,    76,    95,     0,    10,
609130803Smarcel      30,     0,    76,     8,    76,    76,    55,    53,    76,    72,
610130803Smarcel      48,     0,    98,     0,     0,     0,     0,     9,     0,    73,
611130803Smarcel       0,    28,     0,    27,    43,    44,    76,    72,    70,    76,
612130803Smarcel      76,    66,    76,    13,    76,    46,    47,     0,     0,     0,
613130803Smarcel      29,    64,    65,    11
614130803Smarcel};
615130803Smarcel
616130803Smarcel/* YYDEFGOTO[NTERM-NUM]. */
617130803Smarcelstatic const short yydefgoto[] =
618130803Smarcel{
619130803Smarcel      -1,    22,    23,    24,   158,   139,    25,   103,    96,    26,
620130803Smarcel      27,    28,   104,    29,    33
621130803Smarcel};
622130803Smarcel
623130803Smarcel/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
624130803Smarcel   STATE-NUM.  */
625130803Smarcel#define YYPACT_NINF -44
626130803Smarcelstatic const short yypact[] =
627130803Smarcel{
628130803Smarcel     251,   -44,   -44,   -44,   -44,    15,   -44,   -44,   -44,   -44,
629130803Smarcel     -44,   -44,   -44,   251,   251,   251,   251,   251,   251,   251,
630130803Smarcel      17,     2,    31,    10,    55,   947,   -18,    20,   -44,   118,
631130803Smarcel     -29,   -44,   374,   -29,   374,    18,    18,   374,   374,   -21,
632130803Smarcel     -44,    32,    66,    16,   -44,   251,   -44,   -44,    24,    24,
633130803Smarcel      24,   -44,   -44,   -44,   -44,   133,   251,   251,   173,   212,
634130803Smarcel     251,   251,   251,   290,   251,   251,   251,   251,   251,   251,
635130803Smarcel     251,   251,   251,   251,   251,    59,   251,   251,    24,    24,
636130803Smarcel      24,   -44,    35,    38,    40,    47,    58,   -44,   -44,   -44,
637130803Smarcel     251,   -44,   -44,   251,   947,   107,   -44,   -44,   -44,    56,
638130803Smarcel      52,    57,   915,     3,    68,   979,  1002,   251,  1002,   251,
639130803Smarcel    1002,   -20,   -20,   -20,  1004,   837,   -20,   -20,   -20,    51,
640130803Smarcel     374,   374,   374,   -19,   -19,   -19,   -19,   329,   -19,   414,
641130803Smarcel     -44,   -44,   -44,   251,   251,   251,   251,   -44,   536,   -44,
642130803Smarcel      18,    71,   251,   -44,   368,   251,  1002,  1002,   251,    24,
643130803Smarcel    1004,   876,   -44,   579,   446,   491,   622,   -44,    60,   -44,
644130803Smarcel     665,   947,    75,   947,   -20,   -44,   251,    24,   -44,   251,
645130803Smarcel     251,   -44,   251,   -44,   251,   -20,   -44,   708,   751,   794,
646130803Smarcel     947,   -44,   -44,   -44
647130803Smarcel};
648130803Smarcel
649130803Smarcel/* YYPGOTO[NTERM-NUM].  */
650130803Smarcelstatic const yysigned_char yypgoto[] =
651130803Smarcel{
652130803Smarcel     -44,   -44,    99,   -44,   -44,   -44,   -13,   -44,   -43,   -44,
653130803Smarcel     -44,   -44,     0,   125,     8
654130803Smarcel};
655130803Smarcel
656130803Smarcel/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
657130803Smarcel   positive, shift that token.  If negative, reduce the rule which
658130803Smarcel   number is the opposite.  If zero, do what YYDEFACT says.
659130803Smarcel   If YYTABLE_NINF, syntax error.  */
660130803Smarcel#define YYTABLE_NINF -93
661130803Smarcelstatic const short yytable[] =
662130803Smarcel{
663130803Smarcel      32,    34,    35,    36,    37,    38,    97,    98,    30,    41,
664130803Smarcel       6,    67,    68,    69,    70,   -92,    71,    72,    73,    74,
665130803Smarcel      75,    75,    76,    76,    40,    78,    79,    80,    90,    43,
666130803Smarcel      81,    44,    94,    82,    91,   130,   131,   132,    77,    77,
667130803Smarcel      45,    92,   102,   105,   106,   108,   110,   111,   112,   113,
668130803Smarcel     115,   116,   117,   118,   119,   120,   121,   122,   123,   124,
669130803Smarcel     125,   126,    31,   128,   129,   143,    46,   144,    47,    83,
670130803Smarcel      84,    45,   -92,    86,    87,    85,    77,   138,   -92,    31,
671130803Smarcel     140,    95,    93,    68,    69,    70,   127,    71,    72,    73,
672130803Smarcel      74,    75,   133,    76,   146,   134,   147,   135,    48,    49,
673130803Smarcel      50,    51,    52,    31,   136,   137,   165,    53,    54,    77,
674130803Smarcel     141,   -87,    55,   -92,   151,   -88,   -89,   172,    39,   -92,
675130803Smarcel     153,   154,   155,   156,   176,    86,    87,   145,    88,   160,
676130803Smarcel      89,   161,   163,   159,   174,   164,     1,     2,     3,     4,
677130803Smarcel      99,     6,     7,   100,   162,   101,    42,    10,    11,    12,
678130803Smarcel       0,     0,     0,   175,     0,     0,   177,   178,     0,   179,
679130803Smarcel       0,   180,     0,     0,     0,    13,    14,    15,     0,    16,
680130803Smarcel       0,     0,     0,    17,    18,     0,     1,     2,     3,     4,
681130803Smarcel       5,     6,     7,     8,     0,     9,     0,    10,    11,    12,
682130803Smarcel      19,   107,     0,    20,     0,   -25,     0,   -25,    21,     0,
683130803Smarcel       0,     0,     0,     0,     0,    13,    14,    15,     0,    16,
684130803Smarcel       0,     0,     0,    17,    18,     1,     2,     3,     4,     5,
685130803Smarcel       6,     7,     8,     0,     9,     0,    10,    11,    12,     0,
686130803Smarcel      19,   109,     0,    20,     0,     0,     0,     0,    21,     0,
687130803Smarcel       0,     0,     0,     0,    13,    14,    15,     0,    16,     0,
688130803Smarcel       0,     0,    17,    18,     1,     2,     3,     4,     5,     6,
689130803Smarcel       7,     8,     0,     9,     0,    10,    11,    12,     0,    19,
690130803Smarcel       0,     0,    20,     0,     0,     0,     0,    21,     0,     0,
691130803Smarcel       0,     0,     0,    13,    14,    15,     0,    16,     0,     0,
692130803Smarcel       0,    17,    18,     1,     2,     3,     4,   114,     6,     7,
693130803Smarcel       8,     0,     9,     0,    10,    11,    12,     0,    19,     0,
694130803Smarcel       0,    20,     0,     0,     0,     0,    21,     0,     0,     0,
695130803Smarcel       0,     0,    13,    14,    15,     0,    16,     0,     0,     0,
696130803Smarcel      17,    18,     1,     2,     3,     4,   150,     6,     7,     8,
697130803Smarcel       0,     9,     0,    10,    11,    12,     0,    19,     0,     0,
698130803Smarcel      20,     0,     0,     0,     0,    21,     0,     0,     0,     0,
699130803Smarcel       0,    13,    14,    15,     0,    16,     0,     0,     0,    17,
700130803Smarcel      18,     1,     2,     3,     4,    99,     6,     7,   100,     0,
701130803Smarcel     101,     0,    10,    11,    12,     0,    19,     0,     0,    20,
702130803Smarcel       0,     0,     0,     0,    21,     0,     0,     0,     0,     0,
703130803Smarcel      13,    14,    15,     0,    16,     0,     0,     0,    17,    18,
704130803Smarcel      71,    72,    73,    74,    75,     0,    76,     0,     0,     0,
705130803Smarcel       0,     0,     0,     0,     0,    19,     0,     0,    20,     0,
706130803Smarcel       0,    56,    77,    21,    57,    58,    59,    60,    61,    62,
707130803Smarcel       0,    63,    64,    65,    66,    67,    68,    69,    70,     0,
708130803Smarcel      71,    72,    73,    74,    75,     0,    76,     0,     0,     0,
709130803Smarcel       0,     0,     0,    56,     0,     0,    57,    58,    59,    60,
710130803Smarcel      61,    62,    77,    63,    64,    65,    66,    67,    68,    69,
711130803Smarcel      70,   152,    71,    72,    73,    74,    75,     0,    76,     0,
712130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
713130803Smarcel       0,     0,     0,     0,    77,     0,     0,     0,    56,     0,
714130803Smarcel     169,    57,    58,    59,    60,    61,    62,     0,    63,    64,
715130803Smarcel      65,    66,    67,    68,    69,    70,     0,    71,    72,    73,
716130803Smarcel      74,    75,     0,    76,     0,     0,     0,     0,     0,     0,
717130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,    77,
718130803Smarcel       0,     0,     0,    56,     0,   170,    57,    58,    59,    60,
719130803Smarcel      61,    62,     0,    63,    64,    65,    66,    67,    68,    69,
720130803Smarcel      70,     0,    71,    72,    73,    74,    75,     0,    76,     0,
721130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
722130803Smarcel       0,     0,     0,     0,    77,     0,    56,     0,   157,    57,
723130803Smarcel      58,    59,    60,    61,    62,     0,    63,    64,    65,    66,
724130803Smarcel      67,    68,    69,    70,     0,    71,    72,    73,    74,    75,
725130803Smarcel       0,    76,     0,     0,     0,     0,     0,     0,     0,     0,
726130803Smarcel       0,     0,     0,     0,     0,     0,     0,    77,     0,    56,
727130803Smarcel       0,   168,    57,    58,    59,    60,    61,    62,     0,    63,
728130803Smarcel      64,    65,    66,    67,    68,    69,    70,     0,    71,    72,
729130803Smarcel      73,    74,    75,     0,    76,     0,     0,     0,     0,     0,
730130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
731130803Smarcel      77,     0,    56,     0,   171,    57,    58,    59,    60,    61,
732130803Smarcel      62,     0,    63,    64,    65,    66,    67,    68,    69,    70,
733130803Smarcel       0,    71,    72,    73,    74,    75,     0,    76,     0,     0,
734130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
735130803Smarcel       0,     0,     0,    77,     0,    56,     0,   173,    57,    58,
736130803Smarcel      59,    60,    61,    62,     0,    63,    64,    65,    66,    67,
737130803Smarcel      68,    69,    70,     0,    71,    72,    73,    74,    75,     0,
738130803Smarcel      76,     0,     0,     0,     0,     0,     0,     0,     0,     0,
739130803Smarcel       0,     0,     0,     0,     0,     0,    77,     0,    56,     0,
740130803Smarcel     181,    57,    58,    59,    60,    61,    62,     0,    63,    64,
741130803Smarcel      65,    66,    67,    68,    69,    70,     0,    71,    72,    73,
742130803Smarcel      74,    75,     0,    76,     0,     0,     0,     0,     0,     0,
743130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,    77,
744130803Smarcel       0,    56,     0,   182,    57,    58,    59,    60,    61,    62,
745130803Smarcel       0,    63,    64,    65,    66,    67,    68,    69,    70,     0,
746130803Smarcel      71,    72,    73,    74,    75,     0,    76,     0,     0,     0,
747130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
748130803Smarcel       0,     0,    77,     0,    56,     0,   183,    57,    58,    59,
749130803Smarcel      60,    61,    62,   148,    63,    64,    65,    66,    67,    68,
750130803Smarcel      69,    70,     0,    71,    72,    73,    74,    75,     0,    76,
751130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
752130803Smarcel       0,   149,     0,    56,     0,    77,    57,    58,    59,    60,
753130803Smarcel      61,    62,   166,    63,    64,    65,    66,    67,    68,    69,
754130803Smarcel      70,     0,    71,    72,    73,    74,    75,     0,    76,     0,
755130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
756130803Smarcel     167,     0,    56,     0,    77,    57,    58,    59,    60,    61,
757130803Smarcel      62,   142,    63,    64,    65,    66,    67,    68,    69,    70,
758130803Smarcel       0,    71,    72,    73,    74,    75,     0,    76,     0,     0,
759130803Smarcel       0,     0,     0,     0,    56,     0,     0,    57,    58,    59,
760130803Smarcel      60,    61,    62,    77,    63,    64,    65,    66,    67,    68,
761130803Smarcel      69,    70,     0,    71,    72,    73,    74,    75,     0,    76,
762130803Smarcel       0,     0,     0,     0,     0,     0,   -93,     0,     0,    57,
763130803Smarcel      58,    59,    60,    61,    62,    77,    63,    64,    65,    66,
764130803Smarcel      67,    68,    69,    70,     0,    71,    72,    73,    74,    75,
765130803Smarcel       0,    76,     0,     0,     0,    60,    61,    62,     0,    63,
766130803Smarcel      64,    65,    66,    67,    68,    69,    70,    77,    71,    72,
767130803Smarcel      73,    74,    75,     0,    76,     0,     0,   -74,   -74,   -74,
768130803Smarcel       0,    31,   -74,   -74,   -74,   -74,     0,     0,     0,   -74,
769130803Smarcel      77,   -92,     0,     0,     0,     0,     0,   -92
770130803Smarcel};
771130803Smarcel
772130803Smarcelstatic const short yycheck[] =
773130803Smarcel{
774130803Smarcel      13,    14,    15,    16,    17,    18,    49,    50,     0,     7,
775130803Smarcel       8,    31,    32,    33,    34,     0,    36,    37,    38,    39,
776130803Smarcel      40,    40,    42,    42,     7,    43,    44,    45,    57,    21,
777130803Smarcel      48,     0,    45,    51,    63,    78,    79,    80,    58,    58,
778130803Smarcel      61,    62,    55,    56,    57,    58,    59,    60,    61,    62,
779130803Smarcel      63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
780130803Smarcel      73,    74,    47,    76,    77,    62,    11,    64,    13,    49,
781130803Smarcel      50,    61,    57,     7,     8,    55,    58,    90,    63,    47,
782130803Smarcel      93,    57,    66,    32,    33,    34,    27,    36,    37,    38,
783130803Smarcel      39,    40,    57,    42,   107,    57,   109,    57,    43,    44,
784130803Smarcel      45,    46,    47,    47,    57,    47,   149,    52,    53,    58,
785130803Smarcel       3,    59,    57,    57,   127,    59,    59,    57,    19,    63,
786130803Smarcel     133,   134,   135,   136,   167,     7,     8,    59,    10,   142,
787130803Smarcel      12,   144,   145,    62,    59,   148,     3,     4,     5,     6,
788130803Smarcel       7,     8,     9,    10,   144,    12,    21,    14,    15,    16,
789130803Smarcel      -1,    -1,    -1,   166,    -1,    -1,   169,   170,    -1,   172,
790130803Smarcel      -1,   174,    -1,    -1,    -1,    32,    33,    34,    -1,    36,
791130803Smarcel      -1,    -1,    -1,    40,    41,    -1,     3,     4,     5,     6,
792130803Smarcel       7,     8,     9,    10,    -1,    12,    -1,    14,    15,    16,
793130803Smarcel      57,    18,    -1,    60,    -1,    62,    -1,    64,    65,    -1,
794130803Smarcel      -1,    -1,    -1,    -1,    -1,    32,    33,    34,    -1,    36,
795130803Smarcel      -1,    -1,    -1,    40,    41,     3,     4,     5,     6,     7,
796130803Smarcel       8,     9,    10,    -1,    12,    -1,    14,    15,    16,    -1,
797130803Smarcel      57,    19,    -1,    60,    -1,    -1,    -1,    -1,    65,    -1,
798130803Smarcel      -1,    -1,    -1,    -1,    32,    33,    34,    -1,    36,    -1,
799130803Smarcel      -1,    -1,    40,    41,     3,     4,     5,     6,     7,     8,
800130803Smarcel       9,    10,    -1,    12,    -1,    14,    15,    16,    -1,    57,
801130803Smarcel      -1,    -1,    60,    -1,    -1,    -1,    -1,    65,    -1,    -1,
802130803Smarcel      -1,    -1,    -1,    32,    33,    34,    -1,    36,    -1,    -1,
803130803Smarcel      -1,    40,    41,     3,     4,     5,     6,     7,     8,     9,
804130803Smarcel      10,    -1,    12,    -1,    14,    15,    16,    -1,    57,    -1,
805130803Smarcel      -1,    60,    -1,    -1,    -1,    -1,    65,    -1,    -1,    -1,
806130803Smarcel      -1,    -1,    32,    33,    34,    -1,    36,    -1,    -1,    -1,
807130803Smarcel      40,    41,     3,     4,     5,     6,     7,     8,     9,    10,
808130803Smarcel      -1,    12,    -1,    14,    15,    16,    -1,    57,    -1,    -1,
809130803Smarcel      60,    -1,    -1,    -1,    -1,    65,    -1,    -1,    -1,    -1,
810130803Smarcel      -1,    32,    33,    34,    -1,    36,    -1,    -1,    -1,    40,
811130803Smarcel      41,     3,     4,     5,     6,     7,     8,     9,    10,    -1,
812130803Smarcel      12,    -1,    14,    15,    16,    -1,    57,    -1,    -1,    60,
813130803Smarcel      -1,    -1,    -1,    -1,    65,    -1,    -1,    -1,    -1,    -1,
814130803Smarcel      32,    33,    34,    -1,    36,    -1,    -1,    -1,    40,    41,
815130803Smarcel      36,    37,    38,    39,    40,    -1,    42,    -1,    -1,    -1,
816130803Smarcel      -1,    -1,    -1,    -1,    -1,    57,    -1,    -1,    60,    -1,
817130803Smarcel      -1,    17,    58,    65,    20,    21,    22,    23,    24,    25,
818130803Smarcel      -1,    27,    28,    29,    30,    31,    32,    33,    34,    -1,
819130803Smarcel      36,    37,    38,    39,    40,    -1,    42,    -1,    -1,    -1,
820130803Smarcel      -1,    -1,    -1,    17,    -1,    -1,    20,    21,    22,    23,
821130803Smarcel      24,    25,    58,    27,    28,    29,    30,    31,    32,    33,
822130803Smarcel      34,    67,    36,    37,    38,    39,    40,    -1,    42,    -1,
823130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
824130803Smarcel      -1,    -1,    -1,    -1,    58,    -1,    -1,    -1,    17,    -1,
825130803Smarcel      64,    20,    21,    22,    23,    24,    25,    -1,    27,    28,
826130803Smarcel      29,    30,    31,    32,    33,    34,    -1,    36,    37,    38,
827130803Smarcel      39,    40,    -1,    42,    -1,    -1,    -1,    -1,    -1,    -1,
828130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    58,
829130803Smarcel      -1,    -1,    -1,    17,    -1,    64,    20,    21,    22,    23,
830130803Smarcel      24,    25,    -1,    27,    28,    29,    30,    31,    32,    33,
831130803Smarcel      34,    -1,    36,    37,    38,    39,    40,    -1,    42,    -1,
832130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
833130803Smarcel      -1,    -1,    -1,    -1,    58,    -1,    17,    -1,    62,    20,
834130803Smarcel      21,    22,    23,    24,    25,    -1,    27,    28,    29,    30,
835130803Smarcel      31,    32,    33,    34,    -1,    36,    37,    38,    39,    40,
836130803Smarcel      -1,    42,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
837130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    58,    -1,    17,
838130803Smarcel      -1,    62,    20,    21,    22,    23,    24,    25,    -1,    27,
839130803Smarcel      28,    29,    30,    31,    32,    33,    34,    -1,    36,    37,
840130803Smarcel      38,    39,    40,    -1,    42,    -1,    -1,    -1,    -1,    -1,
841130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
842130803Smarcel      58,    -1,    17,    -1,    62,    20,    21,    22,    23,    24,
843130803Smarcel      25,    -1,    27,    28,    29,    30,    31,    32,    33,    34,
844130803Smarcel      -1,    36,    37,    38,    39,    40,    -1,    42,    -1,    -1,
845130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
846130803Smarcel      -1,    -1,    -1,    58,    -1,    17,    -1,    62,    20,    21,
847130803Smarcel      22,    23,    24,    25,    -1,    27,    28,    29,    30,    31,
848130803Smarcel      32,    33,    34,    -1,    36,    37,    38,    39,    40,    -1,
849130803Smarcel      42,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
850130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    58,    -1,    17,    -1,
851130803Smarcel      62,    20,    21,    22,    23,    24,    25,    -1,    27,    28,
852130803Smarcel      29,    30,    31,    32,    33,    34,    -1,    36,    37,    38,
853130803Smarcel      39,    40,    -1,    42,    -1,    -1,    -1,    -1,    -1,    -1,
854130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    58,
855130803Smarcel      -1,    17,    -1,    62,    20,    21,    22,    23,    24,    25,
856130803Smarcel      -1,    27,    28,    29,    30,    31,    32,    33,    34,    -1,
857130803Smarcel      36,    37,    38,    39,    40,    -1,    42,    -1,    -1,    -1,
858130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
859130803Smarcel      -1,    -1,    58,    -1,    17,    -1,    62,    20,    21,    22,
860130803Smarcel      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
861130803Smarcel      33,    34,    -1,    36,    37,    38,    39,    40,    -1,    42,
862130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
863130803Smarcel      -1,    54,    -1,    17,    -1,    58,    20,    21,    22,    23,
864130803Smarcel      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
865130803Smarcel      34,    -1,    36,    37,    38,    39,    40,    -1,    42,    -1,
866130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
867130803Smarcel      54,    -1,    17,    -1,    58,    20,    21,    22,    23,    24,
868130803Smarcel      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
869130803Smarcel      -1,    36,    37,    38,    39,    40,    -1,    42,    -1,    -1,
870130803Smarcel      -1,    -1,    -1,    -1,    17,    -1,    -1,    20,    21,    22,
871130803Smarcel      23,    24,    25,    58,    27,    28,    29,    30,    31,    32,
872130803Smarcel      33,    34,    -1,    36,    37,    38,    39,    40,    -1,    42,
873130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    17,    -1,    -1,    20,
874130803Smarcel      21,    22,    23,    24,    25,    58,    27,    28,    29,    30,
875130803Smarcel      31,    32,    33,    34,    -1,    36,    37,    38,    39,    40,
876130803Smarcel      -1,    42,    -1,    -1,    -1,    23,    24,    25,    -1,    27,
877130803Smarcel      28,    29,    30,    31,    32,    33,    34,    58,    36,    37,
878130803Smarcel      38,    39,    40,    -1,    42,    -1,    -1,    43,    44,    45,
879130803Smarcel      -1,    47,    48,    49,    50,    51,    -1,    -1,    -1,    55,
880130803Smarcel      58,    57,    -1,    -1,    -1,    -1,    -1,    63
881130803Smarcel};
882130803Smarcel
883130803Smarcel/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
884130803Smarcel   symbol of state STATE-NUM.  */
885130803Smarcelstatic const unsigned char yystos[] =
886130803Smarcel{
887130803Smarcel       0,     3,     4,     5,     6,     7,     8,     9,    10,    12,
888130803Smarcel      14,    15,    16,    32,    33,    34,    36,    40,    41,    57,
889130803Smarcel      60,    65,    69,    70,    71,    74,    77,    78,    79,    81,
890130803Smarcel      82,    47,    74,    82,    74,    74,    74,    74,    74,    70,
891130803Smarcel       7,     7,    81,    82,     0,    61,    11,    13,    43,    44,
892130803Smarcel      45,    46,    47,    52,    53,    57,    17,    20,    21,    22,
893130803Smarcel      23,    24,    25,    27,    28,    29,    30,    31,    32,    33,
894130803Smarcel      34,    36,    37,    38,    39,    40,    42,    58,    43,    44,
895130803Smarcel      45,    48,    51,    49,    50,    55,     7,     8,    10,    12,
896130803Smarcel      57,    63,    62,    66,    74,    57,    76,    76,    76,     7,
897130803Smarcel      10,    12,    74,    75,    80,    74,    74,    18,    74,    19,
898130803Smarcel      74,    74,    74,    74,     7,    74,    74,    74,    74,    74,
899130803Smarcel      74,    74,    74,    74,    74,    74,    74,    27,    74,    74,
900130803Smarcel      76,    76,    76,    57,    57,    57,    57,    47,    74,    73,
901130803Smarcel      74,     3,    26,    62,    64,    59,    74,    74,    26,    54,
902130803Smarcel       7,    74,    67,    74,    74,    74,    74,    62,    72,    62,
903130803Smarcel      74,    74,    80,    74,    74,    76,    26,    54,    62,    64,
904130803Smarcel      64,    62,    57,    62,    59,    74,    76,    74,    74,    74,
905130803Smarcel      74,    62,    62,    62
906130803Smarcel};
907130803Smarcel
908130803Smarcel#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
909130803Smarcel# define YYSIZE_T __SIZE_TYPE__
910130803Smarcel#endif
911130803Smarcel#if ! defined (YYSIZE_T) && defined (size_t)
912130803Smarcel# define YYSIZE_T size_t
913130803Smarcel#endif
914130803Smarcel#if ! defined (YYSIZE_T)
915130803Smarcel# if defined (__STDC__) || defined (__cplusplus)
916130803Smarcel#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
917130803Smarcel#  define YYSIZE_T size_t
918130803Smarcel# endif
919130803Smarcel#endif
920130803Smarcel#if ! defined (YYSIZE_T)
921130803Smarcel# define YYSIZE_T unsigned int
922130803Smarcel#endif
923130803Smarcel
924130803Smarcel#define yyerrok		(yyerrstatus = 0)
925130803Smarcel#define yyclearin	(yychar = YYEMPTY)
926130803Smarcel#define YYEMPTY		(-2)
927130803Smarcel#define YYEOF		0
928130803Smarcel
929130803Smarcel#define YYACCEPT	goto yyacceptlab
930130803Smarcel#define YYABORT		goto yyabortlab
931130803Smarcel#define YYERROR		goto yyerrlab1
932130803Smarcel
933130803Smarcel/* Like YYERROR except do call yyerror.  This remains here temporarily
934130803Smarcel   to ease the transition to the new meaning of YYERROR, for GCC.
935130803Smarcel   Once GCC version 2 has supplanted version 1, this can go.  */
936130803Smarcel
937130803Smarcel#define YYFAIL		goto yyerrlab
938130803Smarcel
939130803Smarcel#define YYRECOVERING()  (!!yyerrstatus)
940130803Smarcel
941130803Smarcel#define YYBACKUP(Token, Value)					\
942130803Smarceldo								\
943130803Smarcel  if (yychar == YYEMPTY && yylen == 1)				\
944130803Smarcel    {								\
945130803Smarcel      yychar = (Token);						\
946130803Smarcel      yylval = (Value);						\
947130803Smarcel      yytoken = YYTRANSLATE (yychar);				\
948130803Smarcel      YYPOPSTACK;						\
949130803Smarcel      goto yybackup;						\
950130803Smarcel    }								\
951130803Smarcel  else								\
952130803Smarcel    { 								\
953130803Smarcel      yyerror ("syntax error: cannot back up");\
954130803Smarcel      YYERROR;							\
955130803Smarcel    }								\
956130803Smarcelwhile (0)
957130803Smarcel
958130803Smarcel#define YYTERROR	1
959130803Smarcel#define YYERRCODE	256
960130803Smarcel
961130803Smarcel/* YYLLOC_DEFAULT -- Compute the default location (before the actions
962130803Smarcel   are run).  */
963130803Smarcel
964130803Smarcel#ifndef YYLLOC_DEFAULT
965130803Smarcel# define YYLLOC_DEFAULT(Current, Rhs, N)         \
966130803Smarcel  Current.first_line   = Rhs[1].first_line;      \
967130803Smarcel  Current.first_column = Rhs[1].first_column;    \
968130803Smarcel  Current.last_line    = Rhs[N].last_line;       \
969130803Smarcel  Current.last_column  = Rhs[N].last_column;
970130803Smarcel#endif
971130803Smarcel
972130803Smarcel/* YYLEX -- calling `yylex' with the right arguments.  */
973130803Smarcel
974130803Smarcel#ifdef YYLEX_PARAM
975130803Smarcel# define YYLEX yylex (YYLEX_PARAM)
976130803Smarcel#else
977130803Smarcel# define YYLEX yylex ()
978130803Smarcel#endif
979130803Smarcel
980130803Smarcel/* Enable debugging if requested.  */
981130803Smarcel#if YYDEBUG
982130803Smarcel
983130803Smarcel# ifndef YYFPRINTF
984130803Smarcel#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
985130803Smarcel#  define YYFPRINTF fprintf
986130803Smarcel# endif
987130803Smarcel
988130803Smarcel# define YYDPRINTF(Args)			\
989130803Smarceldo {						\
990130803Smarcel  if (yydebug)					\
991130803Smarcel    YYFPRINTF Args;				\
992130803Smarcel} while (0)
993130803Smarcel
994130803Smarcel# define YYDSYMPRINT(Args)			\
995130803Smarceldo {						\
996130803Smarcel  if (yydebug)					\
997130803Smarcel    yysymprint Args;				\
998130803Smarcel} while (0)
999130803Smarcel
1000130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location)		\
1001130803Smarceldo {								\
1002130803Smarcel  if (yydebug)							\
1003130803Smarcel    {								\
1004130803Smarcel      YYFPRINTF (stderr, "%s ", Title);				\
1005130803Smarcel      yysymprint (stderr, 					\
1006130803Smarcel                  Token, Value);	\
1007130803Smarcel      YYFPRINTF (stderr, "\n");					\
1008130803Smarcel    }								\
1009130803Smarcel} while (0)
1010130803Smarcel
1011130803Smarcel/*------------------------------------------------------------------.
1012130803Smarcel| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1013130803Smarcel| TOP (cinluded).                                                   |
1014130803Smarcel`------------------------------------------------------------------*/
1015130803Smarcel
1016130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1017130803Smarcelstatic void
1018130803Smarcelyy_stack_print (short *bottom, short *top)
1019130803Smarcel#else
1020130803Smarcelstatic void
1021130803Smarcelyy_stack_print (bottom, top)
1022130803Smarcel    short *bottom;
1023130803Smarcel    short *top;
1024130803Smarcel#endif
1025130803Smarcel{
1026130803Smarcel  YYFPRINTF (stderr, "Stack now");
1027130803Smarcel  for (/* Nothing. */; bottom <= top; ++bottom)
1028130803Smarcel    YYFPRINTF (stderr, " %d", *bottom);
1029130803Smarcel  YYFPRINTF (stderr, "\n");
1030130803Smarcel}
1031130803Smarcel
1032130803Smarcel# define YY_STACK_PRINT(Bottom, Top)				\
1033130803Smarceldo {								\
1034130803Smarcel  if (yydebug)							\
1035130803Smarcel    yy_stack_print ((Bottom), (Top));				\
1036130803Smarcel} while (0)
1037130803Smarcel
1038130803Smarcel
1039130803Smarcel/*------------------------------------------------.
1040130803Smarcel| Report that the YYRULE is going to be reduced.  |
1041130803Smarcel`------------------------------------------------*/
1042130803Smarcel
1043130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1044130803Smarcelstatic void
1045130803Smarcelyy_reduce_print (int yyrule)
1046130803Smarcel#else
1047130803Smarcelstatic void
1048130803Smarcelyy_reduce_print (yyrule)
1049130803Smarcel    int yyrule;
1050130803Smarcel#endif
1051130803Smarcel{
1052130803Smarcel  int yyi;
1053130803Smarcel  unsigned int yylineno = yyrline[yyrule];
1054130803Smarcel  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1055130803Smarcel             yyrule - 1, yylineno);
1056130803Smarcel  /* Print the symbols being reduced, and their result.  */
1057130803Smarcel  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1058130803Smarcel    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1059130803Smarcel  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1060130803Smarcel}
1061130803Smarcel
1062130803Smarcel# define YY_REDUCE_PRINT(Rule)		\
1063130803Smarceldo {					\
1064130803Smarcel  if (yydebug)				\
1065130803Smarcel    yy_reduce_print (Rule);		\
1066130803Smarcel} while (0)
1067130803Smarcel
1068130803Smarcel/* Nonzero means print parse trace.  It is left uninitialized so that
1069130803Smarcel   multiple parsers can coexist.  */
1070130803Smarcelint yydebug;
1071130803Smarcel#else /* !YYDEBUG */
1072130803Smarcel# define YYDPRINTF(Args)
1073130803Smarcel# define YYDSYMPRINT(Args)
1074130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location)
1075130803Smarcel# define YY_STACK_PRINT(Bottom, Top)
1076130803Smarcel# define YY_REDUCE_PRINT(Rule)
1077130803Smarcel#endif /* !YYDEBUG */
1078130803Smarcel
1079130803Smarcel
1080130803Smarcel/* YYINITDEPTH -- initial size of the parser's stacks.  */
1081130803Smarcel#ifndef	YYINITDEPTH
1082130803Smarcel# define YYINITDEPTH 200
1083130803Smarcel#endif
1084130803Smarcel
1085130803Smarcel/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1086130803Smarcel   if the built-in stack extension method is used).
1087130803Smarcel
1088130803Smarcel   Do not make this value too large; the results are undefined if
1089130803Smarcel   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1090130803Smarcel   evaluated with infinite-precision integer arithmetic.  */
1091130803Smarcel
1092130803Smarcel#if YYMAXDEPTH == 0
1093130803Smarcel# undef YYMAXDEPTH
1094130803Smarcel#endif
1095130803Smarcel
1096130803Smarcel#ifndef YYMAXDEPTH
1097130803Smarcel# define YYMAXDEPTH 10000
1098130803Smarcel#endif
1099130803Smarcel
1100130803Smarcel
1101130803Smarcel
1102130803Smarcel#if YYERROR_VERBOSE
1103130803Smarcel
1104130803Smarcel# ifndef yystrlen
1105130803Smarcel#  if defined (__GLIBC__) && defined (_STRING_H)
1106130803Smarcel#   define yystrlen strlen
1107130803Smarcel#  else
1108130803Smarcel/* Return the length of YYSTR.  */
1109130803Smarcelstatic YYSIZE_T
1110130803Smarcel#   if defined (__STDC__) || defined (__cplusplus)
1111130803Smarcelyystrlen (const char *yystr)
1112130803Smarcel#   else
1113130803Smarcelyystrlen (yystr)
1114130803Smarcel     const char *yystr;
1115130803Smarcel#   endif
1116130803Smarcel{
1117130803Smarcel  register const char *yys = yystr;
1118130803Smarcel
1119130803Smarcel  while (*yys++ != '\0')
1120130803Smarcel    continue;
1121130803Smarcel
1122130803Smarcel  return yys - yystr - 1;
1123130803Smarcel}
1124130803Smarcel#  endif
1125130803Smarcel# endif
1126130803Smarcel
1127130803Smarcel# ifndef yystpcpy
1128130803Smarcel#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1129130803Smarcel#   define yystpcpy stpcpy
1130130803Smarcel#  else
1131130803Smarcel/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1132130803Smarcel   YYDEST.  */
1133130803Smarcelstatic char *
1134130803Smarcel#   if defined (__STDC__) || defined (__cplusplus)
1135130803Smarcelyystpcpy (char *yydest, const char *yysrc)
1136130803Smarcel#   else
1137130803Smarcelyystpcpy (yydest, yysrc)
1138130803Smarcel     char *yydest;
1139130803Smarcel     const char *yysrc;
1140130803Smarcel#   endif
1141130803Smarcel{
1142130803Smarcel  register char *yyd = yydest;
1143130803Smarcel  register const char *yys = yysrc;
1144130803Smarcel
1145130803Smarcel  while ((*yyd++ = *yys++) != '\0')
1146130803Smarcel    continue;
1147130803Smarcel
1148130803Smarcel  return yyd - 1;
1149130803Smarcel}
1150130803Smarcel#  endif
1151130803Smarcel# endif
1152130803Smarcel
1153130803Smarcel#endif /* !YYERROR_VERBOSE */
1154130803Smarcel
1155130803Smarcel
1156130803Smarcel
1157130803Smarcel#if YYDEBUG
1158130803Smarcel/*--------------------------------.
1159130803Smarcel| Print this symbol on YYOUTPUT.  |
1160130803Smarcel`--------------------------------*/
1161130803Smarcel
1162130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1163130803Smarcelstatic void
1164130803Smarcelyysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1165130803Smarcel#else
1166130803Smarcelstatic void
1167130803Smarcelyysymprint (yyoutput, yytype, yyvaluep)
1168130803Smarcel    FILE *yyoutput;
1169130803Smarcel    int yytype;
1170130803Smarcel    YYSTYPE *yyvaluep;
1171130803Smarcel#endif
1172130803Smarcel{
1173130803Smarcel  /* Pacify ``unused variable'' warnings.  */
1174130803Smarcel  (void) yyvaluep;
1175130803Smarcel
1176130803Smarcel  if (yytype < YYNTOKENS)
1177130803Smarcel    {
1178130803Smarcel      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1179130803Smarcel# ifdef YYPRINT
1180130803Smarcel      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1181130803Smarcel# endif
1182130803Smarcel    }
1183130803Smarcel  else
1184130803Smarcel    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1185130803Smarcel
1186130803Smarcel  switch (yytype)
1187130803Smarcel    {
1188130803Smarcel      default:
1189130803Smarcel        break;
1190130803Smarcel    }
1191130803Smarcel  YYFPRINTF (yyoutput, ")");
1192130803Smarcel}
1193130803Smarcel
1194130803Smarcel#endif /* ! YYDEBUG */
1195130803Smarcel/*-----------------------------------------------.
1196130803Smarcel| Release the memory associated to this symbol.  |
1197130803Smarcel`-----------------------------------------------*/
1198130803Smarcel
1199130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1200130803Smarcelstatic void
1201130803Smarcelyydestruct (int yytype, YYSTYPE *yyvaluep)
1202130803Smarcel#else
1203130803Smarcelstatic void
1204130803Smarcelyydestruct (yytype, yyvaluep)
1205130803Smarcel    int yytype;
1206130803Smarcel    YYSTYPE *yyvaluep;
1207130803Smarcel#endif
1208130803Smarcel{
1209130803Smarcel  /* Pacify ``unused variable'' warnings.  */
1210130803Smarcel  (void) yyvaluep;
1211130803Smarcel
1212130803Smarcel  switch (yytype)
1213130803Smarcel    {
1214130803Smarcel
1215130803Smarcel      default:
1216130803Smarcel        break;
1217130803Smarcel    }
1218130803Smarcel}
1219130803Smarcel
1220130803Smarcel
1221130803Smarcel/* Prevent warnings from -Wmissing-prototypes.  */
1222130803Smarcel
1223130803Smarcel#ifdef YYPARSE_PARAM
1224130803Smarcel# if defined (__STDC__) || defined (__cplusplus)
1225130803Smarcelint yyparse (void *YYPARSE_PARAM);
1226130803Smarcel# else
1227130803Smarcelint yyparse ();
1228130803Smarcel# endif
1229130803Smarcel#else /* ! YYPARSE_PARAM */
1230130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1231130803Smarcelint yyparse (void);
1232130803Smarcel#else
1233130803Smarcelint yyparse ();
1234130803Smarcel#endif
1235130803Smarcel#endif /* ! YYPARSE_PARAM */
1236130803Smarcel
1237130803Smarcel
1238130803Smarcel
1239130803Smarcel/* The lookahead symbol.  */
1240130803Smarcelint yychar;
1241130803Smarcel
1242130803Smarcel/* The semantic value of the lookahead symbol.  */
1243130803SmarcelYYSTYPE yylval;
1244130803Smarcel
1245130803Smarcel/* Number of syntax errors so far.  */
1246130803Smarcelint yynerrs;
1247130803Smarcel
1248130803Smarcel
1249130803Smarcel
1250130803Smarcel/*----------.
1251130803Smarcel| yyparse.  |
1252130803Smarcel`----------*/
1253130803Smarcel
1254130803Smarcel#ifdef YYPARSE_PARAM
1255130803Smarcel# if defined (__STDC__) || defined (__cplusplus)
1256130803Smarcelint yyparse (void *YYPARSE_PARAM)
1257130803Smarcel# else
1258130803Smarcelint yyparse (YYPARSE_PARAM)
1259130803Smarcel  void *YYPARSE_PARAM;
1260130803Smarcel# endif
1261130803Smarcel#else /* ! YYPARSE_PARAM */
1262130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1263130803Smarcelint
1264130803Smarcelyyparse (void)
1265130803Smarcel#else
1266130803Smarcelint
1267130803Smarcelyyparse ()
1268130803Smarcel
1269130803Smarcel#endif
1270130803Smarcel#endif
1271130803Smarcel{
1272130803Smarcel
1273130803Smarcel  register int yystate;
1274130803Smarcel  register int yyn;
1275130803Smarcel  int yyresult;
1276130803Smarcel  /* Number of tokens to shift before error messages enabled.  */
1277130803Smarcel  int yyerrstatus;
1278130803Smarcel  /* Lookahead token as an internal (translated) token number.  */
1279130803Smarcel  int yytoken = 0;
1280130803Smarcel
1281130803Smarcel  /* Three stacks and their tools:
1282130803Smarcel     `yyss': related to states,
1283130803Smarcel     `yyvs': related to semantic values,
1284130803Smarcel     `yyls': related to locations.
1285130803Smarcel
1286130803Smarcel     Refer to the stacks thru separate pointers, to allow yyoverflow
1287130803Smarcel     to xreallocate them elsewhere.  */
1288130803Smarcel
1289130803Smarcel  /* The state stack.  */
1290130803Smarcel  short	yyssa[YYINITDEPTH];
1291130803Smarcel  short *yyss = yyssa;
1292130803Smarcel  register short *yyssp;
1293130803Smarcel
1294130803Smarcel  /* The semantic value stack.  */
1295130803Smarcel  YYSTYPE yyvsa[YYINITDEPTH];
1296130803Smarcel  YYSTYPE *yyvs = yyvsa;
1297130803Smarcel  register YYSTYPE *yyvsp;
1298130803Smarcel
1299130803Smarcel
1300130803Smarcel
1301130803Smarcel#define YYPOPSTACK   (yyvsp--, yyssp--)
1302130803Smarcel
1303130803Smarcel  YYSIZE_T yystacksize = YYINITDEPTH;
1304130803Smarcel
1305130803Smarcel  /* The variables used to return semantic value and location from the
1306130803Smarcel     action routines.  */
1307130803Smarcel  YYSTYPE yyval;
1308130803Smarcel
1309130803Smarcel
1310130803Smarcel  /* When reducing, the number of symbols on the RHS of the reduced
1311130803Smarcel     rule.  */
1312130803Smarcel  int yylen;
1313130803Smarcel
1314130803Smarcel  YYDPRINTF ((stderr, "Starting parse\n"));
1315130803Smarcel
1316130803Smarcel  yystate = 0;
1317130803Smarcel  yyerrstatus = 0;
1318130803Smarcel  yynerrs = 0;
1319130803Smarcel  yychar = YYEMPTY;		/* Cause a token to be read.  */
1320130803Smarcel
1321130803Smarcel  /* Initialize stack pointers.
1322130803Smarcel     Waste one element of value and location stack
1323130803Smarcel     so that they stay on the same level as the state stack.
1324130803Smarcel     The wasted elements are never initialized.  */
1325130803Smarcel
1326130803Smarcel  yyssp = yyss;
1327130803Smarcel  yyvsp = yyvs;
1328130803Smarcel
1329130803Smarcel  goto yysetstate;
1330130803Smarcel
1331130803Smarcel/*------------------------------------------------------------.
1332130803Smarcel| yynewstate -- Push a new state, which is found in yystate.  |
1333130803Smarcel`------------------------------------------------------------*/
1334130803Smarcel yynewstate:
1335130803Smarcel  /* In all cases, when you get here, the value and location stacks
1336130803Smarcel     have just been pushed. so pushing a state here evens the stacks.
1337130803Smarcel     */
1338130803Smarcel  yyssp++;
1339130803Smarcel
1340130803Smarcel yysetstate:
1341130803Smarcel  *yyssp = yystate;
1342130803Smarcel
1343130803Smarcel  if (yyss + yystacksize - 1 <= yyssp)
1344130803Smarcel    {
1345130803Smarcel      /* Get the current used size of the three stacks, in elements.  */
1346130803Smarcel      YYSIZE_T yysize = yyssp - yyss + 1;
1347130803Smarcel
1348130803Smarcel#ifdef yyoverflow
1349130803Smarcel      {
1350130803Smarcel	/* Give user a chance to xreallocate the stack. Use copies of
1351130803Smarcel	   these so that the &'s don't force the real ones into
1352130803Smarcel	   memory.  */
1353130803Smarcel	YYSTYPE *yyvs1 = yyvs;
1354130803Smarcel	short *yyss1 = yyss;
1355130803Smarcel
1356130803Smarcel
1357130803Smarcel	/* Each stack pointer address is followed by the size of the
1358130803Smarcel	   data in use in that stack, in bytes.  This used to be a
1359130803Smarcel	   conditional around just the two extra args, but that might
1360130803Smarcel	   be undefined if yyoverflow is a macro.  */
1361130803Smarcel	yyoverflow ("parser stack overflow",
1362130803Smarcel		    &yyss1, yysize * sizeof (*yyssp),
1363130803Smarcel		    &yyvs1, yysize * sizeof (*yyvsp),
1364130803Smarcel
1365130803Smarcel		    &yystacksize);
1366130803Smarcel
1367130803Smarcel	yyss = yyss1;
1368130803Smarcel	yyvs = yyvs1;
1369130803Smarcel      }
1370130803Smarcel#else /* no yyoverflow */
1371130803Smarcel# ifndef YYSTACK_RELOCATE
1372130803Smarcel      goto yyoverflowlab;
1373130803Smarcel# else
1374130803Smarcel      /* Extend the stack our own way.  */
1375130803Smarcel      if (YYMAXDEPTH <= yystacksize)
1376130803Smarcel	goto yyoverflowlab;
1377130803Smarcel      yystacksize *= 2;
1378130803Smarcel      if (YYMAXDEPTH < yystacksize)
1379130803Smarcel	yystacksize = YYMAXDEPTH;
1380130803Smarcel
1381130803Smarcel      {
1382130803Smarcel	short *yyss1 = yyss;
1383130803Smarcel	union yyalloc *yyptr =
1384130803Smarcel	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1385130803Smarcel	if (! yyptr)
1386130803Smarcel	  goto yyoverflowlab;
1387130803Smarcel	YYSTACK_RELOCATE (yyss);
1388130803Smarcel	YYSTACK_RELOCATE (yyvs);
1389130803Smarcel
1390130803Smarcel#  undef YYSTACK_RELOCATE
1391130803Smarcel	if (yyss1 != yyssa)
1392130803Smarcel	  YYSTACK_FREE (yyss1);
1393130803Smarcel      }
1394130803Smarcel# endif
1395130803Smarcel#endif /* no yyoverflow */
1396130803Smarcel
1397130803Smarcel      yyssp = yyss + yysize - 1;
1398130803Smarcel      yyvsp = yyvs + yysize - 1;
1399130803Smarcel
1400130803Smarcel
1401130803Smarcel      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1402130803Smarcel		  (unsigned long int) yystacksize));
1403130803Smarcel
1404130803Smarcel      if (yyss + yystacksize - 1 <= yyssp)
1405130803Smarcel	YYABORT;
1406130803Smarcel    }
1407130803Smarcel
1408130803Smarcel  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1409130803Smarcel
1410130803Smarcel  goto yybackup;
1411130803Smarcel
1412130803Smarcel/*-----------.
1413130803Smarcel| yybackup.  |
1414130803Smarcel`-----------*/
1415130803Smarcelyybackup:
1416130803Smarcel
1417130803Smarcel/* Do appropriate processing given the current state.  */
1418130803Smarcel/* Read a lookahead token if we need one and don't already have one.  */
1419130803Smarcel/* yyresume: */
1420130803Smarcel
1421130803Smarcel  /* First try to decide what to do without reference to lookahead token.  */
1422130803Smarcel
1423130803Smarcel  yyn = yypact[yystate];
1424130803Smarcel  if (yyn == YYPACT_NINF)
1425130803Smarcel    goto yydefault;
1426130803Smarcel
1427130803Smarcel  /* Not known => get a lookahead token if don't already have one.  */
1428130803Smarcel
1429130803Smarcel  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1430130803Smarcel  if (yychar == YYEMPTY)
1431130803Smarcel    {
1432130803Smarcel      YYDPRINTF ((stderr, "Reading a token: "));
1433130803Smarcel      yychar = YYLEX;
1434130803Smarcel    }
1435130803Smarcel
1436130803Smarcel  if (yychar <= YYEOF)
1437130803Smarcel    {
1438130803Smarcel      yychar = yytoken = YYEOF;
1439130803Smarcel      YYDPRINTF ((stderr, "Now at end of input.\n"));
1440130803Smarcel    }
1441130803Smarcel  else
1442130803Smarcel    {
1443130803Smarcel      yytoken = YYTRANSLATE (yychar);
1444130803Smarcel      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1445130803Smarcel    }
1446130803Smarcel
1447130803Smarcel  /* If the proper action on seeing token YYTOKEN is to reduce or to
1448130803Smarcel     detect an error, take that action.  */
1449130803Smarcel  yyn += yytoken;
1450130803Smarcel  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1451130803Smarcel    goto yydefault;
1452130803Smarcel  yyn = yytable[yyn];
1453130803Smarcel  if (yyn <= 0)
1454130803Smarcel    {
1455130803Smarcel      if (yyn == 0 || yyn == YYTABLE_NINF)
1456130803Smarcel	goto yyerrlab;
1457130803Smarcel      yyn = -yyn;
1458130803Smarcel      goto yyreduce;
1459130803Smarcel    }
1460130803Smarcel
1461130803Smarcel  if (yyn == YYFINAL)
1462130803Smarcel    YYACCEPT;
1463130803Smarcel
1464130803Smarcel  /* Shift the lookahead token.  */
1465130803Smarcel  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1466130803Smarcel
1467130803Smarcel  /* Discard the token being shifted unless it is eof.  */
1468130803Smarcel  if (yychar != YYEOF)
1469130803Smarcel    yychar = YYEMPTY;
1470130803Smarcel
1471130803Smarcel  *++yyvsp = yylval;
1472130803Smarcel
1473130803Smarcel
1474130803Smarcel  /* Count tokens shifted since error; after three, turn off error
1475130803Smarcel     status.  */
1476130803Smarcel  if (yyerrstatus)
1477130803Smarcel    yyerrstatus--;
1478130803Smarcel
1479130803Smarcel  yystate = yyn;
1480130803Smarcel  goto yynewstate;
1481130803Smarcel
1482130803Smarcel
1483130803Smarcel/*-----------------------------------------------------------.
1484130803Smarcel| yydefault -- do the default action for the current state.  |
1485130803Smarcel`-----------------------------------------------------------*/
1486130803Smarcelyydefault:
1487130803Smarcel  yyn = yydefact[yystate];
1488130803Smarcel  if (yyn == 0)
1489130803Smarcel    goto yyerrlab;
1490130803Smarcel  goto yyreduce;
1491130803Smarcel
1492130803Smarcel
1493130803Smarcel/*-----------------------------.
1494130803Smarcel| yyreduce -- Do a reduction.  |
1495130803Smarcel`-----------------------------*/
1496130803Smarcelyyreduce:
1497130803Smarcel  /* yyn is the number of a rule to reduce with.  */
1498130803Smarcel  yylen = yyr2[yyn];
1499130803Smarcel
1500130803Smarcel  /* If YYLEN is nonzero, implement the default value of the action:
1501130803Smarcel     `$$ = $1'.
1502130803Smarcel
1503130803Smarcel     Otherwise, the following line sets YYVAL to garbage.
1504130803Smarcel     This behavior is undocumented and Bison
1505130803Smarcel     users should not rely upon it.  Assigning to YYVAL
1506130803Smarcel     unconditionally makes the parser a bit smaller, and it avoids a
1507130803Smarcel     GCC warning that YYVAL may be used uninitialized.  */
1508130803Smarcel  yyval = yyvsp[1-yylen];
1509130803Smarcel
1510130803Smarcel
1511130803Smarcel  YY_REDUCE_PRINT (yyn);
1512130803Smarcel  switch (yyn)
1513130803Smarcel    {
1514130803Smarcel        case 3:
1515130803Smarcel#line 209 "ada-exp.y"
1516130803Smarcel    { write_exp_elt_opcode (OP_TYPE);
1517130803Smarcel			  write_exp_elt_type (yyvsp[0].tval);
1518130803Smarcel 			  write_exp_elt_opcode (OP_TYPE); }
1519130803Smarcel    break;
1520130803Smarcel
1521130803Smarcel  case 5:
1522130803Smarcel#line 217 "ada-exp.y"
1523130803Smarcel    { write_exp_elt_opcode (BINOP_COMMA); }
1524130803Smarcel    break;
1525130803Smarcel
1526130803Smarcel  case 6:
1527130803Smarcel#line 222 "ada-exp.y"
1528130803Smarcel    { write_exp_elt_opcode (UNOP_IND); }
1529130803Smarcel    break;
1530130803Smarcel
1531130803Smarcel  case 7:
1532130803Smarcel#line 226 "ada-exp.y"
1533130803Smarcel    { write_exp_elt_opcode (STRUCTOP_STRUCT);
1534130803Smarcel			  write_exp_string (yyvsp[0].ssym.stoken);
1535130803Smarcel			  write_exp_elt_opcode (STRUCTOP_STRUCT);
1536130803Smarcel			  }
1537130803Smarcel    break;
1538130803Smarcel
1539130803Smarcel  case 8:
1540130803Smarcel#line 233 "ada-exp.y"
1541130803Smarcel    {
1542130803Smarcel			  write_exp_elt_opcode (OP_FUNCALL);
1543130803Smarcel			  write_exp_elt_longcst (yyvsp[-1].lval);
1544130803Smarcel			  write_exp_elt_opcode (OP_FUNCALL);
1545130803Smarcel		        }
1546130803Smarcel    break;
1547130803Smarcel
1548130803Smarcel  case 9:
1549130803Smarcel#line 241 "ada-exp.y"
1550130803Smarcel    {
1551130803Smarcel			  write_exp_elt_opcode (UNOP_CAST);
1552130803Smarcel			  write_exp_elt_type (yyvsp[-3].tval);
1553130803Smarcel			  write_exp_elt_opcode (UNOP_CAST);
1554130803Smarcel			}
1555130803Smarcel    break;
1556130803Smarcel
1557130803Smarcel  case 10:
1558130803Smarcel#line 248 "ada-exp.y"
1559130803Smarcel    { type_qualifier = yyvsp[-2].tval; }
1560130803Smarcel    break;
1561130803Smarcel
1562130803Smarcel  case 11:
1563130803Smarcel#line 249 "ada-exp.y"
1564130803Smarcel    {
1565130803Smarcel			  /*			  write_exp_elt_opcode (UNOP_QUAL); */
1566130803Smarcel			  /* FIXME: UNOP_QUAL should be defined in expression.h */
1567130803Smarcel			  write_exp_elt_type (yyvsp[-6].tval);
1568130803Smarcel			  /* write_exp_elt_opcode (UNOP_QUAL); */
1569130803Smarcel			  /* FIXME: UNOP_QUAL should be defined in expression.h */
1570130803Smarcel			  type_qualifier = yyvsp[-4].tval;
1571130803Smarcel			}
1572130803Smarcel    break;
1573130803Smarcel
1574130803Smarcel  case 12:
1575130803Smarcel#line 259 "ada-exp.y"
1576130803Smarcel    { yyval.tval = type_qualifier; }
1577130803Smarcel    break;
1578130803Smarcel
1579130803Smarcel  case 13:
1580130803Smarcel#line 264 "ada-exp.y"
1581130803Smarcel    { write_exp_elt_opcode (TERNOP_SLICE); }
1582130803Smarcel    break;
1583130803Smarcel
1584130803Smarcel  case 14:
1585130803Smarcel#line 267 "ada-exp.y"
1586130803Smarcel    { }
1587130803Smarcel    break;
1588130803Smarcel
1589130803Smarcel  case 16:
1590130803Smarcel#line 274 "ada-exp.y"
1591130803Smarcel    { write_exp_elt_opcode (OP_REGISTER);
1592130803Smarcel			  write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1593130803Smarcel			  write_exp_elt_opcode (OP_REGISTER);
1594130803Smarcel			}
1595130803Smarcel    break;
1596130803Smarcel
1597130803Smarcel  case 17:
1598130803Smarcel#line 281 "ada-exp.y"
1599130803Smarcel    { write_exp_elt_opcode (OP_INTERNALVAR);
1600130803Smarcel			  write_exp_elt_intern (yyvsp[0].ivar);
1601130803Smarcel			  write_exp_elt_opcode (OP_INTERNALVAR);
1602130803Smarcel			}
1603130803Smarcel    break;
1604130803Smarcel
1605130803Smarcel  case 19:
1606130803Smarcel#line 292 "ada-exp.y"
1607130803Smarcel    { write_exp_elt_opcode (OP_LAST);
1608130803Smarcel			  write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1609130803Smarcel			  write_exp_elt_opcode (OP_LAST);
1610130803Smarcel			 }
1611130803Smarcel    break;
1612130803Smarcel
1613130803Smarcel  case 20:
1614130803Smarcel#line 299 "ada-exp.y"
1615130803Smarcel    { write_exp_elt_opcode (BINOP_ASSIGN); }
1616130803Smarcel    break;
1617130803Smarcel
1618130803Smarcel  case 21:
1619130803Smarcel#line 303 "ada-exp.y"
1620130803Smarcel    { write_exp_elt_opcode (UNOP_NEG); }
1621130803Smarcel    break;
1622130803Smarcel
1623130803Smarcel  case 22:
1624130803Smarcel#line 307 "ada-exp.y"
1625130803Smarcel    { write_exp_elt_opcode (UNOP_PLUS); }
1626130803Smarcel    break;
1627130803Smarcel
1628130803Smarcel  case 23:
1629130803Smarcel#line 311 "ada-exp.y"
1630130803Smarcel    { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1631130803Smarcel    break;
1632130803Smarcel
1633130803Smarcel  case 24:
1634130803Smarcel#line 315 "ada-exp.y"
1635130803Smarcel    { write_exp_elt_opcode (UNOP_ABS); }
1636130803Smarcel    break;
1637130803Smarcel
1638130803Smarcel  case 25:
1639130803Smarcel#line 318 "ada-exp.y"
1640130803Smarcel    { yyval.lval = 0; }
1641130803Smarcel    break;
1642130803Smarcel
1643130803Smarcel  case 26:
1644130803Smarcel#line 322 "ada-exp.y"
1645130803Smarcel    { yyval.lval = 1; }
1646130803Smarcel    break;
1647130803Smarcel
1648130803Smarcel  case 27:
1649130803Smarcel#line 324 "ada-exp.y"
1650130803Smarcel    { yyval.lval = 1; }
1651130803Smarcel    break;
1652130803Smarcel
1653130803Smarcel  case 28:
1654130803Smarcel#line 326 "ada-exp.y"
1655130803Smarcel    { yyval.lval = yyvsp[-2].lval + 1; }
1656130803Smarcel    break;
1657130803Smarcel
1658130803Smarcel  case 29:
1659130803Smarcel#line 328 "ada-exp.y"
1660130803Smarcel    { yyval.lval = yyvsp[-4].lval + 1; }
1661130803Smarcel    break;
1662130803Smarcel
1663130803Smarcel  case 30:
1664130803Smarcel#line 333 "ada-exp.y"
1665130803Smarcel    { write_exp_elt_opcode (UNOP_MEMVAL);
1666130803Smarcel			  write_exp_elt_type (yyvsp[-2].tval);
1667130803Smarcel			  write_exp_elt_opcode (UNOP_MEMVAL);
1668130803Smarcel			}
1669130803Smarcel    break;
1670130803Smarcel
1671130803Smarcel  case 31:
1672130803Smarcel#line 342 "ada-exp.y"
1673130803Smarcel    { write_exp_elt_opcode (BINOP_EXP); }
1674130803Smarcel    break;
1675130803Smarcel
1676130803Smarcel  case 32:
1677130803Smarcel#line 346 "ada-exp.y"
1678130803Smarcel    { write_exp_elt_opcode (BINOP_MUL); }
1679130803Smarcel    break;
1680130803Smarcel
1681130803Smarcel  case 33:
1682130803Smarcel#line 350 "ada-exp.y"
1683130803Smarcel    { write_exp_elt_opcode (BINOP_DIV); }
1684130803Smarcel    break;
1685130803Smarcel
1686130803Smarcel  case 34:
1687130803Smarcel#line 354 "ada-exp.y"
1688130803Smarcel    { write_exp_elt_opcode (BINOP_REM); }
1689130803Smarcel    break;
1690130803Smarcel
1691130803Smarcel  case 35:
1692130803Smarcel#line 358 "ada-exp.y"
1693130803Smarcel    { write_exp_elt_opcode (BINOP_MOD); }
1694130803Smarcel    break;
1695130803Smarcel
1696130803Smarcel  case 36:
1697130803Smarcel#line 362 "ada-exp.y"
1698130803Smarcel    { write_exp_elt_opcode (BINOP_REPEAT); }
1699130803Smarcel    break;
1700130803Smarcel
1701130803Smarcel  case 37:
1702130803Smarcel#line 366 "ada-exp.y"
1703130803Smarcel    { write_exp_elt_opcode (BINOP_ADD); }
1704130803Smarcel    break;
1705130803Smarcel
1706130803Smarcel  case 38:
1707130803Smarcel#line 370 "ada-exp.y"
1708130803Smarcel    { write_exp_elt_opcode (BINOP_CONCAT); }
1709130803Smarcel    break;
1710130803Smarcel
1711130803Smarcel  case 39:
1712130803Smarcel#line 374 "ada-exp.y"
1713130803Smarcel    { write_exp_elt_opcode (BINOP_SUB); }
1714130803Smarcel    break;
1715130803Smarcel
1716130803Smarcel  case 40:
1717130803Smarcel#line 378 "ada-exp.y"
1718130803Smarcel    { write_exp_elt_opcode (BINOP_EQUAL); }
1719130803Smarcel    break;
1720130803Smarcel
1721130803Smarcel  case 41:
1722130803Smarcel#line 382 "ada-exp.y"
1723130803Smarcel    { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1724130803Smarcel    break;
1725130803Smarcel
1726130803Smarcel  case 42:
1727130803Smarcel#line 386 "ada-exp.y"
1728130803Smarcel    { write_exp_elt_opcode (BINOP_LEQ); }
1729130803Smarcel    break;
1730130803Smarcel
1731130803Smarcel  case 43:
1732130803Smarcel#line 390 "ada-exp.y"
1733130803Smarcel    { /*write_exp_elt_opcode (TERNOP_MBR); */ }
1734130803Smarcel    break;
1735130803Smarcel
1736130803Smarcel  case 44:
1737130803Smarcel#line 394 "ada-exp.y"
1738130803Smarcel    { /*write_exp_elt_opcode (BINOP_MBR); */
1739130803Smarcel			  /* FIXME: BINOP_MBR should be defined in expression.h */
1740130803Smarcel			  write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1741130803Smarcel			  /*write_exp_elt_opcode (BINOP_MBR); */
1742130803Smarcel			}
1743130803Smarcel    break;
1744130803Smarcel
1745130803Smarcel  case 45:
1746130803Smarcel#line 400 "ada-exp.y"
1747130803Smarcel    { /*write_exp_elt_opcode (UNOP_MBR); */
1748130803Smarcel			  /* FIXME: UNOP_QUAL should be defined in expression.h */
1749130803Smarcel		          write_exp_elt_type (yyvsp[0].tval);
1750130803Smarcel			  /*		          write_exp_elt_opcode (UNOP_MBR); */
1751130803Smarcel			  /* FIXME: UNOP_MBR should be defined in expression.h */
1752130803Smarcel			}
1753130803Smarcel    break;
1754130803Smarcel
1755130803Smarcel  case 46:
1756130803Smarcel#line 407 "ada-exp.y"
1757130803Smarcel    { /*write_exp_elt_opcode (TERNOP_MBR); */
1758130803Smarcel			  /* FIXME: TERNOP_MBR should be defined in expression.h */
1759130803Smarcel		          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
1760130803Smarcel			}
1761130803Smarcel    break;
1762130803Smarcel
1763130803Smarcel  case 47:
1764130803Smarcel#line 412 "ada-exp.y"
1765130803Smarcel    { /* write_exp_elt_opcode (BINOP_MBR); */
1766130803Smarcel			  /* FIXME: BINOP_MBR should be defined in expression.h */
1767130803Smarcel			  write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1768130803Smarcel			  /*write_exp_elt_opcode (BINOP_MBR);*/
1769130803Smarcel			  /* FIXME: BINOP_MBR should be defined in expression.h */
1770130803Smarcel		          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
1771130803Smarcel			}
1772130803Smarcel    break;
1773130803Smarcel
1774130803Smarcel  case 48:
1775130803Smarcel#line 420 "ada-exp.y"
1776130803Smarcel    { /*write_exp_elt_opcode (UNOP_MBR);*/
1777130803Smarcel			  /* FIXME: UNOP_MBR should be defined in expression.h */
1778130803Smarcel		          write_exp_elt_type (yyvsp[0].tval);
1779130803Smarcel			  /*		          write_exp_elt_opcode (UNOP_MBR);*/
1780130803Smarcel			  /* FIXME: UNOP_MBR should be defined in expression.h */
1781130803Smarcel		          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
1782130803Smarcel			}
1783130803Smarcel    break;
1784130803Smarcel
1785130803Smarcel  case 49:
1786130803Smarcel#line 430 "ada-exp.y"
1787130803Smarcel    { write_exp_elt_opcode (BINOP_GEQ); }
1788130803Smarcel    break;
1789130803Smarcel
1790130803Smarcel  case 50:
1791130803Smarcel#line 434 "ada-exp.y"
1792130803Smarcel    { write_exp_elt_opcode (BINOP_LESS); }
1793130803Smarcel    break;
1794130803Smarcel
1795130803Smarcel  case 51:
1796130803Smarcel#line 438 "ada-exp.y"
1797130803Smarcel    { write_exp_elt_opcode (BINOP_GTR); }
1798130803Smarcel    break;
1799130803Smarcel
1800130803Smarcel  case 52:
1801130803Smarcel#line 442 "ada-exp.y"
1802130803Smarcel    { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1803130803Smarcel    break;
1804130803Smarcel
1805130803Smarcel  case 53:
1806130803Smarcel#line 446 "ada-exp.y"
1807130803Smarcel    { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1808130803Smarcel    break;
1809130803Smarcel
1810130803Smarcel  case 54:
1811130803Smarcel#line 450 "ada-exp.y"
1812130803Smarcel    { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1813130803Smarcel    break;
1814130803Smarcel
1815130803Smarcel  case 55:
1816130803Smarcel#line 454 "ada-exp.y"
1817130803Smarcel    { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1818130803Smarcel    break;
1819130803Smarcel
1820130803Smarcel  case 56:
1821130803Smarcel#line 458 "ada-exp.y"
1822130803Smarcel    { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1823130803Smarcel    break;
1824130803Smarcel
1825130803Smarcel  case 57:
1826130803Smarcel#line 462 "ada-exp.y"
1827130803Smarcel    { write_exp_elt_opcode (UNOP_ADDR); }
1828130803Smarcel    break;
1829130803Smarcel
1830130803Smarcel  case 58:
1831130803Smarcel#line 464 "ada-exp.y"
1832130803Smarcel    { write_exp_elt_opcode (UNOP_ADDR);
1833130803Smarcel			  write_exp_elt_opcode (UNOP_CAST);
1834130803Smarcel			  write_exp_elt_type (builtin_type_ada_system_address);
1835130803Smarcel			  write_exp_elt_opcode (UNOP_CAST);
1836130803Smarcel			}
1837130803Smarcel    break;
1838130803Smarcel
1839130803Smarcel  case 59:
1840130803Smarcel#line 470 "ada-exp.y"
1841130803Smarcel    { write_attribute_call1 (ATR_FIRST, yyvsp[0].lval); }
1842130803Smarcel    break;
1843130803Smarcel
1844130803Smarcel  case 60:
1845130803Smarcel#line 472 "ada-exp.y"
1846130803Smarcel    { write_attribute_call1 (ATR_LAST, yyvsp[0].lval); }
1847130803Smarcel    break;
1848130803Smarcel
1849130803Smarcel  case 61:
1850130803Smarcel#line 474 "ada-exp.y"
1851130803Smarcel    { write_attribute_call1 (ATR_LENGTH, yyvsp[0].lval); }
1852130803Smarcel    break;
1853130803Smarcel
1854130803Smarcel  case 62:
1855130803Smarcel#line 476 "ada-exp.y"
1856130803Smarcel    { write_attribute_call0 (ATR_SIZE); }
1857130803Smarcel    break;
1858130803Smarcel
1859130803Smarcel  case 63:
1860130803Smarcel#line 478 "ada-exp.y"
1861130803Smarcel    { write_attribute_call0 (ATR_TAG); }
1862130803Smarcel    break;
1863130803Smarcel
1864130803Smarcel  case 64:
1865130803Smarcel#line 480 "ada-exp.y"
1866130803Smarcel    { write_attribute_calln (ATR_MIN, 2); }
1867130803Smarcel    break;
1868130803Smarcel
1869130803Smarcel  case 65:
1870130803Smarcel#line 482 "ada-exp.y"
1871130803Smarcel    { write_attribute_calln (ATR_MAX, 2); }
1872130803Smarcel    break;
1873130803Smarcel
1874130803Smarcel  case 66:
1875130803Smarcel#line 484 "ada-exp.y"
1876130803Smarcel    { write_attribute_calln (ATR_POS, 1); }
1877130803Smarcel    break;
1878130803Smarcel
1879130803Smarcel  case 67:
1880130803Smarcel#line 486 "ada-exp.y"
1881130803Smarcel    { write_attribute_call1 (ATR_FIRST, yyvsp[0].lval); }
1882130803Smarcel    break;
1883130803Smarcel
1884130803Smarcel  case 68:
1885130803Smarcel#line 488 "ada-exp.y"
1886130803Smarcel    { write_attribute_call1 (ATR_LAST, yyvsp[0].lval); }
1887130803Smarcel    break;
1888130803Smarcel
1889130803Smarcel  case 69:
1890130803Smarcel#line 490 "ada-exp.y"
1891130803Smarcel    { write_attribute_call1 (ATR_LENGTH, yyvsp[0].lval); }
1892130803Smarcel    break;
1893130803Smarcel
1894130803Smarcel  case 70:
1895130803Smarcel#line 492 "ada-exp.y"
1896130803Smarcel    { write_attribute_calln (ATR_VAL, 1); }
1897130803Smarcel    break;
1898130803Smarcel
1899130803Smarcel  case 71:
1900130803Smarcel#line 494 "ada-exp.y"
1901130803Smarcel    { write_attribute_call0 (ATR_MODULUS); }
1902130803Smarcel    break;
1903130803Smarcel
1904130803Smarcel  case 72:
1905130803Smarcel#line 498 "ada-exp.y"
1906130803Smarcel    { yyval.lval = 1; }
1907130803Smarcel    break;
1908130803Smarcel
1909130803Smarcel  case 73:
1910130803Smarcel#line 500 "ada-exp.y"
1911130803Smarcel    { yyval.lval = yyvsp[-1].typed_val.val; }
1912130803Smarcel    break;
1913130803Smarcel
1914130803Smarcel  case 74:
1915130803Smarcel#line 505 "ada-exp.y"
1916130803Smarcel    { write_exp_elt_opcode (OP_TYPE);
1917130803Smarcel			  write_exp_elt_type (yyvsp[0].tval);
1918130803Smarcel			  write_exp_elt_opcode (OP_TYPE); }
1919130803Smarcel    break;
1920130803Smarcel
1921130803Smarcel  case 76:
1922130803Smarcel#line 513 "ada-exp.y"
1923130803Smarcel    { write_exp_elt_opcode (OP_TYPE);
1924130803Smarcel			  write_exp_elt_type (builtin_type_void);
1925130803Smarcel			  write_exp_elt_opcode (OP_TYPE); }
1926130803Smarcel    break;
1927130803Smarcel
1928130803Smarcel  case 77:
1929130803Smarcel#line 520 "ada-exp.y"
1930130803Smarcel    { write_exp_elt_opcode (OP_LONG);
1931130803Smarcel			  write_exp_elt_type (yyvsp[0].typed_val.type);
1932130803Smarcel			  write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val.val));
1933130803Smarcel			  write_exp_elt_opcode (OP_LONG);
1934130803Smarcel			}
1935130803Smarcel    break;
1936130803Smarcel
1937130803Smarcel  case 78:
1938130803Smarcel#line 528 "ada-exp.y"
1939130803Smarcel    { write_exp_elt_opcode (OP_LONG);
1940130803Smarcel			  if (type_qualifier == NULL)
1941130803Smarcel			    write_exp_elt_type (yyvsp[0].typed_val.type);
1942130803Smarcel			  else
1943130803Smarcel			    write_exp_elt_type (type_qualifier);
1944130803Smarcel			  write_exp_elt_longcst
1945130803Smarcel			    (convert_char_literal (type_qualifier, yyvsp[0].typed_val.val));
1946130803Smarcel			  write_exp_elt_opcode (OP_LONG);
1947130803Smarcel			}
1948130803Smarcel    break;
1949130803Smarcel
1950130803Smarcel  case 79:
1951130803Smarcel#line 540 "ada-exp.y"
1952130803Smarcel    { write_exp_elt_opcode (OP_DOUBLE);
1953130803Smarcel			  write_exp_elt_type (yyvsp[0].typed_val_float.type);
1954130803Smarcel			  write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1955130803Smarcel			  write_exp_elt_opcode (OP_DOUBLE);
1956130803Smarcel			}
1957130803Smarcel    break;
1958130803Smarcel
1959130803Smarcel  case 80:
1960130803Smarcel#line 548 "ada-exp.y"
1961130803Smarcel    { write_exp_elt_opcode (OP_LONG);
1962130803Smarcel			  write_exp_elt_type (builtin_type_int);
1963130803Smarcel			  write_exp_elt_longcst ((LONGEST)(0));
1964130803Smarcel			  write_exp_elt_opcode (OP_LONG);
1965130803Smarcel			 }
1966130803Smarcel    break;
1967130803Smarcel
1968130803Smarcel  case 81:
1969130803Smarcel#line 556 "ada-exp.y"
1970130803Smarcel    { /* Ada strings are converted into array constants
1971130803Smarcel			     a lower bound of 1.  Thus, the array upper bound
1972130803Smarcel			     is the string length. */
1973130803Smarcel			  char *sp = yyvsp[0].sval.ptr; int count;
1974130803Smarcel			  if (yyvsp[0].sval.length == 0)
1975130803Smarcel			    { /* One dummy character for the type */
1976130803Smarcel			      write_exp_elt_opcode (OP_LONG);
1977130803Smarcel			      write_exp_elt_type (builtin_type_ada_char);
1978130803Smarcel			      write_exp_elt_longcst ((LONGEST)(0));
1979130803Smarcel			      write_exp_elt_opcode (OP_LONG);
1980130803Smarcel			    }
1981130803Smarcel			  for (count = yyvsp[0].sval.length; count > 0; count -= 1)
1982130803Smarcel			    {
1983130803Smarcel			      write_exp_elt_opcode (OP_LONG);
1984130803Smarcel			      write_exp_elt_type (builtin_type_ada_char);
1985130803Smarcel			      write_exp_elt_longcst ((LONGEST)(*sp));
1986130803Smarcel			      sp += 1;
1987130803Smarcel			      write_exp_elt_opcode (OP_LONG);
1988130803Smarcel			    }
1989130803Smarcel			  write_exp_elt_opcode (OP_ARRAY);
1990130803Smarcel			  write_exp_elt_longcst ((LONGEST) 1);
1991130803Smarcel			  write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1992130803Smarcel			  write_exp_elt_opcode (OP_ARRAY);
1993130803Smarcel			 }
1994130803Smarcel    break;
1995130803Smarcel
1996130803Smarcel  case 82:
1997130803Smarcel#line 583 "ada-exp.y"
1998130803Smarcel    { error ("NEW not implemented."); }
1999130803Smarcel    break;
2000130803Smarcel
2001130803Smarcel  case 83:
2002130803Smarcel#line 586 "ada-exp.y"
2003130803Smarcel    { write_var_from_name (NULL, yyvsp[0].ssym); }
2004130803Smarcel    break;
2005130803Smarcel
2006130803Smarcel  case 84:
2007130803Smarcel#line 588 "ada-exp.y"
2008130803Smarcel    { write_var_from_name (yyvsp[-1].bval, yyvsp[0].ssym); }
2009130803Smarcel    break;
2010130803Smarcel
2011130803Smarcel  case 85:
2012130803Smarcel#line 589 "ada-exp.y"
2013130803Smarcel    { write_object_renaming (NULL, yyvsp[0].ssym.sym); }
2014130803Smarcel    break;
2015130803Smarcel
2016130803Smarcel  case 86:
2017130803Smarcel#line 591 "ada-exp.y"
2018130803Smarcel    { write_object_renaming (yyvsp[-1].bval, yyvsp[0].ssym.sym); }
2019130803Smarcel    break;
2020130803Smarcel
2021130803Smarcel  case 87:
2022130803Smarcel#line 594 "ada-exp.y"
2023130803Smarcel    { }
2024130803Smarcel    break;
2025130803Smarcel
2026130803Smarcel  case 88:
2027130803Smarcel#line 595 "ada-exp.y"
2028130803Smarcel    { }
2029130803Smarcel    break;
2030130803Smarcel
2031130803Smarcel  case 89:
2032130803Smarcel#line 596 "ada-exp.y"
2033130803Smarcel    { }
2034130803Smarcel    break;
2035130803Smarcel
2036130803Smarcel  case 90:
2037130803Smarcel#line 600 "ada-exp.y"
2038130803Smarcel    { yyval.bval = yyvsp[0].bval; }
2039130803Smarcel    break;
2040130803Smarcel
2041130803Smarcel  case 91:
2042130803Smarcel#line 602 "ada-exp.y"
2043130803Smarcel    { yyval.bval = yyvsp[0].bval; }
2044130803Smarcel    break;
2045130803Smarcel
2046130803Smarcel  case 92:
2047130803Smarcel#line 606 "ada-exp.y"
2048130803Smarcel    { yyval.tval = yyvsp[0].tval; }
2049130803Smarcel    break;
2050130803Smarcel
2051130803Smarcel  case 93:
2052130803Smarcel#line 607 "ada-exp.y"
2053130803Smarcel    { yyval.tval = yyvsp[0].tval; }
2054130803Smarcel    break;
2055130803Smarcel
2056130803Smarcel  case 94:
2057130803Smarcel#line 609 "ada-exp.y"
2058130803Smarcel    { yyval.tval = lookup_pointer_type (yyvsp[-1].tval); }
2059130803Smarcel    break;
2060130803Smarcel
2061130803Smarcel  case 95:
2062130803Smarcel#line 611 "ada-exp.y"
2063130803Smarcel    { yyval.tval = lookup_pointer_type (yyvsp[-1].tval); }
2064130803Smarcel    break;
2065130803Smarcel
2066130803Smarcel  case 96:
2067130803Smarcel#line 618 "ada-exp.y"
2068130803Smarcel    { write_exp_elt_opcode (UNOP_IND); }
2069130803Smarcel    break;
2070130803Smarcel
2071130803Smarcel  case 97:
2072130803Smarcel#line 620 "ada-exp.y"
2073130803Smarcel    { write_exp_elt_opcode (UNOP_ADDR); }
2074130803Smarcel    break;
2075130803Smarcel
2076130803Smarcel  case 98:
2077130803Smarcel#line 622 "ada-exp.y"
2078130803Smarcel    { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
2079130803Smarcel    break;
2080130803Smarcel
2081130803Smarcel
2082130803Smarcel    }
2083130803Smarcel
2084130803Smarcel/* Line 991 of yacc.c.  */
2085130803Smarcel
2086130803Smarcel  yyvsp -= yylen;
2087130803Smarcel  yyssp -= yylen;
2088130803Smarcel
2089130803Smarcel
2090130803Smarcel  YY_STACK_PRINT (yyss, yyssp);
2091130803Smarcel
2092130803Smarcel  *++yyvsp = yyval;
2093130803Smarcel
2094130803Smarcel
2095130803Smarcel  /* Now `shift' the result of the reduction.  Determine what state
2096130803Smarcel     that goes to, based on the state we popped back to and the rule
2097130803Smarcel     number reduced by.  */
2098130803Smarcel
2099130803Smarcel  yyn = yyr1[yyn];
2100130803Smarcel
2101130803Smarcel  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2102130803Smarcel  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2103130803Smarcel    yystate = yytable[yystate];
2104130803Smarcel  else
2105130803Smarcel    yystate = yydefgoto[yyn - YYNTOKENS];
2106130803Smarcel
2107130803Smarcel  goto yynewstate;
2108130803Smarcel
2109130803Smarcel
2110130803Smarcel/*------------------------------------.
2111130803Smarcel| yyerrlab -- here on detecting error |
2112130803Smarcel`------------------------------------*/
2113130803Smarcelyyerrlab:
2114130803Smarcel  /* If not already recovering from an error, report this error.  */
2115130803Smarcel  if (!yyerrstatus)
2116130803Smarcel    {
2117130803Smarcel      ++yynerrs;
2118130803Smarcel#if YYERROR_VERBOSE
2119130803Smarcel      yyn = yypact[yystate];
2120130803Smarcel
2121130803Smarcel      if (YYPACT_NINF < yyn && yyn < YYLAST)
2122130803Smarcel	{
2123130803Smarcel	  YYSIZE_T yysize = 0;
2124130803Smarcel	  int yytype = YYTRANSLATE (yychar);
2125130803Smarcel	  char *yymsg;
2126130803Smarcel	  int yyx, yycount;
2127130803Smarcel
2128130803Smarcel	  yycount = 0;
2129130803Smarcel	  /* Start YYX at -YYN if negative to avoid negative indexes in
2130130803Smarcel	     YYCHECK.  */
2131130803Smarcel	  for (yyx = yyn < 0 ? -yyn : 0;
2132130803Smarcel	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
2133130803Smarcel	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2134130803Smarcel	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
2135130803Smarcel	  yysize += yystrlen ("syntax error, unexpected ") + 1;
2136130803Smarcel	  yysize += yystrlen (yytname[yytype]);
2137130803Smarcel	  yymsg = (char *) YYSTACK_ALLOC (yysize);
2138130803Smarcel	  if (yymsg != 0)
2139130803Smarcel	    {
2140130803Smarcel	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2141130803Smarcel	      yyp = yystpcpy (yyp, yytname[yytype]);
2142130803Smarcel
2143130803Smarcel	      if (yycount < 5)
2144130803Smarcel		{
2145130803Smarcel		  yycount = 0;
2146130803Smarcel		  for (yyx = yyn < 0 ? -yyn : 0;
2147130803Smarcel		       yyx < (int) (sizeof (yytname) / sizeof (char *));
2148130803Smarcel		       yyx++)
2149130803Smarcel		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2150130803Smarcel		      {
2151130803Smarcel			const char *yyq = ! yycount ? ", expecting " : " or ";
2152130803Smarcel			yyp = yystpcpy (yyp, yyq);
2153130803Smarcel			yyp = yystpcpy (yyp, yytname[yyx]);
2154130803Smarcel			yycount++;
2155130803Smarcel		      }
2156130803Smarcel		}
2157130803Smarcel	      yyerror (yymsg);
2158130803Smarcel	      YYSTACK_FREE (yymsg);
2159130803Smarcel	    }
2160130803Smarcel	  else
2161130803Smarcel	    yyerror ("syntax error; also virtual memory exhausted");
2162130803Smarcel	}
2163130803Smarcel      else
2164130803Smarcel#endif /* YYERROR_VERBOSE */
2165130803Smarcel	yyerror ("syntax error");
2166130803Smarcel    }
2167130803Smarcel
2168130803Smarcel
2169130803Smarcel
2170130803Smarcel  if (yyerrstatus == 3)
2171130803Smarcel    {
2172130803Smarcel      /* If just tried and failed to reuse lookahead token after an
2173130803Smarcel	 error, discard it.  */
2174130803Smarcel
2175130803Smarcel      /* Return failure if at end of input.  */
2176130803Smarcel      if (yychar == YYEOF)
2177130803Smarcel        {
2178130803Smarcel	  /* Pop the error token.  */
2179130803Smarcel          YYPOPSTACK;
2180130803Smarcel	  /* Pop the rest of the stack.  */
2181130803Smarcel	  while (yyss < yyssp)
2182130803Smarcel	    {
2183130803Smarcel	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2184130803Smarcel	      yydestruct (yystos[*yyssp], yyvsp);
2185130803Smarcel	      YYPOPSTACK;
2186130803Smarcel	    }
2187130803Smarcel	  YYABORT;
2188130803Smarcel        }
2189130803Smarcel
2190130803Smarcel      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2191130803Smarcel      yydestruct (yytoken, &yylval);
2192130803Smarcel      yychar = YYEMPTY;
2193130803Smarcel
2194130803Smarcel    }
2195130803Smarcel
2196130803Smarcel  /* Else will try to reuse lookahead token after shifting the error
2197130803Smarcel     token.  */
2198130803Smarcel  goto yyerrlab2;
2199130803Smarcel
2200130803Smarcel
2201130803Smarcel/*----------------------------------------------------.
2202130803Smarcel| yyerrlab1 -- error raised explicitly by an action.  |
2203130803Smarcel`----------------------------------------------------*/
2204130803Smarcelyyerrlab1:
2205130803Smarcel
2206130803Smarcel  /* Suppress GCC warning that yyerrlab1 is unused when no action
2207130803Smarcel     invokes YYERROR.  Doesn't work in C++ */
2208130803Smarcel#ifndef __cplusplus
2209130803Smarcel#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
2210130803Smarcel  __attribute__ ((__unused__))
2211130803Smarcel#endif
2212130803Smarcel#endif
2213130803Smarcel
2214130803Smarcel
2215130803Smarcel  goto yyerrlab2;
2216130803Smarcel
2217130803Smarcel
2218130803Smarcel/*---------------------------------------------------------------.
2219130803Smarcel| yyerrlab2 -- pop states until the error token can be shifted.  |
2220130803Smarcel`---------------------------------------------------------------*/
2221130803Smarcelyyerrlab2:
2222130803Smarcel  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
2223130803Smarcel
2224130803Smarcel  for (;;)
2225130803Smarcel    {
2226130803Smarcel      yyn = yypact[yystate];
2227130803Smarcel      if (yyn != YYPACT_NINF)
2228130803Smarcel	{
2229130803Smarcel	  yyn += YYTERROR;
2230130803Smarcel	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2231130803Smarcel	    {
2232130803Smarcel	      yyn = yytable[yyn];
2233130803Smarcel	      if (0 < yyn)
2234130803Smarcel		break;
2235130803Smarcel	    }
2236130803Smarcel	}
2237130803Smarcel
2238130803Smarcel      /* Pop the current state because it cannot handle the error token.  */
2239130803Smarcel      if (yyssp == yyss)
2240130803Smarcel	YYABORT;
2241130803Smarcel
2242130803Smarcel      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2243130803Smarcel      yydestruct (yystos[yystate], yyvsp);
2244130803Smarcel      yyvsp--;
2245130803Smarcel      yystate = *--yyssp;
2246130803Smarcel
2247130803Smarcel      YY_STACK_PRINT (yyss, yyssp);
2248130803Smarcel    }
2249130803Smarcel
2250130803Smarcel  if (yyn == YYFINAL)
2251130803Smarcel    YYACCEPT;
2252130803Smarcel
2253130803Smarcel  YYDPRINTF ((stderr, "Shifting error token, "));
2254130803Smarcel
2255130803Smarcel  *++yyvsp = yylval;
2256130803Smarcel
2257130803Smarcel
2258130803Smarcel  yystate = yyn;
2259130803Smarcel  goto yynewstate;
2260130803Smarcel
2261130803Smarcel
2262130803Smarcel/*-------------------------------------.
2263130803Smarcel| yyacceptlab -- YYACCEPT comes here.  |
2264130803Smarcel`-------------------------------------*/
2265130803Smarcelyyacceptlab:
2266130803Smarcel  yyresult = 0;
2267130803Smarcel  goto yyreturn;
2268130803Smarcel
2269130803Smarcel/*-----------------------------------.
2270130803Smarcel| yyabortlab -- YYABORT comes here.  |
2271130803Smarcel`-----------------------------------*/
2272130803Smarcelyyabortlab:
2273130803Smarcel  yyresult = 1;
2274130803Smarcel  goto yyreturn;
2275130803Smarcel
2276130803Smarcel#ifndef yyoverflow
2277130803Smarcel/*----------------------------------------------.
2278130803Smarcel| yyoverflowlab -- parser overflow comes here.  |
2279130803Smarcel`----------------------------------------------*/
2280130803Smarcelyyoverflowlab:
2281130803Smarcel  yyerror ("parser stack overflow");
2282130803Smarcel  yyresult = 2;
2283130803Smarcel  /* Fall through.  */
2284130803Smarcel#endif
2285130803Smarcel
2286130803Smarcelyyreturn:
2287130803Smarcel#ifndef yyoverflow
2288130803Smarcel  if (yyss != yyssa)
2289130803Smarcel    YYSTACK_FREE (yyss);
2290130803Smarcel#endif
2291130803Smarcel  return yyresult;
2292130803Smarcel}
2293130803Smarcel
2294130803Smarcel
2295130803Smarcel#line 625 "ada-exp.y"
2296130803Smarcel
2297130803Smarcel
2298130803Smarcel/* yylex defined in ada-lex.c: Reads one token, getting characters */
2299130803Smarcel/* through lexptr.  */
2300130803Smarcel
2301130803Smarcel/* Remap normal flex interface names (yylex) as well as gratuitiously */
2302130803Smarcel/* global symbol names, so we can have multiple flex-generated parsers */
2303130803Smarcel/* in gdb.  */
2304130803Smarcel
2305130803Smarcel/* (See note above on previous definitions for YACC.) */
2306130803Smarcel
2307130803Smarcel#define yy_create_buffer ada_yy_create_buffer
2308130803Smarcel#define yy_delete_buffer ada_yy_delete_buffer
2309130803Smarcel#define yy_init_buffer ada_yy_init_buffer
2310130803Smarcel#define yy_load_buffer_state ada_yy_load_buffer_state
2311130803Smarcel#define yy_switch_to_buffer ada_yy_switch_to_buffer
2312130803Smarcel#define yyrestart ada_yyrestart
2313130803Smarcel#define yytext ada_yytext
2314130803Smarcel#define yywrap ada_yywrap
2315130803Smarcel
2316130803Smarcel/* The following kludge was found necessary to prevent conflicts between */
2317130803Smarcel/* defs.h and non-standard stdlib.h files.  */
2318130803Smarcel#define qsort __qsort__dummy
2319130803Smarcel#include "ada-lex.c"
2320130803Smarcel
2321130803Smarcelint
2322130803Smarcelada_parse ()
2323130803Smarcel{
2324130803Smarcel  lexer_init (yyin);		/* (Re-)initialize lexer. */
2325130803Smarcel  left_block_context = NULL;
2326130803Smarcel  type_qualifier = NULL;
2327130803Smarcel
2328130803Smarcel  return _ada_parse ();
2329130803Smarcel}
2330130803Smarcel
2331130803Smarcelvoid
2332130803Smarcelyyerror (msg)
2333130803Smarcel     char *msg;
2334130803Smarcel{
2335130803Smarcel  error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
2336130803Smarcel}
2337130803Smarcel
2338130803Smarcel/* The operator name corresponding to operator symbol STRING (adds
2339130803Smarcel   quotes and maps to lower-case).  Destroys the previous contents of
2340130803Smarcel   the array pointed to by STRING.ptr.  Error if STRING does not match
2341130803Smarcel   a valid Ada operator.  Assumes that STRING.ptr points to a
2342130803Smarcel   null-terminated string and that, if STRING is a valid operator
2343130803Smarcel   symbol, the array pointed to by STRING.ptr contains at least
2344130803Smarcel   STRING.length+3 characters. */
2345130803Smarcel
2346130803Smarcelstatic struct stoken
2347130803Smarcelstring_to_operator (string)
2348130803Smarcel     struct stoken string;
2349130803Smarcel{
2350130803Smarcel  int i;
2351130803Smarcel
2352130803Smarcel  for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
2353130803Smarcel    {
2354130803Smarcel      if (string.length == strlen (ada_opname_table[i].demangled)-2
2355130803Smarcel	  && strncasecmp (string.ptr, ada_opname_table[i].demangled+1,
2356130803Smarcel			  string.length) == 0)
2357130803Smarcel	{
2358130803Smarcel	  strncpy (string.ptr, ada_opname_table[i].demangled,
2359130803Smarcel		   string.length+2);
2360130803Smarcel	  string.length += 2;
2361130803Smarcel	  return string;
2362130803Smarcel	}
2363130803Smarcel    }
2364130803Smarcel  error ("Invalid operator symbol `%s'", string.ptr);
2365130803Smarcel}
2366130803Smarcel
2367130803Smarcel/* Emit expression to access an instance of SYM, in block BLOCK (if
2368130803Smarcel * non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
2369130803Smarcelstatic void
2370130803Smarcelwrite_var_from_sym (orig_left_context, block, sym)
2371130803Smarcel     struct block* orig_left_context;
2372130803Smarcel     struct block* block;
2373130803Smarcel     struct symbol* sym;
2374130803Smarcel{
2375130803Smarcel  if (orig_left_context == NULL && symbol_read_needs_frame (sym))
2376130803Smarcel    {
2377130803Smarcel      if (innermost_block == 0 ||
2378130803Smarcel	  contained_in (block, innermost_block))
2379130803Smarcel	innermost_block = block;
2380130803Smarcel    }
2381130803Smarcel
2382130803Smarcel  write_exp_elt_opcode (OP_VAR_VALUE);
2383130803Smarcel  /* We want to use the selected frame, not another more inner frame
2384130803Smarcel     which happens to be in the same block */
2385130803Smarcel  write_exp_elt_block (NULL);
2386130803Smarcel  write_exp_elt_sym (sym);
2387130803Smarcel  write_exp_elt_opcode (OP_VAR_VALUE);
2388130803Smarcel}
2389130803Smarcel
2390130803Smarcel/* Emit expression to access an instance of NAME. */
2391130803Smarcelstatic void
2392130803Smarcelwrite_var_from_name (orig_left_context, name)
2393130803Smarcel     struct block* orig_left_context;
2394130803Smarcel     struct name_info name;
2395130803Smarcel{
2396130803Smarcel  if (name.msym != NULL)
2397130803Smarcel    {
2398130803Smarcel      write_exp_msymbol (name.msym,
2399130803Smarcel			 lookup_function_type (builtin_type_int),
2400130803Smarcel			 builtin_type_int);
2401130803Smarcel    }
2402130803Smarcel  else if (name.sym == NULL)
2403130803Smarcel    {
2404130803Smarcel      /* Multiple matches: record name and starting block for later
2405130803Smarcel         resolution by ada_resolve. */
2406130803Smarcel      /*      write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
2407130803Smarcel      /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
2408130803Smarcel      write_exp_elt_block (name.block);
2409130803Smarcel      /*      write_exp_elt_name (name.stoken.ptr); */
2410130803Smarcel      /* FIXME: write_exp_elt_name should be defined in defs.h, located in parse.c */
2411130803Smarcel      /*      write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
2412130803Smarcel      /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
2413130803Smarcel    }
2414130803Smarcel  else
2415130803Smarcel    write_var_from_sym (orig_left_context, name.block, name.sym);
2416130803Smarcel}
2417130803Smarcel
2418130803Smarcel/* Write a call on parameterless attribute ATR.  */
2419130803Smarcel
2420130803Smarcelstatic void
2421130803Smarcelwrite_attribute_call0 (atr)
2422130803Smarcel     enum ada_attribute atr;
2423130803Smarcel{
2424130803Smarcel  /*  write_exp_elt_opcode (OP_ATTRIBUTE); */
2425130803Smarcel  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2426130803Smarcel  write_exp_elt_longcst ((LONGEST) 0);
2427130803Smarcel  write_exp_elt_longcst ((LONGEST) atr);
2428130803Smarcel  /*  write_exp_elt_opcode (OP_ATTRIBUTE); */
2429130803Smarcel  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2430130803Smarcel}
2431130803Smarcel
2432130803Smarcel/* Write a call on an attribute ATR with one constant integer
2433130803Smarcel * parameter. */
2434130803Smarcel
2435130803Smarcelstatic void
2436130803Smarcelwrite_attribute_call1 (atr, arg)
2437130803Smarcel     enum ada_attribute atr;
2438130803Smarcel     LONGEST arg;
2439130803Smarcel{
2440130803Smarcel  write_exp_elt_opcode (OP_LONG);
2441130803Smarcel  write_exp_elt_type (builtin_type_int);
2442130803Smarcel  write_exp_elt_longcst (arg);
2443130803Smarcel  write_exp_elt_opcode (OP_LONG);
2444130803Smarcel  /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
2445130803Smarcel  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2446130803Smarcel  write_exp_elt_longcst ((LONGEST) 1);
2447130803Smarcel  write_exp_elt_longcst ((LONGEST) atr);
2448130803Smarcel  /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
2449130803Smarcel  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2450130803Smarcel}
2451130803Smarcel
2452130803Smarcel/* Write a call on an attribute ATR with N parameters, whose code must have
2453130803Smarcel * been generated previously. */
2454130803Smarcel
2455130803Smarcelstatic void
2456130803Smarcelwrite_attribute_calln (atr, n)
2457130803Smarcel     enum ada_attribute atr;
2458130803Smarcel     int n;
2459130803Smarcel{
2460130803Smarcel  /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
2461130803Smarcel  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2462130803Smarcel  write_exp_elt_longcst ((LONGEST) n);
2463130803Smarcel  write_exp_elt_longcst ((LONGEST) atr);
2464130803Smarcel  /*  write_exp_elt_opcode (OP_ATTRIBUTE);*/
2465130803Smarcel  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
2466130803Smarcel}
2467130803Smarcel
2468130803Smarcel/* Emit expression corresponding to the renamed object designated by
2469130803Smarcel * the type RENAMING, which must be the referent of an object renaming
2470130803Smarcel * type, in the context of ORIG_LEFT_CONTEXT (?). */
2471130803Smarcelstatic void
2472130803Smarcelwrite_object_renaming (orig_left_context, renaming)
2473130803Smarcel     struct block* orig_left_context;
2474130803Smarcel     struct symbol* renaming;
2475130803Smarcel{
2476130803Smarcel  const char* qualification = DEPRECATED_SYMBOL_NAME (renaming);
2477130803Smarcel  const char* simple_tail;
2478130803Smarcel  const char* expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0);
2479130803Smarcel  const char* suffix;
2480130803Smarcel  char* name;
2481130803Smarcel  struct symbol* sym;
2482130803Smarcel  enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
2483130803Smarcel
2484130803Smarcel  /* if orig_left_context is null, then use the currently selected
2485130803Smarcel     block, otherwise we might fail our symbol lookup below */
2486130803Smarcel  if (orig_left_context == NULL)
2487130803Smarcel    orig_left_context = get_selected_block (NULL);
2488130803Smarcel
2489130803Smarcel  for (simple_tail = qualification + strlen (qualification);
2490130803Smarcel       simple_tail != qualification; simple_tail -= 1)
2491130803Smarcel    {
2492130803Smarcel      if (*simple_tail == '.')
2493130803Smarcel	{
2494130803Smarcel	  simple_tail += 1;
2495130803Smarcel	  break;
2496130803Smarcel	}
2497130803Smarcel      else if (DEPRECATED_STREQN (simple_tail, "__", 2))
2498130803Smarcel	{
2499130803Smarcel	  simple_tail += 2;
2500130803Smarcel	  break;
2501130803Smarcel	}
2502130803Smarcel    }
2503130803Smarcel
2504130803Smarcel  suffix = strstr (expr, "___XE");
2505130803Smarcel  if (suffix == NULL)
2506130803Smarcel    goto BadEncoding;
2507130803Smarcel
2508130803Smarcel  name = (char*) xmalloc (suffix - expr + 1);
2509130803Smarcel  /*  add_name_string_cleanup (name); */
2510130803Smarcel  /* FIXME: add_name_string_cleanup should be defined in
2511130803Smarcel     parser-defs.h, implemented in parse.c */
2512130803Smarcel  strncpy (name, expr, suffix-expr);
2513130803Smarcel  name[suffix-expr] = '\000';
2514130803Smarcel  sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL);
2515130803Smarcel  /*  if (sym == NULL)
2516130803Smarcel    error ("Could not find renamed variable: %s", ada_demangle (name));
2517130803Smarcel  */
2518130803Smarcel  /* FIXME: ada_demangle should be defined in defs.h, implemented in ada-lang.c */
2519130803Smarcel  write_var_from_sym (orig_left_context, block_found, sym);
2520130803Smarcel
2521130803Smarcel  suffix += 5;
2522130803Smarcel  slice_state = SIMPLE_INDEX;
2523130803Smarcel  while (*suffix == 'X')
2524130803Smarcel    {
2525130803Smarcel      suffix += 1;
2526130803Smarcel
2527130803Smarcel      switch (*suffix) {
2528130803Smarcel      case 'L':
2529130803Smarcel	slice_state = LOWER_BOUND;
2530130803Smarcel      case 'S':
2531130803Smarcel	suffix += 1;
2532130803Smarcel	if (isdigit (*suffix))
2533130803Smarcel	  {
2534130803Smarcel	    char* next;
2535130803Smarcel	    long val = strtol (suffix, &next, 10);
2536130803Smarcel	    if (next == suffix)
2537130803Smarcel	      goto BadEncoding;
2538130803Smarcel	    suffix = next;
2539130803Smarcel	    write_exp_elt_opcode (OP_LONG);
2540130803Smarcel	    write_exp_elt_type (builtin_type_ada_int);
2541130803Smarcel	    write_exp_elt_longcst ((LONGEST) val);
2542130803Smarcel	    write_exp_elt_opcode (OP_LONG);
2543130803Smarcel	  }
2544130803Smarcel	else
2545130803Smarcel	  {
2546130803Smarcel	    const char* end;
2547130803Smarcel	    char* index_name;
2548130803Smarcel	    int index_len;
2549130803Smarcel	    struct symbol* index_sym;
2550130803Smarcel
2551130803Smarcel	    end = strchr (suffix, 'X');
2552130803Smarcel	    if (end == NULL)
2553130803Smarcel	      end = suffix + strlen (suffix);
2554130803Smarcel
2555130803Smarcel	    index_len = simple_tail - qualification + 2 + (suffix - end) + 1;
2556130803Smarcel	    index_name = (char*) xmalloc (index_len);
2557130803Smarcel	    memset (index_name, '\000', index_len);
2558130803Smarcel	    /*	    add_name_string_cleanup (index_name);*/
2559130803Smarcel	    /* FIXME: add_name_string_cleanup should be defined in
2560130803Smarcel	       parser-defs.h, implemented in parse.c */
2561130803Smarcel	    strncpy (index_name, qualification, simple_tail - qualification);
2562130803Smarcel	    index_name[simple_tail - qualification] = '\000';
2563130803Smarcel	    strncat (index_name, suffix, suffix-end);
2564130803Smarcel	    suffix = end;
2565130803Smarcel
2566130803Smarcel	    index_sym =
2567130803Smarcel	      lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL);
2568130803Smarcel	    if (index_sym == NULL)
2569130803Smarcel	      error ("Could not find %s", index_name);
2570130803Smarcel	    write_var_from_sym (NULL, block_found, sym);
2571130803Smarcel	  }
2572130803Smarcel	if (slice_state == SIMPLE_INDEX)
2573130803Smarcel	  {
2574130803Smarcel	    write_exp_elt_opcode (OP_FUNCALL);
2575130803Smarcel	    write_exp_elt_longcst ((LONGEST) 1);
2576130803Smarcel	    write_exp_elt_opcode (OP_FUNCALL);
2577130803Smarcel	  }
2578130803Smarcel	else if (slice_state == LOWER_BOUND)
2579130803Smarcel	  slice_state = UPPER_BOUND;
2580130803Smarcel	else if (slice_state == UPPER_BOUND)
2581130803Smarcel	  {
2582130803Smarcel	    write_exp_elt_opcode (TERNOP_SLICE);
2583130803Smarcel	    slice_state = SIMPLE_INDEX;
2584130803Smarcel	  }
2585130803Smarcel	break;
2586130803Smarcel
2587130803Smarcel      case 'R':
2588130803Smarcel	{
2589130803Smarcel	  struct stoken field_name;
2590130803Smarcel	  const char* end;
2591130803Smarcel	  suffix += 1;
2592130803Smarcel
2593130803Smarcel	  if (slice_state != SIMPLE_INDEX)
2594130803Smarcel	    goto BadEncoding;
2595130803Smarcel	  end = strchr (suffix, 'X');
2596130803Smarcel	  if (end == NULL)
2597130803Smarcel	    end = suffix + strlen (suffix);
2598130803Smarcel	  field_name.length = end - suffix;
2599130803Smarcel	  field_name.ptr = (char*) xmalloc (end - suffix + 1);
2600130803Smarcel	  strncpy (field_name.ptr, suffix, end - suffix);
2601130803Smarcel	  field_name.ptr[end - suffix] = '\000';
2602130803Smarcel	  suffix = end;
2603130803Smarcel	  write_exp_elt_opcode (STRUCTOP_STRUCT);
2604130803Smarcel	  write_exp_string (field_name);
2605130803Smarcel	  write_exp_elt_opcode (STRUCTOP_STRUCT);
2606130803Smarcel	  break;
2607130803Smarcel	}
2608130803Smarcel
2609130803Smarcel      default:
2610130803Smarcel	goto BadEncoding;
2611130803Smarcel      }
2612130803Smarcel    }
2613130803Smarcel  if (slice_state == SIMPLE_INDEX)
2614130803Smarcel    return;
2615130803Smarcel
2616130803Smarcel BadEncoding:
2617130803Smarcel  error ("Internal error in encoding of renaming declaration: %s",
2618130803Smarcel	 DEPRECATED_SYMBOL_NAME (renaming));
2619130803Smarcel}
2620130803Smarcel
2621130803Smarcel/* Convert the character literal whose ASCII value would be VAL to the
2622130803Smarcel   appropriate value of type TYPE, if there is a translation.
2623130803Smarcel   Otherwise return VAL.  Hence, in an enumeration type ('A', 'B'),
2624130803Smarcel   the literal 'A' (VAL == 65), returns 0. */
2625130803Smarcelstatic LONGEST
2626130803Smarcelconvert_char_literal (struct type* type, LONGEST val)
2627130803Smarcel{
2628130803Smarcel  char name[7];
2629130803Smarcel  int f;
2630130803Smarcel
2631130803Smarcel  if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM)
2632130803Smarcel    return val;
2633130803Smarcel  sprintf (name, "QU%02x", (int) val);
2634130803Smarcel  for (f = 0; f < TYPE_NFIELDS (type); f += 1)
2635130803Smarcel    {
2636130803Smarcel      if (DEPRECATED_STREQ (name, TYPE_FIELD_NAME (type, f)))
2637130803Smarcel	return TYPE_FIELD_BITPOS (type, f);
2638130803Smarcel    }
2639130803Smarcel  return val;
2640130803Smarcel}
2641130803Smarcel
2642130803Smarcel
2643