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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [c-exp.tab.c] - Blame information for rev 1782

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

Line No. Rev Author Line
1 578 markom
 
2
/*  A Bison parser, made from c-exp.y
3
 by  GNU Bison version 1.27
4
  */
5
 
6
#define YYBISON 1  /* Identify Bison output.  */
7
 
8
#define INT     257
9
#define FLOAT   258
10
#define STRING  259
11
#define NAME    260
12
#define TYPENAME        261
13
#define NAME_OR_INT     262
14
#define STRUCT  263
15
#define CLASS   264
16
#define UNION   265
17
#define ENUM    266
18
#define SIZEOF  267
19
#define UNSIGNED        268
20
#define COLONCOLON      269
21
#define TEMPLATE        270
22
#define ERROR   271
23
#define SIGNED_KEYWORD  272
24
#define LONG    273
25
#define SHORT   274
26
#define INT_KEYWORD     275
27
#define CONST_KEYWORD   276
28
#define VOLATILE_KEYWORD        277
29
#define DOUBLE_KEYWORD  278
30
#define VARIABLE        279
31
#define ASSIGN_MODIFY   280
32
#define THIS    281
33
#define TRUEKEYWORD     282
34
#define FALSEKEYWORD    283
35
#define ABOVE_COMMA     284
36
#define OROR    285
37
#define ANDAND  286
38
#define EQUAL   287
39
#define NOTEQUAL        288
40
#define LEQ     289
41
#define GEQ     290
42
#define LSH     291
43
#define RSH     292
44
#define UNARY   293
45
#define INCREMENT       294
46
#define DECREMENT       295
47
#define ARROW   296
48
#define BLOCKNAME       297
49
#define FILENAME        298
50
 
51
#line 39 "c-exp.y"
52
 
53
 
54
#include "defs.h"
55
#include "gdb_string.h"
56
#include <ctype.h>
57
#include "expression.h"
58
#include "value.h"
59
#include "parser-defs.h"
60
#include "language.h"
61
#include "c-lang.h"
62
#include "bfd.h" /* Required by objfiles.h.  */
63
#include "symfile.h" /* Required by objfiles.h.  */
64
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
65
 
66
/* Flag indicating we're dealing with HP-compiled objects */
67
extern int hp_som_som_object_present;
68
 
69
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
70
   as well as gratuitiously global symbol names, so we can have multiple
71
   yacc generated parsers in gdb.  Note that these are only the variables
72
   produced by yacc.  If other parser generators (bison, byacc, etc) produce
73
   additional global names that conflict at link time, then those parser
74
   generators need to be fixed instead of adding those names to this list. */
75
 
76
#define yymaxdepth c_maxdepth
77
#define yyparse c_parse
78
#define yylex   c_lex
79
#define yyerror c_error
80
#define yylval  c_lval
81
#define yychar  c_char
82
#define yydebug c_debug
83
#define yypact  c_pact  
84
#define yyr1    c_r1                    
85
#define yyr2    c_r2                    
86
#define yydef   c_def           
87
#define yychk   c_chk           
88
#define yypgo   c_pgo           
89
#define yyact   c_act           
90
#define yyexca  c_exca
91
#define yyerrflag c_errflag
92
#define yynerrs c_nerrs
93
#define yyps    c_ps
94
#define yypv    c_pv
95
#define yys     c_s
96
#define yy_yys  c_yys
97
#define yystate c_state
98
#define yytmp   c_tmp
99
#define yyv     c_v
100
#define yy_yyv  c_yyv
101
#define yyval   c_val
102
#define yylloc  c_lloc
103
#define yyreds  c_reds          /* With YYDEBUG defined */
104
#define yytoks  c_toks          /* With YYDEBUG defined */
105
#define yylhs   c_yylhs
106
#define yylen   c_yylen
107
#define yydefred c_yydefred
108
#define yydgoto c_yydgoto
109
#define yysindex c_yysindex
110
#define yyrindex c_yyrindex
111
#define yygindex c_yygindex
112
#define yytable  c_yytable
113
#define yycheck  c_yycheck
114
 
115
#ifndef YYDEBUG
116
#define YYDEBUG 0                /* Default to no yydebug support */
117
#endif
118
 
119
int yyparse (void);
120
 
121
static int yylex (void);
122
 
123
void yyerror (char *);
124
 
125
 
126
#line 118 "c-exp.y"
127
typedef union
128
  {
129
    LONGEST lval;
130
    struct {
131
      LONGEST val;
132
      struct type *type;
133
    } typed_val_int;
134
    struct {
135
      DOUBLEST dval;
136
      struct type *type;
137
    } typed_val_float;
138
    struct symbol *sym;
139
    struct type *tval;
140
    struct stoken sval;
141
    struct ttype tsym;
142
    struct symtoken ssym;
143
    int voidval;
144
    struct block *bval;
145
    enum exp_opcode opcode;
146
    struct internalvar *ivar;
147
 
148
    struct type **tvec;
149
    int *ivec;
150
  } YYSTYPE;
151
#line 143 "c-exp.y"
152
 
153
/* YYSTYPE gets defined by %union */
154
static int parse_number (char *, int, int, YYSTYPE *);
155
#include <stdio.h>
156
 
157
#ifndef __cplusplus
158
#ifndef __STDC__
159
#define const
160
#endif
161
#endif
162
 
163
 
164
 
165
#define YYFINAL         214
166
#define YYFLAG          -32768
167
#define YYNTBASE        69
168
 
169
#define YYTRANSLATE(x) ((unsigned)(x) <= 298 ? yytranslate[x] : 91)
170
 
171
static const char yytranslate[] = {     0,
172
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
173
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
174
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
175
     2,     2,    62,     2,     2,     2,    52,    38,     2,    59,
176
    65,    50,    48,    30,    49,    57,    51,     2,     2,     2,
177
     2,     2,     2,     2,     2,     2,     2,    68,     2,    41,
178
    32,    42,    33,    47,     2,     2,     2,     2,     2,     2,
179
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
180
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
181
    58,     2,    64,    37,     2,     2,     2,     2,     2,     2,
182
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
183
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
184
     2,     2,    66,    36,    67,    63,     2,     2,     2,     2,
185
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
186
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
187
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
188
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
189
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
190
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
191
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
192
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
193
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
194
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
195
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
196
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
197
     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
198
     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
199
    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
200
    27,    28,    29,    31,    34,    35,    39,    40,    43,    44,
201
    45,    46,    53,    54,    55,    56,    60,    61
202
};
203
 
204
#if YYDEBUG != 0
205
static const short yyprhs[] = {     0,
206
     0,     2,     4,     6,     8,    12,    15,    18,    21,    24,
207
    27,    30,    33,    36,    39,    42,    46,    50,    55,    59,
208
    63,    68,    73,    74,    80,    82,    83,    85,    89,    91,
209
    95,   100,   105,   109,   113,   117,   121,   125,   129,   133,
210
   137,   141,   145,   149,   153,   157,   161,   165,   169,   173,
211
   177,   181,   185,   191,   195,   199,   201,   203,   205,   207,
212
   209,   214,   216,   218,   220,   222,   224,   226,   230,   234,
213
   238,   243,   245,   248,   250,   252,   255,   258,   261,   265,
214
   269,   271,   274,   276,   279,   281,   285,   288,   290,   293,
215
   295,   298,   302,   305,   309,   311,   315,   317,   319,   321,
216
   323,   326,   330,   333,   337,   341,   346,   349,   353,   355,
217
   358,   361,   364,   367,   370,   373,   375,   378,   380,   386,
218
   389,   392,   394,   396,   398,   400,   402,   406,   408,   410,
219
   412,   414,   416
220
};
221
 
222
static const short yyrhs[] = {    71,
223
     0,    70,     0,    85,     0,    72,     0,    71,    30,    72,
224
     0,    50,    72,     0,    38,    72,     0,    49,    72,     0,
225
    62,    72,     0,    63,    72,     0,    54,    72,     0,    55,
226
    72,     0,    72,    54,     0,    72,    55,     0,    13,    72,
227
     0,    72,    56,    89,     0,    72,    56,    79,     0,    72,
228
    56,    50,    72,     0,    72,    57,    89,     0,    72,    57,
229
    79,     0,    72,    57,    50,    72,     0,    72,    58,    71,
230
    64,     0,     0,    72,    59,    73,    75,    65,     0,    66,
231
     0,     0,    72,     0,    75,    30,    72,     0,    67,     0,
232
    74,    75,    76,     0,    74,    85,    76,    72,     0,    59,
233
    85,    65,    72,     0,    59,    71,    65,     0,    72,    47,
234
    72,     0,    72,    50,    72,     0,    72,    51,    72,     0,
235
    72,    52,    72,     0,    72,    48,    72,     0,    72,    49,
236
    72,     0,    72,    45,    72,     0,    72,    46,    72,     0,
237
    72,    39,    72,     0,    72,    40,    72,     0,    72,    43,
238
    72,     0,    72,    44,    72,     0,    72,    41,    72,     0,
239
    72,    42,    72,     0,    72,    38,    72,     0,    72,    37,
240
    72,     0,    72,    36,    72,     0,    72,    35,    72,     0,
241
    72,    34,    72,     0,    72,    33,    72,    68,    72,     0,
242
    72,    32,    72,     0,    72,    26,    72,     0,     3,     0,
243
     8,     0,     4,     0,    78,     0,    25,     0,    13,    59,
244
    85,    65,     0,     5,     0,    27,     0,    28,     0,    29,
245
     0,    60,     0,    61,     0,    77,    15,    89,     0,    77,
246
    15,    89,     0,    86,    15,    89,     0,    86,    15,    63,
247
    89,     0,    79,     0,    15,    89,     0,    90,     0,    86,
248
     0,    86,    22,     0,    86,    23,     0,    86,    81,     0,
249
    86,    22,    81,     0,    86,    23,    81,     0,    50,     0,
250
    50,    81,     0,    38,     0,    38,    81,     0,    82,     0,
251
    59,    81,    65,     0,    82,    83,     0,    83,     0,    82,
252
    84,     0,    84,     0,    58,    64,     0,    58,     3,    64,
253
     0,    59,    65,     0,    59,    88,    65,     0,    80,     0,
254
    86,    15,    50,     0,     7,     0,    21,     0,    19,     0,
255
    20,     0,    19,    21,     0,    14,    19,    21,     0,    19,
256
    19,     0,    19,    19,    21,     0,    14,    19,    19,     0,
257
    14,    19,    19,    21,     0,    20,    21,     0,    14,    20,
258
    21,     0,    24,     0,    19,    24,     0,     9,    89,     0,
259
    10,    89,     0,    11,    89,     0,    12,    89,     0,    14,
260
    87,     0,    14,     0,    18,    87,     0,    18,     0,    16,
261
    89,    41,    85,    42,     0,    22,    86,     0,    23,    86,
262
     0,     7,     0,    21,     0,    19,     0,    20,     0,    85,
263
     0,    88,    30,    85,     0,     6,     0,    60,     0,     7,
264
     0,     8,     0,     6,     0,    60,     0
265
};
266
 
267
#endif
268
 
269
#if YYDEBUG != 0
270
static const short yyrline[] = { 0,
271
   227,   228,   231,   238,   239,   244,   247,   250,   254,   258,
272
   262,   266,   270,   274,   278,   282,   288,   296,   300,   306,
273
   314,   318,   322,   326,   332,   336,   339,   343,   347,   350,
274
   357,   363,   369,   375,   379,   383,   387,   391,   395,   399,
275
   403,   407,   411,   415,   419,   423,   427,   431,   435,   439,
276
   443,   447,   451,   455,   459,   465,   472,   483,   490,   493,
277
   497,   505,   530,   535,   542,   551,   559,   565,   576,   592,
278
   605,   629,   630,   664,   722,   728,   729,   730,   732,   734,
279
   738,   740,   742,   744,   746,   749,   751,   756,   763,   765,
280
   769,   771,   775,   777,   789,   790,   795,   797,   799,   801,
281
   803,   805,   807,   809,   811,   813,   815,   817,   819,   821,
282
   823,   826,   829,   832,   835,   837,   839,   841,   846,   853,
283
   854,   857,   858,   864,   870,   879,   884,   891,   892,   893,
284
   894,   897,   898
285
};
286
#endif
287
 
288
 
289
#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
290
 
291
static const char * const yytname[] = {   "$","error","$undefined.","INT","FLOAT",
292
"STRING","NAME","TYPENAME","NAME_OR_INT","STRUCT","CLASS","UNION","ENUM","SIZEOF",
293
"UNSIGNED","COLONCOLON","TEMPLATE","ERROR","SIGNED_KEYWORD","LONG","SHORT","INT_KEYWORD",
294
"CONST_KEYWORD","VOLATILE_KEYWORD","DOUBLE_KEYWORD","VARIABLE","ASSIGN_MODIFY",
295
"THIS","TRUEKEYWORD","FALSEKEYWORD","','","ABOVE_COMMA","'='","'?'","OROR","ANDAND",
296
"'|'","'^'","'&'","EQUAL","NOTEQUAL","'<'","'>'","LEQ","GEQ","LSH","RSH","'@'",
297
"'+'","'-'","'*'","'/'","'%'","UNARY","INCREMENT","DECREMENT","ARROW","'.'",
298
"'['","'('","BLOCKNAME","FILENAME","'!'","'~'","']'","')'","'{'","'}'","':'",
299
"start","type_exp","exp1","exp","@1","lcurly","arglist","rcurly","block","variable",
300
"qualified_name","ptype","abs_decl","direct_abs_decl","array_mod","func_mod",
301
"type","typebase","typename","nonempty_typelist","name","name_not_typename", NULL
302
};
303
#endif
304
 
