Add missing "return(error)".
[dragonfly.git] / contrib / gdb-6.2.1 / gdb / objc-exp.c
1 /* A Bison parser, made by GNU Bison 1.875.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330,
19    Boston, MA 02111-1307, USA.  */
20
21 /* As a special exception, when this file is copied by Bison into a
22    Bison output file, you may use that output file without restriction.
23    This special exception was added by the Free Software Foundation
24    in version 1.24 of Bison.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
29 /* All symbols defined below should begin with yy or YY, to avoid
30    infringing on user name space.  This should be done even for local
31    variables, as they might otherwise be expanded by user macros.
32    There are some unavoidable exceptions within include files to
33    define necessary library symbols; they are noted "INFRINGES ON
34    USER NAME SPACE" below.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Skeleton name.  */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers.  */
43 #define YYPURE 0
44
45 /* Using locations.  */
46 #define YYLSP_NEEDED 0
47
48
49
50 /* Tokens.  */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53    /* Put the tokens into the symbol table, so that GDB and other debuggers
54       know about them.  */
55    enum yytokentype {
56      INT = 258,
57      FLOAT = 259,
58      STRING = 260,
59      NSSTRING = 261,
60      SELECTOR = 262,
61      NAME = 263,
62      TYPENAME = 264,
63      CLASSNAME = 265,
64      NAME_OR_INT = 266,
65      STRUCT = 267,
66      CLASS = 268,
67      UNION = 269,
68      ENUM = 270,
69      SIZEOF = 271,
70      UNSIGNED = 272,
71      COLONCOLON = 273,
72      TEMPLATE = 274,
73      ERROR = 275,
74      SIGNED_KEYWORD = 276,
75      LONG = 277,
76      SHORT = 278,
77      INT_KEYWORD = 279,
78      CONST_KEYWORD = 280,
79      VOLATILE_KEYWORD = 281,
80      DOUBLE_KEYWORD = 282,
81      VARIABLE = 283,
82      ASSIGN_MODIFY = 284,
83      ABOVE_COMMA = 285,
84      OROR = 286,
85      ANDAND = 287,
86      NOTEQUAL = 288,
87      EQUAL = 289,
88      GEQ = 290,
89      LEQ = 291,
90      RSH = 292,
91      LSH = 293,
92      DECREMENT = 294,
93      INCREMENT = 295,
94      UNARY = 296,
95      ARROW = 297,
96      BLOCKNAME = 298
97    };
98 #endif
99 #define INT 258
100 #define FLOAT 259
101 #define STRING 260
102 #define NSSTRING 261
103 #define SELECTOR 262
104 #define NAME 263
105 #define TYPENAME 264
106 #define CLASSNAME 265
107 #define NAME_OR_INT 266
108 #define STRUCT 267
109 #define CLASS 268
110 #define UNION 269
111 #define ENUM 270
112 #define SIZEOF 271
113 #define UNSIGNED 272
114 #define COLONCOLON 273
115 #define TEMPLATE 274
116 #define ERROR 275
117 #define SIGNED_KEYWORD 276
118 #define LONG 277
119 #define SHORT 278
120 #define INT_KEYWORD 279
121 #define CONST_KEYWORD 280
122 #define VOLATILE_KEYWORD 281
123 #define DOUBLE_KEYWORD 282
124 #define VARIABLE 283
125 #define ASSIGN_MODIFY 284
126 #define ABOVE_COMMA 285
127 #define OROR 286
128 #define ANDAND 287
129 #define NOTEQUAL 288
130 #define EQUAL 289
131 #define GEQ 290
132 #define LEQ 291
133 #define RSH 292
134 #define LSH 293
135 #define DECREMENT 294
136 #define INCREMENT 295
137 #define UNARY 296
138 #define ARROW 297
139 #define BLOCKNAME 298
140
141
142
143
144 /* Copy the first part of user declarations.  */
145 #line 37 "objc-exp.y"
146
147
148 #include "defs.h"
149 #include "gdb_string.h"
150 #include <ctype.h>
151 #include "expression.h"
152
153 #include "objc-lang.h"  /* For objc language constructs.  */
154
155 #include "value.h"
156 #include "parser-defs.h"
157 #include "language.h"
158 #include "c-lang.h"
159 #include "bfd.h" /* Required by objfiles.h.  */
160 #include "symfile.h" /* Required by objfiles.h.  */
161 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols.  */
162 #include "top.h"
163 #include "completer.h" /* For skip_quoted().  */
164 #include "block.h"
165
166 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
167    etc), as well as gratuitiously global symbol names, so we can have
168    multiple yacc generated parsers in gdb.  Note that these are only
169    the variables produced by yacc.  If other parser generators (bison,
170    byacc, etc) produce additional global names that conflict at link
171    time, then those parser generators need to be fixed instead of
172    adding those names to this list.  */
173
174 #define yymaxdepth      objc_maxdepth
175 #define yyparse         objc_parse
176 #define yylex           objc_lex
177 #define yyerror         objc_error
178 #define yylval          objc_lval
179 #define yychar          objc_char
180 #define yydebug         objc_debug
181 #define yypact          objc_pact       
182 #define yyr1            objc_r1                 
183 #define yyr2            objc_r2                 
184 #define yydef           objc_def                
185 #define yychk           objc_chk                
186 #define yypgo           objc_pgo                
187 #define yyact           objc_act                
188 #define yyexca          objc_exca
189 #define yyerrflag       objc_errflag
190 #define yynerrs         objc_nerrs
191 #define yyps            objc_ps
192 #define yypv            objc_pv
193 #define yys             objc_s
194 #define yy_yys          objc_yys
195 #define yystate         objc_state
196 #define yytmp           objc_tmp
197 #define yyv             objc_v
198 #define yy_yyv          objc_yyv
199 #define yyval           objc_val
200 #define yylloc          objc_lloc
201 #define yyreds          objc_reds               /* With YYDEBUG defined */
202 #define yytoks          objc_toks               /* With YYDEBUG defined */
203 #define yyname          objc_name               /* With YYDEBUG defined */
204 #define yyrule          objc_rule               /* With YYDEBUG defined */
205 #define yylhs           objc_yylhs
206 #define yylen           objc_yylen
207 #define yydefred        objc_yydefred
208 #define yydgoto         objc_yydgoto
209 #define yysindex        objc_yysindex
210 #define yyrindex        objc_yyrindex
211 #define yygindex        objc_yygindex
212 #define yytable         objc_yytable
213 #define yycheck         objc_yycheck
214
215 #ifndef YYDEBUG
216 #define YYDEBUG 0               /* Default to no yydebug support.  */
217 #endif
218
219 int
220 yyparse PARAMS ((void));
221
222 static int
223 yylex PARAMS ((void));
224
225 void
226 yyerror PARAMS ((char *));
227
228
229
230 /* Enabling traces.  */
231 #ifndef YYDEBUG
232 # define YYDEBUG 0
233 #endif
234
235 /* Enabling verbose error messages.  */
236 #ifdef YYERROR_VERBOSE
237 # undef YYERROR_VERBOSE
238 # define YYERROR_VERBOSE 1
239 #else
240 # define YYERROR_VERBOSE 0
241 #endif
242
243 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
244 #line 126 "objc-exp.y"
245 typedef union YYSTYPE {
246     LONGEST lval;
247     struct {
248       LONGEST val;
249       struct type *type;
250     } typed_val_int;
251     struct {
252       DOUBLEST dval;
253       struct type *type;
254     } typed_val_float;
255     struct symbol *sym;
256     struct type *tval;
257     struct stoken sval;
258     struct ttype tsym;
259     struct symtoken ssym;
260     int voidval;
261     struct block *bval;
262     enum exp_opcode opcode;
263     struct internalvar *ivar;
264     struct objc_class_str class;
265
266     struct type **tvec;
267     int *ivec;
268   } YYSTYPE;
269 /* Line 191 of yacc.c.  */
270 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
271 # define YYSTYPE_IS_DECLARED 1
272 # define YYSTYPE_IS_TRIVIAL 1
273 #endif
274
275
276
277 /* Copy the second part of user declarations.  */
278 #line 151 "objc-exp.y"
279
280 /* YYSTYPE gets defined by %union.  */
281 static int
282 parse_number PARAMS ((char *, int, int, YYSTYPE *));
283
284
285 /* Line 214 of yacc.c.  */
286
287 #if ! defined (yyoverflow) || YYERROR_VERBOSE
288
289 /* The parser invokes alloca or xmalloc; define the necessary symbols.  */
290
291 # if YYSTACK_USE_ALLOCA
292 #  define YYSTACK_ALLOC alloca
293 # else
294 #  ifndef YYSTACK_USE_ALLOCA
295 #   if defined (alloca) || defined (_ALLOCA_H)
296 #    define YYSTACK_ALLOC alloca
297 #   else
298 #    ifdef __GNUC__
299 #     define YYSTACK_ALLOC __builtin_alloca
300 #    endif
301 #   endif
302 #  endif
303 # endif
304
305 # ifdef YYSTACK_ALLOC
306    /* Pacify GCC's `empty if-body' warning. */
307 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
308 # else
309 #  if defined (__STDC__) || defined (__cplusplus)
310 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
311 #   define YYSIZE_T size_t
312 #  endif
313 #  define YYSTACK_ALLOC xmalloc
314 #  define YYSTACK_FREE free
315 # endif
316 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
317
318
319 #if (! defined (yyoverflow) \
320      && (! defined (__cplusplus) \
321          || (YYSTYPE_IS_TRIVIAL)))
322
323 /* A type that is properly aligned for any stack member.  */
324 union yyalloc
325 {
326   short yyss;
327   YYSTYPE yyvs;
328   };
329
330 /* The size of the maximum gap between one aligned stack and the next.  */
331 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
332
333 /* The size of an array large to enough to hold all stacks, each with
334    N elements.  */
335 # define YYSTACK_BYTES(N) \
336      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
337       + YYSTACK_GAP_MAXIMUM)
338
339 /* Copy COUNT objects from FROM to TO.  The source and destination do
340    not overlap.  */
341 # ifndef YYCOPY
342 #  if 1 < __GNUC__
343 #   define YYCOPY(To, From, Count) \
344       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
345 #  else
346 #   define YYCOPY(To, From, Count)              \
347       do                                        \
348         {                                       \
349           register YYSIZE_T yyi;                \
350           for (yyi = 0; yyi < (Count); yyi++)   \
351             (To)[yyi] = (From)[yyi];            \
352         }                                       \
353       while (0)
354 #  endif
355 # endif
356
357 /* Relocate STACK from its old location to the new one.  The
358    local variables YYSIZE and YYSTACKSIZE give the old and new number of
359    elements in the stack, and YYPTR gives the new location of the
360    stack.  Advance YYPTR to a properly aligned location for the next
361    stack.  */
362 # define YYSTACK_RELOCATE(Stack)                                        \
363     do                                                                  \
364       {                                                                 \
365         YYSIZE_T yynewbytes;                                            \
366         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
367         Stack = &yyptr->Stack;                                          \
368         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
369         yyptr += yynewbytes / sizeof (*yyptr);                          \
370       }                                                                 \
371     while (0)
372
373 #endif
374
375 #if defined (__STDC__) || defined (__cplusplus)
376    typedef signed char yysigned_char;
377 #else
378    typedef short yysigned_char;
379 #endif
380
381 /* YYFINAL -- State number of the termination state. */
382 #define YYFINAL  89
383 /* YYLAST -- Last index in YYTABLE.  */
384 #define YYLAST   772
385
386 /* YYNTOKENS -- Number of terminals. */
387 #define YYNTOKENS  68
388 /* YYNNTS -- Number of nonterminals. */
389 #define YYNNTS  29
390 /* YYNRULES -- Number of rules. */
391 #define YYNRULES  147
392 /* YYNRULES -- Number of states. */
393 #define YYNSTATES  239
394
395 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
396 #define YYUNDEFTOK  2
397 #define YYMAXUTOK   298
398
399 #define YYTRANSLATE(YYX)                                                \
400   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
401
402 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
403 static const unsigned char yytranslate[] =
404 {
405        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
406        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
407        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
408        2,     2,     2,    61,     2,     2,     2,    52,    38,     2,
409       58,    65,    50,    48,    30,    49,    56,    51,     2,     2,
410        2,     2,     2,     2,     2,     2,     2,     2,    64,     2,
411       41,    32,    42,    33,    47,     2,     2,     2,     2,     2,
412        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
413        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
414        2,    57,     2,    63,    37,     2,     2,     2,     2,     2,
415        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
416        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
417        2,     2,     2,    66,    36,    67,    62,     2,     2,     2,
418        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
419        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
420        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
421        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
422        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
423        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
424        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
425        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
426        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
427        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
428        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
429        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
430        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
431        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
432       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
433       25,    26,    27,    28,    29,    31,    34,    35,    39,    40,
434       43,    44,    45,    46,    53,    54,    55,    59,    60
435 };
436
437 #if YYDEBUG
438 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
439    YYRHS.  */
440 static const unsigned short yyprhs[] =
441 {
442        0,     0,     3,     5,     7,     9,    11,    15,    18,    21,
443       24,    27,    30,    33,    36,    39,    42,    45,    49,    53,
444       58,    62,    66,    71,    76,    77,    83,    84,    90,    91,
445       97,    99,   101,   103,   106,   110,   113,   116,   117,   123,
446      125,   126,   128,   132,   134,   138,   143,   148,   152,   156,
447      160,   164,   168,   172,   176,   180,   184,   188,   192,   196,
448      200,   204,   208,   212,   216,   220,   224,   228,   234,   238,
449      242,   244,   246,   248,   250,   252,   254,   259,   261,   263,
450      265,   269,   273,   277,   282,   284,   287,   289,   291,   294,
451      297,   300,   304,   308,   310,   313,   315,   318,   320,   324,
452      327,   329,   332,   334,   337,   341,   344,   348,   350,   354,
453      356,   358,   360,   362,   364,   367,   371,   374,   378,   382,
454      387,   390,   394,   396,   399,   402,   405,   408,   411,   414,
455      416,   419,   421,   427,   430,   433,   435,   437,   439,   441,
456      443,   447,   449,   451,   453,   455,   457,   459
457 };
458
459 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
460 static const yysigned_char yyrhs[] =
461 {
462       69,     0,    -1,    71,    -1,    70,    -1,    91,    -1,    72,
463       -1,    71,    30,    72,    -1,    50,    72,    -1,    38,    72,
464       -1,    49,    72,    -1,    61,    72,    -1,    62,    72,    -1,
465       54,    72,    -1,    53,    72,    -1,    72,    54,    -1,    72,
466       53,    -1,    16,    72,    -1,    72,    59,    95,    -1,    72,
467       59,    85,    -1,    72,    59,    50,    72,    -1,    72,    56,
468       95,    -1,    72,    56,    85,    -1,    72,    56,    50,    72,
469       -1,    72,    57,    71,    63,    -1,    -1,    57,     9,    73,
470       76,    63,    -1,    -1,    57,    10,    74,    76,    63,    -1,
471       -1,    57,    72,    75,    76,    63,    -1,    95,    -1,    77,
472       -1,    78,    -1,    77,    78,    -1,    95,    64,    72,    -1,
473       64,    72,    -1,    30,    72,    -1,    -1,    72,    58,    79,
474       81,    65,    -1,    66,    -1,    -1,    72,    -1,    81,    30,
475       72,    -1,    67,    -1,    80,    81,    82,    -1,    80,    91,
476       82,    72,    -1,    58,    91,    65,    72,    -1,    58,    71,
477       65,    -1,    72,    47,    72,    -1,    72,    50,    72,    -1,
478       72,    51,    72,    -1,    72,    52,    72,    -1,    72,    48,
479       72,    -1,    72,    49,    72,    -1,    72,    46,    72,    -1,
480       72,    45,    72,    -1,    72,    40,    72,    -1,    72,    39,
481       72,    -1,    72,    44,    72,    -1,    72,    43,    72,    -1,
482       72,    41,    72,    -1,    72,    42,    72,    -1,    72,    38,
483       72,    -1,    72,    37,    72,    -1,    72,    36,    72,    -1,
484       72,    35,    72,    -1,    72,    34,    72,    -1,    72,    33,
485       72,    64,    72,    -1,    72,    32,    72,    -1,    72,    29,
486       72,    -1,     3,    -1,    11,    -1,     4,    -1,    84,    -1,
487       28,    -1,     7,    -1,    16,    58,    91,    65,    -1,     5,
488       -1,     6,    -1,    60,    -1,    83,    18,    95,    -1,    83,
489       18,    95,    -1,    92,    18,    95,    -1,    92,    18,    62,
490       95,    -1,    85,    -1,    18,    95,    -1,    96,    -1,    92,
491       -1,    92,    25,    -1,    92,    26,    -1,    92,    87,    -1,
492       92,    25,    87,    -1,    92,    26,    87,    -1,    50,    -1,
493       50,    87,    -1,    38,    -1,    38,    87,    -1,    88,    -1,
494       58,    87,    65,    -1,    88,    89,    -1,    89,    -1,    88,
495       90,    -1,    90,    -1,    57,    63,    -1,    57,     3,    63,
496       -1,    58,    65,    -1,    58,    94,    65,    -1,    86,    -1,
497       92,    18,    50,    -1,     9,    -1,    10,    -1,    24,    -1,
498       22,    -1,    23,    -1,    22,    24,    -1,    17,    22,    24,
499       -1,    22,    22,    -1,    22,    22,    24,    -1,    17,    22,
500       22,    -1,    17,    22,    22,    24,    -1,    23,    24,    -1,
501       17,    23,    24,    -1,    27,    -1,    22,    27,    -1,    12,
502       95,    -1,    13,    95,    -1,    14,    95,    -1,    15,    95,
503       -1,    17,    93,    -1,    17,    -1,    21,    93,    -1,    21,
504       -1,    19,    95,    41,    91,    42,    -1,    25,    92,    -1,
505       26,    92,    -1,     9,    -1,    24,    -1,    22,    -1,    23,
506       -1,    91,    -1,    94,    30,    91,    -1,     8,    -1,    60,
507       -1,     9,    -1,    10,    -1,    11,    -1,     8,    -1,    60,
508       -1
509 };
510
511 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
512 static const unsigned short yyrline[] =
513 {
514        0,   231,   231,   232,   235,   242,   243,   248,   252,   256,
515      260,   264,   268,   272,   276,   280,   284,   288,   294,   301,
516      305,   312,   320,   324,   333,   332,   354,   353,   369,   368,
517      377,   379,   382,   383,   386,   388,   390,   397,   394,   404,
518      408,   411,   415,   419,   422,   429,   435,   441,   447,   451,
519      455,   459,   463,   467,   471,   475,   479,   483,   487,   491,
520      495,   499,   503,   507,   511,   515,   519,   523,   527,   531,
521      537,   544,   555,   562,   565,   569,   576,   584,   609,   617,
522      634,   645,   661,   674,   699,   700,   734,   793,   799,   800,
523      801,   803,   805,   809,   811,   813,   815,   817,   820,   822,
524      827,   834,   836,   840,   842,   846,   848,   860,   861,   866,
525      868,   876,   878,   880,   882,   884,   886,   888,   890,   892,
526      894,   896,   898,   900,   902,   905,   908,   911,   914,   916,
527      918,   920,   922,   929,   930,   933,   934,   940,   946,   955,
528      960,   967,   968,   969,   970,   971,   974,   975
529 };
530 #endif
531
532 #if YYDEBUG || YYERROR_VERBOSE
533 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
534    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
535 static const char *const yytname[] =
536 {
537   "$end", "error", "$undefined", "INT", "FLOAT", "STRING", "NSSTRING", 
538   "SELECTOR", "NAME", "TYPENAME", "CLASSNAME", "NAME_OR_INT", "STRUCT", 
539   "CLASS", "UNION", "ENUM", "SIZEOF", "UNSIGNED", "COLONCOLON", 
540   "TEMPLATE", "ERROR", "SIGNED_KEYWORD", "LONG", "SHORT", "INT_KEYWORD", 
541   "CONST_KEYWORD", "VOLATILE_KEYWORD", "DOUBLE_KEYWORD", "VARIABLE", 
542   "ASSIGN_MODIFY", "','", "ABOVE_COMMA", "'='", "'?'", "OROR", "ANDAND", 
543   "'|'", "'^'", "'&'", "NOTEQUAL", "EQUAL", "'<'", "'>'", "GEQ", "LEQ", 
544   "RSH", "LSH", "'@'", "'+'", "'-'", "'*'", "'/'", "'%'", "DECREMENT", 
545   "INCREMENT", "UNARY", "'.'", "'['", "'('", "ARROW", "BLOCKNAME", "'!'", 
546   "'~'", "']'", "':'", "')'", "'{'", "'}'", "$accept", "start", 
547   "type_exp", "exp1", "exp", "@1", "@2", "@3", "msglist", "msgarglist", 
548   "msgarg", "@4", "lcurly", "arglist", "rcurly", "block", "variable", 
549   "qualified_name", "ptype", "abs_decl", "direct_abs_decl", "array_mod", 
550   "func_mod", "type", "typebase", "typename", "nonempty_typelist", "name", 
551   "name_not_typename", 0
552 };
553 #endif
554
555 # ifdef YYPRINT
556 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
557    token YYLEX-NUM.  */
558 static const unsigned short yytoknum[] =
559 {
560        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
561      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
562      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
563       44,   285,    61,    63,   286,   287,   124,    94,    38,   288,
564      289,    60,    62,   290,   291,   292,   293,    64,    43,    45,
565       42,    47,    37,   294,   295,   296,    46,    91,    40,   297,
566      298,    33,   126,    93,    58,    41,   123,   125
567 };
568 # endif
569
570 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
571 static const unsigned char yyr1[] =
572 {
573        0,    68,    69,    69,    70,    71,    71,    72,    72,    72,
574       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
575       72,    72,    72,    72,    73,    72,    74,    72,    75,    72,
576       76,    76,    77,    77,    78,    78,    78,    79,    72,    80,
577       81,    81,    81,    82,    72,    72,    72,    72,    72,    72,
578       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
579       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
580       72,    72,    72,    72,    72,    72,    72,    72,    72,    83,
581       83,    84,    85,    85,    84,    84,    84,    86,    86,    86,
582       86,    86,    86,    87,    87,    87,    87,    87,    88,    88,
583       88,    88,    88,    89,    89,    90,    90,    91,    91,    92,
584       92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
585       92,    92,    92,    92,    92,    92,    92,    92,    92,    92,
586       92,    92,    92,    92,    92,    93,    93,    93,    93,    94,
587       94,    95,    95,    95,    95,    95,    96,    96
588 };
589
590 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
591 static const unsigned char yyr2[] =
592 {
593        0,     2,     1,     1,     1,     1,     3,     2,     2,     2,
594        2,     2,     2,     2,     2,     2,     2,     3,     3,     4,
595        3,     3,     4,     4,     0,     5,     0,     5,     0,     5,
596        1,     1,     1,     2,     3,     2,     2,     0,     5,     1,
597        0,     1,     3,     1,     3,     4,     4,     3,     3,     3,
598        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
599        3,     3,     3,     3,     3,     3,     3,     5,     3,     3,
600        1,     1,     1,     1,     1,     1,     4,     1,     1,     1,
601        3,     3,     3,     4,     1,     2,     1,     1,     2,     2,
602        2,     3,     3,     1,     2,     1,     2,     1,     3,     2,
603        1,     2,     1,     2,     3,     2,     3,     1,     3,     1,
604        1,     1,     1,     1,     2,     3,     2,     3,     3,     4,
605        2,     3,     1,     2,     2,     2,     2,     2,     2,     1,
606        2,     1,     5,     2,     2,     1,     1,     1,     1,     1,
607        3,     1,     1,     1,     1,     1,     1,     1
608 };
609
610 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
611    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
612    means the default is an error.  */
613 static const unsigned char yydefact[] =
614 {
615        0,    70,    72,    77,    78,    75,   146,   109,   110,    71,
616        0,     0,     0,     0,     0,   129,     0,     0,   131,   112,
617      113,   111,     0,     0,   122,    74,     0,     0,     0,     0,
618        0,     0,     0,   147,     0,     0,    39,     0,     3,     2,
619        5,    40,     0,    73,    84,   107,     4,    87,    86,   141,
620      143,   144,   145,   142,   124,   125,   126,   127,     0,    16,
621        0,   135,   137,   138,   136,   128,    85,     0,   137,   138,
622      130,   116,   114,   123,   120,   133,   134,     8,     9,     7,
623       13,    12,    24,    26,    28,     0,     0,    10,    11,     1,
624        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
625        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
626        0,     0,     0,    15,    14,     0,     0,    37,     0,    41,
627        0,     0,     0,     0,    88,    89,    95,    93,     0,     0,
628       90,    97,   100,   102,     0,     0,   118,   115,   121,     0,
629      117,     0,     0,     0,    47,     0,     6,    69,    68,     0,
630       66,    65,    64,    63,    62,    57,    56,    60,    61,    59,
631       58,    55,    54,    48,    52,    53,    49,    50,    51,   143,
632      144,     0,    21,    20,     0,    40,     0,    18,    17,     0,
633       43,    44,     0,    81,   108,     0,    82,    91,    92,    96,
634       94,     0,   103,   105,     0,   139,    87,     0,     0,    99,
635      101,    76,   119,     0,     0,     0,     0,    31,    32,    30,
636        0,     0,    46,     0,    22,    23,     0,    19,    42,    45,
637       83,   104,    98,     0,     0,   106,   132,    36,    35,    25,
638       33,     0,     0,    27,    29,    67,    38,   140,    34
639 };
640
641 /* YYDEFGOTO[NTERM-NUM]. */
642 static const short yydefgoto[] =
643 {
644       -1,    37,    38,    85,    40,   141,   142,   143,   206,   207,
645      208,   175,    41,   120,   181,    42,    43,    44,    45,   130,
646      131,   132,   133,   195,    60,    65,   197,   209,    48
647 };
648
649 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
650    STATE-NUM.  */
651 #define YYPACT_NINF -90
652 static const short yypact[] =
653 {
654      223,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
655       19,    19,    19,    19,   287,   195,    19,    19,   234,    82,
656       -9,   -90,   307,   307,   -90,   -90,   223,   223,   223,   223,
657      223,   351,   223,     8,   223,   223,   -90,    39,   -90,    13,
658      542,   223,    32,   -90,   -90,   -90,   -90,   149,   -90,   -90,
659      -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   223,   212,
660       38,   -90,    33,    45,   -90,   -90,   -90,    30,   -90,   -90,
661      -90,    83,   -90,   -90,   -90,   -90,   -90,   212,   212,   212,
662      212,   212,   107,   108,   542,   -20,    66,   212,   212,   -90,
663      223,   223,   223,   223,   223,   223,   223,   223,   223,   223,
664      223,   223,   223,   223,   223,   223,   223,   223,   223,   223,
665      223,   223,   223,   -90,   -90,   436,   223,   -90,   480,   542,
666      -21,    65,    19,   202,    70,    70,    70,    70,    -1,   132,
667      -90,    54,   -90,   -90,    68,    43,   110,   -90,   -90,   307,
668      -90,   113,   113,   113,   -90,   223,   542,   542,   542,   509,
669      567,   591,   614,   636,   657,   676,   676,   691,   691,   691,
670      691,   334,   334,   703,   713,   713,   212,   212,   212,   107,
671      108,   223,   -90,   -90,     4,   223,   223,   -90,   -90,   223,
672      -90,   -90,   223,   118,   -90,    19,   -90,   -90,   -90,   -90,
673      -90,    74,   -90,   -90,    73,   -90,   158,   -17,    51,   -90,
674      -90,   415,   -90,   106,   223,   223,    87,   113,   -90,    88,
675       97,    99,   212,   223,   212,   -90,   -16,   212,   542,   212,
676      -90,   -90,   -90,   114,   307,   -90,   -90,   542,   542,   -90,
677      -90,    88,   223,   -90,   -90,   475,   -90,   -90,   542
678 };
679
680 /* YYPGOTO[NTERM-NUM].  */
681 static const short yypgoto[] =
682 {
683      -90,   -90,   -90,     3,   -10,   -90,   -90,   -90,   -28,   -90,
684      -44,   -90,   -90,    -7,    50,   -90,   -90,   -71,   -90,   -89,
685      -90,    47,    48,     1,     0,   163,   -90,    -5,   -90
686 };
687
688 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
689    positive, shift that token.  If negative, reduce the rule which
690    number is the opposite.  If zero, do what YYDEFACT says.
691    If YYTABLE_NINF, syntax error.  */
692 #define YYTABLE_NINF -111
693 static const short yytable[] =
694 {
695       47,    46,   191,    39,    59,    54,    55,    56,    57,   179,
696       90,    66,    67,   224,   179,    74,    77,    78,    79,    80,
697       81,    84,    75,    76,    87,    88,   -79,    49,    50,    51,
698       52,   119,    47,    86,    90,   187,   188,   189,   190,    89,
699      194,    47,   121,    90,   172,   144,   180,   177,   225,   236,
700      122,    49,    50,    51,    52,   136,   135,   137,    47,   134,
701        7,     8,   192,    10,    11,    12,    13,   215,    15,   138,
702       17,   139,    18,    19,    20,    21,    22,    23,    24,    53,
703      146,   147,   148,   149,   150,   151,   152,   153,   154,   155,
704      156,   157,   158,   159,   160,   161,   162,   163,   164,   165,
705      166,   167,   168,    53,    71,   185,    72,   140,   126,    73,
706      173,   128,   198,   178,   210,   211,   193,   183,   186,   174,
707      127,    49,    50,    51,    52,  -109,  -110,   128,   129,   196,
708      186,   145,   180,   201,   202,   212,   -80,   221,   222,   196,
709      203,     7,     8,   204,    10,    11,    12,    13,   226,    15,
710      229,    17,   232,    18,    19,    20,    21,    22,    23,    24,
711      233,   214,   234,   230,   184,   119,   217,   123,   216,   218,
712      126,   182,   219,    53,   124,   125,   223,   205,   199,   200,
713      220,    70,   127,   124,   125,     0,     0,   126,     0,   128,
714      129,   212,     0,     0,   227,   228,   126,   193,   196,   127,
715        0,     0,   231,   235,    61,     0,   128,   129,   127,     0,
716       49,    50,    51,    52,     0,   128,   129,    62,    63,    64,
717        0,     0,   238,     0,   196,   237,     1,     2,     3,     4,
718        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
719       15,    16,    17,    61,    18,    19,    20,    21,    22,    23,
720       24,    25,   184,     0,     0,     0,    68,    69,    64,     0,
721        0,    26,    53,     0,   185,   113,   114,     0,   115,   116,
722      117,   118,    27,    28,     0,     0,    29,    30,     0,     0,
723       31,    32,     0,    33,    34,    35,     0,     0,     0,    36,
724        1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
725       11,    12,    13,    14,    15,    16,    17,     0,    18,    19,
726       20,    21,    22,    23,    24,    25,     7,     8,     0,    10,
727       11,    12,    13,     0,    15,    26,    17,     0,    18,    19,
728       20,    21,    22,    23,    24,     0,    27,    28,     0,     0,
729       29,    30,     0,     0,    31,    58,     0,    33,    34,    35,
730        0,     0,     0,    36,     1,     2,     3,     4,     5,     6,
731       82,    83,     9,    10,    11,    12,    13,    14,    15,    16,
732       17,     0,    18,    19,    20,    21,    22,    23,    24,    25,
733        0,   107,   108,   109,   110,   111,   112,   113,   114,    26,
734      115,   116,   117,   118,     0,     0,     0,     0,     0,     0,
735       27,    28,     0,     0,    29,    30,     0,     0,    31,    32,
736        0,    33,    34,    35,     0,     0,     0,    36,     1,     2,
737        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
738       13,    14,    15,    16,    17,     0,    18,    19,    20,    21,
739       22,    23,    24,    25,    49,   169,   170,    52,    10,    11,
740       12,    13,     0,    15,     0,    17,     0,    18,    19,    20,
741       21,    22,    23,    24,     0,     0,     0,     0,    29,    30,
742        0,     0,    31,    32,     0,    33,    34,    35,     0,     0,
743        0,    36,     0,     0,     0,     0,   171,     0,    49,   169,
744      170,    52,    10,    11,    12,    13,    53,    15,     0,    17,
745        0,    18,    19,    20,    21,    22,    23,    24,    93,    94,
746       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
747      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
748      176,   115,   116,   117,   118,     0,     0,     0,    91,     0,
749       53,    92,    93,    94,    95,    96,    97,    98,    99,   100,
750      101,   102,   103,   104,   105,   106,   107,   108,   109,   110,
751      111,   112,   113,   114,     0,   115,   116,   117,   118,     0,
752        0,    91,     0,   213,    92,    93,    94,    95,    96,    97,
753       98,    99,   100,   101,   102,   103,   104,   105,   106,   107,
754      108,   109,   110,   111,   112,   113,   114,     0,   115,   116,
755      117,   118,    95,    96,    97,    98,    99,   100,   101,   102,
756      103,   104,   105,   106,   107,   108,   109,   110,   111,   112,
757      113,   114,     0,   115,   116,   117,   118,    96,    97,    98,
758       99,   100,   101,   102,   103,   104,   105,   106,   107,   108,
759      109,   110,   111,   112,   113,   114,     0,   115,   116,   117,
760      118,    97,    98,    99,   100,   101,   102,   103,   104,   105,
761      106,   107,   108,   109,   110,   111,   112,   113,   114,     0,
762      115,   116,   117,   118,    98,    99,   100,   101,   102,   103,
763      104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
764      114,     0,   115,   116,   117,   118,    99,   100,   101,   102,
765      103,   104,   105,   106,   107,   108,   109,   110,   111,   112,
766      113,   114,     0,   115,   116,   117,   118,   101,   102,   103,
767      104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
768      114,     0,   115,   116,   117,   118,   105,   106,   107,   108,
769      109,   110,   111,   112,   113,   114,     0,   115,   116,   117,
770      118,   108,   109,   110,   111,   112,   113,   114,     0,   115,
771      116,   117,   118,   110,   111,   112,   113,   114,     0,   115,
772      116,   117,   118
773 };
774
775 static const short yycheck[] =
776 {
777        0,     0,     3,     0,    14,    10,    11,    12,    13,    30,
778       30,    16,    17,    30,    30,    24,    26,    27,    28,    29,
779       30,    31,    22,    23,    34,    35,    18,     8,     9,    10,
780       11,    41,    32,    32,    30,   124,   125,   126,   127,     0,
781      129,    41,    41,    30,   115,    65,    67,   118,    65,    65,
782       18,     8,     9,    10,    11,    22,    18,    24,    58,    58,
783        9,    10,    63,    12,    13,    14,    15,    63,    17,    24,
784       19,    41,    21,    22,    23,    24,    25,    26,    27,    60,
785       90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
786      100,   101,   102,   103,   104,   105,   106,   107,   108,   109,
787      110,   111,   112,    60,    22,    62,    24,    24,    38,    27,
788      115,    57,    58,   118,   142,   143,    65,   122,   123,   116,
789       50,     8,     9,    10,    11,    18,    18,    57,    58,   129,
790      135,    65,    67,    65,    24,   145,    18,    63,    65,   139,
791      139,     9,    10,    30,    12,    13,    14,    15,    42,    17,
792       63,    19,    64,    21,    22,    23,    24,    25,    26,    27,
793       63,   171,    63,   207,    50,   175,   176,    18,   175,   179,
794       38,   121,   182,    60,    25,    26,    18,    64,   131,   131,
795      185,    18,    50,    25,    26,    -1,    -1,    38,    -1,    57,
796       58,   201,    -1,    -1,   204,   205,    38,    65,   198,    50,
797       -1,    -1,   207,   213,     9,    -1,    57,    58,    50,    -1,
798        8,     9,    10,    11,    -1,    57,    58,    22,    23,    24,
799       -1,    -1,   232,    -1,   224,   224,     3,     4,     5,     6,
800        7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
801       17,    18,    19,     9,    21,    22,    23,    24,    25,    26,
802       27,    28,    50,    -1,    -1,    -1,    22,    23,    24,    -1,
803       -1,    38,    60,    -1,    62,    53,    54,    -1,    56,    57,
804       58,    59,    49,    50,    -1,    -1,    53,    54,    -1,    -1,
805       57,    58,    -1,    60,    61,    62,    -1,    -1,    -1,    66,
806        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
807       13,    14,    15,    16,    17,    18,    19,    -1,    21,    22,
808       23,    24,    25,    26,    27,    28,     9,    10,    -1,    12,
809       13,    14,    15,    -1,    17,    38,    19,    -1,    21,    22,
810       23,    24,    25,    26,    27,    -1,    49,    50,    -1,    -1,
811       53,    54,    -1,    -1,    57,    58,    -1,    60,    61,    62,
812       -1,    -1,    -1,    66,     3,     4,     5,     6,     7,     8,
813        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
814       19,    -1,    21,    22,    23,    24,    25,    26,    27,    28,
815       -1,    47,    48,    49,    50,    51,    52,    53,    54,    38,
816       56,    57,    58,    59,    -1,    -1,    -1,    -1,    -1,    -1,
817       49,    50,    -1,    -1,    53,    54,    -1,    -1,    57,    58,
818       -1,    60,    61,    62,    -1,    -1,    -1,    66,     3,     4,
819        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
820       15,    16,    17,    18,    19,    -1,    21,    22,    23,    24,
821       25,    26,    27,    28,     8,     9,    10,    11,    12,    13,
822       14,    15,    -1,    17,    -1,    19,    -1,    21,    22,    23,
823       24,    25,    26,    27,    -1,    -1,    -1,    -1,    53,    54,
824       -1,    -1,    57,    58,    -1,    60,    61,    62,    -1,    -1,
825       -1,    66,    -1,    -1,    -1,    -1,    50,    -1,     8,     9,
826       10,    11,    12,    13,    14,    15,    60,    17,    -1,    19,
827       -1,    21,    22,    23,    24,    25,    26,    27,    33,    34,
828       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
829       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
830       50,    56,    57,    58,    59,    -1,    -1,    -1,    29,    -1,
831       60,    32,    33,    34,    35,    36,    37,    38,    39,    40,
832       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
833       51,    52,    53,    54,    -1,    56,    57,    58,    59,    -1,
834       -1,    29,    -1,    64,    32,    33,    34,    35,    36,    37,
835       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
836       48,    49,    50,    51,    52,    53,    54,    -1,    56,    57,
837       58,    59,    35,    36,    37,    38,    39,    40,    41,    42,
838       43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
839       53,    54,    -1,    56,    57,    58,    59,    36,    37,    38,
840       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
841       49,    50,    51,    52,    53,    54,    -1,    56,    57,    58,
842       59,    37,    38,    39,    40,    41,    42,    43,    44,    45,
843       46,    47,    48,    49,    50,    51,    52,    53,    54,    -1,
844       56,    57,    58,    59,    38,    39,    40,    41,    42,    43,
845       44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
846       54,    -1,    56,    57,    58,    59,    39,    40,    41,    42,
847       43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
848       53,    54,    -1,    56,    57,    58,    59,    41,    42,    43,
849       44,    45,    46,    47,    48,    49,    50,    51,    52,    53,
850       54,    -1,    56,    57,    58,    59,    45,    46,    47,    48,
851       49,    50,    51,    52,    53,    54,    -1,    56,    57,    58,
852       59,    48,    49,    50,    51,    52,    53,    54,    -1,    56,
853       57,    58,    59,    50,    51,    52,    53,    54,    -1,    56,
854       57,    58,    59
855 };
856
857 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
858    symbol of state STATE-NUM.  */
859 static const unsigned char yystos[] =
860 {
861        0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
862       12,    13,    14,    15,    16,    17,    18,    19,    21,    22,
863       23,    24,    25,    26,    27,    28,    38,    49,    50,    53,
864       54,    57,    58,    60,    61,    62,    66,    69,    70,    71,
865       72,    80,    83,    84,    85,    86,    91,    92,    96,     8,
866        9,    10,    11,    60,    95,    95,    95,    95,    58,    72,
867       92,     9,    22,    23,    24,    93,    95,    95,    22,    23,
868       93,    22,    24,    27,    24,    92,    92,    72,    72,    72,
869       72,    72,     9,    10,    72,    71,    91,    72,    72,     0,
870       30,    29,    32,    33,    34,    35,    36,    37,    38,    39,
871       40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
872       50,    51,    52,    53,    54,    56,    57,    58,    59,    72,
873       81,    91,    18,    18,    25,    26,    38,    50,    57,    58,
874       87,    88,    89,    90,    91,    18,    22,    24,    24,    41,
875       24,    73,    74,    75,    65,    65,    72,    72,    72,    72,
876       72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
877       72,    72,    72,    72,    72,    72,    72,    72,    72,     9,
878       10,    50,    85,    95,    71,    79,    50,    85,    95,    30,
879       67,    82,    82,    95,    50,    62,    95,    87,    87,    87,
880       87,     3,    63,    65,    87,    91,    92,    94,    58,    89,
881       90,    65,    24,    91,    30,    64,    76,    77,    78,    95,
882       76,    76,    72,    64,    72,    63,    81,    72,    72,    72,
883       95,    63,    65,    18,    30,    65,    42,    72,    72,    63,
884       78,    95,    64,    63,    63,    72,    65,    91,    72
885 };
886
887 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
888 # define YYSIZE_T __SIZE_TYPE__
889 #endif
890 #if ! defined (YYSIZE_T) && defined (size_t)
891 # define YYSIZE_T size_t
892 #endif
893 #if ! defined (YYSIZE_T)
894 # if defined (__STDC__) || defined (__cplusplus)
895 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
896 #  define YYSIZE_T size_t
897 # endif
898 #endif
899 #if ! defined (YYSIZE_T)
900 # define YYSIZE_T unsigned int
901 #endif
902
903 #define yyerrok         (yyerrstatus = 0)
904 #define yyclearin       (yychar = YYEMPTY)
905 #define YYEMPTY         (-2)
906 #define YYEOF           0
907
908 #define YYACCEPT        goto yyacceptlab
909 #define YYABORT         goto yyabortlab
910 #define YYERROR         goto yyerrlab1
911
912 /* Like YYERROR except do call yyerror.  This remains here temporarily
913    to ease the transition to the new meaning of YYERROR, for GCC.
914    Once GCC version 2 has supplanted version 1, this can go.  */
915
916 #define YYFAIL          goto yyerrlab
917
918 #define YYRECOVERING()  (!!yyerrstatus)
919
920 #define YYBACKUP(Token, Value)                                  \
921 do                                                              \
922   if (yychar == YYEMPTY && yylen == 1)                          \
923     {                                                           \
924       yychar = (Token);                                         \
925       yylval = (Value);                                         \
926       yytoken = YYTRANSLATE (yychar);                           \
927       YYPOPSTACK;                                               \
928       goto yybackup;                                            \
929     }                                                           \
930   else                                                          \
931     {                                                           \
932       yyerror ("syntax error: cannot back up");\
933       YYERROR;                                                  \
934     }                                                           \
935 while (0)
936
937 #define YYTERROR        1
938 #define YYERRCODE       256
939
940 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
941    are run).  */
942
943 #ifndef YYLLOC_DEFAULT
944 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
945   Current.first_line   = Rhs[1].first_line;      \
946   Current.first_column = Rhs[1].first_column;    \
947   Current.last_line    = Rhs[N].last_line;       \
948   Current.last_column  = Rhs[N].last_column;
949 #endif
950
951 /* YYLEX -- calling `yylex' with the right arguments.  */
952
953 #ifdef YYLEX_PARAM
954 # define YYLEX yylex (YYLEX_PARAM)
955 #else
956 # define YYLEX yylex ()
957 #endif
958
959 /* Enable debugging if requested.  */
960 #if YYDEBUG
961
962 # ifndef YYFPRINTF
963 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
964 #  define YYFPRINTF fprintf
965 # endif
966
967 # define YYDPRINTF(Args)                        \
968 do {                                            \
969   if (yydebug)                                  \
970     YYFPRINTF Args;                             \
971 } while (0)
972
973 # define YYDSYMPRINT(Args)                      \
974 do {                                            \
975   if (yydebug)                                  \
976     yysymprint Args;                            \
977 } while (0)
978
979 # define YYDSYMPRINTF(Title, Token, Value, Location)            \
980 do {                                                            \
981   if (yydebug)                                                  \
982     {                                                           \
983       YYFPRINTF (stderr, "%s ", Title);                         \
984       yysymprint (stderr,                                       \
985                   Token, Value);        \
986       YYFPRINTF (stderr, "\n");                                 \
987     }                                                           \
988 } while (0)
989
990 /*------------------------------------------------------------------.
991 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
992 | TOP (cinluded).                                                   |
993 `------------------------------------------------------------------*/
994
995 #if defined (__STDC__) || defined (__cplusplus)
996 static void
997 yy_stack_print (short *bottom, short *top)
998 #else
999 static void
1000 yy_stack_print (bottom, top)
1001     short *bottom;
1002     short *top;
1003 #endif
1004 {
1005   YYFPRINTF (stderr, "Stack now");
1006   for (/* Nothing. */; bottom <= top; ++bottom)
1007     YYFPRINTF (stderr, " %d", *bottom);
1008   YYFPRINTF (stderr, "\n");
1009 }
1010
1011 # define YY_STACK_PRINT(Bottom, Top)                            \
1012 do {                                                            \
1013   if (yydebug)                                                  \
1014     yy_stack_print ((Bottom), (Top));                           \
1015 } while (0)
1016
1017
1018 /*------------------------------------------------.
1019 | Report that the YYRULE is going to be reduced.  |
1020 `------------------------------------------------*/
1021
1022 #if defined (__STDC__) || defined (__cplusplus)
1023 static void
1024 yy_reduce_print (int yyrule)
1025 #else
1026 static void
1027 yy_reduce_print (yyrule)
1028     int yyrule;
1029 #endif
1030 {
1031   int yyi;
1032   unsigned int yylineno = yyrline[yyrule];
1033   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1034              yyrule - 1, yylineno);
1035   /* Print the symbols being reduced, and their result.  */
1036   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1037     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1038   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1039 }
1040
1041 # define YY_REDUCE_PRINT(Rule)          \
1042 do {                                    \
1043   if (yydebug)                          \
1044     yy_reduce_print (Rule);             \
1045 } while (0)
1046
1047 /* Nonzero means print parse trace.  It is left uninitialized so that
1048    multiple parsers can coexist.  */
1049 int yydebug;
1050 #else /* !YYDEBUG */
1051 # define YYDPRINTF(Args)
1052 # define YYDSYMPRINT(Args)
1053 # define YYDSYMPRINTF(Title, Token, Value, Location)
1054 # define YY_STACK_PRINT(Bottom, Top)
1055 # define YY_REDUCE_PRINT(Rule)
1056 #endif /* !YYDEBUG */
1057
1058
1059 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1060 #ifndef YYINITDEPTH
1061 # define YYINITDEPTH 200
1062 #endif
1063
1064 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1065    if the built-in stack extension method is used).
1066
1067    Do not make this value too large; the results are undefined if
1068    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1069    evaluated with infinite-precision integer arithmetic.  */
1070
1071 #if YYMAXDEPTH == 0
1072 # undef YYMAXDEPTH
1073 #endif
1074
1075 #ifndef YYMAXDEPTH
1076 # define YYMAXDEPTH 10000
1077 #endif
1078
1079 \f
1080
1081 #if YYERROR_VERBOSE
1082
1083 # ifndef yystrlen
1084 #  if defined (__GLIBC__) && defined (_STRING_H)
1085 #   define yystrlen strlen
1086 #  else
1087 /* Return the length of YYSTR.  */
1088 static YYSIZE_T
1089 #   if defined (__STDC__) || defined (__cplusplus)
1090 yystrlen (const char *yystr)
1091 #   else
1092 yystrlen (yystr)
1093      const char *yystr;
1094 #   endif
1095 {
1096   register const char *yys = yystr;
1097
1098   while (*yys++ != '\0')
1099     continue;
1100
1101   return yys - yystr - 1;
1102 }
1103 #  endif
1104 # endif
1105
1106 # ifndef yystpcpy
1107 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1108 #   define yystpcpy stpcpy
1109 #  else
1110 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1111    YYDEST.  */
1112 static char *
1113 #   if defined (__STDC__) || defined (__cplusplus)
1114 yystpcpy (char *yydest, const char *yysrc)
1115 #   else
1116 yystpcpy (yydest, yysrc)
1117      char *yydest;
1118      const char *yysrc;
1119 #   endif
1120 {
1121   register char *yyd = yydest;
1122   register const char *yys = yysrc;
1123
1124   while ((*yyd++ = *yys++) != '\0')
1125     continue;
1126
1127   return yyd - 1;
1128 }
1129 #  endif
1130 # endif
1131
1132 #endif /* !YYERROR_VERBOSE */
1133
1134 \f
1135
1136 #if YYDEBUG
1137 /*--------------------------------.
1138 | Print this symbol on YYOUTPUT.  |
1139 `--------------------------------*/
1140
1141 #if defined (__STDC__) || defined (__cplusplus)
1142 static void
1143 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1144 #else
1145 static void
1146 yysymprint (yyoutput, yytype, yyvaluep)
1147     FILE *yyoutput;
1148     int yytype;
1149     YYSTYPE *yyvaluep;
1150 #endif
1151 {
1152   /* Pacify ``unused variable'' warnings.  */
1153   (void) yyvaluep;
1154
1155   if (yytype < YYNTOKENS)
1156     {
1157       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1158 # ifdef YYPRINT
1159       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1160 # endif
1161     }
1162   else
1163     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1164
1165   switch (yytype)
1166     {
1167       default:
1168         break;
1169     }
1170   YYFPRINTF (yyoutput, ")");
1171 }
1172
1173 #endif /* ! YYDEBUG */
1174 /*-----------------------------------------------.
1175 | Release the memory associated to this symbol.  |
1176 `-----------------------------------------------*/
1177
1178 #if defined (__STDC__) || defined (__cplusplus)
1179 static void
1180 yydestruct (int yytype, YYSTYPE *yyvaluep)
1181 #else
1182 static void
1183 yydestruct (yytype, yyvaluep)
1184     int yytype;
1185     YYSTYPE *yyvaluep;
1186 #endif
1187 {
1188   /* Pacify ``unused variable'' warnings.  */
1189   (void) yyvaluep;
1190
1191   switch (yytype)
1192     {
1193
1194       default:
1195         break;
1196     }
1197 }
1198 \f
1199
1200 /* Prevent warnings from -Wmissing-prototypes.  */
1201
1202 #ifdef YYPARSE_PARAM
1203 # if defined (__STDC__) || defined (__cplusplus)
1204 int yyparse (void *YYPARSE_PARAM);
1205 # else
1206 int yyparse ();
1207 # endif
1208 #else /* ! YYPARSE_PARAM */
1209 #if defined (__STDC__) || defined (__cplusplus)
1210 int yyparse (void);
1211 #else
1212 int yyparse ();
1213 #endif
1214 #endif /* ! YYPARSE_PARAM */
1215
1216
1217
1218 /* The lookahead symbol.  */
1219 int yychar;
1220
1221 /* The semantic value of the lookahead symbol.  */
1222 YYSTYPE yylval;
1223
1224 /* Number of syntax errors so far.  */
1225 int yynerrs;
1226
1227
1228
1229 /*----------.
1230 | yyparse.  |
1231 `----------*/
1232
1233 #ifdef YYPARSE_PARAM
1234 # if defined (__STDC__) || defined (__cplusplus)
1235 int yyparse (void *YYPARSE_PARAM)
1236 # else
1237 int yyparse (YYPARSE_PARAM)
1238   void *YYPARSE_PARAM;
1239 # endif
1240 #else /* ! YYPARSE_PARAM */
1241 #if defined (__STDC__) || defined (__cplusplus)
1242 int
1243 yyparse (void)
1244 #else
1245 int
1246 yyparse ()
1247
1248 #endif
1249 #endif
1250 {
1251   
1252   register int yystate;
1253   register int yyn;
1254   int yyresult;
1255   /* Number of tokens to shift before error messages enabled.  */
1256   int yyerrstatus;
1257   /* Lookahead token as an internal (translated) token number.  */
1258   int yytoken = 0;
1259
1260   /* Three stacks and their tools:
1261      `yyss': related to states,
1262      `yyvs': related to semantic values,
1263      `yyls': related to locations.
1264
1265      Refer to the stacks thru separate pointers, to allow yyoverflow
1266      to xreallocate them elsewhere.  */
1267
1268   /* The state stack.  */
1269   short yyssa[YYINITDEPTH];
1270   short *yyss = yyssa;
1271   register short *yyssp;
1272
1273   /* The semantic value stack.  */
1274   YYSTYPE yyvsa[YYINITDEPTH];
1275   YYSTYPE *yyvs = yyvsa;
1276   register YYSTYPE *yyvsp;
1277
1278
1279
1280 #define YYPOPSTACK   (yyvsp--, yyssp--)
1281
1282   YYSIZE_T yystacksize = YYINITDEPTH;
1283
1284   /* The variables used to return semantic value and location from the
1285      action routines.  */
1286   YYSTYPE yyval;
1287
1288
1289   /* When reducing, the number of symbols on the RHS of the reduced
1290      rule.  */
1291   int yylen;
1292
1293   YYDPRINTF ((stderr, "Starting parse\n"));
1294
1295   yystate = 0;
1296   yyerrstatus = 0;
1297   yynerrs = 0;
1298   yychar = YYEMPTY;             /* Cause a token to be read.  */
1299
1300   /* Initialize stack pointers.
1301      Waste one element of value and location stack
1302      so that they stay on the same level as the state stack.
1303      The wasted elements are never initialized.  */
1304
1305   yyssp = yyss;
1306   yyvsp = yyvs;
1307
1308   goto yysetstate;
1309
1310 /*------------------------------------------------------------.
1311 | yynewstate -- Push a new state, which is found in yystate.  |
1312 `------------------------------------------------------------*/
1313  yynewstate:
1314   /* In all cases, when you get here, the value and location stacks
1315      have just been pushed. so pushing a state here evens the stacks.
1316      */
1317   yyssp++;
1318
1319  yysetstate:
1320   *yyssp = yystate;
1321
1322   if (yyss + yystacksize - 1 <= yyssp)
1323     {
1324       /* Get the current used size of the three stacks, in elements.  */
1325       YYSIZE_T yysize = yyssp - yyss + 1;
1326
1327 #ifdef yyoverflow
1328       {
1329         /* Give user a chance to xreallocate the stack. Use copies of
1330            these so that the &'s don't force the real ones into
1331            memory.  */
1332         YYSTYPE *yyvs1 = yyvs;
1333         short *yyss1 = yyss;
1334
1335
1336         /* Each stack pointer address is followed by the size of the
1337            data in use in that stack, in bytes.  This used to be a
1338            conditional around just the two extra args, but that might
1339            be undefined if yyoverflow is a macro.  */
1340         yyoverflow ("parser stack overflow",
1341                     &yyss1, yysize * sizeof (*yyssp),
1342                     &yyvs1, yysize * sizeof (*yyvsp),
1343
1344                     &yystacksize);
1345
1346         yyss = yyss1;
1347         yyvs = yyvs1;
1348       }
1349 #else /* no yyoverflow */
1350 # ifndef YYSTACK_RELOCATE
1351       goto yyoverflowlab;
1352 # else
1353       /* Extend the stack our own way.  */
1354       if (YYMAXDEPTH <= yystacksize)
1355         goto yyoverflowlab;
1356       yystacksize *= 2;
1357       if (YYMAXDEPTH < yystacksize)
1358         yystacksize = YYMAXDEPTH;
1359
1360       {
1361         short *yyss1 = yyss;
1362         union yyalloc *yyptr =
1363           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1364         if (! yyptr)
1365           goto yyoverflowlab;
1366         YYSTACK_RELOCATE (yyss);
1367         YYSTACK_RELOCATE (yyvs);
1368
1369 #  undef YYSTACK_RELOCATE
1370         if (yyss1 != yyssa)
1371           YYSTACK_FREE (yyss1);
1372       }
1373 # endif
1374 #endif /* no yyoverflow */
1375
1376       yyssp = yyss + yysize - 1;
1377       yyvsp = yyvs + yysize - 1;
1378
1379
1380       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1381                   (unsigned long int) yystacksize));
1382
1383       if (yyss + yystacksize - 1 <= yyssp)
1384         YYABORT;
1385     }
1386
1387   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1388
1389   goto yybackup;
1390
1391 /*-----------.
1392 | yybackup.  |
1393 `-----------*/
1394 yybackup:
1395
1396 /* Do appropriate processing given the current state.  */
1397 /* Read a lookahead token if we need one and don't already have one.  */
1398 /* yyresume: */
1399
1400   /* First try to decide what to do without reference to lookahead token.  */
1401
1402   yyn = yypact[yystate];
1403   if (yyn == YYPACT_NINF)
1404     goto yydefault;
1405
1406   /* Not known => get a lookahead token if don't already have one.  */
1407
1408   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1409   if (yychar == YYEMPTY)
1410     {
1411       YYDPRINTF ((stderr, "Reading a token: "));
1412       yychar = YYLEX;
1413     }
1414
1415   if (yychar <= YYEOF)
1416     {
1417       yychar = yytoken = YYEOF;
1418       YYDPRINTF ((stderr, "Now at end of input.\n"));
1419     }
1420   else
1421     {
1422       yytoken = YYTRANSLATE (yychar);
1423       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1424     }
1425
1426   /* If the proper action on seeing token YYTOKEN is to reduce or to
1427      detect an error, take that action.  */
1428   yyn += yytoken;
1429   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1430     goto yydefault;
1431   yyn = yytable[yyn];
1432   if (yyn <= 0)
1433     {
1434       if (yyn == 0 || yyn == YYTABLE_NINF)
1435         goto yyerrlab;
1436       yyn = -yyn;
1437       goto yyreduce;
1438     }
1439
1440   if (yyn == YYFINAL)
1441     YYACCEPT;
1442
1443   /* Shift the lookahead token.  */
1444   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1445
1446   /* Discard the token being shifted unless it is eof.  */
1447   if (yychar != YYEOF)
1448     yychar = YYEMPTY;
1449
1450   *++yyvsp = yylval;
1451
1452
1453   /* Count tokens shifted since error; after three, turn off error
1454      status.  */
1455   if (yyerrstatus)
1456     yyerrstatus--;
1457
1458   yystate = yyn;
1459   goto yynewstate;
1460
1461
1462 /*-----------------------------------------------------------.
1463 | yydefault -- do the default action for the current state.  |
1464 `-----------------------------------------------------------*/
1465 yydefault:
1466   yyn = yydefact[yystate];
1467   if (yyn == 0)
1468     goto yyerrlab;
1469   goto yyreduce;
1470
1471
1472 /*-----------------------------.
1473 | yyreduce -- Do a reduction.  |
1474 `-----------------------------*/
1475 yyreduce:
1476   /* yyn is the number of a rule to reduce with.  */
1477   yylen = yyr2[yyn];
1478
1479   /* If YYLEN is nonzero, implement the default value of the action:
1480      `$$ = $1'.
1481
1482      Otherwise, the following line sets YYVAL to garbage.
1483      This behavior is undocumented and Bison
1484      users should not rely upon it.  Assigning to YYVAL
1485      unconditionally makes the parser a bit smaller, and it avoids a
1486      GCC warning that YYVAL may be used uninitialized.  */
1487   yyval = yyvsp[1-yylen];
1488
1489
1490   YY_REDUCE_PRINT (yyn);
1491   switch (yyn)
1492     {
1493         case 4:
1494 #line 236 "objc-exp.y"
1495     { write_exp_elt_opcode(OP_TYPE);
1496                           write_exp_elt_type(yyvsp[0].tval);
1497                           write_exp_elt_opcode(OP_TYPE);}
1498     break;
1499
1500   case 6:
1501 #line 244 "objc-exp.y"
1502     { write_exp_elt_opcode (BINOP_COMMA); }
1503     break;
1504
1505   case 7:
1506 #line 249 "objc-exp.y"
1507     { write_exp_elt_opcode (UNOP_IND); }
1508     break;
1509
1510   case 8:
1511 #line 253 "objc-exp.y"
1512     { write_exp_elt_opcode (UNOP_ADDR); }
1513     break;
1514
1515   case 9:
1516 #line 257 "objc-exp.y"
1517     { write_exp_elt_opcode (UNOP_NEG); }
1518     break;
1519
1520   case 10:
1521 #line 261 "objc-exp.y"
1522     { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1523     break;
1524
1525   case 11:
1526 #line 265 "objc-exp.y"
1527     { write_exp_elt_opcode (UNOP_COMPLEMENT); }
1528     break;
1529
1530   case 12:
1531 #line 269 "objc-exp.y"
1532     { write_exp_elt_opcode (UNOP_PREINCREMENT); }
1533     break;
1534
1535   case 13:
1536 #line 273 "objc-exp.y"
1537     { write_exp_elt_opcode (UNOP_PREDECREMENT); }
1538     break;
1539
1540   case 14:
1541 #line 277 "objc-exp.y"
1542     { write_exp_elt_opcode (UNOP_POSTINCREMENT); }
1543     break;
1544
1545   case 15:
1546 #line 281 "objc-exp.y"
1547     { write_exp_elt_opcode (UNOP_POSTDECREMENT); }
1548     break;
1549
1550   case 16:
1551 #line 285 "objc-exp.y"
1552     { write_exp_elt_opcode (UNOP_SIZEOF); }
1553     break;
1554
1555   case 17:
1556 #line 289 "objc-exp.y"
1557     { write_exp_elt_opcode (STRUCTOP_PTR);
1558                           write_exp_string (yyvsp[0].sval);
1559                           write_exp_elt_opcode (STRUCTOP_PTR); }
1560     break;
1561
1562   case 18:
1563 #line 295 "objc-exp.y"
1564     { /* exp->type::name becomes exp->*(&type::name) */
1565                           /* Note: this doesn't work if name is a
1566                              static member!  FIXME */
1567                           write_exp_elt_opcode (UNOP_ADDR);
1568                           write_exp_elt_opcode (STRUCTOP_MPTR); }
1569     break;
1570
1571   case 19:
1572 #line 302 "objc-exp.y"
1573     { write_exp_elt_opcode (STRUCTOP_MPTR); }
1574     break;
1575
1576   case 20:
1577 #line 306 "objc-exp.y"
1578     { write_exp_elt_opcode (STRUCTOP_STRUCT);
1579                           write_exp_string (yyvsp[0].sval);
1580                           write_exp_elt_opcode (STRUCTOP_STRUCT); }
1581     break;
1582
1583   case 21:
1584 #line 313 "objc-exp.y"
1585     { /* exp.type::name becomes exp.*(&type::name) */
1586                           /* Note: this doesn't work if name is a
1587                              static member!  FIXME */
1588                           write_exp_elt_opcode (UNOP_ADDR);
1589                           write_exp_elt_opcode (STRUCTOP_MEMBER); }
1590     break;
1591
1592   case 22:
1593 #line 321 "objc-exp.y"
1594     { write_exp_elt_opcode (STRUCTOP_MEMBER); }
1595     break;
1596
1597   case 23:
1598 #line 325 "objc-exp.y"
1599     { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
1600     break;
1601
1602   case 24:
1603 #line 333 "objc-exp.y"
1604     {
1605                           CORE_ADDR class;
1606
1607                           class = lookup_objc_class (copy_name (yyvsp[0].tsym.stoken));
1608                           if (class == 0)
1609                             error ("%s is not an ObjC Class", 
1610                                    copy_name (yyvsp[0].tsym.stoken));
1611                           write_exp_elt_opcode (OP_LONG);
1612                           write_exp_elt_type (builtin_type_int);
1613                           write_exp_elt_longcst ((LONGEST) class);
1614                           write_exp_elt_opcode (OP_LONG);
1615                           start_msglist();
1616                         }
1617     break;
1618
1619   case 25:
1620 #line 347 "objc-exp.y"
1621     { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1622                           end_msglist();
1623                           write_exp_elt_opcode (OP_OBJC_MSGCALL); 
1624                         }
1625     break;
1626
1627   case 26:
1628 #line 354 "objc-exp.y"
1629     {
1630                           write_exp_elt_opcode (OP_LONG);
1631                           write_exp_elt_type (builtin_type_int);
1632                           write_exp_elt_longcst ((LONGEST) yyvsp[0].class.class);
1633                           write_exp_elt_opcode (OP_LONG);
1634                           start_msglist();
1635                         }
1636     break;
1637
1638   case 27:
1639 #line 362 "objc-exp.y"
1640     { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1641                           end_msglist();
1642                           write_exp_elt_opcode (OP_OBJC_MSGCALL); 
1643                         }
1644     break;
1645
1646   case 28:
1647 #line 369 "objc-exp.y"
1648     { start_msglist(); }
1649     break;
1650
1651   case 29:
1652 #line 371 "objc-exp.y"
1653     { write_exp_elt_opcode (OP_OBJC_MSGCALL);
1654                           end_msglist();
1655                           write_exp_elt_opcode (OP_OBJC_MSGCALL); 
1656                         }
1657     break;
1658
1659   case 30:
1660 #line 378 "objc-exp.y"
1661     { add_msglist(&yyvsp[0].sval, 0); }
1662     break;
1663
1664   case 34:
1665 #line 387 "objc-exp.y"
1666     { add_msglist(&yyvsp[-2].sval, 1); }
1667     break;
1668
1669   case 35:
1670 #line 389 "objc-exp.y"
1671     { add_msglist(0, 1);   }
1672     break;
1673
1674   case 36:
1675 #line 391 "objc-exp.y"
1676     { add_msglist(0, 0);   }
1677     break;
1678
1679   case 37:
1680 #line 397 "objc-exp.y"
1681     { start_arglist (); }
1682     break;
1683
1684   case 38:
1685 #line 399 "objc-exp.y"
1686     { write_exp_elt_opcode (OP_FUNCALL);
1687                           write_exp_elt_longcst ((LONGEST) end_arglist ());
1688                           write_exp_elt_opcode (OP_FUNCALL); }
1689     break;
1690
1691   case 39:
1692 #line 405 "objc-exp.y"
1693     { start_arglist (); }
1694     break;
1695
1696   case 41:
1697 #line 412 "objc-exp.y"
1698     { arglist_len = 1; }
1699     break;
1700
1701   case 42:
1702 #line 416 "objc-exp.y"
1703     { arglist_len++; }
1704     break;
1705
1706   case 43:
1707 #line 420 "objc-exp.y"
1708     { yyval.lval = end_arglist () - 1; }
1709     break;
1710
1711   case 44:
1712 #line 423 "objc-exp.y"
1713     { write_exp_elt_opcode (OP_ARRAY);
1714                           write_exp_elt_longcst ((LONGEST) 0);
1715                           write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1716                           write_exp_elt_opcode (OP_ARRAY); }
1717     break;
1718
1719   case 45:
1720 #line 430 "objc-exp.y"
1721     { write_exp_elt_opcode (UNOP_MEMVAL);
1722                           write_exp_elt_type (yyvsp[-2].tval);
1723                           write_exp_elt_opcode (UNOP_MEMVAL); }
1724     break;
1725
1726   case 46:
1727 #line 436 "objc-exp.y"
1728     { write_exp_elt_opcode (UNOP_CAST);
1729                           write_exp_elt_type (yyvsp[-2].tval);
1730                           write_exp_elt_opcode (UNOP_CAST); }
1731     break;
1732
1733   case 47:
1734 #line 442 "objc-exp.y"
1735     { }
1736     break;
1737
1738   case 48:
1739 #line 448 "objc-exp.y"
1740     { write_exp_elt_opcode (BINOP_REPEAT); }
1741     break;
1742
1743   case 49:
1744 #line 452 "objc-exp.y"
1745     { write_exp_elt_opcode (BINOP_MUL); }
1746     break;
1747
1748   case 50:
1749 #line 456 "objc-exp.y"
1750     { write_exp_elt_opcode (BINOP_DIV); }
1751     break;
1752
1753   case 51:
1754 #line 460 "objc-exp.y"
1755     { write_exp_elt_opcode (BINOP_REM); }
1756     break;
1757
1758   case 52:
1759 #line 464 "objc-exp.y"
1760     { write_exp_elt_opcode (BINOP_ADD); }
1761     break;
1762
1763   case 53:
1764 #line 468 "objc-exp.y"
1765     { write_exp_elt_opcode (BINOP_SUB); }
1766     break;
1767
1768   case 54:
1769 #line 472 "objc-exp.y"
1770     { write_exp_elt_opcode (BINOP_LSH); }
1771     break;
1772
1773   case 55:
1774 #line 476 "objc-exp.y"
1775     { write_exp_elt_opcode (BINOP_RSH); }
1776     break;
1777
1778   case 56:
1779 #line 480 "objc-exp.y"
1780     { write_exp_elt_opcode (BINOP_EQUAL); }
1781     break;
1782
1783   case 57:
1784 #line 484 "objc-exp.y"
1785     { write_exp_elt_opcode (BINOP_NOTEQUAL); }
1786     break;
1787
1788   case 58:
1789 #line 488 "objc-exp.y"
1790     { write_exp_elt_opcode (BINOP_LEQ); }
1791     break;
1792
1793   case 59:
1794 #line 492 "objc-exp.y"
1795     { write_exp_elt_opcode (BINOP_GEQ); }
1796     break;
1797
1798   case 60:
1799 #line 496 "objc-exp.y"
1800     { write_exp_elt_opcode (BINOP_LESS); }
1801     break;
1802
1803   case 61:
1804 #line 500 "objc-exp.y"
1805     { write_exp_elt_opcode (BINOP_GTR); }
1806     break;
1807
1808   case 62:
1809 #line 504 "objc-exp.y"
1810     { write_exp_elt_opcode (BINOP_BITWISE_AND); }
1811     break;
1812
1813   case 63:
1814 #line 508 "objc-exp.y"
1815     { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1816     break;
1817
1818   case 64:
1819 #line 512 "objc-exp.y"
1820     { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1821     break;
1822
1823   case 65:
1824 #line 516 "objc-exp.y"
1825     { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
1826     break;
1827
1828   case 66:
1829 #line 520 "objc-exp.y"
1830     { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
1831     break;
1832
1833   case 67:
1834 #line 524 "objc-exp.y"
1835     { write_exp_elt_opcode (TERNOP_COND); }
1836     break;
1837
1838   case 68:
1839 #line 528 "objc-exp.y"
1840     { write_exp_elt_opcode (BINOP_ASSIGN); }
1841     break;
1842
1843   case 69:
1844 #line 532 "objc-exp.y"
1845     { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
1846                           write_exp_elt_opcode (yyvsp[-1].opcode);
1847                           write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); }
1848     break;
1849
1850   case 70:
1851 #line 538 "objc-exp.y"
1852     { write_exp_elt_opcode (OP_LONG);
1853                           write_exp_elt_type (yyvsp[0].typed_val_int.type);
1854                           write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val));
1855                           write_exp_elt_opcode (OP_LONG); }
1856     break;
1857
1858   case 71:
1859 #line 545 "objc-exp.y"
1860     { YYSTYPE val;
1861                           parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
1862                           write_exp_elt_opcode (OP_LONG);
1863                           write_exp_elt_type (val.typed_val_int.type);
1864                           write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
1865                           write_exp_elt_opcode (OP_LONG);
1866                         }
1867     break;
1868
1869   case 72:
1870 #line 556 "objc-exp.y"
1871     { write_exp_elt_opcode (OP_DOUBLE);
1872                           write_exp_elt_type (yyvsp[0].typed_val_float.type);
1873                           write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1874                           write_exp_elt_opcode (OP_DOUBLE); }
1875     break;
1876
1877   case 75:
1878 #line 570 "objc-exp.y"
1879     {
1880                           write_exp_elt_opcode (OP_OBJC_SELECTOR);
1881                           write_exp_string (yyvsp[0].sval);
1882                           write_exp_elt_opcode (OP_OBJC_SELECTOR); }
1883     break;
1884
1885   case 76:
1886 #line 577 "objc-exp.y"
1887     { write_exp_elt_opcode (OP_LONG);
1888                           write_exp_elt_type (builtin_type_int);
1889                           CHECK_TYPEDEF (yyvsp[-1].tval);
1890                           write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1891                           write_exp_elt_opcode (OP_LONG); }
1892     break;
1893
1894   case 77:
1895 #line 585 "objc-exp.y"
1896     { /* C strings are converted into array
1897                              constants with an explicit null byte
1898                              added at the end.  Thus the array upper
1899                              bound is the string length.  There is no
1900                              such thing in C as a completely empty
1901                              string.  */
1902                           char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
1903                           while (count-- > 0)
1904                             {
1905                               write_exp_elt_opcode (OP_LONG);
1906                               write_exp_elt_type (builtin_type_char);
1907                               write_exp_elt_longcst ((LONGEST)(*sp++));
1908                               write_exp_elt_opcode (OP_LONG);
1909                             }
1910                           write_exp_elt_opcode (OP_LONG);
1911                           write_exp_elt_type (builtin_type_char);
1912                           write_exp_elt_longcst ((LONGEST)'\0');
1913                           write_exp_elt_opcode (OP_LONG);
1914                           write_exp_elt_opcode (OP_ARRAY);
1915                           write_exp_elt_longcst ((LONGEST) 0);
1916                           write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1917                           write_exp_elt_opcode (OP_ARRAY); }
1918     break;
1919
1920   case 78:
1921 #line 612 "objc-exp.y"
1922     { write_exp_elt_opcode (OP_OBJC_NSSTRING);
1923                           write_exp_string (yyvsp[0].sval);
1924                           write_exp_elt_opcode (OP_OBJC_NSSTRING); }
1925     break;
1926
1927   case 79:
1928 #line 618 "objc-exp.y"
1929     {
1930                           if (yyvsp[0].ssym.sym != 0)
1931                               yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
1932                           else
1933                             {
1934                               struct symtab *tem =
1935                                   lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
1936                               if (tem)
1937                                 yyval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
1938                               else
1939                                 error ("No file or function \"%s\".",
1940                                        copy_name (yyvsp[0].ssym.stoken));
1941                             }
1942                         }
1943     break;
1944
1945   case 80:
1946 #line 635 "objc-exp.y"
1947     { struct symbol *tem
1948                             = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1949                                              VAR_DOMAIN, (int *) NULL,
1950                                              (struct symtab **) NULL);
1951                           if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1952                             error ("No function \"%s\" in specified context.",
1953                                    copy_name (yyvsp[0].sval));
1954                           yyval.bval = SYMBOL_BLOCK_VALUE (tem); }
1955     break;
1956
1957   case 81:
1958 #line 646 "objc-exp.y"
1959     { struct symbol *sym;
1960                           sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1961                                                VAR_DOMAIN, (int *) NULL,
1962                                                (struct symtab **) NULL);
1963                           if (sym == 0)
1964                             error ("No symbol \"%s\" in specified context.",
1965                                    copy_name (yyvsp[0].sval));
1966
1967                           write_exp_elt_opcode (OP_VAR_VALUE);
1968                           /* block_found is set by lookup_symbol.  */
1969                           write_exp_elt_block (block_found);
1970                           write_exp_elt_sym (sym);
1971                           write_exp_elt_opcode (OP_VAR_VALUE); }
1972     break;
1973
1974   case 82:
1975 #line 662 "objc-exp.y"
1976     {
1977                           struct type *type = yyvsp[-2].tval;
1978                           if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1979                               && TYPE_CODE (type) != TYPE_CODE_UNION)
1980                             error ("`%s' is not defined as an aggregate type.",
1981                                    TYPE_NAME (type));
1982
1983                           write_exp_elt_opcode (OP_SCOPE);
1984                           write_exp_elt_type (type);
1985                           write_exp_string (yyvsp[0].sval);
1986                           write_exp_elt_opcode (OP_SCOPE);
1987                         }
1988     break;
1989
1990   case 83:
1991 #line 675 "objc-exp.y"
1992     {
1993                           struct type *type = yyvsp[-3].tval;
1994                           struct stoken tmp_token;
1995                           if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1996                               && TYPE_CODE (type) != TYPE_CODE_UNION)
1997                             error ("`%s' is not defined as an aggregate type.",
1998                                    TYPE_NAME (type));
1999
2000                           if (!DEPRECATED_STREQ (type_name_no_tag (type), yyvsp[0].sval.ptr))
2001                             error ("invalid destructor `%s::~%s'",
2002                                    type_name_no_tag (type), yyvsp[0].sval.ptr);
2003
2004                           tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2);
2005                           tmp_token.length = yyvsp[0].sval.length + 1;
2006                           tmp_token.ptr[0] = '~';
2007                           memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length);
2008                           tmp_token.ptr[tmp_token.length] = 0;
2009                           write_exp_elt_opcode (OP_SCOPE);
2010                           write_exp_elt_type (type);
2011                           write_exp_string (tmp_token);
2012                           write_exp_elt_opcode (OP_SCOPE);
2013                         }
2014     break;
2015
2016   case 85:
2017 #line 701 "objc-exp.y"
2018     {
2019                           char *name = copy_name (yyvsp[0].sval);
2020                           struct symbol *sym;
2021                           struct minimal_symbol *msymbol;
2022
2023                           sym =
2024                             lookup_symbol (name, (const struct block *) NULL,
2025                                            VAR_DOMAIN, (int *) NULL,
2026                                            (struct symtab **) NULL);
2027                           if (sym)
2028                             {
2029                               write_exp_elt_opcode (OP_VAR_VALUE);
2030                               write_exp_elt_block (NULL);
2031                               write_exp_elt_sym (sym);
2032                               write_exp_elt_opcode (OP_VAR_VALUE);
2033                               break;
2034                             }
2035
2036                           msymbol = lookup_minimal_symbol (name, NULL, NULL);
2037                           if (msymbol != NULL)
2038                             {
2039                               write_exp_msymbol (msymbol,
2040                                                  lookup_function_type (builtin_type_int),
2041                                                  builtin_type_int);
2042                             }
2043                           else
2044                             if (!have_full_symbols () && !have_partial_symbols ())
2045                               error ("No symbol table is loaded.  Use the \"file\" command.");
2046                             else
2047                               error ("No symbol \"%s\" in current context.", name);
2048                         }
2049     break;
2050
2051   case 86:
2052 #line 735 "objc-exp.y"
2053     { struct symbol *sym = yyvsp[0].ssym.sym;
2054
2055                           if (sym)
2056                             {
2057                               if (symbol_read_needs_frame (sym))
2058                                 {
2059                                   if (innermost_block == 0 ||
2060                                       contained_in (block_found, 
2061                                                     innermost_block))
2062                                     innermost_block = block_found;
2063                                 }
2064
2065                               write_exp_elt_opcode (OP_VAR_VALUE);
2066                               /* We want to use the selected frame, not
2067                                  another more inner frame which happens to
2068                                  be in the same block.  */
2069                               write_exp_elt_block (NULL);
2070                               write_exp_elt_sym (sym);
2071                               write_exp_elt_opcode (OP_VAR_VALUE);
2072                             }
2073                           else if (yyvsp[0].ssym.is_a_field_of_this)
2074                             {
2075                               /* C++/ObjC: it hangs off of `this'/'self'.  
2076                                  Must not inadvertently convert from a 
2077                                  method call to data ref.  */
2078                               if (innermost_block == 0 || 
2079                                   contained_in (block_found, innermost_block))
2080                                 innermost_block = block_found;
2081                               write_exp_elt_opcode (OP_OBJC_SELF);
2082                               write_exp_elt_opcode (OP_OBJC_SELF);
2083                               write_exp_elt_opcode (STRUCTOP_PTR);
2084                               write_exp_string (yyvsp[0].ssym.stoken);
2085                               write_exp_elt_opcode (STRUCTOP_PTR);
2086                             }
2087                           else
2088                             {
2089                               struct minimal_symbol *msymbol;
2090                               char *arg = copy_name (yyvsp[0].ssym.stoken);
2091
2092                               msymbol =
2093                                 lookup_minimal_symbol (arg, NULL, NULL);
2094                               if (msymbol != NULL)
2095                                 {
2096                                   write_exp_msymbol (msymbol,
2097                                                      lookup_function_type (builtin_type_int),
2098                                                      builtin_type_int);
2099                                 }
2100                               else if (!have_full_symbols () && 
2101                                        !have_partial_symbols ())
2102                                 error ("No symbol table is loaded.  Use the \"file\" command.");
2103                               else
2104                                 error ("No symbol \"%s\" in current context.",
2105                                        copy_name (yyvsp[0].ssym.stoken));
2106                             }
2107                         }
2108     break;
2109
2110   case 90:
2111 #line 802 "objc-exp.y"
2112     { yyval.tval = follow_types (yyvsp[-1].tval); }
2113     break;
2114
2115   case 91:
2116 #line 804 "objc-exp.y"
2117     { yyval.tval = follow_types (yyvsp[-2].tval); }
2118     break;
2119
2120   case 92:
2121 #line 806 "objc-exp.y"
2122     { yyval.tval = follow_types (yyvsp[-2].tval); }
2123     break;
2124
2125   case 93:
2126 #line 810 "objc-exp.y"
2127     { push_type (tp_pointer); yyval.voidval = 0; }
2128     break;
2129
2130   case 94:
2131 #line 812 "objc-exp.y"
2132     { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; }
2133     break;
2134
2135   case 95:
2136 #line 814 "objc-exp.y"
2137     { push_type (tp_reference); yyval.voidval = 0; }
2138     break;
2139
2140   case 96:
2141 #line 816 "objc-exp.y"
2142     { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; }
2143     break;
2144
2145   case 98:
2146 #line 821 "objc-exp.y"
2147     { yyval.voidval = yyvsp[-1].voidval; }
2148     break;
2149
2150   case 99:
2151 #line 823 "objc-exp.y"
2152     {
2153                           push_type_int (yyvsp[0].lval);
2154                           push_type (tp_array);
2155                         }
2156     break;
2157
2158   case 100:
2159 #line 828 "objc-exp.y"
2160     {
2161                           push_type_int (yyvsp[0].lval);
2162                           push_type (tp_array);
2163                           yyval.voidval = 0;
2164                         }
2165     break;
2166
2167   case 101:
2168 #line 835 "objc-exp.y"
2169     { push_type (tp_function); }
2170     break;
2171
2172   case 102:
2173 #line 837 "objc-exp.y"
2174     { push_type (tp_function); }
2175     break;
2176
2177   case 103:
2178 #line 841 "objc-exp.y"
2179     { yyval.lval = -1; }
2180     break;
2181
2182   case 104:
2183 #line 843 "objc-exp.y"
2184     { yyval.lval = yyvsp[-1].typed_val_int.val; }
2185     break;
2186
2187   case 105:
2188 #line 847 "objc-exp.y"
2189     { yyval.voidval = 0; }
2190     break;
2191
2192   case 106:
2193 #line 849 "objc-exp.y"
2194     { free (yyvsp[-1].tvec); yyval.voidval = 0; }
2195     break;
2196
2197   case 108:
2198 #line 862 "objc-exp.y"
2199     { yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); }
2200     break;
2201
2202   case 109:
2203 #line 867 "objc-exp.y"
2204     { yyval.tval = yyvsp[0].tsym.type; }
2205     break;
2206
2207   case 110:
2208 #line 869 "objc-exp.y"
2209     {
2210                           if (yyvsp[0].class.type == NULL)
2211                             error ("No symbol \"%s\" in current context.", 
2212                                    copy_name(yyvsp[0].class.stoken));
2213                           else
2214                             yyval.tval = yyvsp[0].class.type;
2215                         }
2216     break;
2217
2218   case 111:
2219 #line 877 "objc-exp.y"
2220     { yyval.tval = builtin_type_int; }
2221     break;
2222
2223   case 112:
2224 #line 879 "objc-exp.y"
2225     { yyval.tval = builtin_type_long; }
2226     break;
2227
2228   case 113:
2229 #line 881 "objc-exp.y"
2230     { yyval.tval = builtin_type_short; }
2231     break;
2232
2233   case 114:
2234 #line 883 "objc-exp.y"
2235     { yyval.tval = builtin_type_long; }
2236     break;
2237
2238   case 115:
2239 #line 885 "objc-exp.y"
2240     { yyval.tval = builtin_type_unsigned_long; }
2241     break;
2242
2243   case 116:
2244 #line 887 "objc-exp.y"
2245     { yyval.tval = builtin_type_long_long; }
2246     break;
2247
2248   case 117:
2249 #line 889 "objc-exp.y"
2250     { yyval.tval = builtin_type_long_long; }
2251     break;
2252
2253   case 118:
2254 #line 891 "objc-exp.y"
2255     { yyval.tval = builtin_type_unsigned_long_long; }
2256     break;
2257
2258   case 119:
2259 #line 893 "objc-exp.y"
2260     { yyval.tval = builtin_type_unsigned_long_long; }
2261     break;
2262
2263   case 120:
2264 #line 895 "objc-exp.y"
2265     { yyval.tval = builtin_type_short; }
2266     break;
2267
2268   case 121:
2269 #line 897 "objc-exp.y"
2270     { yyval.tval = builtin_type_unsigned_short; }
2271     break;
2272
2273   case 122:
2274 #line 899 "objc-exp.y"
2275     { yyval.tval = builtin_type_double; }
2276     break;
2277
2278   case 123:
2279 #line 901 "objc-exp.y"
2280     { yyval.tval = builtin_type_long_double; }
2281     break;
2282
2283   case 124:
2284 #line 903 "objc-exp.y"
2285     { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2286                                               expression_context_block); }
2287     break;
2288
2289   case 125:
2290 #line 906 "objc-exp.y"
2291     { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
2292                                               expression_context_block); }
2293     break;
2294
2295   case 126:
2296 #line 909 "objc-exp.y"
2297     { yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
2298                                              expression_context_block); }
2299     break;
2300
2301   case 127:
2302 #line 912 "objc-exp.y"
2303     { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
2304                                             expression_context_block); }
2305     break;
2306
2307   case 128:
2308 #line 915 "objc-exp.y"
2309     { yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); }
2310     break;
2311
2312   case 129:
2313 #line 917 "objc-exp.y"
2314     { yyval.tval = builtin_type_unsigned_int; }
2315     break;
2316
2317   case 130:
2318 #line 919 "objc-exp.y"
2319     { yyval.tval = lookup_signed_typename (TYPE_NAME(yyvsp[0].tsym.type)); }
2320     break;
2321
2322   case 131:
2323 #line 921 "objc-exp.y"
2324     { yyval.tval = builtin_type_int; }
2325     break;
2326
2327   case 132:
2328 #line 923 "objc-exp.y"
2329     { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval,
2330                                                     expression_context_block);
2331                         }
2332     break;
2333
2334   case 133:
2335 #line 929 "objc-exp.y"
2336     { yyval.tval = yyvsp[0].tval; }
2337     break;
2338
2339   case 134:
2340 #line 930 "objc-exp.y"
2341     { yyval.tval = yyvsp[0].tval; }
2342     break;
2343
2344   case 136:
2345 #line 935 "objc-exp.y"
2346     {
2347                   yyval.tsym.stoken.ptr = "int";
2348                   yyval.tsym.stoken.length = 3;
2349                   yyval.tsym.type = builtin_type_int;
2350                 }
2351     break;
2352
2353   case 137:
2354 #line 941 "objc-exp.y"
2355     {
2356                   yyval.tsym.stoken.ptr = "long";
2357                   yyval.tsym.stoken.length = 4;
2358                   yyval.tsym.type = builtin_type_long;
2359                 }
2360     break;
2361
2362   case 138:
2363 #line 947 "objc-exp.y"
2364     {
2365                   yyval.tsym.stoken.ptr = "short";
2366                   yyval.tsym.stoken.length = 5;
2367                   yyval.tsym.type = builtin_type_short;
2368                 }
2369     break;
2370
2371   case 139:
2372 #line 956 "objc-exp.y"
2373     { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2);
2374                   yyval.ivec[0] = 1;    /* Number of types in vector.  */
2375                   yyval.tvec[1] = yyvsp[0].tval;
2376                 }
2377     break;
2378
2379   case 140:
2380 #line 961 "objc-exp.y"
2381     { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1);
2382                   yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len);
2383                   yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
2384                 }
2385     break;
2386
2387   case 141:
2388 #line 967 "objc-exp.y"
2389     { yyval.sval = yyvsp[0].ssym.stoken; }
2390     break;
2391
2392   case 142:
2393 #line 968 "objc-exp.y"
2394     { yyval.sval = yyvsp[0].ssym.stoken; }
2395     break;
2396
2397   case 143:
2398 #line 969 "objc-exp.y"
2399     { yyval.sval = yyvsp[0].tsym.stoken; }
2400     break;
2401
2402   case 144:
2403 #line 970 "objc-exp.y"
2404     { yyval.sval = yyvsp[0].class.stoken; }
2405     break;
2406
2407   case 145:
2408 #line 971 "objc-exp.y"
2409     { yyval.sval = yyvsp[0].ssym.stoken; }
2410     break;
2411
2412
2413     }
2414
2415 /* Line 991 of yacc.c.  */
2416 \f
2417   yyvsp -= yylen;
2418   yyssp -= yylen;
2419
2420
2421   YY_STACK_PRINT (yyss, yyssp);
2422
2423   *++yyvsp = yyval;
2424
2425
2426   /* Now `shift' the result of the reduction.  Determine what state
2427      that goes to, based on the state we popped back to and the rule
2428      number reduced by.  */
2429
2430   yyn = yyr1[yyn];
2431
2432   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2433   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2434     yystate = yytable[yystate];
2435   else
2436     yystate = yydefgoto[yyn - YYNTOKENS];
2437
2438   goto yynewstate;
2439
2440
2441 /*------------------------------------.
2442 | yyerrlab -- here on detecting error |
2443 `------------------------------------*/
2444 yyerrlab:
2445   /* If not already recovering from an error, report this error.  */
2446   if (!yyerrstatus)
2447     {
2448       ++yynerrs;
2449 #if YYERROR_VERBOSE
2450       yyn = yypact[yystate];
2451
2452       if (YYPACT_NINF < yyn && yyn < YYLAST)
2453         {
2454           YYSIZE_T yysize = 0;
2455           int yytype = YYTRANSLATE (yychar);
2456           char *yymsg;
2457           int yyx, yycount;
2458
2459           yycount = 0;
2460           /* Start YYX at -YYN if negative to avoid negative indexes in
2461              YYCHECK.  */
2462           for (yyx = yyn < 0 ? -yyn : 0;
2463                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
2464             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2465               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
2466           yysize += yystrlen ("syntax error, unexpected ") + 1;
2467           yysize += yystrlen (yytname[yytype]);
2468           yymsg = (char *) YYSTACK_ALLOC (yysize);
2469           if (yymsg != 0)
2470             {
2471               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2472               yyp = yystpcpy (yyp, yytname[yytype]);
2473
2474               if (yycount < 5)
2475                 {
2476                   yycount = 0;
2477                   for (yyx = yyn < 0 ? -yyn : 0;
2478                        yyx < (int) (sizeof (yytname) / sizeof (char *));
2479                        yyx++)
2480                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2481                       {
2482                         const char *yyq = ! yycount ? ", expecting " : " or ";
2483                         yyp = yystpcpy (yyp, yyq);
2484                         yyp = yystpcpy (yyp, yytname[yyx]);
2485                         yycount++;
2486                       }
2487                 }
2488               yyerror (yymsg);
2489               YYSTACK_FREE (yymsg);
2490             }
2491           else
2492             yyerror ("syntax error; also virtual memory exhausted");
2493         }
2494       else
2495 #endif /* YYERROR_VERBOSE */
2496         yyerror ("syntax error");
2497     }
2498
2499
2500
2501   if (yyerrstatus == 3)
2502     {
2503       /* If just tried and failed to reuse lookahead token after an
2504          error, discard it.  */
2505
2506       /* Return failure if at end of input.  */
2507       if (yychar == YYEOF)
2508         {
2509           /* Pop the error token.  */
2510           YYPOPSTACK;
2511           /* Pop the rest of the stack.  */
2512           while (yyss < yyssp)
2513             {
2514               YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2515               yydestruct (yystos[*yyssp], yyvsp);
2516               YYPOPSTACK;
2517             }
2518           YYABORT;
2519         }
2520
2521       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2522       yydestruct (yytoken, &yylval);
2523       yychar = YYEMPTY;
2524
2525     }
2526
2527   /* Else will try to reuse lookahead token after shifting the error
2528      token.  */
2529   goto yyerrlab2;
2530
2531
2532 /*----------------------------------------------------.
2533 | yyerrlab1 -- error raised explicitly by an action.  |
2534 `----------------------------------------------------*/
2535 yyerrlab1:
2536
2537   /* Suppress GCC warning that yyerrlab1 is unused when no action
2538      invokes YYERROR.  MacOS 10.2.3's buggy "smart preprocessor"
2539      insists on the trailing semicolon.  */
2540 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
2541   __attribute__ ((__unused__));
2542 #endif
2543
2544
2545   goto yyerrlab2;
2546
2547
2548 /*---------------------------------------------------------------.
2549 | yyerrlab2 -- pop states until the error token can be shifted.  |
2550 `---------------------------------------------------------------*/
2551 yyerrlab2:
2552   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2553
2554   for (;;)
2555     {
2556       yyn = yypact[yystate];
2557       if (yyn != YYPACT_NINF)
2558         {
2559           yyn += YYTERROR;
2560           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2561             {
2562               yyn = yytable[yyn];
2563               if (0 < yyn)
2564                 break;
2565             }
2566         }
2567
2568       /* Pop the current state because it cannot handle the error token.  */
2569       if (yyssp == yyss)
2570         YYABORT;
2571
2572       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2573       yydestruct (yystos[yystate], yyvsp);
2574       yyvsp--;
2575       yystate = *--yyssp;
2576
2577       YY_STACK_PRINT (yyss, yyssp);
2578     }
2579
2580   if (yyn == YYFINAL)
2581     YYACCEPT;
2582
2583   YYDPRINTF ((stderr, "Shifting error token, "));
2584
2585   *++yyvsp = yylval;
2586
2587
2588   yystate = yyn;
2589   goto yynewstate;
2590
2591
2592 /*-------------------------------------.
2593 | yyacceptlab -- YYACCEPT comes here.  |
2594 `-------------------------------------*/
2595 yyacceptlab:
2596   yyresult = 0;
2597   goto yyreturn;
2598
2599 /*-----------------------------------.
2600 | yyabortlab -- YYABORT comes here.  |
2601 `-----------------------------------*/
2602 yyabortlab:
2603   yyresult = 1;
2604   goto yyreturn;
2605
2606 #ifndef yyoverflow
2607 /*----------------------------------------------.
2608 | yyoverflowlab -- parser overflow comes here.  |
2609 `----------------------------------------------*/
2610 yyoverflowlab:
2611   yyerror ("parser stack overflow");
2612   yyresult = 2;
2613   /* Fall through.  */
2614 #endif
2615
2616 yyreturn:
2617 #ifndef yyoverflow
2618   if (yyss != yyssa)
2619     YYSTACK_FREE (yyss);
2620 #endif
2621   return yyresult;
2622 }
2623
2624
2625 #line 985 "objc-exp.y"
2626
2627
2628 /* Take care of parsing a number (anything that starts with a digit).
2629    Set yylval and return the token type; update lexptr.  LEN is the
2630    number of characters in it.  */
2631
2632 /*** Needs some error checking for the float case.  ***/
2633
2634 static int
2635 parse_number (p, len, parsed_float, putithere)
2636      char *p;
2637      int len;
2638      int parsed_float;
2639      YYSTYPE *putithere;
2640 {
2641   /* FIXME: Shouldn't these be unsigned?  We don't deal with negative
2642      values here, and we do kind of silly things like cast to
2643      unsigned.  */
2644   LONGEST n = 0;
2645   LONGEST prevn = 0;
2646   unsigned LONGEST un;
2647
2648   int i = 0;
2649   int c;
2650   int base = input_radix;
2651   int unsigned_p = 0;
2652
2653   /* Number of "L" suffixes encountered.  */
2654   int long_p = 0;
2655
2656   /* We have found a "L" or "U" suffix.  */
2657   int found_suffix = 0;
2658
2659   unsigned LONGEST high_bit;
2660   struct type *signed_type;
2661   struct type *unsigned_type;
2662
2663   if (parsed_float)
2664     {
2665       char c;
2666
2667       /* It's a float since it contains a point or an exponent.  */
2668
2669       if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
2670         sscanf (p, "%g", (float *)&putithere->typed_val_float.dval);
2671       else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
2672         sscanf (p, "%lg", (double *)&putithere->typed_val_float.dval);
2673       else
2674         {
2675 #ifdef PRINTF_HAS_LONG_DOUBLE
2676           sscanf (p, "%Lg", &putithere->typed_val_float.dval);
2677 #else
2678           /* Scan it into a double, then assign it to the long double.
2679              This at least wins with values representable in the range
2680              of doubles.  */
2681           double temp;
2682           sscanf (p, "%lg", &temp);
2683           putithere->typed_val_float.dval = temp;
2684 #endif
2685         }
2686
2687       /* See if it has `f' or `l' suffix (float or long double).  */
2688
2689       c = tolower (p[len - 1]);
2690
2691       if (c == 'f')
2692         putithere->typed_val_float.type = builtin_type_float;
2693       else if (c == 'l')
2694         putithere->typed_val_float.type = builtin_type_long_double;
2695       else if (isdigit (c) || c == '.')
2696         putithere->typed_val_float.type = builtin_type_double;
2697       else
2698         return ERROR;
2699
2700       return FLOAT;
2701     }
2702
2703   /* Handle base-switching prefixes 0x, 0t, 0d, and 0.  */
2704   if (p[0] == '0')
2705     switch (p[1])
2706       {
2707       case 'x':
2708       case 'X':
2709         if (len >= 3)
2710           {
2711             p += 2;
2712             base = 16;
2713             len -= 2;
2714           }
2715         break;
2716
2717       case 't':
2718       case 'T':
2719       case 'd':
2720       case 'D':
2721         if (len >= 3)
2722           {
2723             p += 2;
2724             base = 10;
2725             len -= 2;
2726           }
2727         break;
2728
2729       default:
2730         base = 8;
2731         break;
2732       }
2733
2734   while (len-- > 0)
2735     {
2736       c = *p++;
2737       if (c >= 'A' && c <= 'Z')
2738         c += 'a' - 'A';
2739       if (c != 'l' && c != 'u')
2740         n *= base;
2741       if (c >= '0' && c <= '9')
2742         {
2743           if (found_suffix)
2744             return ERROR;
2745           n += i = c - '0';
2746         }
2747       else
2748         {
2749           if (base > 10 && c >= 'a' && c <= 'f')
2750             {
2751               if (found_suffix)
2752                 return ERROR;
2753               n += i = c - 'a' + 10;
2754             }
2755           else if (c == 'l')
2756             {
2757               ++long_p;
2758               found_suffix = 1;
2759             }
2760           else if (c == 'u')
2761             {
2762               unsigned_p = 1;
2763               found_suffix = 1;
2764             }
2765           else
2766             return ERROR;       /* Char not a digit.  */
2767         }
2768       if (i >= base)
2769         return ERROR;           /* Invalid digit in this base.  */
2770
2771       /* Portably test for overflow (only works for nonzero values, so
2772          make a second check for zero).  FIXME: Can't we just make n
2773          and prevn unsigned and avoid this?  */
2774       if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
2775         unsigned_p = 1;         /* Try something unsigned.  */
2776
2777       /* Portably test for unsigned overflow.
2778          FIXME: This check is wrong; for example it doesn't find 
2779          overflow on 0x123456789 when LONGEST is 32 bits.  */
2780       if (c != 'l' && c != 'u' && n != 0)
2781         {       
2782           if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n))
2783             error ("Numeric constant too large.");
2784         }
2785       prevn = n;
2786     }
2787
2788   /* An integer constant is an int, a long, or a long long.  An L
2789      suffix forces it to be long; an LL suffix forces it to be long
2790      long.  If not forced to a larger size, it gets the first type of
2791      the above that it fits in.  To figure out whether it fits, we
2792      shift it right and see whether anything remains.  Note that we
2793      can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2794      operation, because many compilers will warn about such a shift
2795      (which always produces a zero result).  Sometimes TARGET_INT_BIT
2796      or TARGET_LONG_BIT will be that big, sometimes not.  To deal with
2797      the case where it is we just always shift the value more than
2798      once, with fewer bits each time.  */
2799
2800   un = (unsigned LONGEST)n >> 2;
2801   if (long_p == 0
2802       && (un >> (TARGET_INT_BIT - 2)) == 0)
2803     {
2804       high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1);
2805
2806       /* A large decimal (not hex or octal) constant (between INT_MAX
2807          and UINT_MAX) is a long or unsigned long, according to ANSI,
2808          never an unsigned int, but this code treats it as unsigned
2809          int.  This probably should be fixed.  GCC gives a warning on
2810          such constants.  */
2811
2812       unsigned_type = builtin_type_unsigned_int;
2813       signed_type = builtin_type_int;
2814     }
2815   else if (long_p <= 1
2816            && (un >> (TARGET_LONG_BIT - 2)) == 0)
2817     {
2818       high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
2819       unsigned_type = builtin_type_unsigned_long;
2820       signed_type = builtin_type_long;
2821     }
2822   else
2823     {
2824       high_bit = (((unsigned LONGEST)1)
2825                   << (TARGET_LONG_LONG_BIT - 32 - 1)
2826                   << 16
2827                   << 16);
2828       if (high_bit == 0)
2829         /* A long long does not fit in a LONGEST.  */
2830         high_bit =
2831           (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
2832       unsigned_type = builtin_type_unsigned_long_long;
2833       signed_type = builtin_type_long_long;
2834     }
2835
2836    putithere->typed_val_int.val = n;
2837
2838    /* If the high bit of the worked out type is set then this number
2839       has to be unsigned.  */
2840
2841    if (unsigned_p || (n & high_bit)) 
2842      {
2843        putithere->typed_val_int.type = unsigned_type;
2844      }
2845    else 
2846      {
2847        putithere->typed_val_int.type = signed_type;
2848      }
2849
2850    return INT;
2851 }
2852
2853 struct token
2854 {
2855   char *operator;
2856   int token;
2857   enum exp_opcode opcode;
2858 };
2859
2860 static const struct token tokentab3[] =
2861   {
2862     {">>=", ASSIGN_MODIFY, BINOP_RSH},
2863     {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2864   };
2865
2866 static const struct token tokentab2[] =
2867   {
2868     {"+=", ASSIGN_MODIFY, BINOP_ADD},
2869     {"-=", ASSIGN_MODIFY, BINOP_SUB},
2870     {"*=", ASSIGN_MODIFY, BINOP_MUL},
2871     {"/=", ASSIGN_MODIFY, BINOP_DIV},
2872     {"%=", ASSIGN_MODIFY, BINOP_REM},
2873     {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2874     {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2875     {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2876     {"++", INCREMENT, BINOP_END},
2877     {"--", DECREMENT, BINOP_END},
2878     {"->", ARROW, BINOP_END},
2879     {"&&", ANDAND, BINOP_END},
2880     {"||", OROR, BINOP_END},
2881     {"::", COLONCOLON, BINOP_END},
2882     {"<<", LSH, BINOP_END},
2883     {">>", RSH, BINOP_END},
2884     {"==", EQUAL, BINOP_END},
2885     {"!=", NOTEQUAL, BINOP_END},
2886     {"<=", LEQ, BINOP_END},
2887     {">=", GEQ, BINOP_END}
2888   };
2889
2890 /* Read one token, getting characters through lexptr.  */
2891
2892 static int
2893 yylex ()
2894 {
2895   int c, tokchr;
2896   int namelen;
2897   unsigned int i;
2898   char *tokstart;
2899   char *tokptr;
2900   int tempbufindex;
2901   static char *tempbuf;
2902   static int tempbufsize;
2903   
2904  retry:
2905
2906   tokstart = lexptr;
2907   /* See if it is a special token of length 3.  */
2908   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2909     if (DEPRECATED_STREQN (tokstart, tokentab3[i].operator, 3))
2910       {
2911         lexptr += 3;
2912         yylval.opcode = tokentab3[i].opcode;
2913         return tokentab3[i].token;
2914       }
2915
2916   /* See if it is a special token of length 2.  */
2917   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2918     if (DEPRECATED_STREQN (tokstart, tokentab2[i].operator, 2))
2919       {
2920         lexptr += 2;
2921         yylval.opcode = tokentab2[i].opcode;
2922         return tokentab2[i].token;
2923       }
2924
2925   c = 0;
2926   switch (tokchr = *tokstart)
2927     {
2928     case 0:
2929       return 0;
2930
2931     case ' ':
2932     case '\t':
2933     case '\n':
2934       lexptr++;
2935       goto retry;
2936
2937     case '\'':
2938       /* We either have a character constant ('0' or '\177' for
2939          example) or we have a quoted symbol reference ('foo(int,int)'
2940          in C++ for example).  */
2941       lexptr++;
2942       c = *lexptr++;
2943       if (c == '\\')
2944         c = parse_escape (&lexptr);
2945       else if (c == '\'')
2946         error ("Empty character constant.");
2947
2948       yylval.typed_val_int.val = c;
2949       yylval.typed_val_int.type = builtin_type_char;
2950
2951       c = *lexptr++;
2952       if (c != '\'')
2953         {
2954           namelen = skip_quoted (tokstart) - tokstart;
2955           if (namelen > 2)
2956             {
2957               lexptr = tokstart + namelen;
2958               if (lexptr[-1] != '\'')
2959                 error ("Unmatched single quote.");
2960               namelen -= 2;
2961               tokstart++;
2962               goto tryname;
2963             }
2964           error ("Invalid character constant.");
2965         }
2966       return INT;
2967
2968     case '(':
2969       paren_depth++;
2970       lexptr++;
2971       return '(';
2972
2973     case ')':
2974       if (paren_depth == 0)
2975         return 0;
2976       paren_depth--;
2977       lexptr++;
2978       return ')';
2979
2980     case ',':
2981       if (comma_terminates && paren_depth == 0)
2982         return 0;
2983       lexptr++;
2984       return ',';
2985
2986     case '.':
2987       /* Might be a floating point number.  */
2988       if (lexptr[1] < '0' || lexptr[1] > '9')
2989         goto symbol;            /* Nope, must be a symbol.  */
2990       /* FALL THRU into number case.  */
2991
2992     case '0':
2993     case '1':
2994     case '2':
2995     case '3':
2996     case '4':
2997     case '5':
2998     case '6':
2999     case '7':
3000     case '8':
3001     case '9':
3002       {
3003         /* It's a number.  */
3004         int got_dot = 0, got_e = 0, toktype = FLOAT;
3005         /* Initialize toktype to anything other than ERROR.  */
3006         char *p = tokstart;
3007         int hex = input_radix > 10;
3008         int local_radix = input_radix;
3009         if (tokchr == '0' && (p[1] == 'x' || p[1] == 'X'))
3010           {
3011             p += 2;
3012             hex = 1;
3013             local_radix = 16;
3014           }
3015         else if (tokchr == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
3016           {
3017             p += 2;
3018             hex = 0;
3019             local_radix = 10;
3020           }
3021
3022         for (;; ++p)
3023           {
3024             /* This test includes !hex because 'e' is a valid hex digit
3025                and thus does not indicate a floating point number when
3026                the radix is hex.  */
3027
3028             if (!hex && (*p == 'e' || *p == 'E'))
3029               if (got_e)
3030                 toktype = ERROR;        /* Only one 'e' in a float.  */
3031               else
3032                 got_e = 1;
3033             /* This test does not include !hex, because a '.' always
3034                indicates a decimal floating point number regardless of
3035                the radix.  */
3036             else if (*p == '.')
3037               if (got_dot)
3038                 toktype = ERROR;        /* Only one '.' in a float.  */
3039               else
3040                 got_dot = 1;
3041             else if (got_e && (p[-1] == 'e' || p[-1] == 'E') &&
3042                     (*p == '-' || *p == '+'))
3043               /* This is the sign of the exponent, not the end of the
3044                  number.  */
3045               continue;
3046             /* Always take decimal digits; parse_number handles radix
3047                error.  */
3048             else if (*p >= '0' && *p <= '9')
3049               continue;
3050             /* We will take letters only if hex is true, and only up
3051                to what the input radix would permit.  FSF was content
3052                to rely on parse_number to validate; but it leaks.  */
3053             else if (*p >= 'a' && *p <= 'z') 
3054               {
3055                 if (!hex || *p >= ('a' + local_radix - 10))
3056                   toktype = ERROR;
3057               }
3058             else if (*p >= 'A' && *p <= 'Z') 
3059               {
3060                 if (!hex || *p >= ('A' + local_radix - 10))
3061                   toktype = ERROR;
3062               }
3063             else break;
3064           }
3065         if (toktype != ERROR)
3066           toktype = parse_number (tokstart, p - tokstart, 
3067                                   got_dot | got_e, &yylval);
3068         if (toktype == ERROR)
3069           {
3070             char *err_copy = (char *) alloca (p - tokstart + 1);
3071
3072             memcpy (err_copy, tokstart, p - tokstart);
3073             err_copy[p - tokstart] = 0;
3074             error ("Invalid number \"%s\".", err_copy);
3075           }
3076         lexptr = p;
3077         return toktype;
3078       }
3079
3080     case '+':
3081     case '-':
3082     case '*':
3083     case '/':
3084     case '%':
3085     case '|':
3086     case '&':
3087     case '^':
3088     case '~':
3089     case '!':
3090 #if 0
3091     case '@':           /* Moved out below.  */
3092 #endif
3093     case '<':
3094     case '>':
3095     case '[':
3096     case ']':
3097     case '?':
3098     case ':':
3099     case '=':
3100     case '{':
3101     case '}':
3102     symbol:
3103       lexptr++;
3104       return tokchr;
3105
3106     case '@':
3107       if (strncmp(tokstart, "@selector", 9) == 0)
3108         {
3109           tokptr = strchr(tokstart, '(');
3110           if (tokptr == NULL)
3111             {
3112               error ("Missing '(' in @selector(...)");
3113             }
3114           tempbufindex = 0;
3115           tokptr++;     /* Skip the '('.  */
3116           do {
3117             /* Grow the static temp buffer if necessary, including
3118                allocating the first one on demand.  */
3119             if (tempbufindex + 1 >= tempbufsize)
3120               {
3121                 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3122               }
3123             tempbuf[tempbufindex++] = *tokptr++;
3124           } while ((*tokptr != ')') && (*tokptr != '\0'));
3125           if (*tokptr++ != ')')
3126             {
3127               error ("Missing ')' in @selector(...)");
3128             }
3129           tempbuf[tempbufindex] = '\0';
3130           yylval.sval.ptr = tempbuf;
3131           yylval.sval.length = tempbufindex;
3132           lexptr = tokptr;
3133           return SELECTOR;
3134         }
3135       if (tokstart[1] != '"')
3136         {
3137           lexptr++;
3138           return tokchr;
3139         }
3140       /* ObjC NextStep NSString constant: fall thru and parse like
3141          STRING.  */
3142       tokstart++;
3143
3144     case '"':
3145
3146       /* Build the gdb internal form of the input string in tempbuf,
3147          translating any standard C escape forms seen.  Note that the
3148          buffer is null byte terminated *only* for the convenience of
3149          debugging gdb itself and printing the buffer contents when
3150          the buffer contains no embedded nulls.  Gdb does not depend
3151          upon the buffer being null byte terminated, it uses the
3152          length string instead.  This allows gdb to handle C strings
3153          (as well as strings in other languages) with embedded null
3154          bytes.  */
3155
3156       tokptr = ++tokstart;
3157       tempbufindex = 0;
3158
3159       do {
3160         /* Grow the static temp buffer if necessary, including
3161            allocating the first one on demand.  */
3162         if (tempbufindex + 1 >= tempbufsize)
3163           {
3164             tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
3165           }
3166         switch (*tokptr)
3167           {
3168           case '\0':
3169           case '"':
3170             /* Do nothing, loop will terminate.  */
3171             break;
3172           case '\\':
3173             tokptr++;
3174             c = parse_escape (&tokptr);
3175             if (c == -1)
3176               {
3177                 continue;
3178               }
3179             tempbuf[tempbufindex++] = c;
3180             break;
3181           default:
3182             tempbuf[tempbufindex++] = *tokptr++;
3183             break;
3184           }
3185       } while ((*tokptr != '"') && (*tokptr != '\0'));
3186       if (*tokptr++ != '"')
3187         {
3188           error ("Unterminated string in expression.");
3189         }
3190       tempbuf[tempbufindex] = '\0';     /* See note above.  */
3191       yylval.sval.ptr = tempbuf;
3192       yylval.sval.length = tempbufindex;
3193       lexptr = tokptr;
3194       return (tokchr == '@' ? NSSTRING : STRING);
3195     }
3196
3197   if (!(tokchr == '_' || tokchr == '$' || 
3198        (tokchr >= 'a' && tokchr <= 'z') || (tokchr >= 'A' && tokchr <= 'Z')))
3199     /* We must have come across a bad character (e.g. ';').  */
3200     error ("Invalid character '%c' in expression.", c);
3201
3202   /* It's a name.  See how long it is.  */
3203   namelen = 0;
3204   for (c = tokstart[namelen];
3205        (c == '_' || c == '$' || (c >= '0' && c <= '9')
3206         || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
3207     {
3208        if (c == '<')
3209          {
3210            int i = namelen;
3211            while (tokstart[++i] && tokstart[i] != '>');
3212            if (tokstart[i] == '>')
3213              namelen = i;
3214           }
3215        c = tokstart[++namelen];
3216      }
3217
3218   /* The token "if" terminates the expression and is NOT 
3219      removed from the input stream.  */
3220   if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
3221     {
3222       return 0;
3223     }
3224
3225   lexptr += namelen;
3226
3227   tryname:
3228
3229   /* Catch specific keywords.  Should be done with a data structure.  */
3230   switch (namelen)
3231     {
3232     case 8:
3233       if (DEPRECATED_STREQN (tokstart, "unsigned", 8))
3234         return UNSIGNED;
3235       if (current_language->la_language == language_cplus
3236           && strncmp (tokstart, "template", 8) == 0)
3237         return TEMPLATE;
3238       if (DEPRECATED_STREQN (tokstart, "volatile", 8))
3239         return VOLATILE_KEYWORD;
3240       break;
3241     case 6:
3242       if (DEPRECATED_STREQN (tokstart, "struct", 6))
3243         return STRUCT;
3244       if (DEPRECATED_STREQN (tokstart, "signed", 6))
3245         return SIGNED_KEYWORD;
3246       if (DEPRECATED_STREQN (tokstart, "sizeof", 6))      
3247         return SIZEOF;
3248       if (DEPRECATED_STREQN (tokstart, "double", 6))      
3249         return DOUBLE_KEYWORD;
3250       break;
3251     case 5:
3252       if ((current_language->la_language == language_cplus)
3253           && strncmp (tokstart, "class", 5) == 0)
3254         return CLASS;
3255       if (DEPRECATED_STREQN (tokstart, "union", 5))
3256         return UNION;
3257       if (DEPRECATED_STREQN (tokstart, "short", 5))
3258         return SHORT;
3259       if (DEPRECATED_STREQN (tokstart, "const", 5))
3260         return CONST_KEYWORD;
3261       break;
3262     case 4:
3263       if (DEPRECATED_STREQN (tokstart, "enum", 4))
3264         return ENUM;
3265       if (DEPRECATED_STREQN (tokstart, "long", 4))
3266         return LONG;
3267       break;
3268     case 3:
3269       if (DEPRECATED_STREQN (tokstart, "int", 3))
3270         return INT_KEYWORD;
3271       break;
3272     default:
3273       break;
3274     }
3275
3276   yylval.sval.ptr = tokstart;
3277   yylval.sval.length = namelen;
3278
3279   if (*tokstart == '$')
3280     {
3281       write_dollar_variable (yylval.sval);
3282       return VARIABLE;
3283     }
3284
3285   /* Use token-type BLOCKNAME for symbols that happen to be defined as
3286      functions or symtabs.  If this is not so, then ...
3287      Use token-type TYPENAME for symbols that happen to be defined
3288      currently as names of types; NAME for other symbols.
3289      The caller is not constrained to care about the distinction.  */
3290   {
3291     char *tmp = copy_name (yylval.sval);
3292     struct symbol *sym;
3293     int is_a_field_of_this = 0, *need_this;
3294     int hextype;
3295
3296     if (current_language->la_language == language_cplus ||
3297         current_language->la_language == language_objc)
3298       need_this = &is_a_field_of_this;
3299     else
3300       need_this = (int *) NULL;
3301
3302     sym = lookup_symbol (tmp, expression_context_block,
3303                          VAR_DOMAIN,
3304                          need_this,
3305                          (struct symtab **) NULL);
3306     /* Call lookup_symtab, not lookup_partial_symtab, in case there
3307        are no psymtabs (coff, xcoff, or some future change to blow
3308        away the psymtabs once symbols are read).  */
3309     if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
3310         lookup_symtab (tmp))
3311       {
3312         yylval.ssym.sym = sym;
3313         yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3314         return BLOCKNAME;
3315       }
3316     if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
3317         {
3318 #if 1
3319           /* Despite the following flaw, we need to keep this code
3320              enabled.  Because we can get called from
3321              check_stub_method, if we don't handle nested types then
3322              it screws many operations in any program which uses
3323              nested types.  */
3324           /* In "A::x", if x is a member function of A and there
3325              happens to be a type (nested or not, since the stabs
3326              don't make that distinction) named x, then this code
3327              incorrectly thinks we are dealing with nested types
3328              rather than a member function.  */
3329
3330           char *p;
3331           char *namestart;
3332           struct symbol *best_sym;
3333
3334           /* Look ahead to detect nested types.  This probably should
3335              be done in the grammar, but trying seemed to introduce a
3336              lot of shift/reduce and reduce/reduce conflicts.  It's
3337              possible that it could be done, though.  Or perhaps a
3338              non-grammar, but less ad hoc, approach would work well.  */
3339
3340           /* Since we do not currently have any way of distinguishing
3341              a nested type from a non-nested one (the stabs don't tell
3342              us whether a type is nested), we just ignore the
3343              containing type.  */
3344
3345           p = lexptr;
3346           best_sym = sym;
3347           while (1)
3348             {
3349               /* Skip whitespace.  */
3350               while (*p == ' ' || *p == '\t' || *p == '\n')
3351                 ++p;
3352               if (*p == ':' && p[1] == ':')
3353                 {
3354                   /* Skip the `::'.  */
3355                   p += 2;
3356                   /* Skip whitespace.  */
3357                   while (*p == ' ' || *p == '\t' || *p == '\n')
3358                     ++p;
3359                   namestart = p;
3360                   while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
3361                          || (*p >= 'a' && *p <= 'z')
3362                          || (*p >= 'A' && *p <= 'Z'))
3363                     ++p;
3364                   if (p != namestart)
3365                     {
3366                       struct symbol *cur_sym;
3367                       /* As big as the whole rest of the expression,
3368                          which is at least big enough.  */
3369                       char *ncopy = alloca (strlen (tmp) +
3370                                             strlen (namestart) + 3);
3371                       char *tmp1;
3372
3373                       tmp1 = ncopy;
3374                       memcpy (tmp1, tmp, strlen (tmp));
3375                       tmp1 += strlen (tmp);
3376                       memcpy (tmp1, "::", 2);
3377                       tmp1 += 2;
3378                       memcpy (tmp1, namestart, p - namestart);
3379                       tmp1[p - namestart] = '\0';
3380                       cur_sym = lookup_symbol (ncopy, 
3381                                                expression_context_block,
3382                                                VAR_DOMAIN, (int *) NULL,
3383                                                (struct symtab **) NULL);
3384                       if (cur_sym)
3385                         {
3386                           if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
3387                             {
3388                               best_sym = cur_sym;
3389                               lexptr = p;
3390                             }
3391                           else
3392                             break;
3393                         }
3394                       else
3395                         break;
3396                     }
3397                   else
3398                     break;
3399                 }
3400               else
3401                 break;
3402             }
3403
3404           yylval.tsym.type = SYMBOL_TYPE (best_sym);
3405 #else /* not 0 */
3406           yylval.tsym.type = SYMBOL_TYPE (sym);
3407 #endif /* not 0 */
3408           return TYPENAME;
3409         }
3410     if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
3411         return TYPENAME;
3412
3413     /* See if it's an ObjC classname.  */
3414     if (!sym)
3415       {
3416         CORE_ADDR Class = lookup_objc_class(tmp);
3417         if (Class)
3418           {
3419             yylval.class.class = Class;
3420             if ((sym = lookup_struct_typedef (tmp, 
3421                                               expression_context_block, 
3422                                               1)))
3423               yylval.class.type = SYMBOL_TYPE (sym);
3424             return CLASSNAME;
3425           }
3426       }
3427
3428     /* Input names that aren't symbols but ARE valid hex numbers,
3429        when the input radix permits them, can be names or numbers
3430        depending on the parse.  Note we support radixes > 16 here.  */
3431     if (!sym && 
3432         ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
3433          (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
3434       {
3435         YYSTYPE newlval;        /* Its value is ignored.  */
3436         hextype = parse_number (tokstart, namelen, 0, &newlval);
3437         if (hextype == INT)
3438           {
3439             yylval.ssym.sym = sym;
3440             yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3441             return NAME_OR_INT;
3442           }
3443       }
3444
3445     /* Any other kind of symbol.  */
3446     yylval.ssym.sym = sym;
3447     yylval.ssym.is_a_field_of_this = is_a_field_of_this;
3448     return NAME;
3449   }
3450 }
3451
3452 void
3453 yyerror (msg)
3454      char *msg;
3455 {
3456   if (*lexptr == '\0')
3457     error("A %s near end of expression.",  (msg ? msg : "error"));
3458   else
3459     error ("A %s in expression, near `%s'.", (msg ? msg : "error"), 
3460            lexptr);
3461 }
3462
3463