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     INTEGER_LITERAL = 258,
57130803Smarcel     FLOATING_POINT_LITERAL = 259,
58130803Smarcel     IDENTIFIER = 260,
59130803Smarcel     STRING_LITERAL = 261,
60130803Smarcel     BOOLEAN_LITERAL = 262,
61130803Smarcel     TYPENAME = 263,
62130803Smarcel     NAME_OR_INT = 264,
63130803Smarcel     ERROR = 265,
64130803Smarcel     LONG = 266,
65130803Smarcel     SHORT = 267,
66130803Smarcel     BYTE = 268,
67130803Smarcel     INT = 269,
68130803Smarcel     CHAR = 270,
69130803Smarcel     BOOLEAN = 271,
70130803Smarcel     DOUBLE = 272,
71130803Smarcel     FLOAT = 273,
72130803Smarcel     VARIABLE = 274,
73130803Smarcel     ASSIGN_MODIFY = 275,
74130803Smarcel     SUPER = 276,
75130803Smarcel     NEW = 277,
76130803Smarcel     OROR = 278,
77130803Smarcel     ANDAND = 279,
78130803Smarcel     NOTEQUAL = 280,
79130803Smarcel     EQUAL = 281,
80130803Smarcel     GEQ = 282,
81130803Smarcel     LEQ = 283,
82130803Smarcel     RSH = 284,
83130803Smarcel     LSH = 285,
84130803Smarcel     DECREMENT = 286,
85130803Smarcel     INCREMENT = 287
86130803Smarcel   };
87130803Smarcel#endif
88130803Smarcel#define INTEGER_LITERAL 258
89130803Smarcel#define FLOATING_POINT_LITERAL 259
90130803Smarcel#define IDENTIFIER 260
91130803Smarcel#define STRING_LITERAL 261
92130803Smarcel#define BOOLEAN_LITERAL 262
93130803Smarcel#define TYPENAME 263
94130803Smarcel#define NAME_OR_INT 264
95130803Smarcel#define ERROR 265
96130803Smarcel#define LONG 266
97130803Smarcel#define SHORT 267
98130803Smarcel#define BYTE 268
99130803Smarcel#define INT 269
100130803Smarcel#define CHAR 270
101130803Smarcel#define BOOLEAN 271
102130803Smarcel#define DOUBLE 272
103130803Smarcel#define FLOAT 273
104130803Smarcel#define VARIABLE 274
105130803Smarcel#define ASSIGN_MODIFY 275
106130803Smarcel#define SUPER 276
107130803Smarcel#define NEW 277
108130803Smarcel#define OROR 278
109130803Smarcel#define ANDAND 279
110130803Smarcel#define NOTEQUAL 280
111130803Smarcel#define EQUAL 281
112130803Smarcel#define GEQ 282
113130803Smarcel#define LEQ 283
114130803Smarcel#define RSH 284
115130803Smarcel#define LSH 285
116130803Smarcel#define DECREMENT 286
117130803Smarcel#define INCREMENT 287
118130803Smarcel
119130803Smarcel
120130803Smarcel
121130803Smarcel
122130803Smarcel/* Copy the first part of user declarations.  */
123130803Smarcel#line 38 "jv-exp.y"
124130803Smarcel
125130803Smarcel
126130803Smarcel#include "defs.h"
127130803Smarcel#include "gdb_string.h"
128130803Smarcel#include <ctype.h>
129130803Smarcel#include "expression.h"
130130803Smarcel#include "value.h"
131130803Smarcel#include "parser-defs.h"
132130803Smarcel#include "language.h"
133130803Smarcel#include "jv-lang.h"
134130803Smarcel#include "bfd.h" /* Required by objfiles.h.  */
135130803Smarcel#include "symfile.h" /* Required by objfiles.h.  */
136130803Smarcel#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
137130803Smarcel#include "block.h"
138130803Smarcel
139130803Smarcel/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
140130803Smarcel   as well as gratuitiously global symbol names, so we can have multiple
141130803Smarcel   yacc generated parsers in gdb.  Note that these are only the variables
142130803Smarcel   produced by yacc.  If other parser generators (bison, byacc, etc) produce
143130803Smarcel   additional global names that conflict at link time, then those parser
144130803Smarcel   generators need to be fixed instead of adding those names to this list. */
145130803Smarcel
146130803Smarcel#define	yymaxdepth java_maxdepth
147130803Smarcel#define	yyparse	java_parse
148130803Smarcel#define	yylex	java_lex
149130803Smarcel#define	yyerror	java_error
150130803Smarcel#define	yylval	java_lval
151130803Smarcel#define	yychar	java_char
152130803Smarcel#define	yydebug	java_debug
153130803Smarcel#define	yypact	java_pact
154130803Smarcel#define	yyr1	java_r1
155130803Smarcel#define	yyr2	java_r2
156130803Smarcel#define	yydef	java_def
157130803Smarcel#define	yychk	java_chk
158130803Smarcel#define	yypgo	java_pgo
159130803Smarcel#define	yyact	java_act
160130803Smarcel#define	yyexca	java_exca
161130803Smarcel#define yyerrflag java_errflag
162130803Smarcel#define yynerrs	java_nerrs
163130803Smarcel#define	yyps	java_ps
164130803Smarcel#define	yypv	java_pv
165130803Smarcel#define	yys	java_s
166130803Smarcel#define	yy_yys	java_yys
167130803Smarcel#define	yystate	java_state
168130803Smarcel#define	yytmp	java_tmp
169130803Smarcel#define	yyv	java_v
170130803Smarcel#define	yy_yyv	java_yyv
171130803Smarcel#define	yyval	java_val
172130803Smarcel#define	yylloc	java_lloc
173130803Smarcel#define yyreds	java_reds		/* With YYDEBUG defined */
174130803Smarcel#define yytoks	java_toks		/* With YYDEBUG defined */
175130803Smarcel#define yyname	java_name		/* With YYDEBUG defined */
176130803Smarcel#define yyrule	java_rule		/* With YYDEBUG defined */
177130803Smarcel#define yylhs	java_yylhs
178130803Smarcel#define yylen	java_yylen
179130803Smarcel#define yydefred java_yydefred
180130803Smarcel#define yydgoto	java_yydgoto
181130803Smarcel#define yysindex java_yysindex
182130803Smarcel#define yyrindex java_yyrindex
183130803Smarcel#define yygindex java_yygindex
184130803Smarcel#define yytable	 java_yytable
185130803Smarcel#define yycheck	 java_yycheck
186130803Smarcel
187130803Smarcel#ifndef YYDEBUG
188130803Smarcel#define	YYDEBUG 1		/* Default to yydebug support */
189130803Smarcel#endif
190130803Smarcel
191130803Smarcel#define YYFPRINTF parser_fprintf
192130803Smarcel
193130803Smarcelint yyparse (void);
194130803Smarcel
195130803Smarcelstatic int yylex (void);
196130803Smarcel
197130803Smarcelvoid yyerror (char *);
198130803Smarcel
199130803Smarcelstatic struct type *java_type_from_name (struct stoken);
200130803Smarcelstatic void push_expression_name (struct stoken);
201130803Smarcelstatic void push_fieldnames (struct stoken);
202130803Smarcel
203130803Smarcelstatic struct expression *copy_exp (struct expression *, int);
204130803Smarcelstatic void insert_exp (int, struct expression *);
205130803Smarcel
206130803Smarcel
207130803Smarcel
208130803Smarcel/* Enabling traces.  */
209130803Smarcel#ifndef YYDEBUG
210130803Smarcel# define YYDEBUG 0
211130803Smarcel#endif
212130803Smarcel
213130803Smarcel/* Enabling verbose error messages.  */
214130803Smarcel#ifdef YYERROR_VERBOSE
215130803Smarcel# undef YYERROR_VERBOSE
216130803Smarcel# define YYERROR_VERBOSE 1
217130803Smarcel#else
218130803Smarcel# define YYERROR_VERBOSE 0
219130803Smarcel#endif
220130803Smarcel
221130803Smarcel#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
222130803Smarcel#line 127 "jv-exp.y"
223130803Smarceltypedef union YYSTYPE {
224130803Smarcel    LONGEST lval;
225130803Smarcel    struct {
226130803Smarcel      LONGEST val;
227130803Smarcel      struct type *type;
228130803Smarcel    } typed_val_int;
229130803Smarcel    struct {
230130803Smarcel      DOUBLEST dval;
231130803Smarcel      struct type *type;
232130803Smarcel    } typed_val_float;
233130803Smarcel    struct symbol *sym;
234130803Smarcel    struct type *tval;
235130803Smarcel    struct stoken sval;
236130803Smarcel    struct ttype tsym;
237130803Smarcel    struct symtoken ssym;
238130803Smarcel    struct block *bval;
239130803Smarcel    enum exp_opcode opcode;
240130803Smarcel    struct internalvar *ivar;
241130803Smarcel    int *ivec;
242130803Smarcel  } YYSTYPE;
243130803Smarcel/* Line 191 of yacc.c.  */
244130803Smarcel# define yystype YYSTYPE /* obsolescent; will be withdrawn */
245130803Smarcel# define YYSTYPE_IS_DECLARED 1
246130803Smarcel# define YYSTYPE_IS_TRIVIAL 1
247130803Smarcel#endif
248130803Smarcel
249130803Smarcel
250130803Smarcel
251130803Smarcel/* Copy the second part of user declarations.  */
252130803Smarcel#line 148 "jv-exp.y"
253130803Smarcel
254130803Smarcel/* YYSTYPE gets defined by %union */
255130803Smarcelstatic int parse_number (char *, int, int, YYSTYPE *);
256130803Smarcel
257130803Smarcel
258130803Smarcel/* Line 214 of yacc.c.  */
259130803Smarcel
260130803Smarcel#if ! defined (yyoverflow) || YYERROR_VERBOSE
261130803Smarcel
262130803Smarcel/* The parser invokes alloca or xmalloc; define the necessary symbols.  */
263130803Smarcel
264130803Smarcel# if YYSTACK_USE_ALLOCA
265130803Smarcel#  define YYSTACK_ALLOC alloca
266130803Smarcel# else
267130803Smarcel#  ifndef YYSTACK_USE_ALLOCA
268130803Smarcel#   if defined (alloca) || defined (_ALLOCA_H)
269130803Smarcel#    define YYSTACK_ALLOC alloca
270130803Smarcel#   else
271130803Smarcel#    ifdef __GNUC__
272130803Smarcel#     define YYSTACK_ALLOC __builtin_alloca
273130803Smarcel#    endif
274130803Smarcel#   endif
275130803Smarcel#  endif
276130803Smarcel# endif
277130803Smarcel
278130803Smarcel# ifdef YYSTACK_ALLOC
279130803Smarcel   /* Pacify GCC's `empty if-body' warning. */
280130803Smarcel#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
281130803Smarcel# else
282130803Smarcel#  if defined (__STDC__) || defined (__cplusplus)
283130803Smarcel#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
284130803Smarcel#   define YYSIZE_T size_t
285130803Smarcel#  endif
286130803Smarcel#  define YYSTACK_ALLOC xmalloc
287130803Smarcel#  define YYSTACK_FREE free
288130803Smarcel# endif
289130803Smarcel#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
290130803Smarcel
291130803Smarcel
292130803Smarcel#if (! defined (yyoverflow) \
293130803Smarcel     && (! defined (__cplusplus) \
294130803Smarcel	 || (YYSTYPE_IS_TRIVIAL)))
295130803Smarcel
296130803Smarcel/* A type that is properly aligned for any stack member.  */
297130803Smarcelunion yyalloc
298130803Smarcel{
299130803Smarcel  short yyss;
300130803Smarcel  YYSTYPE yyvs;
301130803Smarcel  };
302130803Smarcel
303130803Smarcel/* The size of the maximum gap between one aligned stack and the next.  */
304130803Smarcel# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
305130803Smarcel
306130803Smarcel/* The size of an array large to enough to hold all stacks, each with
307130803Smarcel   N elements.  */
308130803Smarcel# define YYSTACK_BYTES(N) \
309130803Smarcel     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
310130803Smarcel      + YYSTACK_GAP_MAXIMUM)
311130803Smarcel
312130803Smarcel/* Copy COUNT objects from FROM to TO.  The source and destination do
313130803Smarcel   not overlap.  */
314130803Smarcel# ifndef YYCOPY
315130803Smarcel#  if 1 < __GNUC__
316130803Smarcel#   define YYCOPY(To, From, Count) \
317130803Smarcel      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
318130803Smarcel#  else
319130803Smarcel#   define YYCOPY(To, From, Count)		\
320130803Smarcel      do					\
321130803Smarcel	{					\
322130803Smarcel	  register YYSIZE_T yyi;		\
323130803Smarcel	  for (yyi = 0; yyi < (Count); yyi++)	\
324130803Smarcel	    (To)[yyi] = (From)[yyi];		\
325130803Smarcel	}					\
326130803Smarcel      while (0)
327130803Smarcel#  endif
328130803Smarcel# endif
329130803Smarcel
330130803Smarcel/* Relocate STACK from its old location to the new one.  The
331130803Smarcel   local variables YYSIZE and YYSTACKSIZE give the old and new number of
332130803Smarcel   elements in the stack, and YYPTR gives the new location of the
333130803Smarcel   stack.  Advance YYPTR to a properly aligned location for the next
334130803Smarcel   stack.  */
335130803Smarcel# define YYSTACK_RELOCATE(Stack)					\
336130803Smarcel    do									\
337130803Smarcel      {									\
338130803Smarcel	YYSIZE_T yynewbytes;						\
339130803Smarcel	YYCOPY (&yyptr->Stack, Stack, yysize);				\
340130803Smarcel	Stack = &yyptr->Stack;						\
341130803Smarcel	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
342130803Smarcel	yyptr += yynewbytes / sizeof (*yyptr);				\
343130803Smarcel      }									\
344130803Smarcel    while (0)
345130803Smarcel
346130803Smarcel#endif
347130803Smarcel
348130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
349130803Smarcel   typedef signed char yysigned_char;
350130803Smarcel#else
351130803Smarcel   typedef short yysigned_char;
352130803Smarcel#endif
353130803Smarcel
354130803Smarcel/* YYFINAL -- State number of the termination state. */
355130803Smarcel#define YYFINAL  97
356130803Smarcel/* YYLAST -- Last index in YYTABLE.  */
357130803Smarcel#define YYLAST   421
358130803Smarcel
359130803Smarcel/* YYNTOKENS -- Number of terminals. */
360130803Smarcel#define YYNTOKENS  56
361130803Smarcel/* YYNNTS -- Number of nonterminals. */
362130803Smarcel#define YYNNTS  56
363130803Smarcel/* YYNRULES -- Number of rules. */
364130803Smarcel#define YYNRULES  130
365130803Smarcel/* YYNRULES -- Number of states. */
366130803Smarcel#define YYNSTATES  207
367130803Smarcel
368130803Smarcel/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
369130803Smarcel#define YYUNDEFTOK  2
370130803Smarcel#define YYMAXUTOK   287
371130803Smarcel
372130803Smarcel#define YYTRANSLATE(YYX) 						\
373130803Smarcel  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
374130803Smarcel
375130803Smarcel/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
376130803Smarcelstatic const unsigned char yytranslate[] =
377130803Smarcel{
378130803Smarcel       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
379130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
380130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
381130803Smarcel       2,     2,     2,    54,     2,     2,     2,    43,    30,     2,
382130803Smarcel      48,    49,    41,    39,    23,    40,    46,    42,     2,     2,
383130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,    55,     2,
384130803Smarcel      33,    24,    34,    25,     2,     2,     2,     2,     2,     2,
385130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
386130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
387130803Smarcel       2,    47,     2,    52,    29,     2,     2,     2,     2,     2,
388130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
389130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
390130803Smarcel       2,     2,     2,    50,    28,    51,    53,     2,     2,     2,
391130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
392130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
393130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
394130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
395130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
396130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
397130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
398130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
399130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
400130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
401130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
402130803Smarcel       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
403130803Smarcel       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
404130803Smarcel       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
405130803Smarcel      15,    16,    17,    18,    19,    20,    21,    22,    26,    27,
406130803Smarcel      31,    32,    35,    36,    37,    38,    44,    45
407130803Smarcel};
408130803Smarcel
409130803Smarcel#if YYDEBUG
410130803Smarcel/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
411130803Smarcel   YYRHS.  */
412130803Smarcelstatic const unsigned short yyprhs[] =
413130803Smarcel{
414130803Smarcel       0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
415130803Smarcel      19,    21,    23,    25,    27,    29,    31,    33,    35,    37,
416130803Smarcel      39,    41,    43,    45,    47,    49,    51,    54,    57,    59,
417130803Smarcel      61,    63,    65,    67,    69,    73,    75,    79,    81,    83,
418130803Smarcel      85,    89,    91,    93,    95,    97,   101,   103,   105,   111,
419130803Smarcel     113,   117,   118,   120,   125,   130,   132,   135,   139,   142,
420130803Smarcel     146,   148,   149,   153,   157,   162,   169,   176,   181,   186,
421130803Smarcel     191,   193,   195,   197,   199,   201,   204,   207,   209,   211,
422130803Smarcel     214,   217,   220,   222,   225,   228,   230,   233,   236,   238,
423130803Smarcel     244,   249,   255,   257,   261,   265,   269,   271,   275,   279,
424130803Smarcel     281,   285,   289,   291,   295,   299,   303,   307,   309,   313,
425130803Smarcel     317,   319,   323,   325,   329,   331,   335,   337,   341,   343,
426130803Smarcel     347,   349,   355,   357,   359,   363,   367,   369,   371,   373,
427130803Smarcel     375
428130803Smarcel};
429130803Smarcel
430130803Smarcel/* YYRHS -- A `-1'-separated list of the rules' RHS. */
431130803Smarcelstatic const yysigned_char yyrhs[] =
432130803Smarcel{
433130803Smarcel      57,     0,    -1,    73,    -1,    58,    -1,    59,    -1,    62,
434130803Smarcel      -1,    68,    -1,     6,    -1,     3,    -1,     9,    -1,     4,
435130803Smarcel      -1,     7,    -1,    60,    -1,    63,    -1,    16,    -1,    64,
436130803Smarcel      -1,    65,    -1,    13,    -1,    12,    -1,    14,    -1,    11,
437130803Smarcel      -1,    15,    -1,    18,    -1,    17,    -1,    69,    -1,    66,
438130803Smarcel      -1,    62,    84,    -1,    69,    84,    -1,     5,    -1,    72,
439130803Smarcel      -1,    71,    -1,    72,    -1,     5,    -1,     9,    -1,    69,
440130803Smarcel      46,    71,    -1,   111,    -1,    73,    23,   111,    -1,    75,
441130803Smarcel      -1,    81,    -1,    61,    -1,    48,   111,    49,    -1,    78,
442130803Smarcel      -1,    86,    -1,    87,    -1,    88,    -1,    76,    79,    77,
443130803Smarcel      -1,    50,    -1,    51,    -1,    22,    67,    48,    80,    49,
444130803Smarcel      -1,   111,    -1,    79,    23,   111,    -1,    -1,    79,    -1,
445130803Smarcel      22,    62,    82,    85,    -1,    22,    66,    82,    85,    -1,
446130803Smarcel      83,    -1,    82,    83,    -1,    47,   111,    52,    -1,    47,
447130803Smarcel      52,    -1,    84,    47,    52,    -1,    84,    -1,    -1,    74,
448130803Smarcel      46,    71,    -1,    19,    46,    71,    -1,    69,    48,    80,
449130803Smarcel      49,    -1,    74,    46,    71,    48,    80,    49,    -1,    21,
450130803Smarcel      46,    71,    48,    80,    49,    -1,    69,    47,   111,    52,
451130803Smarcel      -1,    19,    47,   111,    52,    -1,    75,    47,   111,    52,
452130803Smarcel      -1,    74,    -1,    69,    -1,    19,    -1,    90,    -1,    91,
453130803Smarcel      -1,    89,    45,    -1,    89,    44,    -1,    93,    -1,    94,
454130803Smarcel      -1,    39,    92,    -1,    40,    92,    -1,    41,    92,    -1,
455130803Smarcel      95,    -1,    45,    92,    -1,    44,    92,    -1,    89,    -1,
456130803Smarcel      53,    92,    -1,    54,    92,    -1,    96,    -1,    48,    62,
457130803Smarcel      85,    49,    92,    -1,    48,   111,    49,    95,    -1,    48,
458130803Smarcel      69,    84,    49,    95,    -1,    92,    -1,    97,    41,    92,
459130803Smarcel      -1,    97,    42,    92,    -1,    97,    43,    92,    -1,    97,
460130803Smarcel      -1,    98,    39,    97,    -1,    98,    40,    97,    -1,    98,
461130803Smarcel      -1,    99,    38,    98,    -1,    99,    37,    98,    -1,    99,
462130803Smarcel      -1,   100,    33,    99,    -1,   100,    34,    99,    -1,   100,
463130803Smarcel      36,    99,    -1,   100,    35,    99,    -1,   100,    -1,   101,
464130803Smarcel      32,   100,    -1,   101,    31,   100,    -1,   101,    -1,   102,
465130803Smarcel      30,   101,    -1,   102,    -1,   103,    29,   102,    -1,   103,
466130803Smarcel      -1,   104,    28,   103,    -1,   104,    -1,   105,    27,   104,
467130803Smarcel      -1,   105,    -1,   106,    26,   105,    -1,   106,    -1,   106,
468130803Smarcel      25,   111,    55,   107,    -1,   107,    -1,   109,    -1,   110,
469130803Smarcel      24,   107,    -1,   110,    20,   107,    -1,    70,    -1,    19,
470130803Smarcel      -1,    86,    -1,    88,    -1,   108,    -1
471130803Smarcel};
472130803Smarcel
473130803Smarcel/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
474130803Smarcelstatic const unsigned short yyrline[] =
475130803Smarcel{
476130803Smarcel       0,   204,   204,   205,   208,   217,   218,   222,   231,   236,
477130803Smarcel     244,   249,   254,   265,   266,   271,   272,   276,   278,   280,
478130803Smarcel     282,   284,   289,   291,   303,   308,   312,   314,   319,   320,
479130803Smarcel     324,   325,   329,   330,   334,   357,   358,   363,   364,   368,
480130803Smarcel     369,   370,   371,   372,   373,   374,   382,   387,   392,   398,
481130803Smarcel     400,   406,   407,   411,   414,   420,   421,   425,   429,   431,
482130803Smarcel     436,   438,   442,   444,   450,   452,   454,   459,   476,   478,
483130803Smarcel     483,   484,   486,   488,   489,   493,   498,   503,   504,   505,
484130803Smarcel     506,   508,   510,   514,   519,   524,   525,   527,   529,   533,
485130803Smarcel     537,   558,   566,   567,   569,   571,   576,   577,   579,   584,
486130803Smarcel     585,   587,   593,   594,   596,   598,   600,   606,   607,   609,
487130803Smarcel     614,   615,   620,   621,   625,   626,   631,   632,   637,   638,
488130803Smarcel     643,   644,   649,   650,   654,   656,   663,   665,   667,   668,
489130803Smarcel     673
490130803Smarcel};
491130803Smarcel#endif
492130803Smarcel
493130803Smarcel#if YYDEBUG || YYERROR_VERBOSE
494130803Smarcel/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
495130803Smarcel   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
496130803Smarcelstatic const char *const yytname[] =
497130803Smarcel{
498130803Smarcel  "$end", "error", "$undefined", "INTEGER_LITERAL",
499130803Smarcel  "FLOATING_POINT_LITERAL", "IDENTIFIER", "STRING_LITERAL",
500130803Smarcel  "BOOLEAN_LITERAL", "TYPENAME", "NAME_OR_INT", "ERROR", "LONG", "SHORT",
501130803Smarcel  "BYTE", "INT", "CHAR", "BOOLEAN", "DOUBLE", "FLOAT", "VARIABLE",
502130803Smarcel  "ASSIGN_MODIFY", "SUPER", "NEW", "','", "'='", "'?'", "OROR", "ANDAND",
503130803Smarcel  "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ",
504130803Smarcel  "RSH", "LSH", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT",
505130803Smarcel  "INCREMENT", "'.'", "'['", "'('", "')'", "'{'", "'}'", "']'", "'~'",
506130803Smarcel  "'!'", "':'", "$accept", "start", "type_exp", "PrimitiveOrArrayType",
507130803Smarcel  "StringLiteral", "Literal", "PrimitiveType", "NumericType",
508130803Smarcel  "IntegralType", "FloatingPointType", "ClassOrInterfaceType",
509130803Smarcel  "ClassType", "ArrayType", "Name", "ForcedName", "SimpleName",
510130803Smarcel  "QualifiedName", "exp1", "Primary", "PrimaryNoNewArray", "lcurly",
511130803Smarcel  "rcurly", "ClassInstanceCreationExpression", "ArgumentList",
512130803Smarcel  "ArgumentList_opt", "ArrayCreationExpression", "DimExprs", "DimExpr",
513130803Smarcel  "Dims", "Dims_opt", "FieldAccess", "MethodInvocation", "ArrayAccess",
514130803Smarcel  "PostfixExpression", "PostIncrementExpression",
515130803Smarcel  "PostDecrementExpression", "UnaryExpression", "PreIncrementExpression",
516130803Smarcel  "PreDecrementExpression", "UnaryExpressionNotPlusMinus",
517130803Smarcel  "CastExpression", "MultiplicativeExpression", "AdditiveExpression",
518130803Smarcel  "ShiftExpression", "RelationalExpression", "EqualityExpression",
519130803Smarcel  "AndExpression", "ExclusiveOrExpression", "InclusiveOrExpression",
520130803Smarcel  "ConditionalAndExpression", "ConditionalOrExpression",
521130803Smarcel  "ConditionalExpression", "AssignmentExpression", "Assignment",
522130803Smarcel  "LeftHandSide", "Expression", 0
523130803Smarcel};
524130803Smarcel#endif
525130803Smarcel
526130803Smarcel# ifdef YYPRINT
527130803Smarcel/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
528130803Smarcel   token YYLEX-NUM.  */
529130803Smarcelstatic const unsigned short yytoknum[] =
530130803Smarcel{
531130803Smarcel       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
532130803Smarcel     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
533130803Smarcel     275,   276,   277,    44,    61,    63,   278,   279,   124,    94,
534130803Smarcel      38,   280,   281,    60,    62,   282,   283,   284,   285,    43,
535130803Smarcel      45,    42,    47,    37,   286,   287,    46,    91,    40,    41,
536130803Smarcel     123,   125,    93,   126,    33,    58
537130803Smarcel};
538130803Smarcel# endif
539130803Smarcel
540130803Smarcel/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
541130803Smarcelstatic const unsigned char yyr1[] =
542130803Smarcel{
543130803Smarcel       0,    56,    57,    57,    58,    59,    59,    60,    61,    61,
544130803Smarcel      61,    61,    61,    62,    62,    63,    63,    64,    64,    64,
545130803Smarcel      64,    64,    65,    65,    66,    67,    68,    68,    69,    69,
546130803Smarcel      70,    70,    71,    71,    72,    73,    73,    74,    74,    75,
547130803Smarcel      75,    75,    75,    75,    75,    75,    76,    77,    78,    79,
548130803Smarcel      79,    80,    80,    81,    81,    82,    82,    83,    84,    84,
549130803Smarcel      85,    85,    86,    86,    87,    87,    87,    88,    88,    88,
550130803Smarcel      89,    89,    89,    89,    89,    90,    91,    92,    92,    92,
551130803Smarcel      92,    92,    92,    93,    94,    95,    95,    95,    95,    96,
552130803Smarcel      96,    96,    97,    97,    97,    97,    98,    98,    98,    99,
553130803Smarcel      99,    99,   100,   100,   100,   100,   100,   101,   101,   101,
554130803Smarcel     102,   102,   103,   103,   104,   104,   105,   105,   106,   106,
555130803Smarcel     107,   107,   108,   108,   109,   109,   110,   110,   110,   110,
556130803Smarcel     111
557130803Smarcel};
558130803Smarcel
559130803Smarcel/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
560130803Smarcelstatic const unsigned char yyr2[] =
561130803Smarcel{
562130803Smarcel       0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
563130803Smarcel       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
564130803Smarcel       1,     1,     1,     1,     1,     1,     2,     2,     1,     1,
565130803Smarcel       1,     1,     1,     1,     3,     1,     3,     1,     1,     1,
566130803Smarcel       3,     1,     1,     1,     1,     3,     1,     1,     5,     1,
567130803Smarcel       3,     0,     1,     4,     4,     1,     2,     3,     2,     3,
568130803Smarcel       1,     0,     3,     3,     4,     6,     6,     4,     4,     4,
569130803Smarcel       1,     1,     1,     1,     1,     2,     2,     1,     1,     2,
570130803Smarcel       2,     2,     1,     2,     2,     1,     2,     2,     1,     5,
571130803Smarcel       4,     5,     1,     3,     3,     3,     1,     3,     3,     1,
572130803Smarcel       3,     3,     1,     3,     3,     3,     3,     1,     3,     3,
573130803Smarcel       1,     3,     1,     3,     1,     3,     1,     3,     1,     3,
574130803Smarcel       1,     5,     1,     1,     3,     3,     1,     1,     1,     1,
575130803Smarcel       1
576130803Smarcel};
577130803Smarcel
578130803Smarcel/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
579130803Smarcel   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
580130803Smarcel   means the default is an error.  */
581130803Smarcelstatic const unsigned char yydefact[] =
582130803Smarcel{
583130803Smarcel       0,     8,    10,    28,     7,    11,     9,    20,    18,    17,
584130803Smarcel      19,    21,    14,    23,    22,    72,     0,     0,     0,     0,
585130803Smarcel       0,     0,     0,     0,    46,     0,     0,     0,     3,     4,
586130803Smarcel      12,    39,     5,    13,    15,    16,     6,    71,   126,    30,
587130803Smarcel      29,     2,    70,    37,     0,    41,    38,    42,    43,    44,
588130803Smarcel      85,    73,    74,    92,    77,    78,    82,    88,    96,    99,
589130803Smarcel     102,   107,   110,   112,   114,   116,   118,   120,   122,   130,
590130803Smarcel     123,     0,    35,     0,     0,     0,    28,     0,    25,     0,
591130803Smarcel      24,    29,     9,    72,    71,    42,    44,    79,    80,    81,
592130803Smarcel      84,    83,    61,    71,     0,    86,    87,     1,     0,    26,
593130803Smarcel       0,     0,    51,    27,     0,     0,     0,     0,    49,    76,
594130803Smarcel      75,     0,     0,     0,     0,     0,     0,     0,     0,     0,
595130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
596130803Smarcel       0,     0,    32,    33,    63,     0,     0,     0,    61,    55,
597130803Smarcel      61,    51,     0,    60,     0,     0,    40,    58,     0,    34,
598130803Smarcel       0,    52,     0,    36,    62,     0,     0,    47,    45,    93,
599130803Smarcel      94,    95,    97,    98,   101,   100,   103,   104,   106,   105,
600130803Smarcel     109,   108,   111,   113,   115,   117,     0,   119,   125,   124,
601130803Smarcel      68,    51,     0,     0,    56,    53,    54,     0,     0,     0,
602130803Smarcel      90,    59,    67,    64,    51,    69,    50,     0,     0,    57,
603130803Smarcel      48,    89,    91,     0,   121,    66,    65
604130803Smarcel};
605130803Smarcel
606130803Smarcel/* YYDEFGOTO[NTERM-NUM]. */
607130803Smarcelstatic const short yydefgoto[] =
608130803Smarcel{
609130803Smarcel      -1,    27,    28,    29,    30,    31,    32,    33,    34,    35,
610130803Smarcel      78,    79,    36,    84,    38,    39,    81,    41,    42,    43,
611130803Smarcel      44,   158,    45,   151,   152,    46,   138,   139,   143,   144,
612130803Smarcel      85,    48,    86,    50,    51,    52,    53,    54,    55,    56,
613130803Smarcel      57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
614130803Smarcel      67,    68,    69,    70,    71,   108
615130803Smarcel};
616130803Smarcel
617130803Smarcel/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
618130803Smarcel   STATE-NUM.  */
619130803Smarcel#define YYPACT_NINF -135
620130803Smarcelstatic const short yypact[] =
621130803Smarcel{
622130803Smarcel     204,  -135,  -135,     8,  -135,  -135,    14,  -135,  -135,  -135,
623130803Smarcel    -135,  -135,  -135,  -135,  -135,    -4,     5,    50,   308,   308,
624130803Smarcel     308,   308,   308,   204,  -135,   308,   308,    40,  -135,  -135,
625130803Smarcel    -135,  -135,    -1,  -135,  -135,  -135,  -135,    37,  -135,  -135,
626130803Smarcel      28,    36,    45,    46,   360,  -135,  -135,    33,  -135,    49,
627130803Smarcel     -19,  -135,  -135,  -135,  -135,  -135,  -135,  -135,    84,    31,
628130803Smarcel      95,    54,    89,    75,    74,    81,    88,   110,  -135,  -135,
629130803Smarcel    -135,    52,  -135,    73,   360,    73,  -135,    64,    64,    69,
630130803Smarcel      77,  -135,  -135,    92,    83,  -135,  -135,  -135,  -135,  -135,
631130803Smarcel    -135,  -135,    -1,    37,   103,  -135,  -135,  -135,   107,   114,
632130803Smarcel      73,   256,   360,   114,   360,    73,   360,    -6,  -135,  -135,
633130803Smarcel    -135,   308,   308,   308,   308,   308,   308,   308,   308,   308,
634130803Smarcel     308,   308,   308,   308,   308,   308,   308,   308,   360,   308,
635130803Smarcel     308,   308,  -135,  -135,  -135,   111,   116,   360,   118,  -135,
636130803Smarcel     118,   360,   360,   114,   117,   -16,   367,  -135,   115,  -135,
637130803Smarcel     120,   146,   121,  -135,   125,   123,   360,  -135,  -135,  -135,
638130803Smarcel    -135,  -135,    84,    84,    31,    31,    95,    95,    95,    95,
639130803Smarcel      54,    54,    89,    75,    74,    81,   122,    88,  -135,  -135,
640130803Smarcel    -135,   360,   124,   256,  -135,  -135,  -135,   129,   308,   367,
641130803Smarcel    -135,  -135,  -135,  -135,   360,  -135,  -135,   308,   130,  -135,
642130803Smarcel    -135,  -135,  -135,   131,  -135,  -135,  -135
643130803Smarcel};
644130803Smarcel
645130803Smarcel/* YYPGOTO[NTERM-NUM].  */
646130803Smarcelstatic const short yypgoto[] =
647130803Smarcel{
648130803Smarcel    -135,  -135,  -135,  -135,  -135,  -135,     4,  -135,  -135,  -135,
649130803Smarcel    -135,  -135,  -135,    13,  -135,   -51,     0,  -135,  -135,  -135,
650130803Smarcel    -135,  -135,  -135,   138,  -134,  -135,   106,  -101,   -18,   -59,
651130803Smarcel       6,  -135,    12,  -135,  -135,  -135,   -17,  -135,  -135,  -131,
652130803Smarcel    -135,    30,    34,   -21,    35,    61,    63,    60,    65,    62,
653130803Smarcel    -135,  -120,  -135,  -135,  -135,    18
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 -130
661130803Smarcelstatic const short yytable[] =
662130803Smarcel{
663130803Smarcel      40,    87,    88,    89,    90,    91,    47,   187,    95,    96,
664130803Smarcel     178,   179,    49,    37,    99,   190,  -127,   156,    72,   103,
665130803Smarcel    -127,    77,   134,    40,   136,   109,   110,    92,   -32,    47,
666130803Smarcel      80,   148,   -32,   189,   -33,    49,    93,   184,   -33,   184,
667130803Smarcel      97,    94,    73,    74,    40,   157,    98,   198,   -31,   149,
668130803Smarcel      47,    75,   -31,  -128,   154,    76,    49,  -128,   202,   104,
669130803Smarcel     203,     7,     8,     9,    10,    11,    12,    13,    14,  -129,
670130803Smarcel     114,   115,   130,  -129,    40,   145,   131,   204,   132,   185,
671130803Smarcel      47,   186,   133,   100,   101,   102,    49,   118,   119,   120,
672130803Smarcel     121,   105,   135,   106,   159,   160,   161,   166,   167,   168,
673130803Smarcel     169,    40,    40,   125,    40,   124,    40,    47,    47,   126,
674130803Smarcel      47,   137,    47,    49,    49,   127,    49,   141,    49,   150,
675130803Smarcel     122,   123,   153,   100,   155,   111,   112,   113,    40,   100,
676130803Smarcel     142,   102,   116,   117,    47,   128,   129,    40,    73,    74,
677130803Smarcel      49,    40,    40,    47,   162,   163,   176,    47,    47,    49,
678130803Smarcel     164,   165,   146,    49,    49,   182,    40,   170,   171,   147,
679130803Smarcel     150,   148,    47,   180,   181,   183,   188,   191,    49,   156,
680130803Smarcel     193,   201,   192,   194,   196,   195,   199,   197,   200,   205,
681130803Smarcel     206,    40,   107,    40,   140,   172,   174,    47,   173,    47,
682130803Smarcel       0,   177,   175,    49,    40,    49,     0,     0,     0,     0,
683130803Smarcel      47,   182,     0,     0,     0,     0,    49,     1,     2,     3,
684130803Smarcel       4,     5,     0,     6,     0,     7,     8,     9,    10,    11,
685130803Smarcel      12,    13,    14,    15,     0,    16,    17,     0,     0,     0,
686130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
687130803Smarcel       0,     0,     0,    18,    19,    20,     0,     0,    21,    22,
688130803Smarcel       0,     0,    23,     0,    24,     0,     0,    25,    26,     1,
689130803Smarcel       2,     3,     4,     5,     0,     6,     0,     0,     0,     0,
690130803Smarcel       0,     0,     0,     0,     0,    15,     0,    16,    17,     0,
691130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
692130803Smarcel       0,     0,     0,     0,     0,    18,    19,    20,     0,     0,
693130803Smarcel      21,    22,     0,     0,    23,     0,    24,     0,   147,    25,
694130803Smarcel      26,     1,     2,    76,     4,     5,     0,    82,     0,     0,
695130803Smarcel       0,     0,     0,     0,     0,     0,     0,    83,     0,    16,
696130803Smarcel      17,     0,     0,     0,     0,     0,     0,     0,     0,     0,
697130803Smarcel       0,     0,     0,     0,     0,     0,     0,    18,    19,    20,
698130803Smarcel       0,     0,    21,    22,     0,     0,    23,     0,    24,     0,
699130803Smarcel       0,    25,    26,     1,     2,     3,     4,     5,     0,     6,
700130803Smarcel       1,     2,    76,     4,     5,     0,    82,     0,     0,    15,
701130803Smarcel       0,    16,    17,     0,     0,     0,    83,     0,    16,    17,
702130803Smarcel       0,     0,     0,     0,     0,     0,     0,     0,     0,    18,
703130803Smarcel      19,    20,     0,     0,    21,    22,     0,     0,    23,     0,
704130803Smarcel      24,     0,     0,    25,    26,    23,     0,    24,     0,     0,
705130803Smarcel      25,    26
706130803Smarcel};
707130803Smarcel
708130803Smarcelstatic const short yycheck[] =
709130803Smarcel{
710130803Smarcel       0,    18,    19,    20,    21,    22,     0,   141,    25,    26,
711130803Smarcel     130,   131,     0,     0,    32,   146,    20,    23,     0,    37,
712130803Smarcel      24,    17,    73,    23,    75,    44,    45,    23,    20,    23,
713130803Smarcel      17,    47,    24,    49,    20,    23,    23,   138,    24,   140,
714130803Smarcel       0,    23,    46,    47,    44,    51,    47,   181,    20,   100,
715130803Smarcel      44,    46,    24,    20,   105,     5,    44,    24,   189,    23,
716130803Smarcel     194,    11,    12,    13,    14,    15,    16,    17,    18,    20,
717130803Smarcel      39,    40,    20,    24,    74,    93,    24,   197,     5,   138,
718130803Smarcel      74,   140,     9,    46,    47,    48,    74,    33,    34,    35,
719130803Smarcel      36,    46,    74,    47,   111,   112,   113,   118,   119,   120,
720130803Smarcel     121,   101,   102,    29,   104,    30,   106,   101,   102,    28,
721130803Smarcel     104,    47,   106,   101,   102,    27,   104,    48,   106,   101,
722130803Smarcel      31,    32,   104,    46,   106,    41,    42,    43,   128,    46,
723130803Smarcel      47,    48,    37,    38,   128,    25,    26,   137,    46,    47,
724130803Smarcel     128,   141,   142,   137,   114,   115,   128,   141,   142,   137,
725130803Smarcel     116,   117,    49,   141,   142,   137,   156,   122,   123,    52,
726130803Smarcel     142,    47,   156,    52,    48,    47,    49,    52,   156,    23,
727130803Smarcel      49,   188,    52,    48,   156,    52,    52,    55,    49,    49,
728130803Smarcel      49,   181,    44,   183,    78,   124,   126,   181,   125,   183,
729130803Smarcel      -1,   129,   127,   181,   194,   183,    -1,    -1,    -1,    -1,
730130803Smarcel     194,   183,    -1,    -1,    -1,    -1,   194,     3,     4,     5,
731130803Smarcel       6,     7,    -1,     9,    -1,    11,    12,    13,    14,    15,
732130803Smarcel      16,    17,    18,    19,    -1,    21,    22,    -1,    -1,    -1,
733130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
734130803Smarcel      -1,    -1,    -1,    39,    40,    41,    -1,    -1,    44,    45,
735130803Smarcel      -1,    -1,    48,    -1,    50,    -1,    -1,    53,    54,     3,
736130803Smarcel       4,     5,     6,     7,    -1,     9,    -1,    -1,    -1,    -1,
737130803Smarcel      -1,    -1,    -1,    -1,    -1,    19,    -1,    21,    22,    -1,
738130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
739130803Smarcel      -1,    -1,    -1,    -1,    -1,    39,    40,    41,    -1,    -1,
740130803Smarcel      44,    45,    -1,    -1,    48,    -1,    50,    -1,    52,    53,
741130803Smarcel      54,     3,     4,     5,     6,     7,    -1,     9,    -1,    -1,
742130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    19,    -1,    21,
743130803Smarcel      22,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
744130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    39,    40,    41,
745130803Smarcel      -1,    -1,    44,    45,    -1,    -1,    48,    -1,    50,    -1,
746130803Smarcel      -1,    53,    54,     3,     4,     5,     6,     7,    -1,     9,
747130803Smarcel       3,     4,     5,     6,     7,    -1,     9,    -1,    -1,    19,
748130803Smarcel      -1,    21,    22,    -1,    -1,    -1,    19,    -1,    21,    22,
749130803Smarcel      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    39,
750130803Smarcel      40,    41,    -1,    -1,    44,    45,    -1,    -1,    48,    -1,
751130803Smarcel      50,    -1,    -1,    53,    54,    48,    -1,    50,    -1,    -1,
752130803Smarcel      53,    54
753130803Smarcel};
754130803Smarcel
755130803Smarcel/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
756130803Smarcel   symbol of state STATE-NUM.  */
757130803Smarcelstatic const unsigned char yystos[] =
758130803Smarcel{
759130803Smarcel       0,     3,     4,     5,     6,     7,     9,    11,    12,    13,
760130803Smarcel      14,    15,    16,    17,    18,    19,    21,    22,    39,    40,
761130803Smarcel      41,    44,    45,    48,    50,    53,    54,    57,    58,    59,
762130803Smarcel      60,    61,    62,    63,    64,    65,    68,    69,    70,    71,
763130803Smarcel      72,    73,    74,    75,    76,    78,    81,    86,    87,    88,
764130803Smarcel      89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
765130803Smarcel      99,   100,   101,   102,   103,   104,   105,   106,   107,   108,
766130803Smarcel     109,   110,   111,    46,    47,    46,     5,    62,    66,    67,
767130803Smarcel      69,    72,     9,    19,    69,    86,    88,    92,    92,    92,
768130803Smarcel      92,    92,    62,    69,   111,    92,    92,     0,    47,    84,
769130803Smarcel      46,    47,    48,    84,    23,    46,    47,    79,   111,    44,
770130803Smarcel      45,    41,    42,    43,    39,    40,    37,    38,    33,    34,
771130803Smarcel      35,    36,    31,    32,    30,    29,    28,    27,    25,    26,
772130803Smarcel      20,    24,     5,     9,    71,   111,    71,    47,    82,    83,
773130803Smarcel      82,    48,    47,    84,    85,    84,    49,    52,    47,    71,
774130803Smarcel     111,    79,    80,   111,    71,   111,    23,    51,    77,    92,
775130803Smarcel      92,    92,    97,    97,    98,    98,    99,    99,    99,    99,
776130803Smarcel     100,   100,   101,   102,   103,   104,   111,   105,   107,   107,
777130803Smarcel      52,    48,   111,    47,    83,    85,    85,    80,    49,    49,
778130803Smarcel      95,    52,    52,    49,    48,    52,   111,    55,    80,    52,
779130803Smarcel      49,    92,    95,    80,   107,    49,    49
780130803Smarcel};
781130803Smarcel
782130803Smarcel#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
783130803Smarcel# define YYSIZE_T __SIZE_TYPE__
784130803Smarcel#endif
785130803Smarcel#if ! defined (YYSIZE_T) && defined (size_t)
786130803Smarcel# define YYSIZE_T size_t
787130803Smarcel#endif
788130803Smarcel#if ! defined (YYSIZE_T)
789130803Smarcel# if defined (__STDC__) || defined (__cplusplus)
790130803Smarcel#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
791130803Smarcel#  define YYSIZE_T size_t
792130803Smarcel# endif
793130803Smarcel#endif
794130803Smarcel#if ! defined (YYSIZE_T)
795130803Smarcel# define YYSIZE_T unsigned int
796130803Smarcel#endif
797130803Smarcel
798130803Smarcel#define yyerrok		(yyerrstatus = 0)
799130803Smarcel#define yyclearin	(yychar = YYEMPTY)
800130803Smarcel#define YYEMPTY		(-2)
801130803Smarcel#define YYEOF		0
802130803Smarcel
803130803Smarcel#define YYACCEPT	goto yyacceptlab
804130803Smarcel#define YYABORT		goto yyabortlab
805130803Smarcel#define YYERROR		goto yyerrlab1
806130803Smarcel
807130803Smarcel/* Like YYERROR except do call yyerror.  This remains here temporarily
808130803Smarcel   to ease the transition to the new meaning of YYERROR, for GCC.
809130803Smarcel   Once GCC version 2 has supplanted version 1, this can go.  */
810130803Smarcel
811130803Smarcel#define YYFAIL		goto yyerrlab
812130803Smarcel
813130803Smarcel#define YYRECOVERING()  (!!yyerrstatus)
814130803Smarcel
815130803Smarcel#define YYBACKUP(Token, Value)					\
816130803Smarceldo								\
817130803Smarcel  if (yychar == YYEMPTY && yylen == 1)				\
818130803Smarcel    {								\
819130803Smarcel      yychar = (Token);						\
820130803Smarcel      yylval = (Value);						\
821130803Smarcel      yytoken = YYTRANSLATE (yychar);				\
822130803Smarcel      YYPOPSTACK;						\
823130803Smarcel      goto yybackup;						\
824130803Smarcel    }								\
825130803Smarcel  else								\
826130803Smarcel    { 								\
827130803Smarcel      yyerror ("syntax error: cannot back up");\
828130803Smarcel      YYERROR;							\
829130803Smarcel    }								\
830130803Smarcelwhile (0)
831130803Smarcel
832130803Smarcel#define YYTERROR	1
833130803Smarcel#define YYERRCODE	256
834130803Smarcel
835130803Smarcel/* YYLLOC_DEFAULT -- Compute the default location (before the actions
836130803Smarcel   are run).  */
837130803Smarcel
838130803Smarcel#ifndef YYLLOC_DEFAULT
839130803Smarcel# define YYLLOC_DEFAULT(Current, Rhs, N)         \
840130803Smarcel  Current.first_line   = Rhs[1].first_line;      \
841130803Smarcel  Current.first_column = Rhs[1].first_column;    \
842130803Smarcel  Current.last_line    = Rhs[N].last_line;       \
843130803Smarcel  Current.last_column  = Rhs[N].last_column;
844130803Smarcel#endif
845130803Smarcel
846130803Smarcel/* YYLEX -- calling `yylex' with the right arguments.  */
847130803Smarcel
848130803Smarcel#ifdef YYLEX_PARAM
849130803Smarcel# define YYLEX yylex (YYLEX_PARAM)
850130803Smarcel#else
851130803Smarcel# define YYLEX yylex ()
852130803Smarcel#endif
853130803Smarcel
854130803Smarcel/* Enable debugging if requested.  */
855130803Smarcel#if YYDEBUG
856130803Smarcel
857130803Smarcel# ifndef YYFPRINTF
858130803Smarcel#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
859130803Smarcel#  define YYFPRINTF fprintf
860130803Smarcel# endif
861130803Smarcel
862130803Smarcel# define YYDPRINTF(Args)			\
863130803Smarceldo {						\
864130803Smarcel  if (yydebug)					\
865130803Smarcel    YYFPRINTF Args;				\
866130803Smarcel} while (0)
867130803Smarcel
868130803Smarcel# define YYDSYMPRINT(Args)			\
869130803Smarceldo {						\
870130803Smarcel  if (yydebug)					\
871130803Smarcel    yysymprint Args;				\
872130803Smarcel} while (0)
873130803Smarcel
874130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location)		\
875130803Smarceldo {								\
876130803Smarcel  if (yydebug)							\
877130803Smarcel    {								\
878130803Smarcel      YYFPRINTF (stderr, "%s ", Title);				\
879130803Smarcel      yysymprint (stderr, 					\
880130803Smarcel                  Token, Value);	\
881130803Smarcel      YYFPRINTF (stderr, "\n");					\
882130803Smarcel    }								\
883130803Smarcel} while (0)
884130803Smarcel
885130803Smarcel/*------------------------------------------------------------------.
886130803Smarcel| yy_stack_print -- Print the state stack from its BOTTOM up to its |
887130803Smarcel| TOP (cinluded).                                                   |
888130803Smarcel`------------------------------------------------------------------*/
889130803Smarcel
890130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
891130803Smarcelstatic void
892130803Smarcelyy_stack_print (short *bottom, short *top)
893130803Smarcel#else
894130803Smarcelstatic void
895130803Smarcelyy_stack_print (bottom, top)
896130803Smarcel    short *bottom;
897130803Smarcel    short *top;
898130803Smarcel#endif
899130803Smarcel{
900130803Smarcel  YYFPRINTF (stderr, "Stack now");
901130803Smarcel  for (/* Nothing. */; bottom <= top; ++bottom)
902130803Smarcel    YYFPRINTF (stderr, " %d", *bottom);
903130803Smarcel  YYFPRINTF (stderr, "\n");
904130803Smarcel}
905130803Smarcel
906130803Smarcel# define YY_STACK_PRINT(Bottom, Top)				\
907130803Smarceldo {								\
908130803Smarcel  if (yydebug)							\
909130803Smarcel    yy_stack_print ((Bottom), (Top));				\
910130803Smarcel} while (0)
911130803Smarcel
912130803Smarcel
913130803Smarcel/*------------------------------------------------.
914130803Smarcel| Report that the YYRULE is going to be reduced.  |
915130803Smarcel`------------------------------------------------*/
916130803Smarcel
917130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
918130803Smarcelstatic void
919130803Smarcelyy_reduce_print (int yyrule)
920130803Smarcel#else
921130803Smarcelstatic void
922130803Smarcelyy_reduce_print (yyrule)
923130803Smarcel    int yyrule;
924130803Smarcel#endif
925130803Smarcel{
926130803Smarcel  int yyi;
927130803Smarcel  unsigned int yylineno = yyrline[yyrule];
928130803Smarcel  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
929130803Smarcel             yyrule - 1, yylineno);
930130803Smarcel  /* Print the symbols being reduced, and their result.  */
931130803Smarcel  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
932130803Smarcel    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
933130803Smarcel  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
934130803Smarcel}
935130803Smarcel
936130803Smarcel# define YY_REDUCE_PRINT(Rule)		\
937130803Smarceldo {					\
938130803Smarcel  if (yydebug)				\
939130803Smarcel    yy_reduce_print (Rule);		\
940130803Smarcel} while (0)
941130803Smarcel
942130803Smarcel/* Nonzero means print parse trace.  It is left uninitialized so that
943130803Smarcel   multiple parsers can coexist.  */
944130803Smarcelint yydebug;
945130803Smarcel#else /* !YYDEBUG */
946130803Smarcel# define YYDPRINTF(Args)
947130803Smarcel# define YYDSYMPRINT(Args)
948130803Smarcel# define YYDSYMPRINTF(Title, Token, Value, Location)
949130803Smarcel# define YY_STACK_PRINT(Bottom, Top)
950130803Smarcel# define YY_REDUCE_PRINT(Rule)
951130803Smarcel#endif /* !YYDEBUG */
952130803Smarcel
953130803Smarcel
954130803Smarcel/* YYINITDEPTH -- initial size of the parser's stacks.  */
955130803Smarcel#ifndef	YYINITDEPTH
956130803Smarcel# define YYINITDEPTH 200
957130803Smarcel#endif
958130803Smarcel
959130803Smarcel/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
960130803Smarcel   if the built-in stack extension method is used).
961130803Smarcel
962130803Smarcel   Do not make this value too large; the results are undefined if
963130803Smarcel   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
964130803Smarcel   evaluated with infinite-precision integer arithmetic.  */
965130803Smarcel
966130803Smarcel#if YYMAXDEPTH == 0
967130803Smarcel# undef YYMAXDEPTH
968130803Smarcel#endif
969130803Smarcel
970130803Smarcel#ifndef YYMAXDEPTH
971130803Smarcel# define YYMAXDEPTH 10000
972130803Smarcel#endif
973130803Smarcel
974130803Smarcel
975130803Smarcel
976130803Smarcel#if YYERROR_VERBOSE
977130803Smarcel
978130803Smarcel# ifndef yystrlen
979130803Smarcel#  if defined (__GLIBC__) && defined (_STRING_H)
980130803Smarcel#   define yystrlen strlen
981130803Smarcel#  else
982130803Smarcel/* Return the length of YYSTR.  */
983130803Smarcelstatic YYSIZE_T
984130803Smarcel#   if defined (__STDC__) || defined (__cplusplus)
985130803Smarcelyystrlen (const char *yystr)
986130803Smarcel#   else
987130803Smarcelyystrlen (yystr)
988130803Smarcel     const char *yystr;
989130803Smarcel#   endif
990130803Smarcel{
991130803Smarcel  register const char *yys = yystr;
992130803Smarcel
993130803Smarcel  while (*yys++ != '\0')
994130803Smarcel    continue;
995130803Smarcel
996130803Smarcel  return yys - yystr - 1;
997130803Smarcel}
998130803Smarcel#  endif
999130803Smarcel# endif
1000130803Smarcel
1001130803Smarcel# ifndef yystpcpy
1002130803Smarcel#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1003130803Smarcel#   define yystpcpy stpcpy
1004130803Smarcel#  else
1005130803Smarcel/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1006130803Smarcel   YYDEST.  */
1007130803Smarcelstatic char *
1008130803Smarcel#   if defined (__STDC__) || defined (__cplusplus)
1009130803Smarcelyystpcpy (char *yydest, const char *yysrc)
1010130803Smarcel#   else
1011130803Smarcelyystpcpy (yydest, yysrc)
1012130803Smarcel     char *yydest;
1013130803Smarcel     const char *yysrc;
1014130803Smarcel#   endif
1015130803Smarcel{
1016130803Smarcel  register char *yyd = yydest;
1017130803Smarcel  register const char *yys = yysrc;
1018130803Smarcel
1019130803Smarcel  while ((*yyd++ = *yys++) != '\0')
1020130803Smarcel    continue;
1021130803Smarcel
1022130803Smarcel  return yyd - 1;
1023130803Smarcel}
1024130803Smarcel#  endif
1025130803Smarcel# endif
1026130803Smarcel
1027130803Smarcel#endif /* !YYERROR_VERBOSE */
1028130803Smarcel
1029130803Smarcel
1030130803Smarcel
1031130803Smarcel#if YYDEBUG
1032130803Smarcel/*--------------------------------.
1033130803Smarcel| Print this symbol on YYOUTPUT.  |
1034130803Smarcel`--------------------------------*/
1035130803Smarcel
1036130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1037130803Smarcelstatic void
1038130803Smarcelyysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1039130803Smarcel#else
1040130803Smarcelstatic void
1041130803Smarcelyysymprint (yyoutput, yytype, yyvaluep)
1042130803Smarcel    FILE *yyoutput;
1043130803Smarcel    int yytype;
1044130803Smarcel    YYSTYPE *yyvaluep;
1045130803Smarcel#endif
1046130803Smarcel{
1047130803Smarcel  /* Pacify ``unused variable'' warnings.  */
1048130803Smarcel  (void) yyvaluep;
1049130803Smarcel
1050130803Smarcel  if (yytype < YYNTOKENS)
1051130803Smarcel    {
1052130803Smarcel      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1053130803Smarcel# ifdef YYPRINT
1054130803Smarcel      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1055130803Smarcel# endif
1056130803Smarcel    }
1057130803Smarcel  else
1058130803Smarcel    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1059130803Smarcel
1060130803Smarcel  switch (yytype)
1061130803Smarcel    {
1062130803Smarcel      default:
1063130803Smarcel        break;
1064130803Smarcel    }
1065130803Smarcel  YYFPRINTF (yyoutput, ")");
1066130803Smarcel}
1067130803Smarcel
1068130803Smarcel#endif /* ! YYDEBUG */
1069130803Smarcel/*-----------------------------------------------.
1070130803Smarcel| Release the memory associated to this symbol.  |
1071130803Smarcel`-----------------------------------------------*/
1072130803Smarcel
1073130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1074130803Smarcelstatic void
1075130803Smarcelyydestruct (int yytype, YYSTYPE *yyvaluep)
1076130803Smarcel#else
1077130803Smarcelstatic void
1078130803Smarcelyydestruct (yytype, yyvaluep)
1079130803Smarcel    int yytype;
1080130803Smarcel    YYSTYPE *yyvaluep;
1081130803Smarcel#endif
1082130803Smarcel{
1083130803Smarcel  /* Pacify ``unused variable'' warnings.  */
1084130803Smarcel  (void) yyvaluep;
1085130803Smarcel
1086130803Smarcel  switch (yytype)
1087130803Smarcel    {
1088130803Smarcel
1089130803Smarcel      default:
1090130803Smarcel        break;
1091130803Smarcel    }
1092130803Smarcel}
1093130803Smarcel
1094130803Smarcel
1095130803Smarcel/* Prevent warnings from -Wmissing-prototypes.  */
1096130803Smarcel
1097130803Smarcel#ifdef YYPARSE_PARAM
1098130803Smarcel# if defined (__STDC__) || defined (__cplusplus)
1099130803Smarcelint yyparse (void *YYPARSE_PARAM);
1100130803Smarcel# else
1101130803Smarcelint yyparse ();
1102130803Smarcel# endif
1103130803Smarcel#else /* ! YYPARSE_PARAM */
1104130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1105130803Smarcelint yyparse (void);
1106130803Smarcel#else
1107130803Smarcelint yyparse ();
1108130803Smarcel#endif
1109130803Smarcel#endif /* ! YYPARSE_PARAM */
1110130803Smarcel
1111130803Smarcel
1112130803Smarcel
1113130803Smarcel/* The lookahead symbol.  */
1114130803Smarcelint yychar;
1115130803Smarcel
1116130803Smarcel/* The semantic value of the lookahead symbol.  */
1117130803SmarcelYYSTYPE yylval;
1118130803Smarcel
1119130803Smarcel/* Number of syntax errors so far.  */
1120130803Smarcelint yynerrs;
1121130803Smarcel
1122130803Smarcel
1123130803Smarcel
1124130803Smarcel/*----------.
1125130803Smarcel| yyparse.  |
1126130803Smarcel`----------*/
1127130803Smarcel
1128130803Smarcel#ifdef YYPARSE_PARAM
1129130803Smarcel# if defined (__STDC__) || defined (__cplusplus)
1130130803Smarcelint yyparse (void *YYPARSE_PARAM)
1131130803Smarcel# else
1132130803Smarcelint yyparse (YYPARSE_PARAM)
1133130803Smarcel  void *YYPARSE_PARAM;
1134130803Smarcel# endif
1135130803Smarcel#else /* ! YYPARSE_PARAM */
1136130803Smarcel#if defined (__STDC__) || defined (__cplusplus)
1137130803Smarcelint
1138130803Smarcelyyparse (void)
1139130803Smarcel#else
1140130803Smarcelint
1141130803Smarcelyyparse ()
1142130803Smarcel
1143130803Smarcel#endif
1144130803Smarcel#endif
1145130803Smarcel{
1146130803Smarcel
1147130803Smarcel  register int yystate;
1148130803Smarcel  register int yyn;
1149130803Smarcel  int yyresult;
1150130803Smarcel  /* Number of tokens to shift before error messages enabled.  */
1151130803Smarcel  int yyerrstatus;
1152130803Smarcel  /* Lookahead token as an internal (translated) token number.  */
1153130803Smarcel  int yytoken = 0;
1154130803Smarcel
1155130803Smarcel  /* Three stacks and their tools:
1156130803Smarcel     `yyss': related to states,
1157130803Smarcel     `yyvs': related to semantic values,
1158130803Smarcel     `yyls': related to locations.
1159130803Smarcel
1160130803Smarcel     Refer to the stacks thru separate pointers, to allow yyoverflow
1161130803Smarcel     to xreallocate them elsewhere.  */
1162130803Smarcel
1163130803Smarcel  /* The state stack.  */
1164130803Smarcel  short	yyssa[YYINITDEPTH];
1165130803Smarcel  short *yyss = yyssa;
1166130803Smarcel  register short *yyssp;
1167130803Smarcel
1168130803Smarcel  /* The semantic value stack.  */
1169130803Smarcel  YYSTYPE yyvsa[YYINITDEPTH];
1170130803Smarcel  YYSTYPE *yyvs = yyvsa;
1171130803Smarcel  register YYSTYPE *yyvsp;
1172130803Smarcel
1173130803Smarcel
1174130803Smarcel
1175130803Smarcel#define YYPOPSTACK   (yyvsp--, yyssp--)
1176130803Smarcel
1177130803Smarcel  YYSIZE_T yystacksize = YYINITDEPTH;
1178130803Smarcel
1179130803Smarcel  /* The variables used to return semantic value and location from the
1180130803Smarcel     action routines.  */
1181130803Smarcel  YYSTYPE yyval;
1182130803Smarcel
1183130803Smarcel
1184130803Smarcel  /* When reducing, the number of symbols on the RHS of the reduced
1185130803Smarcel     rule.  */
1186130803Smarcel  int yylen;
1187130803Smarcel
1188130803Smarcel  YYDPRINTF ((stderr, "Starting parse\n"));
1189130803Smarcel
1190130803Smarcel  yystate = 0;
1191130803Smarcel  yyerrstatus = 0;
1192130803Smarcel  yynerrs = 0;
1193130803Smarcel  yychar = YYEMPTY;		/* Cause a token to be read.  */
1194130803Smarcel
1195130803Smarcel  /* Initialize stack pointers.
1196130803Smarcel     Waste one element of value and location stack
1197130803Smarcel     so that they stay on the same level as the state stack.
1198130803Smarcel     The wasted elements are never initialized.  */
1199130803Smarcel
1200130803Smarcel  yyssp = yyss;
1201130803Smarcel  yyvsp = yyvs;
1202130803Smarcel
1203130803Smarcel  goto yysetstate;
1204130803Smarcel
1205130803Smarcel/*------------------------------------------------------------.
1206130803Smarcel| yynewstate -- Push a new state, which is found in yystate.  |
1207130803Smarcel`------------------------------------------------------------*/
1208130803Smarcel yynewstate:
1209130803Smarcel  /* In all cases, when you get here, the value and location stacks
1210130803Smarcel     have just been pushed. so pushing a state here evens the stacks.
1211130803Smarcel     */
1212130803Smarcel  yyssp++;
1213130803Smarcel
1214130803Smarcel yysetstate:
1215130803Smarcel  *yyssp = yystate;
1216130803Smarcel
1217130803Smarcel  if (yyss + yystacksize - 1 <= yyssp)
1218130803Smarcel    {
1219130803Smarcel      /* Get the current used size of the three stacks, in elements.  */
1220130803Smarcel      YYSIZE_T yysize = yyssp - yyss + 1;
1221130803Smarcel
1222130803Smarcel#ifdef yyoverflow
1223130803Smarcel      {
1224130803Smarcel	/* Give user a chance to xreallocate the stack. Use copies of
1225130803Smarcel	   these so that the &'s don't force the real ones into
1226130803Smarcel	   memory.  */
1227130803Smarcel	YYSTYPE *yyvs1 = yyvs;
1228130803Smarcel	short *yyss1 = yyss;
1229130803Smarcel
1230130803Smarcel
1231130803Smarcel	/* Each stack pointer address is followed by the size of the
1232130803Smarcel	   data in use in that stack, in bytes.  This used to be a
1233130803Smarcel	   conditional around just the two extra args, but that might
1234130803Smarcel	   be undefined if yyoverflow is a macro.  */
1235130803Smarcel	yyoverflow ("parser stack overflow",
1236130803Smarcel		    &yyss1, yysize * sizeof (*yyssp),
1237130803Smarcel		    &yyvs1, yysize * sizeof (*yyvsp),
1238130803Smarcel
1239130803Smarcel		    &yystacksize);
1240130803Smarcel
1241130803Smarcel	yyss = yyss1;
1242130803Smarcel	yyvs = yyvs1;
1243130803Smarcel      }
1244130803Smarcel#else /* no yyoverflow */
1245130803Smarcel# ifndef YYSTACK_RELOCATE
1246130803Smarcel      goto yyoverflowlab;
1247130803Smarcel# else
1248130803Smarcel      /* Extend the stack our own way.  */
1249130803Smarcel      if (YYMAXDEPTH <= yystacksize)
1250130803Smarcel	goto yyoverflowlab;
1251130803Smarcel      yystacksize *= 2;
1252130803Smarcel      if (YYMAXDEPTH < yystacksize)
1253130803Smarcel	yystacksize = YYMAXDEPTH;
1254130803Smarcel
1255130803Smarcel      {
1256130803Smarcel	short *yyss1 = yyss;
1257130803Smarcel	union yyalloc *yyptr =
1258130803Smarcel	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1259130803Smarcel	if (! yyptr)
1260130803Smarcel	  goto yyoverflowlab;
1261130803Smarcel	YYSTACK_RELOCATE (yyss);
1262130803Smarcel	YYSTACK_RELOCATE (yyvs);
1263130803Smarcel
1264130803Smarcel#  undef YYSTACK_RELOCATE
1265130803Smarcel	if (yyss1 != yyssa)
1266130803Smarcel	  YYSTACK_FREE (yyss1);
1267130803Smarcel      }
1268130803Smarcel# endif
1269130803Smarcel#endif /* no yyoverflow */
1270130803Smarcel
1271130803Smarcel      yyssp = yyss + yysize - 1;
1272130803Smarcel      yyvsp = yyvs + yysize - 1;
1273130803Smarcel
1274130803Smarcel
1275130803Smarcel      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1276130803Smarcel		  (unsigned long int) yystacksize));
1277130803Smarcel
1278130803Smarcel      if (yyss + yystacksize - 1 <= yyssp)
1279130803Smarcel	YYABORT;
1280130803Smarcel    }
1281130803Smarcel
1282130803Smarcel  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1283130803Smarcel
1284130803Smarcel  goto yybackup;
1285130803Smarcel
1286130803Smarcel/*-----------.
1287130803Smarcel| yybackup.  |
1288130803Smarcel`-----------*/
1289130803Smarcelyybackup:
1290130803Smarcel
1291130803Smarcel/* Do appropriate processing given the current state.  */
1292130803Smarcel/* Read a lookahead token if we need one and don't already have one.  */
1293130803Smarcel/* yyresume: */
1294130803Smarcel
1295130803Smarcel  /* First try to decide what to do without reference to lookahead token.  */
1296130803Smarcel
1297130803Smarcel  yyn = yypact[yystate];
1298130803Smarcel  if (yyn == YYPACT_NINF)
1299130803Smarcel    goto yydefault;
1300130803Smarcel
1301130803Smarcel  /* Not known => get a lookahead token if don't already have one.  */
1302130803Smarcel
1303130803Smarcel  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1304130803Smarcel  if (yychar == YYEMPTY)
1305130803Smarcel    {
1306130803Smarcel      YYDPRINTF ((stderr, "Reading a token: "));
1307130803Smarcel      yychar = YYLEX;
1308130803Smarcel    }
1309130803Smarcel
1310130803Smarcel  if (yychar <= YYEOF)
1311130803Smarcel    {
1312130803Smarcel      yychar = yytoken = YYEOF;
1313130803Smarcel      YYDPRINTF ((stderr, "Now at end of input.\n"));
1314130803Smarcel    }
1315130803Smarcel  else
1316130803Smarcel    {
1317130803Smarcel      yytoken = YYTRANSLATE (yychar);
1318130803Smarcel      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1319130803Smarcel    }
1320130803Smarcel
1321130803Smarcel  /* If the proper action on seeing token YYTOKEN is to reduce or to
1322130803Smarcel     detect an error, take that action.  */
1323130803Smarcel  yyn += yytoken;
1324130803Smarcel  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1325130803Smarcel    goto yydefault;
1326130803Smarcel  yyn = yytable[yyn];
1327130803Smarcel  if (yyn <= 0)
1328130803Smarcel    {
1329130803Smarcel      if (yyn == 0 || yyn == YYTABLE_NINF)
1330130803Smarcel	goto yyerrlab;
1331130803Smarcel      yyn = -yyn;
1332130803Smarcel      goto yyreduce;
1333130803Smarcel    }
1334130803Smarcel
1335130803Smarcel  if (yyn == YYFINAL)
1336130803Smarcel    YYACCEPT;
1337130803Smarcel
1338130803Smarcel  /* Shift the lookahead token.  */
1339130803Smarcel  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1340130803Smarcel
1341130803Smarcel  /* Discard the token being shifted unless it is eof.  */
1342130803Smarcel  if (yychar != YYEOF)
1343130803Smarcel    yychar = YYEMPTY;
1344130803Smarcel
1345130803Smarcel  *++yyvsp = yylval;
1346130803Smarcel
1347130803Smarcel
1348130803Smarcel  /* Count tokens shifted since error; after three, turn off error
1349130803Smarcel     status.  */
1350130803Smarcel  if (yyerrstatus)
1351130803Smarcel    yyerrstatus--;
1352130803Smarcel
1353130803Smarcel  yystate = yyn;
1354130803Smarcel  goto yynewstate;
1355130803Smarcel
1356130803Smarcel
1357130803Smarcel/*-----------------------------------------------------------.
1358130803Smarcel| yydefault -- do the default action for the current state.  |
1359130803Smarcel`-----------------------------------------------------------*/
1360130803Smarcelyydefault:
1361130803Smarcel  yyn = yydefact[yystate];
1362130803Smarcel  if (yyn == 0)
1363130803Smarcel    goto yyerrlab;
1364130803Smarcel  goto yyreduce;
1365130803Smarcel
1366130803Smarcel
1367130803Smarcel/*-----------------------------.
1368130803Smarcel| yyreduce -- Do a reduction.  |
1369130803Smarcel`-----------------------------*/
1370130803Smarcelyyreduce:
1371130803Smarcel  /* yyn is the number of a rule to reduce with.  */
1372130803Smarcel  yylen = yyr2[yyn];
1373130803Smarcel
1374130803Smarcel  /* If YYLEN is nonzero, implement the default value of the action:
1375130803Smarcel     `$$ = $1'.
1376130803Smarcel
1377130803Smarcel     Otherwise, the following line sets YYVAL to garbage.
1378130803Smarcel     This behavior is undocumented and Bison
1379130803Smarcel     users should not rely upon it.  Assigning to YYVAL
1380130803Smarcel     unconditionally makes the parser a bit smaller, and it avoids a
1381130803Smarcel     GCC warning that YYVAL may be used uninitialized.  */
1382130803Smarcel  yyval = yyvsp[1-yylen];
1383130803Smarcel
1384130803Smarcel
1385130803Smarcel  YY_REDUCE_PRINT (yyn);
1386130803Smarcel  switch (yyn)
1387130803Smarcel    {
1388130803Smarcel        case 4:
1389130803Smarcel#line 209 "jv-exp.y"
1390130803Smarcel    {
1391130803Smarcel		  write_exp_elt_opcode(OP_TYPE);
1392130803Smarcel		  write_exp_elt_type(yyvsp[0].tval);
1393130803Smarcel		  write_exp_elt_opcode(OP_TYPE);
1394130803Smarcel		}
1395130803Smarcel    break;
1396130803Smarcel
1397130803Smarcel  case 7:
1398130803Smarcel#line 223 "jv-exp.y"
1399130803Smarcel    {
1400130803Smarcel		  write_exp_elt_opcode (OP_STRING);
1401130803Smarcel		  write_exp_string (yyvsp[0].sval);
1402130803Smarcel		  write_exp_elt_opcode (OP_STRING);
1403130803Smarcel		}
1404130803Smarcel    break;
1405130803Smarcel
1406130803Smarcel  case 8:
1407130803Smarcel#line 232 "jv-exp.y"
1408130803Smarcel    { write_exp_elt_opcode (OP_LONG);
1409130803Smarcel		  write_exp_elt_type (yyvsp[0].typed_val_int.type);
1410130803Smarcel		  write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val));
1411130803Smarcel		  write_exp_elt_opcode (OP_LONG); }
1412130803Smarcel    break;
1413130803Smarcel
1414130803Smarcel  case 9:
1415130803Smarcel#line 237 "jv-exp.y"
1416130803Smarcel    { YYSTYPE val;
1417130803Smarcel		  parse_number (yyvsp[0].sval.ptr, yyvsp[0].sval.length, 0, &val);
1418130803Smarcel		  write_exp_elt_opcode (OP_LONG);
1419130803Smarcel		  write_exp_elt_type (val.typed_val_int.type);
1420130803Smarcel		  write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
1421130803Smarcel		  write_exp_elt_opcode (OP_LONG);
1422130803Smarcel		}
1423130803Smarcel    break;
1424130803Smarcel
1425130803Smarcel  case 10:
1426130803Smarcel#line 245 "jv-exp.y"
1427130803Smarcel    { write_exp_elt_opcode (OP_DOUBLE);
1428130803Smarcel		  write_exp_elt_type (yyvsp[0].typed_val_float.type);
1429130803Smarcel		  write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1430130803Smarcel		  write_exp_elt_opcode (OP_DOUBLE); }
1431130803Smarcel    break;
1432130803Smarcel
1433130803Smarcel  case 11:
1434130803Smarcel#line 250 "jv-exp.y"
1435130803Smarcel    { write_exp_elt_opcode (OP_LONG);
1436130803Smarcel		  write_exp_elt_type (java_boolean_type);
1437130803Smarcel		  write_exp_elt_longcst ((LONGEST)yyvsp[0].lval);
1438130803Smarcel		  write_exp_elt_opcode (OP_LONG); }
1439130803Smarcel    break;
1440130803Smarcel
1441130803Smarcel  case 14:
1442130803Smarcel#line 267 "jv-exp.y"
1443130803Smarcel    { yyval.tval = java_boolean_type; }
1444130803Smarcel    break;
1445130803Smarcel
1446130803Smarcel  case 17:
1447130803Smarcel#line 277 "jv-exp.y"
1448130803Smarcel    { yyval.tval = java_byte_type; }
1449130803Smarcel    break;
1450130803Smarcel
1451130803Smarcel  case 18:
1452130803Smarcel#line 279 "jv-exp.y"
1453130803Smarcel    { yyval.tval = java_short_type; }
1454130803Smarcel    break;
1455130803Smarcel
1456130803Smarcel  case 19:
1457130803Smarcel#line 281 "jv-exp.y"
1458130803Smarcel    { yyval.tval = java_int_type; }
1459130803Smarcel    break;
1460130803Smarcel
1461130803Smarcel  case 20:
1462130803Smarcel#line 283 "jv-exp.y"
1463130803Smarcel    { yyval.tval = java_long_type; }
1464130803Smarcel    break;
1465130803Smarcel
1466130803Smarcel  case 21:
1467130803Smarcel#line 285 "jv-exp.y"
1468130803Smarcel    { yyval.tval = java_char_type; }
1469130803Smarcel    break;
1470130803Smarcel
1471130803Smarcel  case 22:
1472130803Smarcel#line 290 "jv-exp.y"
1473130803Smarcel    { yyval.tval = java_float_type; }
1474130803Smarcel    break;
1475130803Smarcel
1476130803Smarcel  case 23:
1477130803Smarcel#line 292 "jv-exp.y"
1478130803Smarcel    { yyval.tval = java_double_type; }
1479130803Smarcel    break;
1480130803Smarcel
1481130803Smarcel  case 24:
1482130803Smarcel#line 304 "jv-exp.y"
1483130803Smarcel    { yyval.tval = java_type_from_name (yyvsp[0].sval); }
1484130803Smarcel    break;
1485130803Smarcel
1486130803Smarcel  case 26:
1487130803Smarcel#line 313 "jv-exp.y"
1488130803Smarcel    { yyval.tval = java_array_type (yyvsp[-1].tval, yyvsp[0].lval); }
1489130803Smarcel    break;
1490130803Smarcel
1491130803Smarcel  case 27:
1492130803Smarcel#line 315 "jv-exp.y"
1493130803Smarcel    { yyval.tval = java_array_type (java_type_from_name (yyvsp[-1].sval), yyvsp[0].lval); }
1494130803Smarcel    break;
1495130803Smarcel
1496130803Smarcel  case 34:
1497130803Smarcel#line 335 "jv-exp.y"
1498130803Smarcel    { yyval.sval.length = yyvsp[-2].sval.length + yyvsp[0].sval.length + 1;
1499130803Smarcel		  if (yyvsp[-2].sval.ptr + yyvsp[-2].sval.length + 1 == yyvsp[0].sval.ptr
1500130803Smarcel		      && yyvsp[-2].sval.ptr[yyvsp[-2].sval.length] == '.')
1501130803Smarcel		    yyval.sval.ptr = yyvsp[-2].sval.ptr;  /* Optimization. */
1502130803Smarcel		  else
1503130803Smarcel		    {
1504130803Smarcel		      yyval.sval.ptr = (char *) xmalloc (yyval.sval.length + 1);
1505130803Smarcel		      make_cleanup (free, yyval.sval.ptr);
1506130803Smarcel		      sprintf (yyval.sval.ptr, "%.*s.%.*s",
1507130803Smarcel			       yyvsp[-2].sval.length, yyvsp[-2].sval.ptr, yyvsp[0].sval.length, yyvsp[0].sval.ptr);
1508130803Smarcel		} }
1509130803Smarcel    break;
1510130803Smarcel
1511130803Smarcel  case 36:
1512130803Smarcel#line 359 "jv-exp.y"
1513130803Smarcel    { write_exp_elt_opcode (BINOP_COMMA); }
1514130803Smarcel    break;
1515130803Smarcel
1516130803Smarcel  case 45:
1517130803Smarcel#line 375 "jv-exp.y"
1518130803Smarcel    { write_exp_elt_opcode (OP_ARRAY);
1519130803Smarcel		  write_exp_elt_longcst ((LONGEST) 0);
1520130803Smarcel		  write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1521130803Smarcel		  write_exp_elt_opcode (OP_ARRAY); }
1522130803Smarcel    break;
1523130803Smarcel
1524130803Smarcel  case 46:
1525130803Smarcel#line 383 "jv-exp.y"
1526130803Smarcel    { start_arglist (); }
1527130803Smarcel    break;
1528130803Smarcel
1529130803Smarcel  case 47:
1530130803Smarcel#line 388 "jv-exp.y"
1531130803Smarcel    { yyval.lval = end_arglist () - 1; }
1532130803Smarcel    break;
1533130803Smarcel
1534130803Smarcel  case 48:
1535130803Smarcel#line 393 "jv-exp.y"
1536130803Smarcel    { internal_error (__FILE__, __LINE__,
1537130803Smarcel				  _("FIXME - ClassInstanceCreationExpression")); }
1538130803Smarcel    break;
1539130803Smarcel
1540130803Smarcel  case 49:
1541130803Smarcel#line 399 "jv-exp.y"
1542130803Smarcel    { arglist_len = 1; }
1543130803Smarcel    break;
1544130803Smarcel
1545130803Smarcel  case 50:
1546130803Smarcel#line 401 "jv-exp.y"
1547130803Smarcel    { arglist_len++; }
1548130803Smarcel    break;
1549130803Smarcel
1550130803Smarcel  case 51:
1551130803Smarcel#line 406 "jv-exp.y"
1552130803Smarcel    { arglist_len = 0; }
1553130803Smarcel    break;
1554130803Smarcel
1555130803Smarcel  case 53:
1556130803Smarcel#line 412 "jv-exp.y"
1557130803Smarcel    { internal_error (__FILE__, __LINE__,
1558130803Smarcel				  _("FIXME - ArrayCreationExpression")); }
1559130803Smarcel    break;
1560130803Smarcel
1561130803Smarcel  case 54:
1562130803Smarcel#line 415 "jv-exp.y"
1563130803Smarcel    { internal_error (__FILE__, __LINE__,
1564130803Smarcel				  _("FIXME - ArrayCreationExpression")); }
1565130803Smarcel    break;
1566130803Smarcel
1567130803Smarcel  case 58:
1568130803Smarcel#line 430 "jv-exp.y"
1569130803Smarcel    { yyval.lval = 1; }
1570130803Smarcel    break;
1571130803Smarcel
1572130803Smarcel  case 59:
1573130803Smarcel#line 432 "jv-exp.y"
1574130803Smarcel    { yyval.lval = yyvsp[-2].lval + 1; }
1575130803Smarcel    break;
1576130803Smarcel
1577130803Smarcel  case 61:
1578130803Smarcel#line 438 "jv-exp.y"
1579130803Smarcel    { yyval.lval = 0; }
1580130803Smarcel    break;
1581130803Smarcel
1582130803Smarcel  case 62:
1583130803Smarcel#line 443 "jv-exp.y"
1584130803Smarcel    { push_fieldnames (yyvsp[0].sval); }
1585130803Smarcel    break;
1586130803Smarcel
1587130803Smarcel  case 63:
1588130803Smarcel#line 445 "jv-exp.y"
1589130803Smarcel    { push_fieldnames (yyvsp[0].sval); }
1590130803Smarcel    break;
1591130803Smarcel
1592130803Smarcel  case 64:
1593130803Smarcel#line 451 "jv-exp.y"
1594130803Smarcel    { error (_("Method invocation not implemented")); }
1595130803Smarcel    break;
1596130803Smarcel
1597130803Smarcel  case 65:
1598130803Smarcel#line 453 "jv-exp.y"
1599130803Smarcel    { error (_("Method invocation not implemented")); }
1600130803Smarcel    break;
1601130803Smarcel
1602130803Smarcel  case 66:
1603130803Smarcel#line 455 "jv-exp.y"
1604130803Smarcel    { error (_("Method invocation not implemented")); }
1605130803Smarcel    break;
1606130803Smarcel
1607130803Smarcel  case 67:
1608130803Smarcel#line 460 "jv-exp.y"
1609130803Smarcel    {
1610130803Smarcel                  /* Emit code for the Name now, then exchange it in the
1611130803Smarcel		     expout array with the Expression's code.  We could
1612130803Smarcel		     introduce a OP_SWAP code or a reversed version of
1613130803Smarcel		     BINOP_SUBSCRIPT, but that makes the rest of GDB pay
1614130803Smarcel		     for our parsing kludges.  */
1615130803Smarcel		  struct expression *name_expr;
1616130803Smarcel
1617130803Smarcel		  push_expression_name (yyvsp[-3].sval);
1618130803Smarcel		  name_expr = copy_exp (expout, expout_ptr);
1619130803Smarcel		  expout_ptr -= name_expr->nelts;
1620130803Smarcel		  insert_exp (expout_ptr-length_of_subexp (expout, expout_ptr),
1621130803Smarcel			      name_expr);
1622130803Smarcel		  free (name_expr);
1623130803Smarcel		  write_exp_elt_opcode (BINOP_SUBSCRIPT);
1624130803Smarcel		}
1625130803Smarcel    break;
1626130803Smarcel
1627130803Smarcel  case 68:
1628130803Smarcel#line 477 "jv-exp.y"
1629130803Smarcel    { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1630130803Smarcel    break;
1631130803Smarcel
1632130803Smarcel  case 69:
1633130803Smarcel#line 479 "jv-exp.y"
1634130803Smarcel    { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1635130803Smarcel    break;
1636130803Smarcel
1637130803Smarcel  case 71:
1638130803Smarcel#line 485 "jv-exp.y"
1639130803Smarcel    { push_expression_name (yyvsp[0].sval); }
1640130803Smarcel    break;
1641130803Smarcel
1642130803Smarcel  case 75:
1643130803Smarcel#line 494 "jv-exp.y"
1644130803Smarcel    { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
1645130803Smarcel    break;
1646130803Smarcel
1647130803Smarcel  case 76:
1648130803Smarcel#line 499 "jv-exp.y"
1649130803Smarcel    { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
1650130803Smarcel    break;
1651130803Smarcel
1652130803Smarcel  case 80:
1653130803Smarcel#line 507 "jv-exp.y"
1654130803Smarcel    { write_exp_elt_opcode (UNOP_NEG); }
1655130803Smarcel    break;
1656130803Smarcel
1657130803Smarcel  case 81:
1658130803Smarcel#line 509 "jv-exp.y"
1659130803Smarcel    { write_exp_elt_opcode (UNOP_IND); }
1660130803Smarcel    break;
1661130803Smarcel
1662130803Smarcel  case 83:
1663130803Smarcel#line 515 "jv-exp.y"
1664130803Smarcel    { write_exp_elt_opcode (UNOP_PREINCREMENT); }
1665130803Smarcel    break;
1666130803Smarcel
1667130803Smarcel  case 84:
1668130803Smarcel#line 520 "jv-exp.y"
1669130803Smarcel    { write_exp_elt_opcode (UNOP_PREDECREMENT); }
1670130803Smarcel    break;
1671130803Smarcel
1672130803Smarcel  case 86:
1673130803Smarcel#line 526 "jv-exp.y"
1674130803Smarcel    { write_exp_elt_opcode (UNOP_COMPLEMENT); }
1675130803Smarcel    break;
1676130803Smarcel
1677130803Smarcel  case 87:
1678130803Smarcel#line 528 "jv-exp.y"
1679130803Smarcel    { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1680130803Smarcel    break;
1681130803Smarcel
1682130803Smarcel  case 89:
1683130803Smarcel#line 534 "jv-exp.y"
1684130803Smarcel    { write_exp_elt_opcode (UNOP_CAST);
1685130803Smarcel		  write_exp_elt_type (java_array_type (yyvsp[-3].tval, yyvsp[-2].lval));
1686130803Smarcel		  write_exp_elt_opcode (UNOP_CAST); }
1687130803Smarcel    break;
1688130803Smarcel
1689130803Smarcel  case 90:
1690130803Smarcel#line 538 "jv-exp.y"
1691130803Smarcel    {
1692130803Smarcel		  int exp_size = expout_ptr;
1693130803Smarcel		  int last_exp_size = length_of_subexp(expout, expout_ptr);
1694130803Smarcel		  struct type *type;
1695130803Smarcel		  int i;
1696130803Smarcel		  int base = expout_ptr - last_exp_size - 3;
1697130803Smarcel		  if (base < 0 || expout->elts[base+2].opcode != OP_TYPE)
1698130803Smarcel		    error (_("Invalid cast expression"));
1699130803Smarcel		  type = expout->elts[base+1].type;
1700130803Smarcel		  /* Remove the 'Expression' and slide the
1701130803Smarcel		     UnaryExpressionNotPlusMinus down to replace it. */
1702130803Smarcel		  for (i = 0;  i < last_exp_size;  i++)
1703130803Smarcel		    expout->elts[base + i] = expout->elts[base + i + 3];
1704130803Smarcel		  expout_ptr -= 3;
1705130803Smarcel		  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
1706130803Smarcel		    type = lookup_pointer_type (type);
1707130803Smarcel		  write_exp_elt_opcode (UNOP_CAST);
1708130803Smarcel		  write_exp_elt_type (type);
1709130803Smarcel		  write_exp_elt_opcode (UNOP_CAST);
1710130803Smarcel		}
1711130803Smarcel    break;
1712130803Smarcel
1713130803Smarcel  case 91:
1714130803Smarcel#line 559 "jv-exp.y"
1715130803Smarcel    { write_exp_elt_opcode (UNOP_CAST);
1716130803Smarcel		  write_exp_elt_type (java_array_type (java_type_from_name (yyvsp[-3].sval), yyvsp[-2].lval));
1717130803Smarcel		  write_exp_elt_opcode (UNOP_CAST); }
1718130803Smarcel    break;
1719130803Smarcel
1720130803Smarcel  case 93:
1721130803Smarcel#line 568 "jv-exp.y"
1722130803Smarcel    { write_exp_elt_opcode (BINOP_MUL); }
1723130803Smarcel    break;
1724130803Smarcel
1725130803Smarcel  case 94:
1726130803Smarcel#line 570 "jv-exp.y"
1727130803Smarcel    { write_exp_elt_opcode (BINOP_DIV); }
1728130803Smarcel    break;
1729130803Smarcel
1730130803Smarcel  case 95:
1731130803Smarcel#line 572 "jv-exp.y"
1732130803Smarcel    { write_exp_elt_opcode (BINOP_REM); }
1733130803Smarcel    break;
1734130803Smarcel
1735130803Smarcel  case 97:
1736130803Smarcel#line 578 "jv-exp.y"
1737130803Smarcel    { write_exp_elt_opcode (BINOP_ADD); }
1738130803Smarcel    break;
1739130803Smarcel
1740130803Smarcel  case 98:
1741130803Smarcel#line 580 "jv-exp.y"
1742130803Smarcel    { write_exp_elt_opcode (BINOP_SUB); }
1743130803Smarcel    break;
1744130803Smarcel
1745130803Smarcel  case 100:
1746130803Smarcel#line 586 "jv-exp.y"
1747130803Smarcel    { write_exp_elt_opcode (BINOP_LSH); }
1748130803Smarcel    break;
1749130803Smarcel
1750130803Smarcel  case 101:
1751130803Smarcel#line 588 "jv-exp.y"
1752130803Smarcel    { write_exp_elt_opcode (BINOP_RSH); }
1753130803Smarcel    break;
1754130803Smarcel
1755130803Smarcel  case 103:
1756130803Smarcel#line 595 "jv-exp.y"
1757130803Smarcel    { write_exp_elt_opcode (BINOP_LESS); }
1758130803Smarcel    break;
1759130803Smarcel
1760130803Smarcel  case 104:
1761130803Smarcel#line 597 "jv-exp.y"
1762130803Smarcel    { write_exp_elt_opcode (BINOP_GTR); }
1763130803Smarcel    break;
1764130803Smarcel
1765130803Smarcel  case 105:
1766130803Smarcel#line 599 "jv-exp.y"
1767130803Smarcel    { write_exp_elt_opcode (BINOP_LEQ); }
1768130803Smarcel    break;
1769130803Smarcel
1770130803Smarcel  case 106:
1771130803Smarcel#line 601 "jv-exp.y"
1772130803Smarcel    { write_exp_elt_opcode (BINOP_GEQ); }
1773130803Smarcel    break;
1774130803Smarcel
1775130803Smarcel  case 108:
1776130803Smarcel#line 608 "jv-exp.y"
1777130803Smarcel    { write_exp_elt_opcode (BINOP_EQUAL); }
1778130803Smarcel    break;
1779130803Smarcel
1780130803Smarcel  case 109:
1781130803Smarcel#line 610 "jv-exp.y"
1782130803Smarcel    { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1783130803Smarcel    break;
1784130803Smarcel
1785130803Smarcel  case 111:
1786130803Smarcel#line 616 "jv-exp.y"
1787130803Smarcel    { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1788130803Smarcel    break;
1789130803Smarcel
1790130803Smarcel  case 113:
1791130803Smarcel#line 622 "jv-exp.y"
1792130803Smarcel    { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1793130803Smarcel    break;
1794130803Smarcel
1795130803Smarcel  case 115:
1796130803Smarcel#line 627 "jv-exp.y"
1797130803Smarcel    { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1798130803Smarcel    break;
1799130803Smarcel
1800130803Smarcel  case 117:
1801130803Smarcel#line 633 "jv-exp.y"
1802130803Smarcel    { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1803130803Smarcel    break;
1804130803Smarcel
1805130803Smarcel  case 119:
1806130803Smarcel#line 639 "jv-exp.y"
1807130803Smarcel    { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1808130803Smarcel    break;
1809130803Smarcel
1810130803Smarcel  case 121:
1811130803Smarcel#line 645 "jv-exp.y"
1812130803Smarcel    { write_exp_elt_opcode (TERNOP_COND); }
1813130803Smarcel    break;
1814130803Smarcel
1815130803Smarcel  case 124:
1816130803Smarcel#line 655 "jv-exp.y"
1817130803Smarcel    { write_exp_elt_opcode (BINOP_ASSIGN); }
1818130803Smarcel    break;
1819130803Smarcel
1820130803Smarcel  case 125:
1821130803Smarcel#line 657 "jv-exp.y"
1822130803Smarcel    { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
1823130803Smarcel		  write_exp_elt_opcode (yyvsp[-1].opcode);
1824130803Smarcel		  write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
1825130803Smarcel    break;
1826130803Smarcel
1827130803Smarcel  case 126:
1828130803Smarcel#line 664 "jv-exp.y"
1829130803Smarcel    { push_expression_name (yyvsp[0].sval); }
1830130803Smarcel    break;
1831130803Smarcel
1832130803Smarcel
1833130803Smarcel    }
1834130803Smarcel
1835130803Smarcel/* Line 991 of yacc.c.  */
1836130803Smarcel
1837130803Smarcel  yyvsp -= yylen;
1838130803Smarcel  yyssp -= yylen;
1839130803Smarcel
1840130803Smarcel
1841130803Smarcel  YY_STACK_PRINT (yyss, yyssp);
1842130803Smarcel
1843130803Smarcel  *++yyvsp = yyval;
1844130803Smarcel
1845130803Smarcel
1846130803Smarcel  /* Now `shift' the result of the reduction.  Determine what state
1847130803Smarcel     that goes to, based on the state we popped back to and the rule
1848130803Smarcel     number reduced by.  */
1849130803Smarcel
1850130803Smarcel  yyn = yyr1[yyn];
1851130803Smarcel
1852130803Smarcel  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1853130803Smarcel  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1854130803Smarcel    yystate = yytable[yystate];
1855130803Smarcel  else
1856130803Smarcel    yystate = yydefgoto[yyn - YYNTOKENS];
1857130803Smarcel
1858130803Smarcel  goto yynewstate;
1859130803Smarcel
1860130803Smarcel
1861130803Smarcel/*------------------------------------.
1862130803Smarcel| yyerrlab -- here on detecting error |
1863130803Smarcel`------------------------------------*/
1864130803Smarcelyyerrlab:
1865130803Smarcel  /* If not already recovering from an error, report this error.  */
1866130803Smarcel  if (!yyerrstatus)
1867130803Smarcel    {
1868130803Smarcel      ++yynerrs;
1869130803Smarcel#if YYERROR_VERBOSE
1870130803Smarcel      yyn = yypact[yystate];
1871130803Smarcel
1872130803Smarcel      if (YYPACT_NINF < yyn && yyn < YYLAST)
1873130803Smarcel	{
1874130803Smarcel	  YYSIZE_T yysize = 0;
1875130803Smarcel	  int yytype = YYTRANSLATE (yychar);
1876130803Smarcel	  char *yymsg;
1877130803Smarcel	  int yyx, yycount;
1878130803Smarcel
1879130803Smarcel	  yycount = 0;
1880130803Smarcel	  /* Start YYX at -YYN if negative to avoid negative indexes in
1881130803Smarcel	     YYCHECK.  */
1882130803Smarcel	  for (yyx = yyn < 0 ? -yyn : 0;
1883130803Smarcel	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1884130803Smarcel	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1885130803Smarcel	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1886130803Smarcel	  yysize += yystrlen ("syntax error, unexpected ") + 1;
1887130803Smarcel	  yysize += yystrlen (yytname[yytype]);
1888130803Smarcel	  yymsg = (char *) YYSTACK_ALLOC (yysize);
1889130803Smarcel	  if (yymsg != 0)
1890130803Smarcel	    {
1891130803Smarcel	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1892130803Smarcel	      yyp = yystpcpy (yyp, yytname[yytype]);
1893130803Smarcel
1894130803Smarcel	      if (yycount < 5)
1895130803Smarcel		{
1896130803Smarcel		  yycount = 0;
1897130803Smarcel		  for (yyx = yyn < 0 ? -yyn : 0;
1898130803Smarcel		       yyx < (int) (sizeof (yytname) / sizeof (char *));
1899130803Smarcel		       yyx++)
1900130803Smarcel		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1901130803Smarcel		      {
1902130803Smarcel			const char *yyq = ! yycount ? ", expecting " : " or ";
1903130803Smarcel			yyp = yystpcpy (yyp, yyq);
1904130803Smarcel			yyp = yystpcpy (yyp, yytname[yyx]);
1905130803Smarcel			yycount++;
1906130803Smarcel		      }
1907130803Smarcel		}
1908130803Smarcel	      yyerror (yymsg);
1909130803Smarcel	      YYSTACK_FREE (yymsg);
1910130803Smarcel	    }
1911130803Smarcel	  else
1912130803Smarcel	    yyerror ("syntax error; also virtual memory exhausted");
1913130803Smarcel	}
1914130803Smarcel      else
1915130803Smarcel#endif /* YYERROR_VERBOSE */
1916130803Smarcel	yyerror ("syntax error");
1917130803Smarcel    }
1918130803Smarcel
1919130803Smarcel
1920130803Smarcel
1921130803Smarcel  if (yyerrstatus == 3)
1922130803Smarcel    {
1923130803Smarcel      /* If just tried and failed to reuse lookahead token after an
1924130803Smarcel	 error, discard it.  */
1925130803Smarcel
1926130803Smarcel      /* Return failure if at end of input.  */
1927130803Smarcel      if (yychar == YYEOF)
1928130803Smarcel        {
1929130803Smarcel	  /* Pop the error token.  */
1930130803Smarcel          YYPOPSTACK;
1931130803Smarcel	  /* Pop the rest of the stack.  */
1932130803Smarcel	  while (yyss < yyssp)
1933130803Smarcel	    {
1934130803Smarcel	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1935130803Smarcel	      yydestruct (yystos[*yyssp], yyvsp);
1936130803Smarcel	      YYPOPSTACK;
1937130803Smarcel	    }
1938130803Smarcel	  YYABORT;
1939130803Smarcel        }
1940130803Smarcel
1941130803Smarcel      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1942130803Smarcel      yydestruct (yytoken, &yylval);
1943130803Smarcel      yychar = YYEMPTY;
1944130803Smarcel
1945130803Smarcel    }
1946130803Smarcel
1947130803Smarcel  /* Else will try to reuse lookahead token after shifting the error
1948130803Smarcel     token.  */
1949130803Smarcel  goto yyerrlab2;
1950130803Smarcel
1951130803Smarcel
1952130803Smarcel/*----------------------------------------------------.
1953130803Smarcel| yyerrlab1 -- error raised explicitly by an action.  |
1954130803Smarcel`----------------------------------------------------*/
1955130803Smarcelyyerrlab1:
1956130803Smarcel
1957130803Smarcel  /* Suppress GCC warning that yyerrlab1 is unused when no action
1958130803Smarcel     invokes YYERROR.  Doesn't work in C++ */
1959130803Smarcel#ifndef __cplusplus
1960130803Smarcel#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
1961130803Smarcel  __attribute__ ((__unused__))
1962130803Smarcel#endif
1963130803Smarcel#endif
1964130803Smarcel
1965130803Smarcel
1966130803Smarcel  goto yyerrlab2;
1967130803Smarcel
1968130803Smarcel
1969130803Smarcel/*---------------------------------------------------------------.
1970130803Smarcel| yyerrlab2 -- pop states until the error token can be shifted.  |
1971130803Smarcel`---------------------------------------------------------------*/
1972130803Smarcelyyerrlab2:
1973130803Smarcel  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
1974130803Smarcel
1975130803Smarcel  for (;;)
1976130803Smarcel    {
1977130803Smarcel      yyn = yypact[yystate];
1978130803Smarcel      if (yyn != YYPACT_NINF)
1979130803Smarcel	{
1980130803Smarcel	  yyn += YYTERROR;
1981130803Smarcel	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1982130803Smarcel	    {
1983130803Smarcel	      yyn = yytable[yyn];
1984130803Smarcel	      if (0 < yyn)
1985130803Smarcel		break;
1986130803Smarcel	    }
1987130803Smarcel	}
1988130803Smarcel
1989130803Smarcel      /* Pop the current state because it cannot handle the error token.  */
1990130803Smarcel      if (yyssp == yyss)
1991130803Smarcel	YYABORT;
1992130803Smarcel
1993130803Smarcel      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1994130803Smarcel      yydestruct (yystos[yystate], yyvsp);
1995130803Smarcel      yyvsp--;
1996130803Smarcel      yystate = *--yyssp;
1997130803Smarcel
1998130803Smarcel      YY_STACK_PRINT (yyss, yyssp);
1999130803Smarcel    }
2000130803Smarcel
2001130803Smarcel  if (yyn == YYFINAL)
2002130803Smarcel    YYACCEPT;
2003130803Smarcel
2004130803Smarcel  YYDPRINTF ((stderr, "Shifting error token, "));
2005130803Smarcel
2006130803Smarcel  *++yyvsp = yylval;
2007130803Smarcel
2008130803Smarcel
2009130803Smarcel  yystate = yyn;
2010130803Smarcel  goto yynewstate;
2011130803Smarcel
2012130803Smarcel
2013130803Smarcel/*-------------------------------------.
2014130803Smarcel| yyacceptlab -- YYACCEPT comes here.  |
2015130803Smarcel`-------------------------------------*/
2016130803Smarcelyyacceptlab:
2017130803Smarcel  yyresult = 0;
2018130803Smarcel  goto yyreturn;
2019130803Smarcel
2020130803Smarcel/*-----------------------------------.
2021130803Smarcel| yyabortlab -- YYABORT comes here.  |
2022130803Smarcel`-----------------------------------*/
2023130803Smarcelyyabortlab:
2024130803Smarcel  yyresult = 1;
2025130803Smarcel  goto yyreturn;
2026130803Smarcel
2027130803Smarcel#ifndef yyoverflow
2028130803Smarcel/*----------------------------------------------.
2029130803Smarcel| yyoverflowlab -- parser overflow comes here.  |
2030130803Smarcel`----------------------------------------------*/
2031130803Smarcelyyoverflowlab:
2032130803Smarcel  yyerror ("parser stack overflow");
2033130803Smarcel  yyresult = 2;
2034130803Smarcel  /* Fall through.  */
2035130803Smarcel#endif
2036130803Smarcel
2037130803Smarcelyyreturn:
2038130803Smarcel#ifndef yyoverflow
2039130803Smarcel  if (yyss != yyssa)
2040130803Smarcel    YYSTACK_FREE (yyss);
2041130803Smarcel#endif
2042130803Smarcel  return yyresult;
2043130803Smarcel}
2044130803Smarcel
2045130803Smarcel
2046130803Smarcel#line 676 "jv-exp.y"
2047130803Smarcel
2048130803Smarcel/* Take care of parsing a number (anything that starts with a digit).
2049130803Smarcel   Set yylval and return the token type; update lexptr.
2050130803Smarcel   LEN is the number of characters in it.  */
2051130803Smarcel
2052130803Smarcel/*** Needs some error checking for the float case ***/
2053130803Smarcel
2054130803Smarcelstatic int
2055130803Smarcelparse_number (p, len, parsed_float, putithere)
2056130803Smarcel     char *p;
2057130803Smarcel     int len;
2058130803Smarcel     int parsed_float;
2059130803Smarcel     YYSTYPE *putithere;
2060130803Smarcel{
2061130803Smarcel  ULONGEST n = 0;
2062130803Smarcel  ULONGEST limit, limit_div_base;
2063130803Smarcel
2064130803Smarcel  int c;
2065130803Smarcel  int base = input_radix;
2066130803Smarcel
2067130803Smarcel  struct type *type;
2068130803Smarcel
2069130803Smarcel  if (parsed_float)
2070130803Smarcel    {
2071130803Smarcel      /* It's a float since it contains a point or an exponent.  */
2072130803Smarcel      char c;
2073130803Smarcel      int num = 0;	/* number of tokens scanned by scanf */
2074130803Smarcel      char saved_char = p[len];
2075130803Smarcel
2076130803Smarcel      p[len] = 0;	/* null-terminate the token */
2077130803Smarcel      if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
2078130803Smarcel	num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval, &c);
2079130803Smarcel      else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
2080130803Smarcel	num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval, &c);
2081130803Smarcel      else
2082130803Smarcel	{
2083130803Smarcel#ifdef SCANF_HAS_LONG_DOUBLE
2084130803Smarcel	  num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval, &c);
2085130803Smarcel#else
2086130803Smarcel	  /* Scan it into a double, then assign it to the long double.
2087130803Smarcel	     This at least wins with values representable in the range
2088130803Smarcel	     of doubles. */
2089130803Smarcel	  double temp;
2090130803Smarcel	  num = sscanf (p, "%lg%c", &temp, &c);
2091130803Smarcel	  putithere->typed_val_float.dval = temp;
2092130803Smarcel#endif
2093130803Smarcel	}
2094130803Smarcel      p[len] = saved_char;	/* restore the input stream */
2095130803Smarcel      if (num != 1) 		/* check scanf found ONLY a float ... */
2096130803Smarcel	return ERROR;
2097130803Smarcel      /* See if it has `f' or `d' suffix (float or double).  */
2098130803Smarcel
2099130803Smarcel      c = tolower (p[len - 1]);
2100130803Smarcel
2101130803Smarcel      if (c == 'f' || c == 'F')
2102130803Smarcel	putithere->typed_val_float.type = builtin_type_float;
2103130803Smarcel      else if (isdigit (c) || c == '.' || c == 'd' || c == 'D')
2104130803Smarcel	putithere->typed_val_float.type = builtin_type_double;
2105130803Smarcel      else
2106130803Smarcel	return ERROR;
2107130803Smarcel
2108130803Smarcel      return FLOATING_POINT_LITERAL;
2109130803Smarcel    }
2110130803Smarcel
2111130803Smarcel  /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
2112130803Smarcel  if (p[0] == '0')
2113130803Smarcel    switch (p[1])
2114130803Smarcel      {
2115130803Smarcel      case 'x':
2116130803Smarcel      case 'X':
2117130803Smarcel	if (len >= 3)
2118130803Smarcel	  {
2119130803Smarcel	    p += 2;
2120130803Smarcel	    base = 16;
2121130803Smarcel	    len -= 2;
2122130803Smarcel	  }
2123130803Smarcel	break;
2124130803Smarcel
2125130803Smarcel      case 't':
2126130803Smarcel      case 'T':
2127130803Smarcel      case 'd':
2128130803Smarcel      case 'D':
2129130803Smarcel	if (len >= 3)
2130130803Smarcel	  {
2131130803Smarcel	    p += 2;
2132130803Smarcel	    base = 10;
2133130803Smarcel	    len -= 2;
2134130803Smarcel	  }
2135130803Smarcel	break;
2136130803Smarcel
2137130803Smarcel      default:
2138130803Smarcel	base = 8;
2139130803Smarcel	break;
2140130803Smarcel      }
2141130803Smarcel
2142130803Smarcel  c = p[len-1];
2143130803Smarcel  /* A paranoid calculation of (1<<64)-1. */
2144130803Smarcel  limit = (ULONGEST)0xffffffff;
2145130803Smarcel  limit = ((limit << 16) << 16) | limit;
2146130803Smarcel  if (c == 'l' || c == 'L')
2147130803Smarcel    {
2148130803Smarcel      type = java_long_type;
2149130803Smarcel      len--;
2150130803Smarcel    }
2151130803Smarcel  else
2152130803Smarcel    {
2153130803Smarcel      type = java_int_type;
2154130803Smarcel    }
2155130803Smarcel  limit_div_base = limit / (ULONGEST) base;
2156130803Smarcel
2157130803Smarcel  while (--len >= 0)
2158130803Smarcel    {
2159130803Smarcel      c = *p++;
2160130803Smarcel      if (c >= '0' && c <= '9')
2161130803Smarcel	c -= '0';
2162130803Smarcel      else if (c >= 'A' && c <= 'Z')
2163130803Smarcel	c -= 'A' - 10;
2164130803Smarcel      else if (c >= 'a' && c <= 'z')
2165130803Smarcel	c -= 'a' - 10;
2166130803Smarcel      else
2167130803Smarcel	return ERROR;	/* Char not a digit */
2168130803Smarcel      if (c >= base)
2169130803Smarcel	return ERROR;
2170130803Smarcel      if (n > limit_div_base
2171130803Smarcel	  || (n *= base) > limit - c)
2172130803Smarcel	error (_("Numeric constant too large"));
2173130803Smarcel      n += c;
2174130803Smarcel	}
2175130803Smarcel
2176130803Smarcel  /* If the type is bigger than a 32-bit signed integer can be, implicitly
2177130803Smarcel     promote to long.  Java does not do this, so mark it as builtin_type_uint64
2178130803Smarcel     rather than java_long_type.  0x80000000 will become -0x80000000 instead
2179130803Smarcel     of 0x80000000L, because we don't know the sign at this point.
2180130803Smarcel  */
2181130803Smarcel  if (type == java_int_type && n > (ULONGEST)0x80000000)
2182130803Smarcel    type = builtin_type_uint64;
2183130803Smarcel
2184130803Smarcel  putithere->typed_val_int.val = n;
2185130803Smarcel  putithere->typed_val_int.type = type;
2186130803Smarcel
2187130803Smarcel  return INTEGER_LITERAL;
2188130803Smarcel}
2189130803Smarcel
2190130803Smarcelstruct token
2191130803Smarcel{
2192130803Smarcel  char *operator;
2193130803Smarcel  int token;
2194130803Smarcel  enum exp_opcode opcode;
2195130803Smarcel};
2196130803Smarcel
2197130803Smarcelstatic const struct token tokentab3[] =
2198130803Smarcel  {
2199130803Smarcel    {">>=", ASSIGN_MODIFY, BINOP_RSH},
2200130803Smarcel    {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2201130803Smarcel  };
2202130803Smarcel
2203130803Smarcelstatic const struct token tokentab2[] =
2204130803Smarcel  {
2205130803Smarcel    {"+=", ASSIGN_MODIFY, BINOP_ADD},
2206130803Smarcel    {"-=", ASSIGN_MODIFY, BINOP_SUB},
2207130803Smarcel    {"*=", ASSIGN_MODIFY, BINOP_MUL},
2208130803Smarcel    {"/=", ASSIGN_MODIFY, BINOP_DIV},
2209130803Smarcel    {"%=", ASSIGN_MODIFY, BINOP_REM},
2210130803Smarcel    {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2211130803Smarcel    {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2212130803Smarcel    {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2213130803Smarcel    {"++", INCREMENT, BINOP_END},
2214130803Smarcel    {"--", DECREMENT, BINOP_END},
2215130803Smarcel    {"&&", ANDAND, BINOP_END},
2216130803Smarcel    {"||", OROR, BINOP_END},
2217130803Smarcel    {"<<", LSH, BINOP_END},
2218130803Smarcel    {">>", RSH, BINOP_END},
2219130803Smarcel    {"==", EQUAL, BINOP_END},
2220130803Smarcel    {"!=", NOTEQUAL, BINOP_END},
2221130803Smarcel    {"<=", LEQ, BINOP_END},
2222130803Smarcel    {">=", GEQ, BINOP_END}
2223130803Smarcel  };
2224130803Smarcel
2225130803Smarcel/* Read one token, getting characters through lexptr.  */
2226130803Smarcel
2227130803Smarcelstatic int
2228130803Smarcelyylex ()
2229130803Smarcel{
2230130803Smarcel  int c;
2231130803Smarcel  int namelen;
2232130803Smarcel  unsigned int i;
2233130803Smarcel  char *tokstart;
2234130803Smarcel  char *tokptr;
2235130803Smarcel  int tempbufindex;
2236130803Smarcel  static char *tempbuf;
2237130803Smarcel  static int tempbufsize;
2238130803Smarcel
2239130803Smarcel retry:
2240130803Smarcel
2241130803Smarcel  prev_lexptr = lexptr;
2242130803Smarcel
2243130803Smarcel  tokstart = lexptr;
2244130803Smarcel  /* See if it is a special token of length 3.  */
2245130803Smarcel  for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2246130803Smarcel    if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
2247130803Smarcel      {
2248130803Smarcel	lexptr += 3;
2249130803Smarcel	yylval.opcode = tokentab3[i].opcode;
2250130803Smarcel	return tokentab3[i].token;
2251130803Smarcel      }
2252130803Smarcel
2253130803Smarcel  /* See if it is a special token of length 2.  */
2254130803Smarcel  for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2255130803Smarcel    if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
2256130803Smarcel      {
2257130803Smarcel	lexptr += 2;
2258130803Smarcel	yylval.opcode = tokentab2[i].opcode;
2259130803Smarcel	return tokentab2[i].token;
2260130803Smarcel      }
2261130803Smarcel
2262130803Smarcel  switch (c = *tokstart)
2263130803Smarcel    {
2264130803Smarcel    case 0:
2265130803Smarcel      return 0;
2266130803Smarcel
2267130803Smarcel    case ' ':
2268130803Smarcel    case '\t':
2269130803Smarcel    case '\n':
2270130803Smarcel      lexptr++;
2271130803Smarcel      goto retry;
2272130803Smarcel
2273130803Smarcel    case '\'':
2274130803Smarcel      /* We either have a character constant ('0' or '\177' for example)
2275130803Smarcel	 or we have a quoted symbol reference ('foo(int,int)' in C++
2276130803Smarcel	 for example). */
2277130803Smarcel      lexptr++;
2278130803Smarcel      c = *lexptr++;
2279130803Smarcel      if (c == '\\')
2280130803Smarcel	c = parse_escape (&lexptr);
2281130803Smarcel      else if (c == '\'')
2282130803Smarcel	error (_("Empty character constant"));
2283130803Smarcel
2284130803Smarcel      yylval.typed_val_int.val = c;
2285130803Smarcel      yylval.typed_val_int.type = java_char_type;
2286130803Smarcel
2287130803Smarcel      c = *lexptr++;
2288130803Smarcel      if (c != '\'')
2289130803Smarcel	{
2290130803Smarcel	  namelen = skip_quoted (tokstart) - tokstart;
2291130803Smarcel	  if (namelen > 2)
2292130803Smarcel	    {
2293130803Smarcel	      lexptr = tokstart + namelen;
2294130803Smarcel	      if (lexptr[-1] != '\'')
2295130803Smarcel		error (_("Unmatched single quote"));
2296130803Smarcel	      namelen -= 2;
2297130803Smarcel	      tokstart++;
2298130803Smarcel	      goto tryname;
2299130803Smarcel	    }
2300130803Smarcel	  error (_("Invalid character constant"));
2301130803Smarcel	}
2302130803Smarcel      return INTEGER_LITERAL;
2303130803Smarcel
2304130803Smarcel    case '(':
2305130803Smarcel      paren_depth++;
2306130803Smarcel      lexptr++;
2307130803Smarcel      return c;
2308130803Smarcel
2309130803Smarcel    case ')':
2310130803Smarcel      if (paren_depth == 0)
2311130803Smarcel	return 0;
2312130803Smarcel      paren_depth--;
2313130803Smarcel      lexptr++;
2314130803Smarcel      return c;
2315130803Smarcel
2316130803Smarcel    case ',':
2317130803Smarcel      if (comma_terminates && paren_depth == 0)
2318130803Smarcel	return 0;
2319130803Smarcel      lexptr++;
2320130803Smarcel      return c;
2321130803Smarcel
2322130803Smarcel    case '.':
2323130803Smarcel      /* Might be a floating point number.  */
2324130803Smarcel      if (lexptr[1] < '0' || lexptr[1] > '9')
2325130803Smarcel	goto symbol;		/* Nope, must be a symbol. */
2326130803Smarcel      /* FALL THRU into number case.  */
2327130803Smarcel
2328130803Smarcel    case '0':
2329130803Smarcel    case '1':
2330130803Smarcel    case '2':
2331130803Smarcel    case '3':
2332130803Smarcel    case '4':
2333130803Smarcel    case '5':
2334130803Smarcel    case '6':
2335130803Smarcel    case '7':
2336130803Smarcel    case '8':
2337130803Smarcel    case '9':
2338130803Smarcel      {
2339130803Smarcel	/* It's a number.  */
2340130803Smarcel	int got_dot = 0, got_e = 0, toktype;
2341130803Smarcel	char *p = tokstart;
2342130803Smarcel	int hex = input_radix > 10;
2343130803Smarcel
2344130803Smarcel	if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
2345130803Smarcel	  {
2346130803Smarcel	    p += 2;
2347130803Smarcel	    hex = 1;
2348130803Smarcel	  }
2349130803Smarcel	else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
2350130803Smarcel	  {
2351130803Smarcel	    p += 2;
2352130803Smarcel	    hex = 0;
2353130803Smarcel	  }
2354130803Smarcel
2355130803Smarcel	for (;; ++p)
2356130803Smarcel	  {
2357130803Smarcel	    /* This test includes !hex because 'e' is a valid hex digit
2358130803Smarcel	       and thus does not indicate a floating point number when
2359130803Smarcel	       the radix is hex.  */
2360130803Smarcel	    if (!hex && !got_e && (*p == 'e' || *p == 'E'))
2361130803Smarcel	      got_dot = got_e = 1;
2362130803Smarcel	    /* This test does not include !hex, because a '.' always indicates
2363130803Smarcel	       a decimal floating point number regardless of the radix.  */
2364130803Smarcel	    else if (!got_dot && *p == '.')
2365130803Smarcel	      got_dot = 1;
2366130803Smarcel	    else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2367130803Smarcel		     && (*p == '-' || *p == '+'))
2368130803Smarcel	      /* This is the sign of the exponent, not the end of the
2369130803Smarcel		 number.  */
2370130803Smarcel	      continue;
2371130803Smarcel	    /* We will take any letters or digits.  parse_number will
2372130803Smarcel	       complain if past the radix, or if L or U are not final.  */
2373130803Smarcel	    else if ((*p < '0' || *p > '9')
2374130803Smarcel		     && ((*p < 'a' || *p > 'z')
2375130803Smarcel				  && (*p < 'A' || *p > 'Z')))
2376130803Smarcel	      break;
2377130803Smarcel	  }
2378130803Smarcel	toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
2379130803Smarcel        if (toktype == ERROR)
2380130803Smarcel	  {
2381130803Smarcel	    char *err_copy = (char *) alloca (p - tokstart + 1);
2382130803Smarcel
2383130803Smarcel	    memcpy (err_copy, tokstart, p - tokstart);
2384130803Smarcel	    err_copy[p - tokstart] = 0;
2385130803Smarcel	    error (_("Invalid number \"%s\""), err_copy);
2386130803Smarcel	  }
2387130803Smarcel	lexptr = p;
2388130803Smarcel	return toktype;
2389130803Smarcel      }
2390130803Smarcel
2391130803Smarcel    case '+':
2392130803Smarcel    case '-':
2393130803Smarcel    case '*':
2394130803Smarcel    case '/':
2395130803Smarcel    case '%':
2396130803Smarcel    case '|':
2397130803Smarcel    case '&':
2398130803Smarcel    case '^':
2399130803Smarcel    case '~':
2400130803Smarcel    case '!':
2401130803Smarcel    case '<':
2402130803Smarcel    case '>':
2403130803Smarcel    case '[':
2404130803Smarcel    case ']':
2405130803Smarcel    case '?':
2406130803Smarcel    case ':':
2407130803Smarcel    case '=':
2408130803Smarcel    case '{':
2409130803Smarcel    case '}':
2410130803Smarcel    symbol:
2411130803Smarcel      lexptr++;
2412130803Smarcel      return c;
2413130803Smarcel
2414130803Smarcel    case '"':
2415130803Smarcel
2416130803Smarcel      /* Build the gdb internal form of the input string in tempbuf,
2417130803Smarcel	 translating any standard C escape forms seen.  Note that the
2418130803Smarcel	 buffer is null byte terminated *only* for the convenience of
2419130803Smarcel	 debugging gdb itself and printing the buffer contents when
2420130803Smarcel	 the buffer contains no embedded nulls.  Gdb does not depend
2421130803Smarcel	 upon the buffer being null byte terminated, it uses the length
2422130803Smarcel	 string instead.  This allows gdb to handle C strings (as well
2423130803Smarcel	 as strings in other languages) with embedded null bytes */
2424130803Smarcel
2425130803Smarcel      tokptr = ++tokstart;
2426130803Smarcel      tempbufindex = 0;
2427130803Smarcel
2428130803Smarcel      do {
2429130803Smarcel	/* Grow the static temp buffer if necessary, including allocating
2430130803Smarcel	   the first one on demand. */
2431130803Smarcel	if (tempbufindex + 1 >= tempbufsize)
2432130803Smarcel	  {
2433130803Smarcel	    tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
2434130803Smarcel	  }
2435130803Smarcel	switch (*tokptr)
2436130803Smarcel	  {
2437130803Smarcel	  case '\0':
2438130803Smarcel	  case '"':
2439130803Smarcel	    /* Do nothing, loop will terminate. */
2440130803Smarcel	    break;
2441130803Smarcel	  case '\\':
2442130803Smarcel	    tokptr++;
2443130803Smarcel	    c = parse_escape (&tokptr);
2444130803Smarcel	    if (c == -1)
2445130803Smarcel	      {
2446130803Smarcel		continue;
2447130803Smarcel	      }
2448130803Smarcel	    tempbuf[tempbufindex++] = c;
2449130803Smarcel	    break;
2450130803Smarcel	  default:
2451130803Smarcel	    tempbuf[tempbufindex++] = *tokptr++;
2452130803Smarcel	    break;
2453130803Smarcel	  }
2454130803Smarcel      } while ((*tokptr != '"') && (*tokptr != '\0'));
2455130803Smarcel      if (*tokptr++ != '"')
2456130803Smarcel	{
2457130803Smarcel	  error (_("Unterminated string in expression"));
2458130803Smarcel	}
2459130803Smarcel      tempbuf[tempbufindex] = '\0';	/* See note above */
2460130803Smarcel      yylval.sval.ptr = tempbuf;
2461130803Smarcel      yylval.sval.length = tempbufindex;
2462130803Smarcel      lexptr = tokptr;
2463130803Smarcel      return (STRING_LITERAL);
2464130803Smarcel    }
2465130803Smarcel
2466130803Smarcel  if (!(c == '_' || c == '$'
2467130803Smarcel	|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2468130803Smarcel    /* We must have come across a bad character (e.g. ';').  */
2469130803Smarcel    error (_("Invalid character '%c' in expression"), c);
2470130803Smarcel
2471130803Smarcel  /* It's a name.  See how long it is.  */
2472130803Smarcel  namelen = 0;
2473130803Smarcel  for (c = tokstart[namelen];
2474130803Smarcel       (c == '_'
2475130803Smarcel	|| c == '$'
2476130803Smarcel	|| (c >= '0' && c <= '9')
2477130803Smarcel	|| (c >= 'a' && c <= 'z')
2478130803Smarcel	|| (c >= 'A' && c <= 'Z')
2479130803Smarcel	|| c == '<');
2480130803Smarcel       )
2481130803Smarcel    {
2482130803Smarcel      if (c == '<')
2483130803Smarcel	{
2484130803Smarcel	  int i = namelen;
2485130803Smarcel	  while (tokstart[++i] && tokstart[i] != '>');
2486130803Smarcel	  if (tokstart[i] == '>')
2487130803Smarcel	    namelen = i;
2488130803Smarcel	}
2489130803Smarcel       c = tokstart[++namelen];
2490130803Smarcel     }
2491130803Smarcel
2492130803Smarcel  /* The token "if" terminates the expression and is NOT
2493130803Smarcel     removed from the input stream.  */
2494130803Smarcel  if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2495130803Smarcel    {
2496130803Smarcel      return 0;
2497130803Smarcel    }
2498130803Smarcel
2499130803Smarcel  lexptr += namelen;
2500130803Smarcel
2501130803Smarcel  tryname:
2502130803Smarcel
2503130803Smarcel  /* Catch specific keywords.  Should be done with a data structure.  */
2504130803Smarcel  switch (namelen)
2505130803Smarcel    {
2506130803Smarcel    case 7:
2507130803Smarcel      if (DEPRECATED_STREQN (tokstart, "boolean", 7))
2508130803Smarcel	return BOOLEAN;
2509130803Smarcel      break;
2510130803Smarcel    case 6:
2511130803Smarcel      if (DEPRECATED_STREQN (tokstart, "double", 6))
2512130803Smarcel	return DOUBLE;
2513130803Smarcel      break;
2514130803Smarcel    case 5:
2515130803Smarcel      if (DEPRECATED_STREQN (tokstart, "short", 5))
2516130803Smarcel	return SHORT;
2517130803Smarcel      if (DEPRECATED_STREQN (tokstart, "false", 5))
2518130803Smarcel	{
2519130803Smarcel	  yylval.lval = 0;
2520130803Smarcel	  return BOOLEAN_LITERAL;
2521130803Smarcel	}
2522130803Smarcel      if (DEPRECATED_STREQN (tokstart, "super", 5))
2523130803Smarcel	return SUPER;
2524130803Smarcel      if (DEPRECATED_STREQN (tokstart, "float", 5))
2525130803Smarcel	return FLOAT;
2526130803Smarcel      break;
2527130803Smarcel    case 4:
2528130803Smarcel      if (DEPRECATED_STREQN (tokstart, "long", 4))
2529130803Smarcel	return LONG;
2530130803Smarcel      if (DEPRECATED_STREQN (tokstart, "byte", 4))
2531130803Smarcel	return BYTE;
2532130803Smarcel      if (DEPRECATED_STREQN (tokstart, "char", 4))
2533130803Smarcel	return CHAR;
2534130803Smarcel      if (DEPRECATED_STREQN (tokstart, "true", 4))
2535130803Smarcel	{
2536130803Smarcel	  yylval.lval = 1;
2537130803Smarcel	  return BOOLEAN_LITERAL;
2538130803Smarcel	}
2539130803Smarcel      break;
2540130803Smarcel    case 3:
2541130803Smarcel      if (strncmp (tokstart, "int", 3) == 0)
2542130803Smarcel	return INT;
2543130803Smarcel      if (strncmp (tokstart, "new", 3) == 0)
2544130803Smarcel	return NEW;
2545130803Smarcel      break;
2546130803Smarcel    default:
2547130803Smarcel      break;
2548130803Smarcel    }
2549130803Smarcel
2550130803Smarcel  yylval.sval.ptr = tokstart;
2551130803Smarcel  yylval.sval.length = namelen;
2552130803Smarcel
2553130803Smarcel  if (*tokstart == '$')
2554130803Smarcel    {
2555130803Smarcel      write_dollar_variable (yylval.sval);
2556130803Smarcel      return VARIABLE;
2557130803Smarcel    }
2558130803Smarcel
2559130803Smarcel  /* Input names that aren't symbols but ARE valid hex numbers,
2560130803Smarcel     when the input radix permits them, can be names or numbers
2561130803Smarcel     depending on the parse.  Note we support radixes > 16 here.  */
2562130803Smarcel  if (((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
2563130803Smarcel       (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
2564130803Smarcel    {
2565130803Smarcel      YYSTYPE newlval;	/* Its value is ignored.  */
2566130803Smarcel      int hextype = parse_number (tokstart, namelen, 0, &newlval);
2567130803Smarcel      if (hextype == INTEGER_LITERAL)
2568130803Smarcel	return NAME_OR_INT;
2569130803Smarcel    }
2570130803Smarcel  return IDENTIFIER;
2571130803Smarcel}
2572130803Smarcel
2573130803Smarcelvoid
2574130803Smarcelyyerror (msg)
2575130803Smarcel     char *msg;
2576130803Smarcel{
2577130803Smarcel  if (prev_lexptr)
2578130803Smarcel    lexptr = prev_lexptr;
2579130803Smarcel
2580130803Smarcel  if (msg)
2581130803Smarcel    error (_("%s: near `%s'"), msg, lexptr);
2582130803Smarcel  else
2583130803Smarcel    error (_("error in expression, near `%s'"), lexptr);
2584130803Smarcel}
2585130803Smarcel
2586130803Smarcelstatic struct type *
2587130803Smarceljava_type_from_name (name)
2588130803Smarcel     struct stoken name;
2589130803Smarcel
2590130803Smarcel{
2591130803Smarcel  char *tmp = copy_name (name);
2592130803Smarcel  struct type *typ = java_lookup_class (tmp);
2593130803Smarcel  if (typ == NULL || TYPE_CODE (typ) != TYPE_CODE_STRUCT)
2594130803Smarcel    error (_("No class named `%s'"), tmp);
2595130803Smarcel  return typ;
2596130803Smarcel}
2597130803Smarcel
2598130803Smarcel/* If NAME is a valid variable name in this scope, push it and return 1.
2599130803Smarcel   Otherwise, return 0. */
2600130803Smarcel
2601130803Smarcelstatic int
2602130803Smarcelpush_variable (struct stoken name)
2603130803Smarcel{
2604130803Smarcel  char *tmp = copy_name (name);
2605130803Smarcel  int is_a_field_of_this = 0;
2606130803Smarcel  struct symbol *sym;
2607130803Smarcel  sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN,
2608130803Smarcel		       &is_a_field_of_this, (struct symtab **) NULL);
2609130803Smarcel  if (sym && SYMBOL_CLASS (sym) != LOC_TYPEDEF)
2610130803Smarcel    {
2611130803Smarcel      if (symbol_read_needs_frame (sym))
2612130803Smarcel	{
2613130803Smarcel	  if (innermost_block == 0 ||
2614130803Smarcel	      contained_in (block_found, innermost_block))
2615130803Smarcel	    innermost_block = block_found;
2616130803Smarcel	}
2617130803Smarcel
2618130803Smarcel      write_exp_elt_opcode (OP_VAR_VALUE);
2619130803Smarcel      /* We want to use the selected frame, not another more inner frame
2620130803Smarcel	 which happens to be in the same block.  */
2621130803Smarcel      write_exp_elt_block (NULL);
2622130803Smarcel      write_exp_elt_sym (sym);
2623130803Smarcel      write_exp_elt_opcode (OP_VAR_VALUE);
2624130803Smarcel      return 1;
2625130803Smarcel    }
2626130803Smarcel  if (is_a_field_of_this)
2627130803Smarcel    {
2628130803Smarcel      /* it hangs off of `this'.  Must not inadvertently convert from a
2629130803Smarcel	 method call to data ref.  */
2630130803Smarcel      if (innermost_block == 0 ||
2631130803Smarcel	  contained_in (block_found, innermost_block))
2632130803Smarcel	innermost_block = block_found;
2633130803Smarcel      write_exp_elt_opcode (OP_THIS);
2634130803Smarcel      write_exp_elt_opcode (OP_THIS);
2635130803Smarcel      write_exp_elt_opcode (STRUCTOP_PTR);
2636130803Smarcel      write_exp_string (name);
2637130803Smarcel      write_exp_elt_opcode (STRUCTOP_PTR);
2638130803Smarcel      return 1;
2639130803Smarcel    }
2640130803Smarcel  return 0;
2641130803Smarcel}
2642130803Smarcel
2643130803Smarcel/* Assuming a reference expression has been pushed, emit the
2644130803Smarcel   STRUCTOP_STRUCT ops to access the field named NAME.  If NAME is a
2645130803Smarcel   qualified name (has '.'), generate a field access for each part. */
2646130803Smarcel
2647130803Smarcelstatic void
2648130803Smarcelpush_fieldnames (name)
2649130803Smarcel     struct stoken name;
2650130803Smarcel{
2651130803Smarcel  int i;
2652130803Smarcel  struct stoken token;
2653130803Smarcel  token.ptr = name.ptr;
2654130803Smarcel  for (i = 0;  ;  i++)
2655130803Smarcel    {
2656130803Smarcel      if (i == name.length || name.ptr[i] == '.')
2657130803Smarcel	{
2658130803Smarcel	  /* token.ptr is start of current field name. */
2659130803Smarcel	  token.length = &name.ptr[i] - token.ptr;
2660130803Smarcel	  write_exp_elt_opcode (STRUCTOP_STRUCT);
2661130803Smarcel	  write_exp_string (token);
2662130803Smarcel	  write_exp_elt_opcode (STRUCTOP_STRUCT);
2663130803Smarcel	  token.ptr += token.length + 1;
2664130803Smarcel	}
2665130803Smarcel      if (i >= name.length)
2666130803Smarcel	break;
2667130803Smarcel    }
2668130803Smarcel}
2669130803Smarcel
2670130803Smarcel/* Helper routine for push_expression_name.
2671130803Smarcel   Handle a qualified name, where DOT_INDEX is the index of the first '.' */
2672130803Smarcel
2673130803Smarcelstatic void
2674130803Smarcelpush_qualified_expression_name (struct stoken name, int dot_index)
2675130803Smarcel{
2676130803Smarcel  struct stoken token;
2677130803Smarcel  char *tmp;
2678130803Smarcel  struct type *typ;
2679130803Smarcel
2680130803Smarcel  token.ptr = name.ptr;
2681130803Smarcel  token.length = dot_index;
2682130803Smarcel
2683130803Smarcel  if (push_variable (token))
2684130803Smarcel    {
2685130803Smarcel      token.ptr = name.ptr + dot_index + 1;
2686130803Smarcel      token.length = name.length - dot_index - 1;
2687130803Smarcel      push_fieldnames (token);
2688130803Smarcel      return;
2689130803Smarcel    }
2690130803Smarcel
2691130803Smarcel  token.ptr = name.ptr;
2692130803Smarcel  for (;;)
2693130803Smarcel    {
2694130803Smarcel      token.length = dot_index;
2695130803Smarcel      tmp = copy_name (token);
2696130803Smarcel      typ = java_lookup_class (tmp);
2697130803Smarcel      if (typ != NULL)
2698130803Smarcel	{
2699130803Smarcel	  if (dot_index == name.length)
2700130803Smarcel	    {
2701130803Smarcel	      write_exp_elt_opcode(OP_TYPE);
2702130803Smarcel	      write_exp_elt_type(typ);
2703130803Smarcel	      write_exp_elt_opcode(OP_TYPE);
2704130803Smarcel	      return;
2705130803Smarcel	    }
2706130803Smarcel	  dot_index++;  /* Skip '.' */
2707130803Smarcel	  name.ptr += dot_index;
2708130803Smarcel	  name.length -= dot_index;
2709130803Smarcel	  dot_index = 0;
2710130803Smarcel	  while (dot_index < name.length && name.ptr[dot_index] != '.')
2711130803Smarcel	    dot_index++;
2712130803Smarcel	  token.ptr = name.ptr;
2713130803Smarcel	  token.length = dot_index;
2714130803Smarcel	  write_exp_elt_opcode (OP_SCOPE);
2715130803Smarcel	  write_exp_elt_type (typ);
2716130803Smarcel	  write_exp_string (token);
2717130803Smarcel	  write_exp_elt_opcode (OP_SCOPE);
2718130803Smarcel	  if (dot_index < name.length)
2719130803Smarcel	    {
2720130803Smarcel	      dot_index++;
2721130803Smarcel	      name.ptr += dot_index;
2722130803Smarcel	      name.length -= dot_index;
2723130803Smarcel	      push_fieldnames (name);
2724130803Smarcel	    }
2725130803Smarcel	  return;
2726130803Smarcel	}
2727130803Smarcel      else if (dot_index >= name.length)
2728130803Smarcel	break;
2729130803Smarcel      dot_index++;  /* Skip '.' */
2730130803Smarcel      while (dot_index < name.length && name.ptr[dot_index] != '.')
2731130803Smarcel	dot_index++;
2732130803Smarcel    }
2733130803Smarcel  error (_("unknown type `%.*s'"), name.length, name.ptr);
2734130803Smarcel}
2735130803Smarcel
2736130803Smarcel/* Handle Name in an expression (or LHS).
2737130803Smarcel   Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */
2738130803Smarcel
2739130803Smarcelstatic void
2740130803Smarcelpush_expression_name (name)
2741130803Smarcel     struct stoken name;
2742130803Smarcel{
2743130803Smarcel  char *tmp;
2744130803Smarcel  struct type *typ;
2745130803Smarcel  char *ptr;
2746130803Smarcel  int i;
2747130803Smarcel
2748130803Smarcel  for (i = 0;  i < name.length;  i++)
2749130803Smarcel    {
2750130803Smarcel      if (name.ptr[i] == '.')
2751130803Smarcel	{
2752130803Smarcel	  /* It's a Qualified Expression Name. */
2753130803Smarcel	  push_qualified_expression_name (name, i);
2754130803Smarcel	  return;
2755130803Smarcel	}
2756130803Smarcel    }
2757130803Smarcel
2758130803Smarcel  /* It's a Simple Expression Name. */
2759130803Smarcel
2760130803Smarcel  if (push_variable (name))
2761130803Smarcel    return;
2762130803Smarcel  tmp = copy_name (name);
2763130803Smarcel  typ = java_lookup_class (tmp);
2764130803Smarcel  if (typ != NULL)
2765130803Smarcel    {
2766130803Smarcel      write_exp_elt_opcode(OP_TYPE);
2767130803Smarcel      write_exp_elt_type(typ);
2768130803Smarcel      write_exp_elt_opcode(OP_TYPE);
2769130803Smarcel    }
2770130803Smarcel  else
2771130803Smarcel    {
2772130803Smarcel      struct minimal_symbol *msymbol;
2773130803Smarcel
2774130803Smarcel      msymbol = lookup_minimal_symbol (tmp, NULL, NULL);
2775130803Smarcel      if (msymbol != NULL)
2776130803Smarcel	{
2777130803Smarcel	  write_exp_msymbol (msymbol,
2778130803Smarcel			     lookup_function_type (builtin_type_int),
2779130803Smarcel			     builtin_type_int);
2780130803Smarcel	}
2781130803Smarcel      else if (!have_full_symbols () && !have_partial_symbols ())
2782130803Smarcel	error (_("No symbol table is loaded.  Use the \"file\" command"));
2783130803Smarcel      else
2784130803Smarcel	error (_("No symbol \"%s\" in current context"), tmp);
2785130803Smarcel    }
2786130803Smarcel
2787130803Smarcel}
2788130803Smarcel
2789130803Smarcel
2790130803Smarcel/* The following two routines, copy_exp and insert_exp, aren't specific to
2791130803Smarcel   Java, so they could go in parse.c, but their only purpose is to support
2792130803Smarcel   the parsing kludges we use in this file, so maybe it's best to isolate
2793130803Smarcel   them here.  */
2794130803Smarcel
2795130803Smarcel/* Copy the expression whose last element is at index ENDPOS - 1 in EXPR
2796130803Smarcel   into a freshly xmalloc'ed struct expression.  Its language_defn is set
2797130803Smarcel   to null.  */
2798130803Smarcelstatic struct expression *
2799130803Smarcelcopy_exp (expr, endpos)
2800130803Smarcel     struct expression *expr;
2801130803Smarcel     int endpos;
2802130803Smarcel{
2803130803Smarcel  int len = length_of_subexp (expr, endpos);
2804130803Smarcel  struct expression *new
2805130803Smarcel    = (struct expression *) xmalloc (sizeof (*new) + EXP_ELEM_TO_BYTES (len));
2806130803Smarcel  new->nelts = len;
2807130803Smarcel  memcpy (new->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
2808130803Smarcel  new->language_defn = 0;
2809130803Smarcel
2810130803Smarcel  return new;
2811130803Smarcel}
2812130803Smarcel
2813130803Smarcel/* Insert the expression NEW into the current expression (expout) at POS.  */
2814130803Smarcelstatic void
2815130803Smarcelinsert_exp (pos, new)
2816130803Smarcel     int pos;
2817130803Smarcel     struct expression *new;
2818130803Smarcel{
2819130803Smarcel  int newlen = new->nelts;
2820130803Smarcel
2821130803Smarcel  /* Grow expout if necessary.  In this function's only use at present,
2822130803Smarcel     this should never be necessary.  */
2823130803Smarcel  if (expout_ptr + newlen > expout_size)
2824130803Smarcel    {
2825130803Smarcel      expout_size = max (expout_size * 2, expout_ptr + newlen + 10);
2826130803Smarcel      expout = (struct expression *)
2827130803Smarcel	xrealloc ((char *) expout, (sizeof (struct expression)
2828130803Smarcel				    + EXP_ELEM_TO_BYTES (expout_size)));
2829130803Smarcel    }
2830130803Smarcel
2831130803Smarcel  {
2832130803Smarcel    int i;
2833130803Smarcel
2834130803Smarcel    for (i = expout_ptr - 1; i >= pos; i--)
2835130803Smarcel      expout->elts[i + newlen] = expout->elts[i];
2836130803Smarcel  }
2837130803Smarcel
2838130803Smarcel  memcpy (expout->elts + pos, new->elts, EXP_ELEM_TO_BYTES (newlen));
2839130803Smarcel  expout_ptr += newlen;
2840130803Smarcel}
2841130803Smarcel
2842130803Smarcel
2843