305
static const short yyr1[] = {     0,
306
    69,    69,    70,    71,    71,    72,    72,    72,    72,    72,
307
    72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
308
    72,    72,    73,    72,    74,    75,    75,    75,    76,    72,
309
    72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
310
    72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
311
    72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
312
    72,    72,    72,    72,    72,    77,    77,    77,    78,    79,
313
    79,    78,    78,    78,    80,    80,    80,    80,    80,    80,
314
    81,    81,    81,    81,    81,    82,    82,    82,    82,    82,
315
    83,    83,    84,    84,    85,    85,    86,    86,    86,    86,
316
    86,    86,    86,    86,    86,    86,    86,    86,    86,    86,
317
    86,    86,    86,    86,    86,    86,    86,    86,    86,    86,
318
    86,    87,    87,    87,    87,    88,    88,    89,    89,    89,
319
    89,    90,    90
320
};
321
 
322
static const short yyr2[] = {     0,
323
     1,     1,     1,     1,     3,     2,     2,     2,     2,     2,
324
     2,     2,     2,     2,     2,     3,     3,     4,     3,     3,
325
     4,     4,     0,     5,     1,     0,     1,     3,     1,     3,
326
     4,     4,     3,     3,     3,     3,     3,     3,     3,     3,
327
     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
328
     3,     3,     5,     3,     3,     1,     1,     1,     1,     1,
329
     4,     1,     1,     1,     1,     1,     1,     3,     3,     3,
330
     4,     1,     2,     1,     1,     2,     2,     2,     3,     3,
331
     1,     2,     1,     2,     1,     3,     2,     1,     2,     1,
332
     2,     3,     2,     3,     1,     3,     1,     1,     1,     1,
333
     2,     3,     2,     3,     3,     4,     2,     3,     1,     2,
334
     2,     2,     2,     2,     2,     1,     2,     1,     5,     2,
335
     2,     1,     1,     1,     1,     1,     3,     1,     1,     1,
336
     1,     1,     1
337
};
338
 
339
static const short yydefact[] = {     0,
340
    56,    58,    62,   132,    97,    57,     0,     0,     0,     0,
341
     0,   116,     0,     0,   118,    99,   100,    98,     0,     0,
342
   109,    60,    63,    64,    65,     0,     0,     0,     0,     0,
343
     0,   133,    67,     0,     0,    25,     2,     1,     4,    26,
344
     0,    59,    72,    95,     3,    75,    74,   128,   130,   131,
345
   129,   111,   112,   113,   114,     0,    15,     0,   122,   124,
346
   125,   123,   115,    73,     0,   124,   125,   117,   103,   101,
347
   110,   107,   120,   121,     7,     8,     6,    11,    12,     0,
348
     0,     9,    10,     0,     0,     0,     0,     0,     0,     0,
349
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
350
     0,     0,     0,     0,     0,     0,    13,    14,     0,     0,
351
     0,    23,    27,     0,     0,     0,     0,    76,    77,    83,
352
    81,     0,     0,    78,    85,    88,    90,     0,     0,   105,
353
   102,   108,     0,   104,    33,     0,     5,    55,    54,     0,
354
    52,    51,    50,    49,    48,    42,    43,    46,    47,    44,
355
    45,    40,    41,    34,    38,    39,    35,    36,    37,   130,
356
     0,    17,    16,     0,    20,    19,     0,    26,     0,    29,
357
    30,     0,    69,    96,     0,    70,    79,    80,    84,    82,
358
     0,    91,    93,     0,   126,    75,     0,     0,    87,    89,
359
    61,   106,     0,    32,     0,    18,    21,    22,     0,    28,
360
    31,    71,    92,    86,     0,     0,    94,   119,    53,    24,
361
   127,     0,     0,     0
362
};
363
 
364
static const short yydefgoto[] = {   212,
365
    37,    80,    39,   168,    40,   114,   171,    41,    42,    43,
366
    44,   124,   125,   126,   127,   185,    58,    63,   187,   176,
367
    47
368
};
369
 
370
static const short yypact[] = {   205,
371
-32768,-32768,-32768,-32768,-32768,-32768,    46,    46,    46,    46,
372
   269,    57,    46,    46,   100,   134,   -14,-32768,   228,   228,
373
-32768,-32768,-32768,-32768,-32768,   205,   205,   205,   205,   205,
374
   205,    21,-32768,   205,   205,-32768,-32768,   -16,   504,   205,
375
    22,-32768,-32768,-32768,-32768,   107,-32768,-32768,-32768,-32768,
376
-32768,-32768,-32768,-32768,-32768,   205,    14,    23,-32768,     7,
377
    24,-32768,-32768,-32768,    10,-32768,-32768,-32768,    34,-32768,
378
-32768,-32768,-32768,-32768,    14,    14,    14,    14,    14,   -26,
379
   -21,    14,    14,   205,   205,   205,   205,   205,   205,   205,
380
   205,   205,   205,   205,   205,   205,   205,   205,   205,   205,
381
   205,   205,   205,   205,   205,   205,-32768,-32768,   419,   438,
382
   205,-32768,   504,   -25,    -2,    46,    53,     8,     8,     8,
383
     8,    -1,   359,-32768,   -41,-32768,-32768,     9,    42,    54,
384
-32768,-32768,   228,-32768,-32768,   205,   504,   504,   504,   467,
385
   556,   580,   603,   625,   646,   665,   665,   254,   254,   254,
386
   254,   124,   124,   356,   416,   416,    14,    14,    14,    89,
387
   205,-32768,-32768,   205,-32768,-32768,   -17,   205,   205,-32768,
388
-32768,   205,    93,-32768,    46,-32768,-32768,-32768,-32768,-32768,
389
    45,-32768,-32768,    50,-32768,   146,   -22,   128,-32768,-32768,
390
   333,-32768,    68,    14,   205,    14,    14,-32768,    -3,   504,
391
    14,-32768,-32768,-32768,    67,   228,-32768,-32768,   531,-32768,
392
-32768,   125,   126,-32768
393
};
394
 
395
static const short yypgoto[] = {-32768,
396
-32768,     3,    -5,-32768,-32768,   -44,    12,-32768,-32768,   -76,
397
-32768,    79,-32768,    11,    16,     1,     0,   113,-32768,     2,
398
-32768
399
};
400
 
401
 
402
#define YYLAST          724
403
 
404
 
405
static const short yytable[] = {    46,
406
    45,   181,    38,    84,   169,    57,    72,   206,    52,    53,
407
    54,    55,    84,    84,    64,    65,   122,   188,    73,    74,
408
    75,    76,    77,    78,    79,   130,   169,   131,    82,    83,
409
    46,    81,   162,   165,   113,   -66,   116,   129,   135,    46,
410
   115,   170,   207,   136,   132,   120,   198,    48,    49,    50,
411
   133,    48,    49,    50,   134,    46,   128,   121,    48,    49,
412
    50,   210,   182,    59,   170,   122,   123,   107,   108,   109,
413
   110,   111,   112,   191,   192,    60,    61,    62,   137,   138,
414
   139,   140,   141,   142,   143,   144,   145,   146,   147,   148,
415
   149,   150,   151,   152,   153,   154,   155,   156,   157,   158,
416
   159,    51,   174,   -97,   175,    51,    59,   -68,   203,   208,
417
   163,   166,    51,   167,   204,   175,   174,   173,    66,    67,
418
    62,   117,   186,   199,   213,   214,   172,    68,   118,   119,
419
   194,     0,   186,   193,     5,   189,     7,     8,     9,    10,
420
   190,    12,     0,    14,   120,    15,    16,    17,    18,    19,
421
    20,    21,    69,     0,    70,   196,   121,    71,   197,     0,
422
   205,     0,   113,   200,   122,   123,   201,   118,   119,     0,
423
   101,   102,   103,   104,   105,   106,   202,   107,   108,   109,
424
   110,   111,   112,   120,     0,   194,     0,   186,     0,   209,
425
     0,     0,   183,     0,     0,   121,   177,   178,   179,   180,
426
     0,   184,     0,   122,   123,   186,   211,     1,     2,     3,
427
     4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
428
    14,     0,    15,    16,    17,    18,    19,    20,    21,    22,
429
     0,    23,    24,    25,     5,     0,     7,     8,     9,    10,
430
     0,    12,    26,    14,     0,    15,    16,    17,    18,    19,
431
    20,    21,     0,    27,    28,     0,     0,     0,    29,    30,
432
     0,     0,     0,    31,    32,    33,    34,    35,     0,     0,
433
    36,     1,     2,     3,     4,     5,     6,     7,     8,     9,
434
    10,    11,    12,    13,    14,     0,    15,    16,    17,    18,
435
    19,    20,    21,    22,     0,    23,    24,    25,    99,   100,
436
   101,   102,   103,   104,   105,   106,    26,   107,   108,   109,
437
   110,   111,   112,     0,     0,     0,     0,    27,    28,     0,
438
     0,     0,    29,    30,     0,     0,     0,    56,    32,    33,
439
    34,    35,     0,     0,    36,     1,     2,     3,     4,     5,
440
     6,     7,     8,     9,    10,    11,    12,    13,    14,     0,
441
    15,    16,    17,    18,    19,    20,    21,    22,     0,    23,
442
    24,    25,     0,     0,     0,     5,     0,     7,     8,     9,
443
    10,     0,    12,     0,    14,     0,    15,    16,    17,    18,
444
    19,    20,    21,     0,     0,     0,    29,    30,     0,     0,
445
     0,    31,    32,    33,    34,    35,   120,     0,    36,     0,
446
     0,     0,     0,   102,   103,   104,   105,   106,   121,   107,
447
   108,   109,   110,   111,   112,     0,   122,   123,     0,     0,
448
     0,     0,     0,   183,    48,   160,    50,     7,     8,     9,
449
    10,     0,    12,     0,    14,     0,    15,    16,    17,    18,
450
    19,    20,    21,    48,   160,    50,     7,     8,     9,    10,
451
     0,    12,     0,    14,     0,    15,    16,    17,    18,    19,
452
    20,    21,     0,     0,     0,   104,   105,   106,   161,   107,
453
   108,   109,   110,   111,   112,     0,     0,     0,    51,     0,
454
     0,     0,     0,     0,     0,     0,     0,   164,     0,     0,
455
     0,     0,    85,     0,     0,     0,     0,    51,    86,    87,
456
    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
457
    98,    99,   100,   101,   102,   103,   104,   105,   106,     0,
458
   107,   108,   109,   110,   111,   112,     0,     0,     0,    85,
459
     0,     0,     0,     0,   195,    86,    87,    88,    89,    90,
460
    91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
461
   101,   102,   103,   104,   105,   106,     0,   107,   108,   109,
462
   110,   111,   112,    87,    88,    89,    90,    91,    92,    93,
463
    94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
464
   104,   105,   106,     0,   107,   108,   109,   110,   111,   112,
465
    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
466
    99,   100,   101,   102,   103,   104,   105,   106,     0,   107,
467
   108,   109,   110,   111,   112,    90,    91,    92,    93,    94,
468
    95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
469
   105,   106,     0,   107,   108,   109,   110,   111,   112,    91,
470
    92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
471
   102,   103,   104,   105,   106,     0,   107,   108,   109,   110,
472
   111,   112,    92,    93,    94,    95,    96,    97,    98,    99,
473
   100,   101,   102,   103,   104,   105,   106,     0,   107,   108,
474
   109,   110,   111,   112,    93,    94,    95,    96,    97,    98,
475
    99,   100,   101,   102,   103,   104,   105,   106,     0,   107,
476
   108,   109,   110,   111,   112,    95,    96,    97,    98,    99,
477
   100,   101,   102,   103,   104,   105,   106,     0,   107,   108,
478
   109,   110,   111,   112
479
};
480
 
481
static const short yycheck[] = {     0,
482
     0,     3,     0,    30,    30,    11,    21,    30,     7,     8,
483
     9,    10,    30,    30,    13,    14,    58,    59,    19,    20,
484
    26,    27,    28,    29,    30,    19,    30,    21,    34,    35,
485
    31,    31,   109,   110,    40,    15,    15,    15,    65,    40,
486
    40,    67,    65,    65,    21,    38,    64,     6,     7,     8,
487
    41,     6,     7,     8,    21,    56,    56,    50,     6,     7,
488
     8,    65,    64,     7,    67,    58,    59,    54,    55,    56,
489
    57,    58,    59,    65,    21,    19,    20,    21,    84,    85,
490
    86,    87,    88,    89,    90,    91,    92,    93,    94,    95,
491
    96,    97,    98,    99,   100,   101,   102,   103,   104,   105,
492
   106,    60,    50,    15,    63,    60,     7,    15,    64,    42,
493
   109,   110,    60,   111,    65,    63,    50,   116,    19,    20,
494
    21,    15,   123,   168,     0,     0,   115,    15,    22,    23,
495
   136,    -1,   133,   133,     7,   125,     9,    10,    11,    12,
496
   125,    14,    -1,    16,    38,    18,    19,    20,    21,    22,
497
    23,    24,    19,    -1,    21,   161,    50,    24,   164,    -1,
498
    15,    -1,   168,   169,    58,    59,   172,    22,    23,    -1,
499
    47,    48,    49,    50,    51,    52,   175,    54,    55,    56,
500
    57,    58,    59,    38,    -1,   191,    -1,   188,    -1,   195,
501
    -1,    -1,    65,    -1,    -1,    50,   118,   119,   120,   121,
502
    -1,   123,    -1,    58,    59,   206,   206,     3,     4,     5,
503
     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
504
    16,    -1,    18,    19,    20,    21,    22,    23,    24,    25,
505
    -1,    27,    28,    29,     7,    -1,     9,    10,    11,    12,
506
    -1,    14,    38,    16,    -1,    18,    19,    20,    21,    22,
507
    23,    24,    -1,    49,    50,    -1,    -1,    -1,    54,    55,
508
    -1,    -1,    -1,    59,    60,    61,    62,    63,    -1,    -1,
509
    66,     3,     4,     5,     6,     7,     8,     9,    10,    11,
510
    12,    13,    14,    15,    16,    -1,    18,    19,    20,    21,
511
    22,    23,    24,    25,    -1,    27,    28,    29,    45,    46,
512
    47,    48,    49,    50,    51,    52,    38,    54,    55,    56,
513
    57,    58,    59,    -1,    -1,    -1,    -1,    49,    50,    -1,
514
    -1,    -1,    54,    55,    -1,    -1,    -1,    59,    60,    61,
515
    62,    63,    -1,    -1,    66,     3,     4,     5,     6,     7,
516
     8,     9,    10,    11,    12,    13,    14,    15,    16,    -1,
517
    18,    19,    20,    21,    22,    23,    24,    25,    -1,    27,
518
    28,    29,    -1,    -1,    -1,     7,    -1,     9,    10,    11,
519
    12,    -1,    14,    -1,    16,    -1,    18,    19,    20,    21,
520
    22,    23,    24,    -1,    -1,    -1,    54,    55,    -1,    -1,
521
    -1,    59,    60,    61,    62,    63,    38,    -1,    66,    -1,
522
    -1,    -1,    -1,    48,    49,    50,    51,    52,    50,    54,
523
    55,    56,    57,    58,    59,    -1,    58,    59,    -1,    -1,
524
    -1,    -1,    -1,    65,     6,     7,     8,     9,    10,    11,
525
    12,    -1,    14,    -1,    16,    -1,    18,    19,    20,    21,
526
    22,    23,    24,     6,     7,     8,     9,    10,    11,    12,
527
    -1,    14,    -1,    16,    -1,    18,    19,    20,    21,    22,
528
    23,    24,    -1,    -1,    -1,    50,    51,    52,    50,    54,
529
    55,    56,    57,    58,    59,    -1,    -1,    -1,    60,    -1,
530
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    50,    -1,    -1,
531
    -1,    -1,    26,    -1,    -1,    -1,    -1,    60,    32,    33,
532
    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
533
    44,    45,    46,    47,    48,    49,    50,    51,    52,    -1,
534
    54,    55,    56,    57,    58,    59,    -1,    -1,    -1,    26,
535
    -1,    -1,    -1,    -1,    68,    32,    33,    34,    35,    36,
536
    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
537
    47,    48,    49,    50,    51,    52,    -1,    54,    55,    56,
538
    57,    58,    59,    33,    34,    35,    36,    37,    38,    39,
539
    40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
540
    50,    51,    52,    -1,    54,    55,    56,    57,    58,    59,
541
    35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
542
    45,    46,    47,    48,    49,    50,    51,    52,    -1,    54,
543
    55,    56,    57,    58,    59,    36,    37,    38,    39,    40,
544
    41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
545
    51,    52,    -1,    54,    55,    56,    57,    58,    59,    37,
546
    38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
547
    48,    49,    50,    51,    52,    -1,    54,    55,    56,    57,
548
    58,    59,    38,    39,    40,    41,    42,    43,    44,    45,
549
    46,    47,    48,    49,    50,    51,    52,    -1,    54,    55,
550
    56,    57,    58,    59,    39,    40,    41,    42,    43,    44,
551
    45,    46,    47,    48,    49,    50,    51,    52,    -1,    54,
552
    55,    56,    57,    58,    59,    41,    42,    43,    44,    45,
553
    46,    47,    48,    49,    50,    51,    52,    -1,    54,    55,
554
    56,    57,    58,    59
555
};
556
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
557
#line 3 "/usr/lib/bison.simple"
558
/* This file comes from bison-1.27.  */
559
 
560
/* Skeleton output parser for bison,
561
   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
562
 
563
   This program is free software; you can redistribute it and/or modify
564
   it under the terms of the GNU General Public License as published by
565
   the Free Software Foundation; either version 2, or (at your option)
566
   any later version.
567
 
568
   This program is distributed in the hope that it will be useful,
569
   but WITHOUT ANY WARRANTY; without even the implied warranty of
570
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
571
   GNU General Public License for more details.
572
 
573
   You should have received a copy of the GNU General Public License
574
   along with this program; if not, write to the Free Software
575
   Foundation, Inc., 59 Temple Place - Suite 330,
576
   Boston, MA 02111-1307, USA.  */
577
 
578
/* As a special exception, when this file is copied by Bison into a
579
   Bison output file, you may use that output file without restriction.
580
   This special exception was added by the Free Software Foundation
581
   in version 1.24 of Bison.  */
582
 
583
/* This is the parser code that is written into each bison parser
584
  when the %semantic_parser declaration is not specified in the grammar.
585
  It was written by Richard Stallman by simplifying the hairy parser
586
  used when %semantic_parser is specified.  */
587
 
588
#ifndef YYSTACK_USE_ALLOCA
589
#ifdef alloca
590
#define YYSTACK_USE_ALLOCA
591
#else /* alloca not defined */
592
#ifdef __GNUC__
593
#define YYSTACK_USE_ALLOCA
594
#define alloca __builtin_alloca
595
#else /* not GNU C.  */
596
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
597
#define YYSTACK_USE_ALLOCA
598
#include <alloca.h>
599
#else /* not sparc */
600
/* We think this test detects Watcom and Microsoft C.  */
601
/* This used to test MSDOS, but that is a bad idea
602
   since that symbol is in the user namespace.  */
603
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
604
#if 0 /* No need for xmalloc.h, which pollutes the namespace;
605
         instead, just don't use alloca.  */
606
#endif
607
#else /* not MSDOS, or __TURBOC__ */
608
#if defined(_AIX)
609
/* I don't know what this was needed for, but it pollutes the namespace.
610
   So I turned it off.   rms, 2 May 1997.  */
611
 #pragma alloca
612
#define YYSTACK_USE_ALLOCA
613
#else /* not MSDOS, or __TURBOC__, or _AIX */
614
#if 0
615
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
616
                 and on HPUX 10.  Eventually we can turn this on.  */
617
#define YYSTACK_USE_ALLOCA
618
#define alloca __builtin_alloca
619
#endif /* __hpux */
620
#endif
621
#endif /* not _AIX */
622
#endif /* not MSDOS, or __TURBOC__ */
623
#endif /* not sparc */
624
#endif /* not GNU C */
625
#endif /* alloca not defined */
626
#endif /* YYSTACK_USE_ALLOCA not defined */
627
 
628
#ifdef YYSTACK_USE_ALLOCA
629
#define YYSTACK_ALLOC alloca
630
#else
631
#define YYSTACK_ALLOC xmalloc
632
#endif
633
 
634
/* Note: there must be only one dollar sign in this file.
635
   It is replaced by the list of actions, each action
636
   as one case of the switch.  */
637
 
638
#define yyerrok         (yyerrstatus = 0)
639
#define yyclearin       (yychar = YYEMPTY)
640
#define YYEMPTY         -2
641
#define YYEOF           0
642
#define YYACCEPT        goto yyacceptlab
643
#define YYABORT         goto yyabortlab
644
#define YYERROR         goto yyerrlab1
645
/* Like YYERROR except do call yyerror.
646
   This remains here temporarily to ease the
647
   transition to the new meaning of YYERROR, for GCC.
648
   Once GCC version 2 has supplanted version 1, this can go.  */
649
#define YYFAIL          goto yyerrlab
650
#define YYRECOVERING()  (!!yyerrstatus)
651
#define YYBACKUP(token, value) \
652
do                                                              \
653
  if (yychar == YYEMPTY && yylen == 1)                          \
654
    { yychar = (token), yylval = (value);                       \
655
      yychar1 = YYTRANSLATE (yychar);                           \
656
      YYPOPSTACK;                                               \
657
      goto yybackup;                                            \
658
    }                                                           \
659
  else                                                          \
660
    { yyerror ("syntax error: cannot back up"); YYERROR; }      \
661
while (0)
662
 
663
#define YYTERROR        1
664
#define YYERRCODE       256
665
 
666
#ifndef YYPURE
667
#define YYLEX           yylex()
668
#endif
669
 
670
#ifdef YYPURE
671
#ifdef YYLSP_NEEDED
672
#ifdef YYLEX_PARAM
673
#define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
674
#else
675
#define YYLEX           yylex(&yylval, &yylloc)
676
#endif
677
#else /* not YYLSP_NEEDED */
678
#ifdef YYLEX_PARAM
679
#define YYLEX           yylex(&yylval, YYLEX_PARAM)
680
#else
681
#define YYLEX           yylex(&yylval)
682
#endif
683
#endif /* not YYLSP_NEEDED */
684
#endif
685
 
686
/* If nonreentrant, generate the variables here */
687
 
688
#ifndef YYPURE
689
 
690
int     yychar;                 /*  the lookahead symbol                */
691
YYSTYPE yylval;                 /*  the semantic value of the           */
692
                                /*  lookahead symbol                    */
693
 
694
#ifdef YYLSP_NEEDED
695
YYLTYPE yylloc;                 /*  location data for the lookahead     */
696
                                /*  symbol                              */
697
#endif
698
 
699
int yynerrs;                    /*  number of parse errors so far       */
700
#endif  /* not YYPURE */
701
 
702
#if YYDEBUG != 0
703
int yydebug;                    /*  nonzero means print parse trace     */
704
/* Since this is uninitialized, it does not stop multiple parsers
705
   from coexisting.  */
706
#endif
707
 
708
/*  YYINITDEPTH indicates the initial size of the parser's stacks       */
709
 
710
#ifndef YYINITDEPTH
711
#define YYINITDEPTH 200
712
#endif
713
 
714
/*  YYMAXDEPTH is the maximum size the stacks can grow to
715
    (effective only if the built-in stack extension method is used).  */
716
 
717
#if YYMAXDEPTH == 0
718
#undef YYMAXDEPTH
719
#endif
720
 
721
#ifndef YYMAXDEPTH
722
#define YYMAXDEPTH 10000
723
#endif
724
 
725
/* Define __yy_memcpy.  Note that the size argument
726
   should be passed with type unsigned int, because that is what the non-GCC
727
   definitions require.  With GCC, __builtin_memcpy takes an arg
728
   of type size_t, but it can handle unsigned int.  */
729
 
730
#if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
731
#define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
732
#else                           /* not GNU C or C++ */
733
#ifndef __cplusplus
734
 
735
/* This is the most reliable way to avoid incompatibilities
736
   in available built-in functions on various systems.  */
737
static void
738
__yy_memcpy (to, from, count)
739
     char *to;
740
     char *from;
741
     unsigned int count;
742
{
743
  register char *f = from;
744
  register char *t = to;
745
  register int i = count;
746
 
747
  while (i-- > 0)
748
    *t++ = *f++;
749
}
750
 
751
#else /* __cplusplus */
752
 
753
/* This is the most reliable way to avoid incompatibilities
754
   in available built-in functions on various systems.  */
755
static void
756
__yy_memcpy (char *to, char *from, unsigned int count)
757
{
758
  register char *t = to;
759
  register char *f = from;
760
  register int i = count;
761
 
762
  while (i-- > 0)
763
    *t++ = *f++;
764
}
765
 
766
#endif
767
#endif
768
 
769
#line 216 "/usr/lib/bison.simple"
770
 
771
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
772
   into yyparse.  The argument should have type void *.
773
   It should actually point to an object.
774
   Grammar actions can access the variable by casting it
775
   to the proper pointer type.  */
776
 
777
#ifdef YYPARSE_PARAM
778
#ifdef __cplusplus
779
#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
780
#define YYPARSE_PARAM_DECL
781
#else /* not __cplusplus */
782
#define YYPARSE_PARAM_ARG YYPARSE_PARAM
783
#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
784
#endif /* not __cplusplus */
785
#else /* not YYPARSE_PARAM */
786
#define YYPARSE_PARAM_ARG
787
#define YYPARSE_PARAM_DECL
788
#endif /* not YYPARSE_PARAM */
789
 
790
/* Prevent warning if -Wstrict-prototypes.  */
791
#ifdef __GNUC__
792
#ifdef YYPARSE_PARAM
793
int yyparse (void *);
794
#else
795
int yyparse (void);
796
#endif
797
#endif
798
 
799
int
800
yyparse(YYPARSE_PARAM_ARG)
801
     YYPARSE_PARAM_DECL
802
{
803
  register int yystate;
804
  register int yyn;
805
  register short *yyssp;
806
  register YYSTYPE *yyvsp;
807
  int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
808
  int yychar1 = 0;               /*  lookahead token as an internal (translated) token number */
809
 
810
  short yyssa[YYINITDEPTH];     /*  the state stack                     */
811
  YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
812
 
813
  short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
814
  YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to xreallocate them elsewhere */
815
 
816
#ifdef YYLSP_NEEDED
817
  YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
818
  YYLTYPE *yyls = yylsa;
819
  YYLTYPE *yylsp;
820
 
821
#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
822
#else
823
#define YYPOPSTACK   (yyvsp--, yyssp--)
824
#endif
825
 
826
  int yystacksize = YYINITDEPTH;
827
  int yyfree_stacks = 0;
828
 
829
#ifdef YYPURE
830
  int yychar;
831
  YYSTYPE yylval;
832
  int yynerrs;
833
#ifdef YYLSP_NEEDED
834
  YYLTYPE yylloc;
835
#endif
836
#endif
837
 
838
  YYSTYPE yyval;                /*  the variable used to return         */
839
                                /*  semantic values from the action     */
840
                                /*  routines                            */
841
 
842
  int yylen;
843
 
844
#if YYDEBUG != 0
845
  if (yydebug)
846
    fprintf(stderr, "Starting parse\n");
847
#endif
848
 
849
  yystate = 0;
850
  yyerrstatus = 0;
851
  yynerrs = 0;
852
  yychar = YYEMPTY;             /* Cause a token to be read.  */
853
 
854
  /* Initialize stack pointers.
855
     Waste one element of value and location stack
856
     so that they stay on the same level as the state stack.
857
     The wasted elements are never initialized.  */
858
 
859
  yyssp = yyss - 1;
860
  yyvsp = yyvs;
861
#ifdef YYLSP_NEEDED
862
  yylsp = yyls;
863
#endif
864
 
865
/* Push a new state, which is found in  yystate  .  */
866
/* In all cases, when you get here, the value and location stacks
867
   have just been pushed. so pushing a state here evens the stacks.  */
868
yynewstate:
869
 
870
  *++yyssp = yystate;
871
 
872
  if (yyssp >= yyss + yystacksize - 1)
873
    {
874
      /* Give user a chance to xreallocate the stack */
875
      /* Use copies of these so that the &'s don't force the real ones into memory. */
876
      YYSTYPE *yyvs1 = yyvs;
877
      short *yyss1 = yyss;
878
#ifdef YYLSP_NEEDED
879
      YYLTYPE *yyls1 = yyls;
880
#endif
881
 
882
      /* Get the current used size of the three stacks, in elements.  */
883
      int size = yyssp - yyss + 1;
884
 
885
#ifdef yyoverflow
886
      /* Each stack pointer address is followed by the size of
887
         the data in use in that stack, in bytes.  */
888
#ifdef YYLSP_NEEDED
889
      /* This used to be a conditional around just the two extra args,
890
         but that might be undefined if yyoverflow is a macro.  */
891
      yyoverflow("parser stack overflow",
892
                 &yyss1, size * sizeof (*yyssp),
893
                 &yyvs1, size * sizeof (*yyvsp),
894
                 &yyls1, size * sizeof (*yylsp),
895
                 &yystacksize);
896
#else
897
      yyoverflow("parser stack overflow",
898
                 &yyss1, size * sizeof (*yyssp),
899
                 &yyvs1, size * sizeof (*yyvsp),
900
                 &yystacksize);
901
#endif
902
 
903
      yyss = yyss1; yyvs = yyvs1;
904
#ifdef YYLSP_NEEDED
905
      yyls = yyls1;
906
#endif
907
#else /* no yyoverflow */
908
      /* Extend the stack our own way.  */
909
      if (yystacksize >= YYMAXDEPTH)
910
        {
911
          yyerror("parser stack overflow");
912
          if (yyfree_stacks)
913
            {
914
              free (yyss);
915
              free (yyvs);
916
#ifdef YYLSP_NEEDED
917
              free (yyls);
918
#endif
919
            }
920
          return 2;
921
        }
922
      yystacksize *= 2;
923
      if (yystacksize > YYMAXDEPTH)
924
        yystacksize = YYMAXDEPTH;
925
#ifndef YYSTACK_USE_ALLOCA
926
      yyfree_stacks = 1;
927
#endif
928
      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
929
      __yy_memcpy ((char *)yyss, (char *)yyss1,
930
                   size * (unsigned int) sizeof (*yyssp));
931
      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
932
      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
933
                   size * (unsigned int) sizeof (*yyvsp));
934
#ifdef YYLSP_NEEDED
935
      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
936
      __yy_memcpy ((char *)yyls, (char *)yyls1,
937
                   size * (unsigned int) sizeof (*yylsp));
938
#endif
939
#endif /* no yyoverflow */
940
 
941
      yyssp = yyss + size - 1;
942
      yyvsp = yyvs + size - 1;
943
#ifdef YYLSP_NEEDED
944
      yylsp = yyls + size - 1;
945
#endif
946
 
947
#if YYDEBUG != 0
948
      if (yydebug)
949
        fprintf(stderr, "Stack size increased to %d\n", yystacksize);
950
#endif
951
 
952
      if (yyssp >= yyss + yystacksize - 1)
953
        YYABORT;
954
    }
955
 
956
#if YYDEBUG != 0
957
  if (yydebug)
958
    fprintf(stderr, "Entering state %d\n", yystate);
959
#endif
960
 
961
  goto yybackup;
962
 yybackup:
963
 
964
/* Do appropriate processing given the current state.  */
965
/* Read a lookahead token if we need one and don't already have one.  */
966
/* yyresume: */
967
 
968
  /* First try to decide what to do without reference to lookahead token.  */
969
 
970
  yyn = yypact[yystate];
971
  if (yyn == YYFLAG)
972
    goto yydefault;
973
 
974
  /* Not known => get a lookahead token if don't already have one.  */
975
 
976
  /* yychar is either YYEMPTY or YYEOF
977
     or a valid token in external form.  */
978
 
979
  if (yychar == YYEMPTY)
980
    {
981
#if YYDEBUG != 0
982
      if (yydebug)
983
        fprintf(stderr, "Reading a token: ");
984
#endif
985
      yychar = YYLEX;
986
    }
987
 
988
  /* Convert token to internal form (in yychar1) for indexing tables with */
989
 
990
  if (yychar <= 0)               /* This means end of input. */
991
    {
992
      yychar1 = 0;
993
      yychar = YYEOF;           /* Don't call YYLEX any more */
994
 
995
#if YYDEBUG != 0
996
      if (yydebug)
997
        fprintf(stderr, "Now at end of input.\n");
998
#endif
999
    }
1000
  else
1001
    {
1002
      yychar1 = YYTRANSLATE(yychar);
1003
 
1004
#if YYDEBUG != 0
1005
      if (yydebug)
1006
        {
1007
          fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1008
          /* Give the individual parser a way to print the precise meaning
1009
             of a token, for further debugging info.  */
1010
#ifdef YYPRINT
1011
          YYPRINT (stderr, yychar, yylval);
1012
#endif
1013
          fprintf (stderr, ")\n");
1014
        }
1015
#endif
1016
    }
1017
 
1018
  yyn += yychar1;
1019
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1020
    goto yydefault;
1021
 
1022
  yyn = yytable[yyn];
1023
 
1024
  /* yyn is what to do for this token type in this state.
1025
     Negative => reduce, -yyn is rule number.
1026
     Positive => shift, yyn is new state.
1027
       New state is final state => don't bother to shift,
1028
       just return success.
1029
     0, or most negative number => error.  */
1030
 
1031
  if (yyn < 0)
1032
    {
1033
      if (yyn == YYFLAG)
1034
        goto yyerrlab;
1035
      yyn = -yyn;
1036
      goto yyreduce;
1037
    }
1038
  else if (yyn == 0)
1039
    goto yyerrlab;
1040
 
1041
  if (yyn == YYFINAL)
1042
    YYACCEPT;
1043
 
1044
  /* Shift the lookahead token.  */
1045
 
1046
#if YYDEBUG != 0
1047
  if (yydebug)
1048
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1049
#endif
1050
 
1051
  /* Discard the token being shifted unless it is eof.  */
1052
  if (yychar != YYEOF)
1053
    yychar = YYEMPTY;
1054
 
1055
  *++yyvsp = yylval;
1056
#ifdef YYLSP_NEEDED
1057
  *++yylsp = yylloc;
1058
#endif
1059
 
1060
  /* count tokens shifted since error; after three, turn off error status.  */
1061
  if (yyerrstatus) yyerrstatus--;
1062
 
1063
  yystate = yyn;
1064
  goto yynewstate;
1065
 
1066
/* Do the default action for the current state.  */
1067
yydefault:
1068
 
1069
  yyn = yydefact[yystate];
1070
  if (yyn == 0)
1071
    goto yyerrlab;
1072
 
1073
/* Do a reduction.  yyn is the number of a rule to reduce with.  */
1074
yyreduce:
1075
  yylen = yyr2[yyn];
1076
  if (yylen > 0)
1077
    yyval = yyvsp[1-yylen]; /* implement default value of the action */
1078
 
1079
#if YYDEBUG != 0
1080
  if (yydebug)
1081
    {
1082
      int i;
1083
 
1084
      fprintf (stderr, "Reducing via rule %d (line %d), ",
1085
               yyn, yyrline[yyn]);
1086
 
1087
      /* Print the symbols being reduced, and their result.  */
1088
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1089
        fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1090
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1091
    }
1092
#endif
1093
 
1094
 
1095
  switch (yyn) {
1096
 
1097
case 3:
1098
#line 232 "c-exp.y"
1099
{ write_exp_elt_opcode(OP_TYPE);
1100
                          write_exp_elt_type(yyvsp[0].tval);
1101
                          write_exp_elt_opcode(OP_TYPE);;
1102
    break;}
1103
case 5:
1104
#line 240 "c-exp.y"
1105
{ write_exp_elt_opcode (BINOP_COMMA); ;
1106
    break;}
1107
case 6:
1108
#line 245 "c-exp.y"
1109
{ write_exp_elt_opcode (UNOP_IND); ;
1110
    break;}
1111
case 7:
1112
#line 248 "c-exp.y"
1113
{ write_exp_elt_opcode (UNOP_ADDR); ;
1114
    break;}
1115
case 8:
1116
#line 251 "c-exp.y"
1117
{ write_exp_elt_opcode (UNOP_NEG); ;
1118
    break;}
1119
case 9:
1120
#line 255 "c-exp.y"
1121
{ write_exp_elt_opcode (UNOP_LOGICAL_NOT); ;
1122
    break;}
1123
case 10:
1124
#line 259 "c-exp.y"
1125
{ write_exp_elt_opcode (UNOP_COMPLEMENT); ;
1126
    break;}
1127
case 11:
1128
#line 263 "c-exp.y"
1129
{ write_exp_elt_opcode (UNOP_PREINCREMENT); ;
1130
    break;}
1131
case 12:
1132
#line 267 "c-exp.y"
1133
{ write_exp_elt_opcode (UNOP_PREDECREMENT); ;
1134
    break;}
1135
case 13:
1136
#line 271 "c-exp.y"
1137
{ write_exp_elt_opcode (UNOP_POSTINCREMENT); ;
1138
    break;}
1139
case 14:
1140
#line 275 "c-exp.y"
1141
{ write_exp_elt_opcode (UNOP_POSTDECREMENT); ;
1142
    break;}
1143
case 15:
1144
#line 279 "c-exp.y"
1145
{ write_exp_elt_opcode (UNOP_SIZEOF); ;
1146
    break;}
1147
case 16:
1148
#line 283 "c-exp.y"
1149
{ write_exp_elt_opcode (STRUCTOP_PTR);
1150
                          write_exp_string (yyvsp[0].sval);
1151
                          write_exp_elt_opcode (STRUCTOP_PTR); ;
1152
    break;}
1153
case 17:
1154
#line 289 "c-exp.y"
1155
{ /* exp->type::name becomes exp->*(&type::name) */
1156
                          /* Note: this doesn't work if name is a
1157
                             static member!  FIXME */
1158
                          write_exp_elt_opcode (UNOP_ADDR);
1159
                          write_exp_elt_opcode (STRUCTOP_MPTR); ;
1160
    break;}
1161
case 18:
1162
#line 297 "c-exp.y"
1163
{ write_exp_elt_opcode (STRUCTOP_MPTR); ;
1164
    break;}
1165
case 19:
1166
#line 301 "c-exp.y"
1167
{ write_exp_elt_opcode (STRUCTOP_STRUCT);
1168
                          write_exp_string (yyvsp[0].sval);
1169
                          write_exp_elt_opcode (STRUCTOP_STRUCT); ;
1170
    break;}
1171
case 20:
1172
#line 307 "c-exp.y"
1173
{ /* exp.type::name becomes exp.*(&type::name) */
1174
                          /* Note: this doesn't work if name is a
1175
                             static member!  FIXME */
1176
                          write_exp_elt_opcode (UNOP_ADDR);
1177
                          write_exp_elt_opcode (STRUCTOP_MEMBER); ;
1178
    break;}
1179
case 21:
1180
#line 315 "c-exp.y"
1181
{ write_exp_elt_opcode (STRUCTOP_MEMBER); ;
1182
    break;}
1183
case 22:
1184
#line 319 "c-exp.y"
1185
{ write_exp_elt_opcode (BINOP_SUBSCRIPT); ;
1186
    break;}
1187
case 23:
1188
#line 325 "c-exp.y"
1189
{ start_arglist (); ;
1190
    break;}
1191
case 24:
1192
#line 327 "c-exp.y"
1193
{ write_exp_elt_opcode (OP_FUNCALL);
1194
                          write_exp_elt_longcst ((LONGEST) end_arglist ());
1195
                          write_exp_elt_opcode (OP_FUNCALL); ;
1196
    break;}
1197
case 25:
1198
#line 333 "c-exp.y"
1199
{ start_arglist (); ;
1200
    break;}
1201
case 27:
1202
#line 340 "c-exp.y"
1203
{ arglist_len = 1; ;
1204
    break;}
1205
case 28:
1206
#line 344 "c-exp.y"
1207
{ arglist_len++; ;
1208
    break;}
1209
case 29:
1210
#line 348 "c-exp.y"
1211
{ yyval.lval = end_arglist () - 1; ;
1212
    break;}
1213
case 30:
1214
#line 351 "c-exp.y"
1215
{ write_exp_elt_opcode (OP_ARRAY);
1216
                          write_exp_elt_longcst ((LONGEST) 0);
1217
                          write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
1218
                          write_exp_elt_opcode (OP_ARRAY); ;
1219
    break;}
1220
case 31:
1221
#line 358 "c-exp.y"
1222
{ write_exp_elt_opcode (UNOP_MEMVAL);
1223
                          write_exp_elt_type (yyvsp[-2].tval);
1224
                          write_exp_elt_opcode (UNOP_MEMVAL); ;
1225
    break;}
1226
case 32:
1227
#line 364 "c-exp.y"
1228
{ write_exp_elt_opcode (UNOP_CAST);
1229
                          write_exp_elt_type (yyvsp[-2].tval);
1230
                          write_exp_elt_opcode (UNOP_CAST); ;
1231
    break;}
1232
case 33:
1233
#line 370 "c-exp.y"
1234
{ ;
1235
    break;}
1236
case 34:
1237
#line 376 "c-exp.y"
1238
{ write_exp_elt_opcode (BINOP_REPEAT); ;
1239
    break;}
1240
case 35:
1241
#line 380 "c-exp.y"
1242
{ write_exp_elt_opcode (BINOP_MUL); ;
1243
    break;}
1244
case 36:
1245
#line 384 "c-exp.y"
1246
{ write_exp_elt_opcode (BINOP_DIV); ;
1247
    break;}
1248
case 37:
1249
#line 388 "c-exp.y"
1250
{ write_exp_elt_opcode (BINOP_REM); ;
1251
    break;}
1252
case 38:
1253
#line 392 "c-exp.y"
1254
{ write_exp_elt_opcode (BINOP_ADD); ;
1255
    break;}
1256
case 39:
1257
#line 396 "c-exp.y"
1258
{ write_exp_elt_opcode (BINOP_SUB); ;
1259
    break;}
1260
case 40:
1261
#line 400 "c-exp.y"
1262
{ write_exp_elt_opcode (BINOP_LSH); ;
1263
    break;}
1264
case 41:
1265
#line 404 "c-exp.y"
1266
{ write_exp_elt_opcode (BINOP_RSH); ;
1267
    break;}
1268
case 42:
1269
#line 408 "c-exp.y"
1270
{ write_exp_elt_opcode (BINOP_EQUAL); ;
1271
    break;}
1272
case 43:
1273
#line 412 "c-exp.y"
1274
{ write_exp_elt_opcode (BINOP_NOTEQUAL); ;
1275
    break;}
1276
case 44:
1277
#line 416 "c-exp.y"
1278
{ write_exp_elt_opcode (BINOP_LEQ); ;
1279
    break;}
1280
case 45:
1281
#line 420 "c-exp.y"
1282
{ write_exp_elt_opcode (BINOP_GEQ); ;
1283
    break;}
1284
case 46:
1285
#line 424 "c-exp.y"
1286
{ write_exp_elt_opcode (BINOP_LESS); ;
1287
    break;}
1288
case 47:
1289
#line 428 "c-exp.y"
1290
{ write_exp_elt_opcode (BINOP_GTR); ;
1291
    break;}
1292
case 48:
1293
#line 432 "c-exp.y"
1294
{ write_exp_elt_opcode (BINOP_BITWISE_AND); ;
1295
    break;}
1296
case 49:
1297
#line 436 "c-exp.y"
1298
{ write_exp_elt_opcode (BINOP_BITWISE_XOR); ;
1299
    break;}
1300
case 50:
1301
#line 440 "c-exp.y"
1302
{ write_exp_elt_opcode (BINOP_BITWISE_IOR); ;
1303
    break;}
1304
case 51:
1305
#line 444 "c-exp.y"
1306
{ write_exp_elt_opcode (BINOP_LOGICAL_AND); ;
1307
    break;}
1308
case 52:
1309
#line 448 "c-exp.y"
1310
{ write_exp_elt_opcode (BINOP_LOGICAL_OR); ;
1311
    break;}
1312
case 53:
1313
#line 452 "c-exp.y"
1314
{ write_exp_elt_opcode (TERNOP_COND); ;
1315
    break;}
1316
case 54:
1317
#line 456 "c-exp.y"
1318
{ write_exp_elt_opcode (BINOP_ASSIGN); ;
1319
    break;}
1320
case 55:
1321
#line 460 "c-exp.y"
1322
{ write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
1323
                          write_exp_elt_opcode (yyvsp[-1].opcode);
1324
                          write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); ;
1325
    break;}
1326
case 56:
1327
#line 466 "c-exp.y"
1328
{ write_exp_elt_opcode (OP_LONG);
1329
                          write_exp_elt_type (yyvsp[0].typed_val_int.type);
1330
                          write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val_int.val));
1331
                          write_exp_elt_opcode (OP_LONG); ;
1332
    break;}
1333
case 57:
1334
#line 473 "c-exp.y"
1335
{ YYSTYPE val;
1336
                          parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
1337
                          write_exp_elt_opcode (OP_LONG);
1338
                          write_exp_elt_type (val.typed_val_int.type);
1339
                          write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
1340
                          write_exp_elt_opcode (OP_LONG);
1341
                        ;
1342
    break;}
1343
case 58:
1344
#line 484 "c-exp.y"
1345
{ write_exp_elt_opcode (OP_DOUBLE);
1346
                          write_exp_elt_type (yyvsp[0].typed_val_float.type);
1347
                          write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1348
                          write_exp_elt_opcode (OP_DOUBLE); ;
1349
    break;}
1350
case 61:
1351
#line 498 "c-exp.y"
1352
{ write_exp_elt_opcode (OP_LONG);
1353
                          write_exp_elt_type (builtin_type_int);
1354
                          CHECK_TYPEDEF (yyvsp[-1].tval);
1355
                          write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
1356
                          write_exp_elt_opcode (OP_LONG); ;
1357
    break;}
1358
case 62:
1359
#line 506 "c-exp.y"
1360
{ /* C strings are converted into array constants with
1361
                             an explicit null byte added at the end.  Thus
1362
                             the array upper bound is the string length.
1363
                             There is no such thing in C as a completely empty
1364
                             string. */
1365
                          char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
1366
                          while (count-- > 0)
1367
                            {
1368
                              write_exp_elt_opcode (OP_LONG);
1369
                              write_exp_elt_type (builtin_type_char);
1370
                              write_exp_elt_longcst ((LONGEST)(*sp++));
1371
                              write_exp_elt_opcode (OP_LONG);
1372
                            }
1373
                          write_exp_elt_opcode (OP_LONG);
1374
                          write_exp_elt_type (builtin_type_char);
1375
                          write_exp_elt_longcst ((LONGEST)'\0');
1376
                          write_exp_elt_opcode (OP_LONG);
1377
                          write_exp_elt_opcode (OP_ARRAY);
1378
                          write_exp_elt_longcst ((LONGEST) 0);
1379
                          write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
1380
                          write_exp_elt_opcode (OP_ARRAY); ;
1381
    break;}
1382
case 63:
1383
#line 531 "c-exp.y"
1384
{ write_exp_elt_opcode (OP_THIS);
1385
                          write_exp_elt_opcode (OP_THIS); ;
1386
    break;}
1387
case 64:
1388
#line 536 "c-exp.y"
1389
{ write_exp_elt_opcode (OP_LONG);
1390
                          write_exp_elt_type (builtin_type_bool);
1391
                          write_exp_elt_longcst ((LONGEST) 1);
1392
                          write_exp_elt_opcode (OP_LONG); ;
1393
    break;}
1394
case 65:
1395
#line 543 "c-exp.y"
1396
{ write_exp_elt_opcode (OP_LONG);
1397
                          write_exp_elt_type (builtin_type_bool);
1398
                          write_exp_elt_longcst ((LONGEST) 0);
1399
                          write_exp_elt_opcode (OP_LONG); ;
1400
    break;}
1401
case 66:
1402
#line 552 "c-exp.y"
1403
{
1404
                          if (yyvsp[0].ssym.sym)
1405
                            yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
1406
                          else
1407
                            error ("No file or function \"%s\".",
1408
                                   copy_name (yyvsp[0].ssym.stoken));
1409
                        ;
1410
    break;}
1411
case 67:
1412
#line 560 "c-exp.y"
1413
{
1414
                          yyval.bval = yyvsp[0].bval;
1415
                        ;
1416
    break;}
1417
case 68:
1418
#line 566 "c-exp.y"
1419
{ struct symbol *tem
1420
                            = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1421
                                             VAR_NAMESPACE, (int *) NULL,
1422
                                             (struct symtab **) NULL);
1423
                          if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
1424
                            error ("No function \"%s\" in specified context.",
1425
                                   copy_name (yyvsp[0].sval));
1426
                          yyval.bval = SYMBOL_BLOCK_VALUE (tem); ;
1427
    break;}
1428
case 69:
1429
#line 577 "c-exp.y"
1430
{ struct symbol *sym;
1431
                          sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
1432
                                               VAR_NAMESPACE, (int *) NULL,
1433
                                               (struct symtab **) NULL);
1434
                          if (sym == 0)
1435
                            error ("No symbol \"%s\" in specified context.",
1436
                                   copy_name (yyvsp[0].sval));
1437
 
1438
                          write_exp_elt_opcode (OP_VAR_VALUE);
1439
                          /* block_found is set by lookup_symbol.  */
1440
                          write_exp_elt_block (block_found);
1441
                          write_exp_elt_sym (sym);
1442
                          write_exp_elt_opcode (OP_VAR_VALUE); ;
1443
    break;}
1444
case 70:
1445
#line 593 "c-exp.y"
1446
{
1447
                          struct type *type = yyvsp[-2].tval;
1448
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1449
                              && TYPE_CODE (type) != TYPE_CODE_UNION)
1450
                            error ("`%s' is not defined as an aggregate type.",
1451
                                   TYPE_NAME (type));
1452
 
1453
                          write_exp_elt_opcode (OP_SCOPE);
1454
                          write_exp_elt_type (type);
1455
                          write_exp_string (yyvsp[0].sval);
1456
                          write_exp_elt_opcode (OP_SCOPE);
1457
                        ;
1458
    break;}
1459
case 71:
1460
#line 606 "c-exp.y"
1461
{
1462
                          struct type *type = yyvsp[-3].tval;
1463
                          struct stoken tmp_token;
1464
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
1465
                              && TYPE_CODE (type) != TYPE_CODE_UNION)
1466
                            error ("`%s' is not defined as an aggregate type.",
1467
                                   TYPE_NAME (type));
1468
 
1469
                          tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2);
1470
                          tmp_token.length = yyvsp[0].sval.length + 1;
1471
                          tmp_token.ptr[0] = '~';
1472
                          memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length);
1473
                          tmp_token.ptr[tmp_token.length] = 0;
1474
 
1475
                          /* Check for valid destructor name.  */
1476
                          destructor_name_p (tmp_token.ptr, type);
1477
                          write_exp_elt_opcode (OP_SCOPE);
1478
                          write_exp_elt_type (type);
1479
                          write_exp_string (tmp_token);
1480
                          write_exp_elt_opcode (OP_SCOPE);
1481
                        ;
1482
    break;}
1483
case 73:
1484
#line 631 "c-exp.y"
1485
{
1486
                          char *name = copy_name (yyvsp[0].sval);
1487
                          struct symbol *sym;
1488
                          struct minimal_symbol *msymbol;
1489
 
1490
                          sym =
1491
                            lookup_symbol (name, (const struct block *) NULL,
1492
                                           VAR_NAMESPACE, (int *) NULL,
1493
                                           (struct symtab **) NULL);
1494
                          if (sym)
1495
                            {
1496
                              write_exp_elt_opcode (OP_VAR_VALUE);
1497
                              write_exp_elt_block (NULL);
1498
                              write_exp_elt_sym (sym);
1499
                              write_exp_elt_opcode (OP_VAR_VALUE);
1500
                              break;
1501
                            }
1502
 
1503
                          msymbol = lookup_minimal_symbol (name, NULL, NULL);
1504
                          if (msymbol != NULL)
1505
                            {
1506
                              write_exp_msymbol (msymbol,
1507
                                                 lookup_function_type (builtin_type_int),
1508
                                                 builtin_type_int);
1509
                            }
1510
                          else
1511
                            if (!have_full_symbols () && !have_partial_symbols ())
1512
                              error ("No symbol table is loaded.  Use the \"file\" command.");
1513
                            else
1514
                              error ("No symbol \"%s\" in current context.", name);
1515
                        ;
1516
    break;}
1517
case 74:
1518
#line 665 "c-exp.y"
1519
{ struct symbol *sym = yyvsp[0].ssym.sym;
1520
 
1521
                          if (sym)
1522
                            {
1523
                              if (symbol_read_needs_frame (sym))
1524
                                {
1525
                                  if (innermost_block == 0 ||
1526
                                      contained_in (block_found,
1527
                                                    innermost_block))
1528
                                    innermost_block = block_found;
1529
                                }
1530
 
1531
                              write_exp_elt_opcode (OP_VAR_VALUE);
1532
                              /* We want to use the selected frame, not
1533
                                 another more inner frame which happens to
1534
                                 be in the same block.  */
1535
                              write_exp_elt_block (NULL);
1536
                              write_exp_elt_sym (sym);
1537
                              write_exp_elt_opcode (OP_VAR_VALUE);
1538
                            }
1539
                          else if (yyvsp[0].ssym.is_a_field_of_this)
1540
                            {
1541
                              /* C++: it hangs off of `this'.  Must
1542
                                 not inadvertently convert from a method call
1543
                                 to data ref.  */
1544
                              if (innermost_block == 0 ||
1545
                                  contained_in (block_found, innermost_block))
1546
                                innermost_block = block_found;
1547
                              write_exp_elt_opcode (OP_THIS);
1548
                              write_exp_elt_opcode (OP_THIS);
1549
                              write_exp_elt_opcode (STRUCTOP_PTR);
1550
                              write_exp_string (yyvsp[0].ssym.stoken);
1551
                              write_exp_elt_opcode (STRUCTOP_PTR);
1552
                            }
1553
                          else
1554
                            {
1555
                              struct minimal_symbol *msymbol;
1556
                              register char *arg = copy_name (yyvsp[0].ssym.stoken);
1557
 
1558
                              msymbol =
1559
                                lookup_minimal_symbol (arg, NULL, NULL);
1560
                              if (msymbol != NULL)
1561
                                {
1562
                                  write_exp_msymbol (msymbol,
1563
                                                     lookup_function_type (builtin_type_int),
1564
                                                     builtin_type_int);
1565
                                }
1566
                              else if (!have_full_symbols () && !have_partial_symbols ())
1567
                                error ("No symbol table is loaded.  Use the \"file\" command.");
1568
                              else
1569
                                error ("No symbol \"%s\" in current context.",
1570
                                       copy_name (yyvsp[0].ssym.stoken));
1571
                            }
1572
                        ;
1573
    break;}
1574
case 78:
1575
#line 731 "c-exp.y"
1576
{ yyval.tval = follow_types (yyvsp[-1].tval); ;
1577
    break;}
1578
case 79:
1579
#line 733 "c-exp.y"
1580
{ yyval.tval = follow_types (yyvsp[-2].tval); ;
1581
    break;}
1582
case 80:
1583
#line 735 "c-exp.y"
1584
{ yyval.tval = follow_types (yyvsp[-2].tval); ;
1585
    break;}
1586
case 81:
1587
#line 739 "c-exp.y"
1588
{ push_type (tp_pointer); yyval.voidval = 0; ;
1589
    break;}
1590
case 82:
1591
#line 741 "c-exp.y"
1592
{ push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; ;
1593
    break;}
1594
case 83:
1595
#line 743 "c-exp.y"
1596
{ push_type (tp_reference); yyval.voidval = 0; ;
1597
    break;}
1598
case 84:
1599
#line 745 "c-exp.y"
1600
{ push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; ;
1601
    break;}
1602
case 86:
1603
#line 750 "c-exp.y"
1604
{ yyval.voidval = yyvsp[-1].voidval; ;
1605
    break;}
1606
case 87:
1607
#line 752 "c-exp.y"
1608
{
1609
                          push_type_int (yyvsp[0].lval);
1610
                          push_type (tp_array);
1611
                        ;
1612
    break;}
1613
case 88:
1614
#line 757 "c-exp.y"
1615
{
1616
                          push_type_int (yyvsp[0].lval);
1617
                          push_type (tp_array);
1618
                          yyval.voidval = 0;
1619
                        ;
1620
    break;}
1621
case 89:
1622
#line 764 "c-exp.y"
1623
{ push_type (tp_function); ;
1624
    break;}
1625
case 90:
1626
#line 766 "c-exp.y"
1627
{ push_type (tp_function); ;
1628
    break;}
1629
case 91:
1630
#line 770 "c-exp.y"
1631
{ yyval.lval = -1; ;
1632
    break;}
1633
case 92:
1634
#line 772 "c-exp.y"
1635
{ yyval.lval = yyvsp[-1].typed_val_int.val; ;
1636
    break;}
1637
case 93:
1638
#line 776 "c-exp.y"
1639
{ yyval.voidval = 0; ;
1640
    break;}
1641
case 94:
1642
#line 778 "c-exp.y"
1643
{ free ((PTR)yyvsp[-1].tvec); yyval.voidval = 0; ;
1644
    break;}
1645
case 96:
1646
#line 791 "c-exp.y"
1647
{ yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); ;
1648
    break;}
1649
case 97:
1650
#line 796 "c-exp.y"
1651
{ yyval.tval = yyvsp[0].tsym.type; ;
1652
    break;}
1653
case 98:
1654
#line 798 "c-exp.y"
1655
{ yyval.tval = builtin_type_int; ;
1656
    break;}
1657
case 99:
1658
#line 800 "c-exp.y"
1659
{ yyval.tval = builtin_type_long; ;
1660
    break;}
1661
case 100:
1662
#line 802 "c-exp.y"
1663
{ yyval.tval = builtin_type_short; ;
1664
    break;}
1665
case 101:
1666
#line 804 "c-exp.y"
1667
{ yyval.tval = builtin_type_long; ;
1668
    break;}
1669
case 102:
1670
#line 806 "c-exp.y"
1671
{ yyval.tval = builtin_type_unsigned_long; ;
1672
    break;}
1673
case 103:
1674
#line 808 "c-exp.y"
1675
{ yyval.tval = builtin_type_long_long; ;
1676
    break;}
1677
case 104:
1678
#line 810 "c-exp.y"
1679
{ yyval.tval = builtin_type_long_long; ;
1680
    break;}
1681
case 105:
1682
#line 812 "c-exp.y"
1683
{ yyval.tval = builtin_type_unsigned_long_long; ;
1684
    break;}
1685
case 106:
1686
#line 814 "c-exp.y"
1687
{ yyval.tval = builtin_type_unsigned_long_long; ;
1688
    break;}
1689
case 107:
1690
#line 816 "c-exp.y"
1691
{ yyval.tval = builtin_type_short; ;
1692
    break;}
1693
case 108:
1694
#line 818 "c-exp.y"
1695
{ yyval.tval = builtin_type_unsigned_short; ;
1696
    break;}
1697
case 109:
1698
#line 820 "c-exp.y"
1699
{ yyval.tval = builtin_type_double; ;
1700
    break;}
1701
case 110:
1702
#line 822 "c-exp.y"
1703
{ yyval.tval = builtin_type_long_double; ;
1704
    break;}
1705
case 111:
1706
#line 824 "c-exp.y"
1707
{ yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
1708
                                              expression_context_block); ;
1709
    break;}
1710
case 112:
1711
#line 827 "c-exp.y"
1712
{ yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
1713
                                              expression_context_block); ;
1714
    break;}
1715
case 113:
1716
#line 830 "c-exp.y"
1717
{ yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
1718
                                             expression_context_block); ;
1719
    break;}
1720
case 114:
1721
#line 833 "c-exp.y"
1722
{ yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
1723
                                            expression_context_block); ;
1724
    break;}
1725
case 115:
1726
#line 836 "c-exp.y"
1727
{ yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); ;
1728
    break;}
1729
case 116:
1730
#line 838 "c-exp.y"
1731
{ yyval.tval = builtin_type_unsigned_int; ;
1732
    break;}
1733
case 117:
1734
#line 840 "c-exp.y"
1735
{ yyval.tval = lookup_signed_typename (TYPE_NAME(yyvsp[0].tsym.type)); ;
1736
    break;}
1737
case 118:
1738
#line 842 "c-exp.y"
1739
{ yyval.tval = builtin_type_int; ;
1740
    break;}
1741
case 119:
1742
#line 847 "c-exp.y"
1743
{ yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval,
1744
                                                    expression_context_block);
1745
                        ;
1746
    break;}
1747
case 120:
1748
#line 853 "c-exp.y"
1749
{ yyval.tval = yyvsp[0].tval; ;
1750
    break;}
1751
case 121:
1752
#line 854 "c-exp.y"
1753
{ yyval.tval = yyvsp[0].tval; ;
1754
    break;}
1755
case 123:
1756
#line 859 "c-exp.y"
1757
{
1758
                  yyval.tsym.stoken.ptr = "int";
1759
                  yyval.tsym.stoken.length = 3;
1760
                  yyval.tsym.type = builtin_type_int;
1761
                ;
1762
    break;}
1763
case 124:
1764
#line 865 "c-exp.y"
1765
{
1766
                  yyval.tsym.stoken.ptr = "long";
1767
                  yyval.tsym.stoken.length = 4;
1768
                  yyval.tsym.type = builtin_type_long;
1769
                ;
1770
    break;}
1771
case 125:
1772
#line 871 "c-exp.y"
1773
{
1774
                  yyval.tsym.stoken.ptr = "short";
1775
                  yyval.tsym.stoken.length = 5;
1776
                  yyval.tsym.type = builtin_type_short;
1777
                ;
1778
    break;}
1779
case 126:
1780
#line 880 "c-exp.y"
1781
{ yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2);
1782
                  yyval.ivec[0] = 1;     /* Number of types in vector */
1783
                  yyval.tvec[1] = yyvsp[0].tval;
1784
                ;
1785
    break;}
1786
case 127:
1787
#line 885 "c-exp.y"
1788
{ int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1);
1789
                  yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len);
1790
                  yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
1791
                ;
1792
    break;}
1793
case 128:
1794
#line 891 "c-exp.y"
1795
{ yyval.sval = yyvsp[0].ssym.stoken; ;
1796
    break;}
1797
case 129:
1798
#line 892 "c-exp.y"
1799
{ yyval.sval = yyvsp[0].ssym.stoken; ;
1800
    break;}
1801
case 130:
1802
#line 893 "c-exp.y"
1803
{ yyval.sval = yyvsp[0].tsym.stoken; ;
1804
    break;}
1805
case 131:
1806
#line 894 "c-exp.y"
1807
{ yyval.sval = yyvsp[0].ssym.stoken; ;
1808
    break;}
1809
}
1810
   /* the action file gets copied in in place of this dollarsign */
1811
#line 542 "/usr/lib/bison.simple"
1812
 
1813
  yyvsp -= yylen;
1814
  yyssp -= yylen;
1815
#ifdef YYLSP_NEEDED
1816
  yylsp -= yylen;
1817
#endif
1818
 
1819
#if YYDEBUG != 0
1820
  if (yydebug)
1821
    {
1822
      short *ssp1 = yyss - 1;
1823
      fprintf (stderr, "state stack now");
1824
      while (ssp1 != yyssp)
1825
        fprintf (stderr, " %d", *++ssp1);
1826
      fprintf (stderr, "\n");
1827
    }
1828
#endif
1829
 
1830
  *++yyvsp = yyval;
1831
 
1832
#ifdef YYLSP_NEEDED
1833
  yylsp++;
1834
  if (yylen == 0)
1835
    {
1836
      yylsp->first_line = yylloc.first_line;
1837
      yylsp->first_column = yylloc.first_column;
1838
      yylsp->last_line = (yylsp-1)->last_line;
1839
      yylsp->last_column = (yylsp-1)->last_column;
1840
      yylsp->text = 0;
1841
    }
1842
  else
1843
    {
1844
      yylsp->last_line = (yylsp+yylen-1)->last_line;
1845
      yylsp->last_column = (yylsp+yylen-1)->last_column;
1846
    }
1847
#endif
1848
 
1849
  /* Now "shift" the result of the reduction.
1850
     Determine what state that goes to,
1851
     based on the state we popped back to
1852
     and the rule number reduced by.  */
1853
 
1854
  yyn = yyr1[yyn];
1855
 
1856
  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1857
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1858
    yystate = yytable[yystate];
1859
  else
1860
    yystate = yydefgoto[yyn - YYNTBASE];
1861
 
1862
  goto yynewstate;
1863
 
1864
yyerrlab:   /* here on detecting error */
1865
 
1866
  if (! yyerrstatus)
1867
    /* If not already recovering from an error, report this error.  */
1868
    {
1869
      ++yynerrs;
1870
 
1871
#ifdef YYERROR_VERBOSE
1872
      yyn = yypact[yystate];
1873
 
1874
      if (yyn > YYFLAG && yyn < YYLAST)
1875
        {
1876
          int size = 0;
1877
          char *msg;
1878
          int x, count;
1879
 
1880
          count = 0;
1881
          /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
1882
          for (x = (yyn < 0 ? -yyn : 0);
1883
               x < (sizeof(yytname) / sizeof(char *)); x++)
1884
            if (yycheck[x + yyn] == x)
1885
              size += strlen(yytname[x]) + 15, count++;
1886
          msg = (char *) xmalloc(size + 15);
1887
          if (msg != 0)
1888
            {
1889
              strcpy(msg, "parse error");
1890
 
1891
              if (count < 5)
1892
                {
1893
                  count = 0;
1894
                  for (x = (yyn < 0 ? -yyn : 0);
1895
                       x < (sizeof(yytname) / sizeof(char *)); x++)
1896
                    if (yycheck[x + yyn] == x)
1897
                      {
1898
                        strcat(msg, count == 0 ? ", expecting `" : " or `");
1899
                        strcat(msg, yytname[x]);
1900
                        strcat(msg, "'");
1901
                        count++;
1902
                      }
1903
                }
1904
              yyerror(msg);
1905
              free(msg);
1906
            }
1907
          else
1908
            yyerror ("parse error; also virtual memory exceeded");
1909
        }
1910
      else
1911
#endif /* YYERROR_VERBOSE */
1912
        yyerror("parse error");
1913
    }
1914
 
1915
  goto yyerrlab1;
1916
yyerrlab1:   /* here on error raised explicitly by an action */
1917
 
1918
  if (yyerrstatus == 3)
1919
    {
1920
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
1921
 
1922
      /* return failure if at end of input */
1923
      if (yychar == YYEOF)
1924
        YYABORT;
1925
 
1926
#if YYDEBUG != 0
1927
      if (yydebug)
1928
        fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1929
#endif
1930
 
1931
      yychar = YYEMPTY;
1932
    }
1933
 
1934
  /* Else will try to reuse lookahead token
1935
     after shifting the error token.  */
1936
 
1937
  yyerrstatus = 3;              /* Each real token shifted decrements this */
1938
 
1939
  goto yyerrhandle;
1940
 
1941
yyerrdefault:  /* current state does not do anything special for the error token. */
1942
 
1943
#if 0
1944
  /* This is wrong; only states that explicitly want error tokens
1945
     should shift them.  */
1946
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
1947
  if (yyn) goto yydefault;
1948
#endif
1949
 
1950
yyerrpop:   /* pop the current state because it cannot handle the error token */
1951
 
1952
  if (yyssp == yyss) YYABORT;
1953
  yyvsp--;
1954
  yystate = *--yyssp;
1955
#ifdef YYLSP_NEEDED
1956
  yylsp--;
1957
#endif
1958
 
1959
#if YYDEBUG != 0
1960
  if (yydebug)
1961
    {
1962
      short *ssp1 = yyss - 1;
1963
      fprintf (stderr, "Error: state stack now");
1964
      while (ssp1 != yyssp)
1965
        fprintf (stderr, " %d", *++ssp1);
1966
      fprintf (stderr, "\n");
1967
    }
1968
#endif
1969
 
1970
yyerrhandle:
1971
 
1972
  yyn = yypact[yystate];
1973
  if (yyn == YYFLAG)
1974
    goto yyerrdefault;
1975
 
1976
  yyn += YYTERROR;
1977
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1978
    goto yyerrdefault;
1979
 
1980
  yyn = yytable[yyn];
1981
  if (yyn < 0)
1982
    {
1983
      if (yyn == YYFLAG)
1984
        goto yyerrpop;
1985
      yyn = -yyn;
1986
      goto yyreduce;
1987
    }
1988
  else if (yyn == 0)
1989
    goto yyerrpop;
1990
 
1991
  if (yyn == YYFINAL)
1992
    YYACCEPT;
1993
 
1994
#if YYDEBUG != 0
1995
  if (yydebug)
1996
    fprintf(stderr, "Shifting error token, ");
1997
#endif
1998
 
1999
  *++yyvsp = yylval;
2000
#ifdef YYLSP_NEEDED
2001
  *++yylsp = yylloc;
2002
#endif
2003
 
2004
  yystate = yyn;
2005
  goto yynewstate;
2006
 
2007
 yyacceptlab:
2008
  /* YYACCEPT comes here.  */
2009
  if (yyfree_stacks)
2010
    {
2011
      free (yyss);
2012
      free (yyvs);
2013
#ifdef YYLSP_NEEDED
2014
      free (yyls);
2015
#endif
2016
    }
2017
  return 0;
2018
 
2019
 yyabortlab:
2020
  /* YYABORT comes here.  */
2021
  if (yyfree_stacks)
2022
    {
2023
      free (yyss);
2024
      free (yyvs);
2025
#ifdef YYLSP_NEEDED
2026
      free (yyls);
2027
#endif
2028
    }
2029
  return 1;
2030
}
2031
#line 908 "c-exp.y"
2032
 
2033
 
2034
/* Take care of parsing a number (anything that starts with a digit).
2035
   Set yylval and return the token type; update lexptr.
2036
   LEN is the number of characters in it.  */
2037
 
2038
/*** Needs some error checking for the float case ***/
2039
 
2040
static int
2041
parse_number (p, len, parsed_float, putithere)
2042
     register char *p;
2043
     register int len;
2044
     int parsed_float;
2045
     YYSTYPE *putithere;
2046
{
2047
  /* FIXME: Shouldn't these be unsigned?  We don't deal with negative values
2048
     here, and we do kind of silly things like cast to unsigned.  */
2049
  register LONGEST n = 0;
2050
  register LONGEST prevn = 0;
2051
  ULONGEST un;
2052
 
2053
  register int i = 0;
2054
  register int c;
2055
  register int base = input_radix;
2056
  int unsigned_p = 0;
2057
 
2058
  /* Number of "L" suffixes encountered.  */
2059
  int long_p = 0;
2060
 
2061
  /* We have found a "L" or "U" suffix.  */
2062
  int found_suffix = 0;
2063
 
2064
  ULONGEST high_bit;
2065
  struct type *signed_type;
2066
  struct type *unsigned_type;
2067
 
2068
  if (parsed_float)
2069
    {
2070
      /* It's a float since it contains a point or an exponent.  */
2071
      char c;
2072
      int num = 0;       /* number of tokens scanned by scanf */
2073
      char saved_char = p[len];
2074
 
2075
      p[len] = 0;        /* null-terminate the token */
2076
      if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
2077
        num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c);
2078
      else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
2079
        num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c);
2080
      else
2081
        {
2082
#ifdef SCANF_HAS_LONG_DOUBLE
2083
          num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval,&c);
2084
#else
2085
          /* Scan it into a double, then assign it to the long double.
2086
             This at least wins with values representable in the range
2087
             of doubles. */
2088
          double temp;
2089
          num = sscanf (p, "%lg%c", &temp,&c);
2090
          putithere->typed_val_float.dval = temp;
2091
#endif
2092
        }
2093
      p[len] = saved_char;      /* restore the input stream */
2094
      if (num != 1)             /* check scanf found ONLY a float ... */
2095
        return ERROR;
2096
      /* See if it has `f' or `l' suffix (float or long double).  */
2097
 
2098
      c = tolower (p[len - 1]);
2099
 
2100
      if (c == 'f')
2101
        putithere->typed_val_float.type = builtin_type_float;
2102
      else if (c == 'l')
2103
        putithere->typed_val_float.type = builtin_type_long_double;
2104
      else if (isdigit (c) || c == '.')
2105
        putithere->typed_val_float.type = builtin_type_double;
2106
      else
2107
        return ERROR;
2108
 
2109
      return FLOAT;
2110
    }
2111
 
2112
  /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
2113
  if (p[0] == '0')
2114
    switch (p[1])
2115
      {
2116
      case 'x':
2117
      case 'X':
2118
        if (len >= 3)
2119
          {
2120
            p += 2;
2121
            base = 16;
2122
            len -= 2;
2123
          }
2124
        break;
2125
 
2126
      case 't':
2127
      case 'T':
2128
      case 'd':
2129
      case 'D':
2130
        if (len >= 3)
2131
          {
2132
            p += 2;
2133
            base = 10;
2134
            len -= 2;
2135
          }
2136
        break;
2137
 
2138
      default:
2139
        base = 8;
2140
        break;
2141
      }
2142
 
2143
  while (len-- > 0)
2144
    {
2145
      c = *p++;
2146
      if (c >= 'A' && c <= 'Z')
2147
        c += 'a' - 'A';
2148
      if (c != 'l' && c != 'u')
2149
        n *= base;
2150
      if (c >= '0' && c <= '9')
2151
        {
2152
          if (found_suffix)
2153
            return ERROR;
2154
          n += i = c - '0';
2155
        }
2156
      else
2157
        {
2158
          if (base > 10 && c >= 'a' && c <= 'f')
2159
            {
2160
              if (found_suffix)
2161
                return ERROR;
2162
              n += i = c - 'a' + 10;
2163
            }
2164
          else if (c == 'l')
2165
            {
2166
              ++long_p;
2167
              found_suffix = 1;
2168
            }
2169
          else if (c == 'u')
2170
            {
2171
              unsigned_p = 1;
2172
              found_suffix = 1;
2173
            }
2174
          else
2175
            return ERROR;       /* Char not a digit */
2176
        }
2177
      if (i >= base)
2178
        return ERROR;           /* Invalid digit in this base */
2179
 
2180
      /* Portably test for overflow (only works for nonzero values, so make
2181
         a second check for zero).  FIXME: Can't we just make n and prevn
2182
         unsigned and avoid this?  */
2183
      if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
2184
        unsigned_p = 1;         /* Try something unsigned */
2185
 
2186
      /* Portably test for unsigned overflow.
2187
         FIXME: This check is wrong; for example it doesn't find overflow
2188
         on 0x123456789 when LONGEST is 32 bits.  */
2189
      if (c != 'l' && c != 'u' && n != 0)
2190
        {
2191
          if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n))
2192
            error ("Numeric constant too large.");
2193
        }
2194
      prevn = n;
2195
    }
2196
 
2197
  /* An integer constant is an int, a long, or a long long.  An L
2198
     suffix forces it to be long; an LL suffix forces it to be long
2199
     long.  If not forced to a larger size, it gets the first type of
2200
     the above that it fits in.  To figure out whether it fits, we
2201
     shift it right and see whether anything remains.  Note that we
2202
     can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
2203
     operation, because many compilers will warn about such a shift
2204
     (which always produces a zero result).  Sometimes TARGET_INT_BIT
2205
     or TARGET_LONG_BIT will be that big, sometimes not.  To deal with
2206
     the case where it is we just always shift the value more than
2207
     once, with fewer bits each time.  */
2208
 
2209
  un = (ULONGEST)n >> 2;
2210
  if (long_p == 0
2211
      && (un >> (TARGET_INT_BIT - 2)) == 0)
2212
    {
2213
      high_bit = ((ULONGEST)1) << (TARGET_INT_BIT-1);
2214
 
2215
      /* A large decimal (not hex or octal) constant (between INT_MAX
2216
         and UINT_MAX) is a long or unsigned long, according to ANSI,
2217
         never an unsigned int, but this code treats it as unsigned
2218
         int.  This probably should be fixed.  GCC gives a warning on
2219
         such constants.  */
2220
 
2221
      unsigned_type = builtin_type_unsigned_int;
2222
      signed_type = builtin_type_int;
2223
    }
2224
  else if (long_p <= 1
2225
           && (un >> (TARGET_LONG_BIT - 2)) == 0)
2226
    {
2227
      high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1);
2228
      unsigned_type = builtin_type_unsigned_long;
2229
      signed_type = builtin_type_long;
2230
    }
2231
  else
2232
    {
2233
      int shift;
2234
      if (sizeof (ULONGEST) * HOST_CHAR_BIT < TARGET_LONG_LONG_BIT)
2235
        /* A long long does not fit in a LONGEST.  */
2236
        shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
2237
      else
2238
        shift = (TARGET_LONG_LONG_BIT - 1);
2239
      high_bit = (ULONGEST) 1 << shift;
2240
      unsigned_type = builtin_type_unsigned_long_long;
2241
      signed_type = builtin_type_long_long;
2242
    }
2243
 
2244
   putithere->typed_val_int.val = n;
2245
 
2246
   /* If the high bit of the worked out type is set then this number
2247
      has to be unsigned. */
2248
 
2249
   if (unsigned_p || (n & high_bit))
2250
     {
2251
       putithere->typed_val_int.type = unsigned_type;
2252
     }
2253
   else
2254
     {
2255
       putithere->typed_val_int.type = signed_type;
2256
     }
2257
 
2258
   return INT;
2259
}
2260
 
2261
struct token
2262
{
2263
  char *operator;
2264
  int token;
2265
  enum exp_opcode opcode;
2266
};
2267
 
2268
static const struct token tokentab3[] =
2269
  {
2270
    {">>=", ASSIGN_MODIFY, BINOP_RSH},
2271
    {"<<=", ASSIGN_MODIFY, BINOP_LSH}
2272
  };
2273
 
2274
static const struct token tokentab2[] =
2275
  {
2276
    {"+=", ASSIGN_MODIFY, BINOP_ADD},
2277
    {"-=", ASSIGN_MODIFY, BINOP_SUB},
2278
    {"*=", ASSIGN_MODIFY, BINOP_MUL},
2279
    {"/=", ASSIGN_MODIFY, BINOP_DIV},
2280
    {"%=", ASSIGN_MODIFY, BINOP_REM},
2281
    {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
2282
    {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
2283
    {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
2284
    {"++", INCREMENT, BINOP_END},
2285
    {"--", DECREMENT, BINOP_END},
2286
    {"->", ARROW, BINOP_END},
2287
    {"&&", ANDAND, BINOP_END},
2288
    {"||", OROR, BINOP_END},
2289
    {"::", COLONCOLON, BINOP_END},
2290
    {"<<", LSH, BINOP_END},
2291
    {">>", RSH, BINOP_END},
2292
    {"==", EQUAL, BINOP_END},
2293
    {"!=", NOTEQUAL, BINOP_END},
2294
    {"<=", LEQ, BINOP_END},
2295
    {">=", GEQ, BINOP_END}
2296
  };
2297
 
2298
/* Read one token, getting characters through lexptr.  */
2299
 
2300
static int
2301
yylex ()
2302
{
2303
  int c;
2304
  int namelen;
2305
  unsigned int i;
2306
  char *tokstart;
2307
  char *tokptr;
2308
  int tempbufindex;
2309
  static char *tempbuf;
2310
  static int tempbufsize;
2311
  struct symbol * sym_class = NULL;
2312
  char * token_string = NULL;
2313
  int class_prefix = 0;
2314
  int unquoted_expr;
2315
 
2316
 retry:
2317
 
2318
  unquoted_expr = 1;
2319
 
2320
  tokstart = lexptr;
2321
  /* See if it is a special token of length 3.  */
2322
  for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
2323
    if (STREQN (tokstart, tokentab3[i].operator, 3))
2324
      {
2325
        lexptr += 3;
2326
        yylval.opcode = tokentab3[i].opcode;
2327
        return tokentab3[i].token;
2328
      }
2329
 
2330
  /* See if it is a special token of length 2.  */
2331
  for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
2332
    if (STREQN (tokstart, tokentab2[i].operator, 2))
2333
      {
2334
        lexptr += 2;
2335
        yylval.opcode = tokentab2[i].opcode;
2336
        return tokentab2[i].token;
2337
      }
2338
 
2339
  switch (c = *tokstart)
2340
    {
2341
    case 0:
2342
      return 0;
2343
 
2344
    case ' ':
2345
    case '\t':
2346
    case '\n':
2347
      lexptr++;
2348
      goto retry;
2349
 
2350
    case '\'':
2351
      /* We either have a character constant ('0' or '\177' for example)
2352
         or we have a quoted symbol reference ('foo(int,int)' in C++
2353
         for example). */
2354
      lexptr++;
2355
      c = *lexptr++;
2356
      if (c == '\\')
2357
        c = parse_escape (&lexptr);
2358
      else if (c == '\'')
2359
        error ("Empty character constant.");
2360
 
2361
      yylval.typed_val_int.val = c;
2362
      yylval.typed_val_int.type = builtin_type_char;
2363
 
2364
      c = *lexptr++;
2365
      if (c != '\'')
2366
        {
2367
          namelen = skip_quoted (tokstart) - tokstart;
2368
          if (namelen > 2)
2369
            {
2370
              lexptr = tokstart + namelen;
2371
              unquoted_expr = 0;
2372
              if (lexptr[-1] != '\'')
2373
                error ("Unmatched single quote.");
2374
              namelen -= 2;
2375
              tokstart++;
2376
              goto tryname;
2377
            }
2378
          error ("Invalid character constant.");
2379
        }
2380
      return INT;
2381
 
2382
    case '(':
2383
      paren_depth++;
2384
      lexptr++;
2385
      return c;
2386
 
2387
    case ')':
2388
      if (paren_depth == 0)
2389
        return 0;
2390
      paren_depth--;
2391
      lexptr++;
2392
      return c;
2393
 
2394
    case ',':
2395
      if (comma_terminates && paren_depth == 0)
2396
        return 0;
2397
      lexptr++;
2398
      return c;
2399
 
2400
    case '.':
2401
      /* Might be a floating point number.  */
2402
      if (lexptr[1] < '0' || lexptr[1] > '9')
2403
        goto symbol;            /* Nope, must be a symbol. */
2404
      /* FALL THRU into number case.  */
2405
 
2406
    case '0':
2407
    case '1':
2408
    case '2':
2409
    case '3':
2410
    case '4':
2411
    case '5':
2412
    case '6':
2413
    case '7':
2414
    case '8':
2415
    case '9':
2416
      {
2417
        /* It's a number.  */
2418
        int got_dot = 0, got_e = 0, toktype;
2419
        register char *p = tokstart;
2420
        int hex = input_radix > 10;
2421
 
2422
        if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
2423
          {
2424
            p += 2;
2425
            hex = 1;
2426
          }
2427
        else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
2428
          {
2429
            p += 2;
2430
            hex = 0;
2431
          }
2432
 
2433
        for (;; ++p)
2434
          {
2435
            /* This test includes !hex because 'e' is a valid hex digit
2436
               and thus does not indicate a floating point number when
2437
               the radix is hex.  */
2438
            if (!hex && !got_e && (*p == 'e' || *p == 'E'))
2439
              got_dot = got_e = 1;
2440
            /* This test does not include !hex, because a '.' always indicates
2441
               a decimal floating point number regardless of the radix.  */
2442
            else if (!got_dot && *p == '.')
2443
              got_dot = 1;
2444
            else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
2445
                     && (*p == '-' || *p == '+'))
2446
              /* This is the sign of the exponent, not the end of the
2447
                 number.  */
2448
              continue;
2449
            /* We will take any letters or digits.  parse_number will
2450
               complain if past the radix, or if L or U are not final.  */
2451
            else if ((*p < '0' || *p > '9')
2452
                     && ((*p < 'a' || *p > 'z')
2453
                                  && (*p < 'A' || *p > 'Z')))
2454
              break;
2455
          }
2456
        toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
2457
        if (toktype == ERROR)
2458
          {
2459
            char *err_copy = (char *) alloca (p - tokstart + 1);
2460
 
2461
            memcpy (err_copy, tokstart, p - tokstart);
2462
            err_copy[p - tokstart] = 0;
2463
            error ("Invalid number \"%s\".", err_copy);
2464
          }
2465
        lexptr = p;
2466
        return toktype;
2467
      }
2468
 
2469
    case '+':
2470
    case '-':
2471
    case '*':
2472
    case '/':
2473
    case '%':
2474
    case '|':
2475
    case '&':
2476
    case '^':
2477
    case '~':
2478
    case '!':
2479
    case '@':
2480
    case '<':
2481
    case '>':
2482
    case '[':
2483
    case ']':
2484
    case '?':
2485
    case ':':
2486
    case '=':
2487
    case '{':
2488
    case '}':
2489
    symbol:
2490
      lexptr++;
2491
      return c;
2492
 
2493
    case '"':
2494
 
2495
      /* Build the gdb internal form of the input string in tempbuf,
2496
         translating any standard C escape forms seen.  Note that the
2497
         buffer is null byte terminated *only* for the convenience of
2498
         debugging gdb itself and printing the buffer contents when
2499
         the buffer contains no embedded nulls.  Gdb does not depend
2500
         upon the buffer being null byte terminated, it uses the length
2501
         string instead.  This allows gdb to handle C strings (as well
2502
         as strings in other languages) with embedded null bytes */
2503
 
2504
      tokptr = ++tokstart;
2505
      tempbufindex = 0;
2506
 
2507
      do {
2508
        /* Grow the static temp buffer if necessary, including allocating
2509
           the first one on demand. */
2510
        if (tempbufindex + 1 >= tempbufsize)
2511
          {
2512
            tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
2513
          }
2514
        switch (*tokptr)
2515
          {
2516
          case '\0':
2517
          case '"':
2518
            /* Do nothing, loop will terminate. */
2519
            break;
2520
          case '\\':
2521
            tokptr++;
2522
            c = parse_escape (&tokptr);
2523
            if (c == -1)
2524
              {
2525
                continue;
2526
              }
2527
            tempbuf[tempbufindex++] = c;
2528
            break;
2529
          default:
2530
            tempbuf[tempbufindex++] = *tokptr++;
2531
            break;
2532
          }
2533
      } while ((*tokptr != '"') && (*tokptr != '\0'));
2534
      if (*tokptr++ != '"')
2535
        {
2536
          error ("Unterminated string in expression.");
2537
        }
2538
      tempbuf[tempbufindex] = '\0';     /* See note above */
2539
      yylval.sval.ptr = tempbuf;
2540
      yylval.sval.length = tempbufindex;
2541
      lexptr = tokptr;
2542
      return (STRING);
2543
    }
2544
 
2545
  if (!(c == '_' || c == '$'
2546
        || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
2547
    /* We must have come across a bad character (e.g. ';').  */
2548
    error ("Invalid character '%c' in expression.", c);
2549
 
2550
  /* It's a name.  See how long it is.  */
2551
  namelen = 0;
2552
  for (c = tokstart[namelen];
2553
       (c == '_' || c == '$' || (c >= '0' && c <= '9')
2554
        || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
2555
    {
2556
      /* Template parameter lists are part of the name.
2557
         FIXME: This mishandles `print $a<4&&$a>3'.  */
2558
 
2559
      if (c == '<')
2560
        {
2561
               /* Scan ahead to get rest of the template specification.  Note
2562
                  that we look ahead only when the '<' adjoins non-whitespace
2563
                  characters; for comparison expressions, e.g. "a < b > c",
2564
                  there must be spaces before the '<', etc. */
2565
 
2566
               char * p = find_template_name_end (tokstart + namelen);
2567
               if (p)
2568
                 namelen = p - tokstart;
2569
               break;
2570
        }
2571
      c = tokstart[++namelen];
2572
    }
2573
 
2574
  /* The token "if" terminates the expression and is NOT
2575
     removed from the input stream.  */
2576
  if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
2577
    {
2578
      return 0;
2579
    }
2580
 
2581
  lexptr += namelen;
2582
 
2583
  tryname:
2584
 
2585
  /* Catch specific keywords.  Should be done with a data structure.  */
2586
  switch (namelen)
2587
    {
2588
    case 8:
2589
      if (STREQN (tokstart, "unsigned", 8))
2590
        return UNSIGNED;
2591
      if (current_language->la_language == language_cplus
2592
          && STREQN (tokstart, "template", 8))
2593
        return TEMPLATE;
2594
      if (STREQN (tokstart, "volatile", 8))
2595
        return VOLATILE_KEYWORD;
2596
      break;
2597
    case 6:
2598
      if (STREQN (tokstart, "struct", 6))
2599
        return STRUCT;
2600
      if (STREQN (tokstart, "signed", 6))
2601
        return SIGNED_KEYWORD;
2602
      if (STREQN (tokstart, "sizeof", 6))
2603
        return SIZEOF;
2604
      if (STREQN (tokstart, "double", 6))
2605
        return DOUBLE_KEYWORD;
2606
      break;
2607
    case 5:
2608
      if (current_language->la_language == language_cplus)
2609
        {
2610
          if (STREQN (tokstart, "false", 5))
2611
            return FALSEKEYWORD;
2612
          if (STREQN (tokstart, "class", 5))
2613
            return CLASS;
2614
        }
2615
      if (STREQN (tokstart, "union", 5))
2616
        return UNION;
2617
      if (STREQN (tokstart, "short", 5))
2618
        return SHORT;
2619
      if (STREQN (tokstart, "const", 5))
2620
        return CONST_KEYWORD;
2621
      break;
2622
    case 4:
2623
      if (STREQN (tokstart, "enum", 4))
2624
        return ENUM;
2625
      if (STREQN (tokstart, "long", 4))
2626
        return LONG;
2627
      if (current_language->la_language == language_cplus)
2628
          {
2629
            if (STREQN (tokstart, "true", 4))
2630
              return TRUEKEYWORD;
2631
 
2632
            if (STREQN (tokstart, "this", 4))
2633
              {
2634
                static const char this_name[] =
2635
                { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
2636
 
2637
                if (lookup_symbol (this_name, expression_context_block,
2638
                                   VAR_NAMESPACE, (int *) NULL,
2639
                                   (struct symtab **) NULL))
2640
                  return THIS;
2641
              }
2642
          }
2643
      break;
2644
    case 3:
2645
      if (STREQN (tokstart, "int", 3))
2646
        return INT_KEYWORD;
2647
      break;
2648
    default:
2649
      break;
2650
    }
2651
 
2652
  yylval.sval.ptr = tokstart;
2653
  yylval.sval.length = namelen;
2654
 
2655
  if (*tokstart == '$')
2656
    {
2657
      write_dollar_variable (yylval.sval);
2658
      return VARIABLE;
2659
    }
2660
 
2661
  /* Look ahead and see if we can consume more of the input
2662
     string to get a reasonable class/namespace spec or a
2663
     fully-qualified name.  This is a kludge to get around the
2664
     HP aCC compiler's generation of symbol names with embedded
2665
     colons for namespace and nested classes. */
2666
  if (unquoted_expr)
2667
    {
2668
      /* Only do it if not inside single quotes */
2669
      sym_class = parse_nested_classes_for_hpacc (yylval.sval.ptr, yylval.sval.length,
2670
                                                  &token_string, &class_prefix, &lexptr);
2671
      if (sym_class)
2672
        {
2673
          /* Replace the current token with the bigger one we found */
2674
          yylval.sval.ptr = token_string;
2675
          yylval.sval.length = strlen (token_string);
2676
        }
2677
    }
2678
 
2679
  /* Use token-type BLOCKNAME for symbols that happen to be defined as
2680
     functions or symtabs.  If this is not so, then ...
2681
     Use token-type TYPENAME for symbols that happen to be defined
2682
     currently as names of types; NAME for other symbols.
2683
     The caller is not constrained to care about the distinction.  */
2684
  {
2685
    char *tmp = copy_name (yylval.sval);
2686
    struct symbol *sym;
2687
    int is_a_field_of_this = 0;
2688
    int hextype;
2689
 
2690
    sym = lookup_symbol (tmp, expression_context_block,
2691
                         VAR_NAMESPACE,
2692
                         current_language->la_language == language_cplus
2693
                         ? &is_a_field_of_this : (int *) NULL,
2694
                         (struct symtab **) NULL);
2695
    /* Call lookup_symtab, not lookup_partial_symtab, in case there are
2696
       no psymtabs (coff, xcoff, or some future change to blow away the
2697
       psymtabs once once symbols are read).  */
2698
    if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
2699
      {
2700
        yylval.ssym.sym = sym;
2701
        yylval.ssym.is_a_field_of_this = is_a_field_of_this;
2702
        return BLOCKNAME;
2703
      }
2704
    else if (!sym)
2705
      {                         /* See if it's a file name. */
2706
        struct symtab *symtab;
2707
 
2708
        symtab = lookup_symtab (tmp);
2709
 
2710
        if (symtab)
2711
          {
2712
            yylval.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
2713
            return FILENAME;
2714
          }
2715
      }
2716
 
2717
    if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
2718
        {
2719
#if 1
2720
          /* Despite the following flaw, we need to keep this code enabled.
2721
             Because we can get called from check_stub_method, if we don't
2722
             handle nested types then it screws many operations in any
2723
             program which uses nested types.  */
2724
          /* In "A::x", if x is a member function of A and there happens
2725
             to be a type (nested or not, since the stabs don't make that
2726
             distinction) named x, then this code incorrectly thinks we
2727
             are dealing with nested types rather than a member function.  */
2728
 
2729
          char *p;
2730
          char *namestart;
2731
          struct symbol *best_sym;
2732
 
2733
          /* Look ahead to detect nested types.  This probably should be
2734
             done in the grammar, but trying seemed to introduce a lot
2735
             of shift/reduce and reduce/reduce conflicts.  It's possible
2736
             that it could be done, though.  Or perhaps a non-grammar, but
2737
             less ad hoc, approach would work well.  */
2738
 
2739
          /* Since we do not currently have any way of distinguishing
2740
             a nested type from a non-nested one (the stabs don't tell
2741
             us whether a type is nested), we just ignore the
2742
             containing type.  */
2743
 
2744
          p = lexptr;
2745
          best_sym = sym;
2746
          while (1)
2747
            {
2748
              /* Skip whitespace.  */
2749
              while (*p == ' ' || *p == '\t' || *p == '\n')
2750
                ++p;
2751
              if (*p == ':' && p[1] == ':')
2752
                {
2753
                  /* Skip the `::'.  */
2754
                  p += 2;
2755
                  /* Skip whitespace.  */
2756
                  while (*p == ' ' || *p == '\t' || *p == '\n')
2757
                    ++p;
2758
                  namestart = p;
2759
                  while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
2760
                         || (*p >= 'a' && *p <= 'z')
2761
                         || (*p >= 'A' && *p <= 'Z'))
2762
                    ++p;
2763
                  if (p != namestart)
2764
                    {
2765
                      struct symbol *cur_sym;
2766
                      /* As big as the whole rest of the expression, which is
2767
                         at least big enough.  */
2768
                      char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3);
2769
                      char *tmp1;
2770
 
2771
                      tmp1 = ncopy;
2772
                      memcpy (tmp1, tmp, strlen (tmp));
2773
                      tmp1 += strlen (tmp);
2774
                      memcpy (tmp1, "::", 2);
2775
                      tmp1 += 2;
2776
                      memcpy (tmp1, namestart, p - namestart);
2777
                      tmp1[p - namestart] = '\0';
2778
                      cur_sym = lookup_symbol (ncopy, expression_context_block,
2779
                                               VAR_NAMESPACE, (int *) NULL,
2780
                                               (struct symtab **) NULL);
2781
                      if (cur_sym)
2782
                        {
2783
                          if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
2784
                            {
2785
                              best_sym = cur_sym;
2786
                              lexptr = p;
2787
                            }
2788
                          else
2789
                            break;
2790
                        }
2791
                      else
2792
                        break;
2793
                    }
2794
                  else
2795
                    break;
2796
                }
2797
              else
2798
                break;
2799
            }
2800
 
2801
          yylval.tsym.type = SYMBOL_TYPE (best_sym);
2802
#else /* not 0 */
2803
          yylval.tsym.type = SYMBOL_TYPE (sym);
2804
#endif /* not 0 */
2805
          return TYPENAME;
2806
        }
2807
    if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
2808
        return TYPENAME;
2809
 
2810
    /* Input names that aren't symbols but ARE valid hex numbers,
2811
       when the input radix permits them, can be names or numbers
2812
       depending on the parse.  Note we support radixes > 16 here.  */
2813
    if (!sym &&
2814
        ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
2815
         (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
2816
      {
2817
        YYSTYPE newlval;        /* Its value is ignored.  */
2818
        hextype = parse_number (tokstart, namelen, 0, &newlval);
2819
        if (hextype == INT)
2820
          {
2821
            yylval.ssym.sym = sym;
2822
            yylval.ssym.is_a_field_of_this = is_a_field_of_this;
2823
            return NAME_OR_INT;
2824
          }
2825
      }
2826
 
2827
    /* Any other kind of symbol */
2828
    yylval.ssym.sym = sym;
2829
    yylval.ssym.is_a_field_of_this = is_a_field_of_this;
2830
    return NAME;
2831
  }
2832
}
2833
 
2834
void
2835
yyerror (msg)
2836
     char *msg;
2837
{
2838
  error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
2839
}

powered by: WebSVN 2.1.0

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