Bug Summary

File:src/gnu/usr.bin/binutils/obj/gdb/p-exp.c
Warning:line 1919, column 6
1st function call argument is an uninitialized value

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple amd64-unknown-openbsd7.0 -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name p-exp.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 1 -pic-is-pie -mframe-pointer=all -relaxed-aliasing -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/gnu/usr.bin/binutils/obj/gdb -resource-dir /usr/local/lib/clang/13.0.0 -D PIE_DEFAULT=1 -I . -I /usr/src/gnu/usr.bin/binutils/gdb -I /usr/src/gnu/usr.bin/binutils/gdb/config -D LOCALEDIR="/usr/share/locale" -D HAVE_CONFIG_H -I /usr/src/gnu/usr.bin/binutils/gdb/../include/opcode -I ../bfd -I /usr/src/gnu/usr.bin/binutils/gdb/../bfd -I /usr/src/gnu/usr.bin/binutils/gdb/../include -I ../intl -I /usr/src/gnu/usr.bin/binutils/gdb/../intl -D MI_OUT=1 -D TUI=1 -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/usr/src/gnu/usr.bin/binutils/obj/gdb -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fgnuc-version=4.2.1 -fcommon -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/ben/Projects/vmm/scan-build/2022-01-12-194120-40624-1 -x c p-exp.c
1#include <stdlib.h>
2#include <string.h>
3#define YYBYACC1 1
4#define YYMAJOR1 1
5#define YYMINOR9 9
6#define YYLEXpascal_lex() yylexpascal_lex()
7#define YYEMPTY-1 -1
8#define yyclearin(pascal_char=(-1)) (yycharpascal_char=(YYEMPTY-1))
9#define yyerrok(pascal_errflag=0) (yyerrflagpascal_errflag=0)
10#define YYRECOVERING()(pascal_errflag!=0) (yyerrflagpascal_errflag!=0)
11#define YYPREFIX"yy" "yy"
12#line 47 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
13
14#include "defs.h"
15#include "gdb_string.h"
16#include <ctype.h>
17#include "expression.h"
18#include "value.h"
19#include "parser-defs.h"
20#include "language.h"
21#include "p-lang.h"
22#include "bfd.h" /* Required by objfiles.h. */
23#include "symfile.h" /* Required by objfiles.h. */
24#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
25#include "block.h"
26
27/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
28 as well as gratuitiously global symbol names, so we can have multiple
29 yacc generated parsers in gdb. Note that these are only the variables
30 produced by yacc. If other parser generators (bison, byacc, etc) produce
31 additional global names that conflict at link time, then those parser
32 generators need to be fixed instead of adding those names to this list. */
33
34#define yymaxdepthpascal_maxdepth pascal_maxdepth
35#define yyparsepascal_parse pascal_parse
36#define yylexpascal_lex pascal_lex
37#define yyerrorpascal_error pascal_error
38#define yylvalpascal_lval pascal_lval
39#define yycharpascal_char pascal_char
40#define yydebugpascal_debug pascal_debug
41#define yypactpascal_pact pascal_pact
42#define yyr1pascal_r1 pascal_r1
43#define yyr2pascal_r2 pascal_r2
44#define yydefpascal_def pascal_def
45#define yychkpascal_chk pascal_chk
46#define yypgopascal_pgo pascal_pgo
47#define yyactpascal_act pascal_act
48#define yyexcapascal_exca pascal_exca
49#define yyerrflagpascal_errflag pascal_errflag
50#define yynerrspascal_nerrs pascal_nerrs
51#define yypspascal_ps pascal_ps
52#define yypvpascal_pv pascal_pv
53#define yyspascal_s pascal_s
54#define yy_yyspascal_yys pascal_yys
55#define yystatepascal_state pascal_state
56#define yytmppascal_tmp pascal_tmp
57#define yyvpascal_v pascal_v
58#define yy_yyvpascal_yyv pascal_yyv
59#define yyvalpascal_val pascal_val
60#define yyllocpascal_lloc pascal_lloc
61#define yyredspascal_reds pascal_reds /* With YYDEBUG defined */
62#define yytokspascal_toks pascal_toks /* With YYDEBUG defined */
63#define yynamepascal_name pascal_name /* With YYDEBUG defined */
64#define yyrulepascal_rule pascal_rule /* With YYDEBUG defined */
65#define yylhspascal_yylhs pascal_yylhs
66#define yylenpascal_yylen pascal_yylen
67#define yydefredpascal_yydefred pascal_yydefred
68#define yydgotopascal_yydgoto pascal_yydgoto
69#define yysindexpascal_yysindex pascal_yysindex
70#define yyrindexpascal_yyrindex pascal_yyrindex
71#define yygindexpascal_yygindex pascal_yygindex
72#define yytablepascal_yytable pascal_yytable
73#define yycheckpascal_yycheck pascal_yycheck
74
75#ifndef YYDEBUG1
76#define YYDEBUG1 1 /* Default to yydebug support */
77#endif
78
79#define YYFPRINTFparser_fprintf parser_fprintf
80
81int yyparsepascal_parse (void);
82
83static int yylexpascal_lex (void);
84
85void
86yyerrorpascal_error (char *);
87
88static char * uptok (char *, int);
89#line 129 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
90#ifndef YYSTYPE_DEFINED
91#define YYSTYPE_DEFINED
92typedef union
93 {
94 LONGESTlong lval;
95 struct {
96 LONGESTlong val;
97 struct type *type;
98 } typed_val_int;
99 struct {
100 DOUBLEST dval;
101 struct type *type;
102 } typed_val_float;
103 struct symbol *sym;
104 struct type *tval;
105 struct stoken sval;
106 struct ttype tsym;
107 struct symtoken ssym;
108 int voidval;
109 struct block *bval;
110 enum exp_opcode opcode;
111 struct internalvar *ivar;
112
113 struct type **tvec;
114 int *ivec;
115 } YYSTYPE;
116#endif /* YYSTYPE_DEFINED */
117#line 155 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
118/* YYSTYPE gets defined by %union */
119static int
120parse_number (char *, int, int, YYSTYPE *);
121
122static struct type *current_type;
123
124static void push_current_type (void);
125static void pop_current_type (void);
126static int search_field;
127#define INT257 257
128#define FLOAT258 258
129#define STRING259 259
130#define FIELDNAME260 260
131#define NAME261 261
132#define TYPENAME262 262
133#define NAME_OR_INT263 263
134#define STRUCT264 264
135#define CLASS265 265
136#define SIZEOF266 266
137#define COLONCOLON267 267
138#define ERROR268 268
139#define VARIABLE269 269
140#define THIS270 270
141#define TRUEKEYWORD271 271
142#define FALSEKEYWORD272 272
143#define ABOVE_COMMA273 273
144#define ASSIGN274 274
145#define NOT275 275
146#define OR276 276
147#define XOR277 277
148#define ANDAND278 278
149#define NOTEQUAL279 279
150#define LEQ280 280
151#define GEQ281 281
152#define LSH282 282
153#define RSH283 283
154#define DIV284 284
155#define MOD285 285
156#define UNARY286 286
157#define INCREMENT287 287
158#define DECREMENT288 288
159#define ARROW289 289
160#define BLOCKNAME290 290
161#define YYERRCODE256 256
162const short yylhspascal_yylhs[] =
163 { -1,
164 13, 0, 4, 4, 3, 2, 2, 1, 1, 1,
165 1, 1, 1, 14, 1, 15, 1, 17, 1, 16,
166 16, 16, 1, 1, 1, 1, 1, 1, 1, 1,
167 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
168 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
169 1, 1, 12, 12, 5, 6, 5, 5, 5, 9,
170 7, 7, 8, 8, 8, 8, 10, 10, 10, 10,
171 11, 11,
172};
173const short yylenpascal_yylen[] =
174 { 2,
175 0, 2, 1, 1, 1, 1, 3, 2, 2, 2,
176 2, 4, 4, 0, 4, 0, 5, 0, 5, 0,
177 1, 3, 4, 3, 3, 3, 3, 3, 3, 3,
178 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
179 3, 3, 1, 1, 1, 1, 1, 1, 1, 4,
180 1, 1, 1, 3, 3, 3, 1, 2, 1, 1,
181 1, 3, 2, 1, 2, 2, 1, 1, 1, 1,
182 1, 1,
183};
184const short yydefredpascal_yydefred[] =
185 { 1,
186 0, 0, 45, 47, 51, 71, 64, 46, 0, 0,
187 0, 0, 49, 52, 43, 44, 0, 0, 0, 0,
188 0, 0, 0, 0, 0, 0, 4, 2, 48, 57,
189 0, 0, 61, 59, 0, 67, 69, 70, 68, 65,
190 66, 0, 58, 0, 0, 0, 0, 0, 0, 0,
191 63, 0, 0, 0, 0, 0, 0, 0, 0, 0,
192 0, 0, 0, 0, 0, 0, 0, 0, 0, 14,
193 16, 18, 8, 0, 0, 0, 0, 0, 0, 0,
194 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
196 0, 0, 0, 0, 0, 62, 56, 0, 50, 0,
197 12, 13, 15, 0, 0, 0, 23, 17, 0, 19,
198 0,
199};
200const short yydgotopascal_yydgoto[] =
201 { 1,
202 25, 26, 27, 28, 29, 30, 45, 32, 33, 40,
203 34, 35, 2, 101, 102, 116, 103,
204};
205const short yysindexpascal_yysindex[] =
206 { 0,
207 0, 534, 0, 0, 0, 0, 0, 0, -28, -28,
208 -35, -28, 0, 0, 0, 0, 534, 534, 534, -27,
209 -22, 534, -86, 0, 599, -11, 0, 0, 0, 0,
210 -5, -230, 0, 0, -229, 0, 0, 0, 0, 0,
211 0, -86, 0, 70, -5, 70, 70, 534, 534, -24,
212 0, 534, 534, 534, 534, 534, 534, 534, 534, 534,
213 534, 534, 534, 534, 534, 534, 534, 534, 534, 0,
214 0, 0, 0, 534, 534, -40, -28, 9, -228, 549,
215 561, 0, 599, 611, 623, 825, 875, 875, -36, -36,
216 -36, -36, 494, 494, 494, 494, 536, 536, 70, 70,
217 -209, 534, 534, 599, 573, 0, 0, 0, 0, 30,
218 0, 0, 0, -41, 599, -19, 0, 0, 534, 0,
219 599,};
220const short yyrindexpascal_yyrindex[] =
221 { 0,
222 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
224 0, 0, 0, 1, 12, 74, 0, 0, 0, 0,
225 75, 14, 0, 0, 0, 0, 0, 0, 0, 0,
226 0, 0, 0, 36, 0, 59, 89, 0, 0, 0,
227 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
229 0, 0, 0, 0, 0, 0, 0, 0, 50, 0,
230 0, 0, 32, 504, 49, 16, 82, 491, 445, 456,
231 469, 482, 170, 183, 196, 287, 146, 158, 112, 124,
232 0, 0, -15, 229, 0, 0, 0, 24, 0, 0,
233 0, 0, 0, 0, -14, 0, 0, 0, 0, 0,
234 -13,};
235const short yygindexpascal_yygindex[] =
236 { 0,
237 893, -3, 0, 0, 0, 0, -2, -8, 0, 11,
238 0, 0, 0, 0, 0, 0, 0,
239};
240#define YYTABLESIZE1160 1160
241const short yytablepascal_yytable[] =
242 { 31,
243 72, 106, 74, 72, 42, 68, 66, 23, 67, 70,
244 69, 6, 48, 60, 51, 39, 82, 49, 50, 74,
245 41, 120, 43, 55, 119, 20, 21, 22, 20, 21,
246 22, 42, 74, 79, 75, 11, 76, 77, 110, 78,
247 72, 72, 72, 72, 72, 72, 72, 72, 40, 109,
248 113, 118, 6, 60, 71, 6, 39, 73, 9, 39,
249 72, 72, 72, 55, 55, 55, 55, 55, 55, 55,
250 55, 106, 42, 3, 5, 42, 11, 11, 11, 11,
251 11, 33, 11, 55, 55, 55, 107, 108, 10, 40,
252 60, 72, 40, 72, 72, 11, 11, 11, 114, 9,
253 9, 9, 9, 9, 6, 9, 0, 0, 39, 72,
254 0, 25, 0, 0, 55, 70, 55, 55, 9, 9,
255 9, 0, 33, 26, 42, 33, 0, 0, 11, 10,
256 10, 10, 10, 10, 0, 10, 0, 0, 0, 0,
257 0, 40, 33, 0, 0, 29, 0, 0, 10, 10,
258 10, 9, 25, 25, 25, 25, 25, 30, 25, 0,
259 71, 0, 0, 73, 26, 26, 26, 26, 26, 31,
260 26, 25, 25, 25, 33, 7, 0, 9, 10, 0,
261 0, 10, 32, 26, 26, 26, 29, 0, 29, 29,
262 29, 0, 0, 0, 0, 27, 0, 0, 30, 0,
263 30, 30, 30, 0, 25, 29, 29, 29, 0, 0,
264 31, 0, 0, 31, 0, 0, 26, 30, 30, 30,
265 36, 37, 38, 32, 0, 0, 32, 0, 7, 31,
266 31, 31, 36, 37, 38, 0, 27, 0, 29, 27,
267 0, 0, 32, 32, 32, 62, 63, 64, 65, 39,
268 30, 0, 0, 0, 0, 27, 27, 27, 0, 0,
269 0, 39, 31, 0, 0, 0, 0, 53, 0, 7,
270 0, 0, 7, 0, 72, 32, 72, 72, 72, 72,
271 72, 72, 72, 72, 72, 72, 28, 0, 27, 39,
272 54, 39, 39, 39, 0, 0, 0, 55, 0, 55,
273 55, 55, 55, 55, 55, 55, 55, 55, 55, 11,
274 0, 11, 11, 11, 11, 11, 11, 11, 11, 11,
275 11, 7, 40, 0, 40, 40, 0, 28, 0, 0,
276 28, 0, 9, 0, 9, 9, 9, 9, 9, 9,
277 9, 9, 9, 9, 0, 0, 28, 28, 28, 0,
278 0, 0, 0, 0, 0, 33, 0, 33, 33, 33,
279 33, 0, 10, 0, 10, 10, 10, 10, 10, 10,
280 10, 10, 10, 10, 0, 0, 0, 0, 0, 28,
281 0, 0, 0, 0, 0, 25, 0, 25, 25, 25,
282 25, 25, 25, 25, 25, 25, 25, 26, 0, 26,
283 26, 26, 26, 26, 26, 26, 26, 26, 26, 0,
284 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,
285 0, 29, 29, 29, 29, 29, 29, 29, 29, 29,
286 29, 30, 0, 30, 30, 30, 30, 30, 30, 30,
287 30, 30, 30, 31, 37, 31, 31, 31, 31, 31,
288 31, 31, 31, 31, 31, 38, 32, 0, 32, 32,
289 32, 32, 32, 32, 32, 32, 32, 32, 35, 27,
290 0, 27, 27, 27, 27, 27, 27, 27, 27, 27,
291 27, 36, 0, 0, 0, 37, 0, 0, 37, 0,
292 34, 0, 0, 0, 0, 0, 38, 0, 0, 38,
293 0, 0, 0, 41, 37, 37, 37, 0, 0, 35,
294 0, 0, 35, 0, 0, 38, 38, 38, 0, 0,
295 0, 0, 36, 0, 0, 36, 0, 0, 35, 35,
296 35, 34, 0, 72, 34, 68, 66, 37, 67, 70,
297 69, 36, 36, 36, 41, 0, 0, 41, 38, 0,
298 0, 34, 0, 0, 0, 0, 0, 0, 0, 0,
299 28, 35, 28, 28, 28, 28, 28, 28, 28, 28,
300 28, 28, 0, 22, 36, 72, 0, 68, 19, 0,
301 0, 70, 69, 34, 71, 0, 0, 73, 72, 111,
302 68, 66, 0, 67, 70, 69, 41, 18, 0, 0,
303 72, 112, 68, 66, 0, 67, 70, 69, 58, 56,
304 59, 0, 72, 117, 68, 66, 0, 67, 70, 69,
305 58, 56, 59, 0, 0, 0, 71, 23, 0, 73,
306 0, 0, 58, 56, 59, 0, 0, 0, 72, 71,
307 68, 66, 73, 67, 70, 69, 0, 0, 0, 0,
308 72, 71, 68, 66, 73, 67, 70, 69, 58, 56,
309 59, 0, 72, 71, 68, 66, 73, 67, 70, 69,
310 58, 56, 59, 0, 0, 0, 0, 0, 0, 0,
311 0, 0, 58, 56, 59, 0, 0, 0, 0, 71,
312 0, 0, 73, 0, 0, 0, 0, 0, 0, 0,
313 0, 71, 0, 0, 73, 0, 0, 0, 0, 0,
314 0, 0, 0, 71, 0, 0, 73, 0, 37, 0,
315 37, 37, 37, 37, 37, 37, 0, 0, 0, 38,
316 0, 38, 38, 38, 38, 38, 38, 0, 0, 0,
317 0, 0, 35, 0, 35, 35, 35, 35, 35, 35,
318 0, 0, 0, 0, 0, 36, 0, 36, 36, 36,
319 36, 36, 36, 0, 34, 0, 34, 34, 34, 34,
320 0, 0, 0, 0, 0, 0, 0, 41, 0, 41,
321 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
322 3, 4, 5, 0, 6, 7, 8, 9, 10, 11,
323 12, 0, 13, 14, 15, 16, 0, 0, 17, 0,
324 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
325 20, 21, 52, 24, 53, 54, 55, 57, 60, 61,
326 62, 63, 64, 65, 52, 0, 53, 54, 55, 57,
327 60, 61, 62, 63, 64, 65, 52, 0, 53, 54,
328 55, 57, 60, 61, 62, 63, 64, 65, 0, 0,
329 0, 0, 0, 0, 72, 0, 68, 66, 0, 67,
330 70, 69, 52, 0, 53, 54, 55, 57, 60, 61,
331 62, 63, 64, 65, 58, 56, 59, 54, 55, 57,
332 60, 61, 62, 63, 64, 65, 0, 0, 0, 0,
333 55, 57, 60, 61, 62, 63, 64, 65, 0, 44,
334 46, 47, 0, 0, 72, 71, 68, 66, 73, 67,
335 70, 69, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 58, 0, 59, 0, 0, 0,
337 80, 81, 0, 0, 83, 84, 85, 86, 87, 88,
338 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
339 99, 100, 0, 0, 0, 71, 104, 105, 73, 0,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
342 0, 0, 0, 0, 0, 115, 0, 0, 0, 0,
343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
344 0, 121, 0, 0, 0, 0, 0, 0, 0, 0,
345 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
348 0, 0, 0, 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, 0, 0, 0, 0,
351 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
352 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
353 0, 0, 0, 57, 60, 61, 62, 63, 64, 65,
354 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
355 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
356 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
358 0, 0, 0, 0, 60, 61, 62, 63, 64, 65,
359};
360const short yycheckpascal_yycheck[] =
361 { 2,
362 0, 42, 44, 40, 40, 42, 43, 94, 45, 46,
363 47, 0, 40, 0, 23, 0, 41, 40, 22, 44,
364 10, 41, 12, 0, 44, 41, 41, 41, 44, 44,
365 44, 0, 44, 42, 40, 0, 267, 267, 267, 42,
366 40, 41, 42, 43, 44, 45, 46, 47, 0, 41,
367 260, 93, 41, 40, 91, 44, 41, 94, 0, 44,
368 60, 61, 62, 40, 41, 42, 43, 44, 45, 46,
369 47, 42, 41, 0, 0, 44, 41, 42, 43, 44,
370 45, 0, 47, 60, 61, 62, 76, 77, 0, 41,
371 41, 91, 44, 93, 94, 60, 61, 62, 102, 41,
372 42, 43, 44, 45, 93, 47, -1, -1, 93, 40,
373 -1, 0, -1, -1, 91, 46, 93, 94, 60, 61,
374 62, -1, 41, 0, 93, 44, -1, -1, 93, 41,
375 42, 43, 44, 45, -1, 47, -1, -1, -1, -1,
376 -1, 93, 61, -1, -1, 0, -1, -1, 60, 61,
377 62, 93, 41, 42, 43, 44, 45, 0, 47, -1,
378 91, -1, -1, 94, 41, 42, 43, 44, 45, 0,
379 47, 60, 61, 62, 93, 262, -1, 264, 265, -1,
380 -1, 93, 0, 60, 61, 62, 41, -1, 43, 44,
381 45, -1, -1, -1, -1, 0, -1, -1, 41, -1,
382 43, 44, 45, -1, 93, 60, 61, 62, -1, -1,
383 41, -1, -1, 44, -1, -1, 93, 60, 61, 62,
384 261, 262, 263, 41, -1, -1, 44, -1, 0, 60,
385 61, 62, 261, 262, 263, -1, 41, -1, 93, 44,
386 -1, -1, 60, 61, 62, 282, 283, 284, 285, 290,
387 93, -1, -1, -1, -1, 60, 61, 62, -1, -1,
388 -1, 290, 93, -1, -1, -1, -1, 267, -1, 41,
389 -1, -1, 44, -1, 274, 93, 276, 277, 278, 279,
390 280, 281, 282, 283, 284, 285, 0, -1, 93, 274,
391 267, 276, 277, 278, -1, -1, -1, 274, -1, 276,
392 277, 278, 279, 280, 281, 282, 283, 284, 285, 274,
393 -1, 276, 277, 278, 279, 280, 281, 282, 283, 284,
394 285, 93, 274, -1, 276, 277, -1, 41, -1, -1,
395 44, -1, 274, -1, 276, 277, 278, 279, 280, 281,
396 282, 283, 284, 285, -1, -1, 60, 61, 62, -1,
397 -1, -1, -1, -1, -1, 274, -1, 276, 277, 278,
398 279, -1, 274, -1, 276, 277, 278, 279, 280, 281,
399 282, 283, 284, 285, -1, -1, -1, -1, -1, 93,
400 -1, -1, -1, -1, -1, 274, -1, 276, 277, 278,
401 279, 280, 281, 282, 283, 284, 285, 274, -1, 276,
402 277, 278, 279, 280, 281, 282, 283, 284, 285, -1,
403 -1, -1, -1, -1, -1, -1, -1, -1, -1, 274,
404 -1, 276, 277, 278, 279, 280, 281, 282, 283, 284,
405 285, 274, -1, 276, 277, 278, 279, 280, 281, 282,
406 283, 284, 285, 274, 0, 276, 277, 278, 279, 280,
407 281, 282, 283, 284, 285, 0, 274, -1, 276, 277,
408 278, 279, 280, 281, 282, 283, 284, 285, 0, 274,
409 -1, 276, 277, 278, 279, 280, 281, 282, 283, 284,
410 285, 0, -1, -1, -1, 41, -1, -1, 44, -1,
411 0, -1, -1, -1, -1, -1, 41, -1, -1, 44,
412 -1, -1, -1, 0, 60, 61, 62, -1, -1, 41,
413 -1, -1, 44, -1, -1, 60, 61, 62, -1, -1,
414 -1, -1, 41, -1, -1, 44, -1, -1, 60, 61,
415 62, 41, -1, 40, 44, 42, 43, 93, 45, 46,
416 47, 60, 61, 62, 41, -1, -1, 44, 93, -1,
417 -1, 61, -1, -1, -1, -1, -1, -1, -1, -1,
418 274, 93, 276, 277, 278, 279, 280, 281, 282, 283,
419 284, 285, -1, 40, 93, 40, -1, 42, 45, -1,
420 -1, 46, 47, 93, 91, -1, -1, 94, 40, 41,
421 42, 43, -1, 45, 46, 47, 93, 64, -1, -1,
422 40, 41, 42, 43, -1, 45, 46, 47, 60, 61,
423 62, -1, 40, 41, 42, 43, -1, 45, 46, 47,
424 60, 61, 62, -1, -1, -1, 91, 94, -1, 94,
425 -1, -1, 60, 61, 62, -1, -1, -1, 40, 91,
426 42, 43, 94, 45, 46, 47, -1, -1, -1, -1,
427 40, 91, 42, 43, 94, 45, 46, 47, 60, 61,
428 62, -1, 40, 91, 42, 43, 94, 45, 46, 47,
429 60, 61, 62, -1, -1, -1, -1, -1, -1, -1,
430 -1, -1, 60, 61, 62, -1, -1, -1, -1, 91,
431 -1, -1, 94, -1, -1, -1, -1, -1, -1, -1,
432 -1, 91, -1, -1, 94, -1, -1, -1, -1, -1,
433 -1, -1, -1, 91, -1, -1, 94, -1, 274, -1,
434 276, 277, 278, 279, 280, 281, -1, -1, -1, 274,
435 -1, 276, 277, 278, 279, 280, 281, -1, -1, -1,
436 -1, -1, 274, -1, 276, 277, 278, 279, 280, 281,
437 -1, -1, -1, -1, -1, 274, -1, 276, 277, 278,
438 279, 280, 281, -1, 274, -1, 276, 277, 278, 279,
439 -1, -1, -1, -1, -1, -1, -1, 274, -1, 276,
440 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
441 257, 258, 259, -1, 261, 262, 263, 264, 265, 266,
442 267, -1, 269, 270, 271, 272, -1, -1, 275, -1,
443 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
444 287, 288, 274, 290, 276, 277, 278, 279, 280, 281,
445 282, 283, 284, 285, 274, -1, 276, 277, 278, 279,
446 280, 281, 282, 283, 284, 285, 274, -1, 276, 277,
447 278, 279, 280, 281, 282, 283, 284, 285, -1, -1,
448 -1, -1, -1, -1, 40, -1, 42, 43, -1, 45,
449 46, 47, 274, -1, 276, 277, 278, 279, 280, 281,
450 282, 283, 284, 285, 60, 61, 62, 277, 278, 279,
451 280, 281, 282, 283, 284, 285, -1, -1, -1, -1,
452 278, 279, 280, 281, 282, 283, 284, 285, -1, 17,
453 18, 19, -1, -1, 40, 91, 42, 43, 94, 45,
454 46, 47, -1, -1, -1, -1, -1, -1, -1, -1,
455 -1, -1, -1, -1, 60, -1, 62, -1, -1, -1,
456 48, 49, -1, -1, 52, 53, 54, 55, 56, 57,
457 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
458 68, 69, -1, -1, -1, 91, 74, 75, 94, -1,
459 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
460 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
461 -1, -1, -1, -1, -1, 103, -1, -1, -1, -1,
462 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
463 -1, 119, -1, -1, -1, -1, -1, -1, -1, -1,
464 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
465 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
466 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
467 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
468 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
469 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
470 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
471 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
472 -1, -1, -1, 279, 280, 281, 282, 283, 284, 285,
473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
475 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
476 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
477 -1, -1, -1, -1, 280, 281, 282, 283, 284, 285,
478};
479#define YYFINAL1 1
480#ifndef YYDEBUG1
481#define YYDEBUG1 0
482#endif
483#define YYMAXTOKEN290 290
484#if YYDEBUG1
485const char * const yynamepascal_name[] =
486 {
487"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4880,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0,0,0,0,0,0,0,0,
4890,0,"'<'","'='","'>'",0,"'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4900,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4920,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4930,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4940,0,0,0,0,0,0,0,0,0,0,0,0,"INT","FLOAT","STRING","FIELDNAME","NAME","TYPENAME",
495"NAME_OR_INT","STRUCT","CLASS","SIZEOF","COLONCOLON","ERROR","VARIABLE","THIS",
496"TRUEKEYWORD","FALSEKEYWORD","ABOVE_COMMA","ASSIGN","NOT","OR","XOR","ANDAND",
497"NOTEQUAL","LEQ","GEQ","LSH","RSH","DIV","MOD","UNARY","INCREMENT","DECREMENT",
498"ARROW","BLOCKNAME",
499};
500const char * const yyrulepascal_rule[] =
501 {"$accept : start",
502"$$1 :",
503"start : $$1 normal_start",
504"normal_start : exp1",
505"normal_start : type_exp",
506"type_exp : type",
507"exp1 : exp",
508"exp1 : exp1 ',' exp",
509"exp : exp '^'",
510"exp : '@' exp",
511"exp : '-' exp",
512"exp : NOT exp",
513"exp : INCREMENT '(' exp ')'",
514"exp : DECREMENT '(' exp ')'",
515"$$2 :",
516"exp : exp '.' $$2 FIELDNAME",
517"$$3 :",
518"exp : exp '[' $$3 exp1 ']'",
519"$$4 :",
520"exp : exp '(' $$4 arglist ')'",
521"arglist :",
522"arglist : exp",
523"arglist : arglist ',' exp",
524"exp : type '(' exp ')'",
525"exp : '(' exp1 ')'",
526"exp : exp '*' exp",
527"exp : exp '/' exp",
528"exp : exp DIV exp",
529"exp : exp MOD exp",
530"exp : exp '+' exp",
531"exp : exp '-' exp",
532"exp : exp LSH exp",
533"exp : exp RSH exp",
534"exp : exp '=' exp",
535"exp : exp NOTEQUAL exp",
536"exp : exp LEQ exp",
537"exp : exp GEQ exp",
538"exp : exp '<' exp",
539"exp : exp '>' exp",
540"exp : exp ANDAND exp",
541"exp : exp XOR exp",
542"exp : exp OR exp",
543"exp : exp ASSIGN exp",
544"exp : TRUEKEYWORD",
545"exp : FALSEKEYWORD",
546"exp : INT",
547"exp : NAME_OR_INT",
548"exp : FLOAT",
549"exp : variable",
550"exp : VARIABLE",
551"exp : SIZEOF '(' type ')'",
552"exp : STRING",
553"exp : THIS",
554"block : BLOCKNAME",
555"block : block COLONCOLON name",
556"variable : block COLONCOLON name",
557"qualified_name : typebase COLONCOLON name",
558"variable : qualified_name",
559"variable : COLONCOLON name",
560"variable : name_not_typename",
561"ptype : typebase",
562"type : ptype",
563"type : typebase COLONCOLON '*'",
564"typebase : '^' typebase",
565"typebase : TYPENAME",
566"typebase : STRUCT name",
567"typebase : CLASS name",
568"name : NAME",
569"name : BLOCKNAME",
570"name : TYPENAME",
571"name : NAME_OR_INT",
572"name_not_typename : NAME",
573"name_not_typename : BLOCKNAME",
574};
575#endif
576#ifdef YYSTACKSIZE10000
577#undef YYMAXDEPTH10000
578#define YYMAXDEPTH10000 YYSTACKSIZE10000
579#else
580#ifdef YYMAXDEPTH10000
581#define YYSTACKSIZE10000 YYMAXDEPTH10000
582#else
583#define YYSTACKSIZE10000 10000
584#define YYMAXDEPTH10000 10000
585#endif
586#endif
587#define YYINITSTACKSIZE200 200
588/* LINTUSED */
589int yydebugpascal_debug;
590int yynerrspascal_nerrs;
591int yyerrflagpascal_errflag;
592int yycharpascal_char;
593short *yyssp;
594YYSTYPE *yyvsp;
595YYSTYPE yyvalpascal_val;
596YYSTYPE yylvalpascal_lval;
597short *yyss;
598short *yysslim;
599YYSTYPE *yyvs;
600unsigned int yystacksize;
601int yyparsepascal_parse(void);
602#line 758 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
603
604/* Take care of parsing a number (anything that starts with a digit).
605 Set yylval and return the token type; update lexptr.
606 LEN is the number of characters in it. */
607
608/*** Needs some error checking for the float case ***/
609
610static int
611parse_number (p, len, parsed_float, putithere)
612 char *p;
613 int len;
614 int parsed_float;
615 YYSTYPE *putithere;
616{
617 /* FIXME: Shouldn't these be unsigned? We don't deal with negative values
618 here, and we do kind of silly things like cast to unsigned. */
619 LONGESTlong n = 0;
620 LONGESTlong prevn = 0;
621 ULONGESTunsigned long un;
622
623 int i = 0;
624 int c;
625 int base = input_radix;
626 int unsigned_p = 0;
627
628 /* Number of "L" suffixes encountered. */
629 int long_p = 0;
630
631 /* We have found a "L" or "U" suffix. */
632 int found_suffix = 0;
633
634 ULONGESTunsigned long high_bit;
635 struct type *signed_type;
636 struct type *unsigned_type;
637
638 if (parsed_float
46.1
'parsed_float' is 0
)
47
Taking false branch
639 {
640 /* It's a float since it contains a point or an exponent. */
641 char c;
642 int num = 0; /* number of tokens scanned by scanf */
643 char saved_char = p[len];
644
645 p[len] = 0; /* null-terminate the token */
646 if (sizeof (putithere->typed_val_float.dval) <= sizeof (float))
647 num = sscanf (p, "%g%c", (float *) &putithere->typed_val_float.dval,&c);
648 else if (sizeof (putithere->typed_val_float.dval) <= sizeof (double))
649 num = sscanf (p, "%lg%c", (double *) &putithere->typed_val_float.dval,&c);
650 else
651 {
652#ifdef SCANF_HAS_LONG_DOUBLE1
653 num = sscanf (p, "%Lg%c", &putithere->typed_val_float.dval,&c);
654#else
655 /* Scan it into a double, then assign it to the long double.
656 This at least wins with values representable in the range
657 of doubles. */
658 double temp;
659 num = sscanf (p, "%lg%c", &temp,&c);
660 putithere->typed_val_float.dval = temp;
661#endif
662 }
663 p[len] = saved_char; /* restore the input stream */
664 if (num != 1) /* check scanf found ONLY a float ... */
665 return ERROR268;
666 /* See if it has `f' or `l' suffix (float or long double). */
667
668 c = tolower (p[len - 1]);
669
670 if (c == 'f')
671 putithere->typed_val_float.type = builtin_type_float;
672 else if (c == 'l')
673 putithere->typed_val_float.type = builtin_type_long_double;
674 else if (isdigit (c) || c == '.')
675 putithere->typed_val_float.type = builtin_type_double;
676 else
677 return ERROR268;
678
679 return FLOAT258;
680 }
681
682 /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
683 if (p[0] == '0')
48
Assuming the condition is false
49
Taking false branch
684 switch (p[1])
685 {
686 case 'x':
687 case 'X':
688 if (len >= 3)
689 {
690 p += 2;
691 base = 16;
692 len -= 2;
693 }
694 break;
695
696 case 't':
697 case 'T':
698 case 'd':
699 case 'D':
700 if (len >= 3)
701 {
702 p += 2;
703 base = 10;
704 len -= 2;
705 }
706 break;
707
708 default:
709 base = 8;
710 break;
711 }
712
713 while (len-- > 0)
50
Assuming the condition is true
51
Loop condition is true. Entering loop body
714 {
715 c = *p++;
716 if (c >= 'A' && c <= 'Z')
52
Assuming the condition is false
717 c += 'a' - 'A';
718 if (c != 'l' && c != 'u')
53
Taking true branch
719 n *= base;
720 if (c >= '0' && c <= '9')
54
Assuming the condition is false
721 {
722 if (found_suffix)
723 return ERROR268;
724 n += i = c - '0';
725 }
726 else
727 {
728 if (base > 10 && c >= 'a' && c <= 'f')
55
Assuming 'base' is <= 10
729 {
730 if (found_suffix)
731 return ERROR268;
732 n += i = c - 'a' + 10;
733 }
734 else if (c == 'l')
56
Taking false branch
735 {
736 ++long_p;
737 found_suffix = 1;
738 }
739 else if (c == 'u')
57
Taking false branch
740 {
741 unsigned_p = 1;
742 found_suffix = 1;
743 }
744 else
745 return ERROR268; /* Char not a digit */
58
Returning without writing to 'putithere->typed_val_int.type'
746 }
747 if (i >= base)
748 return ERROR268; /* Invalid digit in this base */
749
750 /* Portably test for overflow (only works for nonzero values, so make
751 a second check for zero). FIXME: Can't we just make n and prevn
752 unsigned and avoid this? */
753 if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
754 unsigned_p = 1; /* Try something unsigned */
755
756 /* Portably test for unsigned overflow.
757 FIXME: This check is wrong; for example it doesn't find overflow
758 on 0x123456789 when LONGEST is 32 bits. */
759 if (c != 'l' && c != 'u' && n != 0)
760 {
761 if ((unsigned_p && (ULONGESTunsigned long) prevn >= (ULONGESTunsigned long) n))
762 error ("Numeric constant too large.");
763 }
764 prevn = n;
765 }
766
767 /* An integer constant is an int, a long, or a long long. An L
768 suffix forces it to be long; an LL suffix forces it to be long
769 long. If not forced to a larger size, it gets the first type of
770 the above that it fits in. To figure out whether it fits, we
771 shift it right and see whether anything remains. Note that we
772 can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
773 operation, because many compilers will warn about such a shift
774 (which always produces a zero result). Sometimes TARGET_INT_BIT
775 or TARGET_LONG_BIT will be that big, sometimes not. To deal with
776 the case where it is we just always shift the value more than
777 once, with fewer bits each time. */
778
779 un = (ULONGESTunsigned long)n >> 2;
780 if (long_p == 0
781 && (un >> (TARGET_INT_BIT(gdbarch_int_bit (current_gdbarch)) - 2)) == 0)
782 {
783 high_bit = ((ULONGESTunsigned long)1) << (TARGET_INT_BIT(gdbarch_int_bit (current_gdbarch))-1);
784
785 /* A large decimal (not hex or octal) constant (between INT_MAX
786 and UINT_MAX) is a long or unsigned long, according to ANSI,
787 never an unsigned int, but this code treats it as unsigned
788 int. This probably should be fixed. GCC gives a warning on
789 such constants. */
790
791 unsigned_type = builtin_type_unsigned_int;
792 signed_type = builtin_type_int;
793 }
794 else if (long_p <= 1
795 && (un >> (TARGET_LONG_BIT(gdbarch_long_bit (current_gdbarch)) - 2)) == 0)
796 {
797 high_bit = ((ULONGESTunsigned long)1) << (TARGET_LONG_BIT(gdbarch_long_bit (current_gdbarch))-1);
798 unsigned_type = builtin_type_unsigned_long;
799 signed_type = builtin_type_long;
800 }
801 else
802 {
803 int shift;
804 if (sizeof (ULONGESTunsigned long) * HOST_CHAR_BIT8 < TARGET_LONG_LONG_BIT(gdbarch_long_long_bit (current_gdbarch)))
805 /* A long long does not fit in a LONGEST. */
806 shift = (sizeof (ULONGESTunsigned long) * HOST_CHAR_BIT8 - 1);
807 else
808 shift = (TARGET_LONG_LONG_BIT(gdbarch_long_long_bit (current_gdbarch)) - 1);
809 high_bit = (ULONGESTunsigned long) 1 << shift;
810 unsigned_type = builtin_type_unsigned_long_long;
811 signed_type = builtin_type_long_long;
812 }
813
814 putithere->typed_val_int.val = n;
815
816 /* If the high bit of the worked out type is set then this number
817 has to be unsigned. */
818
819 if (unsigned_p || (n & high_bit))
820 {
821 putithere->typed_val_int.type = unsigned_type;
822 }
823 else
824 {
825 putithere->typed_val_int.type = signed_type;
826 }
827
828 return INT257;
829}
830
831
832struct type_push
833{
834 struct type *stored;
835 struct type_push *next;
836};
837
838static struct type_push *tp_top = NULL((void*)0);
839
840static void
841push_current_type (void)
842{
843 struct type_push *tpnew;
844 tpnew = (struct type_push *) xmalloc (sizeof (struct type_push));
845 tpnew->next = tp_top;
846 tpnew->stored = current_type;
847 current_type = NULL((void*)0);
848 tp_top = tpnew;
849}
850
851static void
852pop_current_type (void)
853{
854 struct type_push *tp = tp_top;
855 if (tp)
856 {
857 current_type = tp->stored;
858 tp_top = tp->next;
859 xfree (tp);
860 }
861}
862
863struct token
864{
865 char *operator;
866 int token;
867 enum exp_opcode opcode;
868};
869
870static const struct token tokentab3[] =
871 {
872 {"shr", RSH283, BINOP_END},
873 {"shl", LSH282, BINOP_END},
874 {"and", ANDAND278, BINOP_END},
875 {"div", DIV284, BINOP_END},
876 {"not", NOT275, BINOP_END},
877 {"mod", MOD285, BINOP_END},
878 {"inc", INCREMENT287, BINOP_END},
879 {"dec", DECREMENT288, BINOP_END},
880 {"xor", XOR277, BINOP_END}
881 };
882
883static const struct token tokentab2[] =
884 {
885 {"or", OR276, BINOP_END},
886 {"<>", NOTEQUAL279, BINOP_END},
887 {"<=", LEQ280, BINOP_END},
888 {">=", GEQ281, BINOP_END},
889 {":=", ASSIGN274, BINOP_END},
890 {"::", COLONCOLON267, BINOP_END} };
891
892/* Allocate uppercased var */
893/* make an uppercased copy of tokstart */
894static char * uptok (tokstart, namelen)
895 char *tokstart;
896 int namelen;
897{
898 int i;
899 char *uptokstart = (char *)xmalloc(namelen+1);
900 for (i = 0;i <= namelen;i++)
901 {
902 if ((tokstart[i]>='a' && tokstart[i]<='z'))
903 uptokstart[i] = tokstart[i]-('a'-'A');
904 else
905 uptokstart[i] = tokstart[i];
906 }
907 uptokstart[namelen]='\0';
908 return uptokstart;
909}
910/* Read one token, getting characters through lexptr. */
911
912
913static int
914yylexpascal_lex ()
915{
916 int c;
917 int namelen;
918 unsigned int i;
919 char *tokstart;
920 char *uptokstart;
921 char *tokptr;
922 char *p;
923 int explen, tempbufindex;
924 static char *tempbuf;
925 static int tempbufsize;
926
927 retry:
928
929 prev_lexptr = lexptr;
930
931 tokstart = lexptr;
932 explen = strlen (lexptr);
933 /* See if it is a special token of length 3. */
934 if (explen > 2)
935 for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
936 if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0
937 && (!isalpha (tokentab3[i].operator[0]) || explen == 3
938 || (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_')))
939 {
940 lexptr += 3;
941 yylvalpascal_lval.opcode = tokentab3[i].opcode;
942 return tokentab3[i].token;
943 }
944
945 /* See if it is a special token of length 2. */
946 if (explen > 1)
947 for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
948 if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0
949 && (!isalpha (tokentab2[i].operator[0]) || explen == 2
950 || (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_')))
951 {
952 lexptr += 2;
953 yylvalpascal_lval.opcode = tokentab2[i].opcode;
954 return tokentab2[i].token;
955 }
956
957 switch (c = *tokstart)
958 {
959 case 0:
960 return 0;
961
962 case ' ':
963 case '\t':
964 case '\n':
965 lexptr++;
966 goto retry;
967
968 case '\'':
969 /* We either have a character constant ('0' or '\177' for example)
970 or we have a quoted symbol reference ('foo(int,int)' in object pascal
971 for example). */
972 lexptr++;
973 c = *lexptr++;
974 if (c == '\\')
975 c = parse_escape (&lexptr);
976 else if (c == '\'')
977 error ("Empty character constant.");
978
979 yylvalpascal_lval.typed_val_int.val = c;
980 yylvalpascal_lval.typed_val_int.type = builtin_type_char;
981
982 c = *lexptr++;
983 if (c != '\'')
984 {
985 namelen = skip_quoted (tokstart) - tokstart;
986 if (namelen > 2)
987 {
988 lexptr = tokstart + namelen;
989 if (lexptr[-1] != '\'')
990 error ("Unmatched single quote.");
991 namelen -= 2;
992 tokstart++;
993 uptokstart = uptok(tokstart,namelen);
994 goto tryname;
995 }
996 error ("Invalid character constant.");
997 }
998 return INT257;
999
1000 case '(':
1001 paren_depth++;
1002 lexptr++;
1003 return c;
1004
1005 case ')':
1006 if (paren_depth == 0)
1007 return 0;
1008 paren_depth--;
1009 lexptr++;
1010 return c;
1011
1012 case ',':
1013 if (comma_terminates && paren_depth == 0)
1014 return 0;
1015 lexptr++;
1016 return c;
1017
1018 case '.':
1019 /* Might be a floating point number. */
1020 if (lexptr[1] < '0' || lexptr[1] > '9')
1021 goto symbol; /* Nope, must be a symbol. */
1022 /* FALL THRU into number case. */
1023
1024 case '0':
1025 case '1':
1026 case '2':
1027 case '3':
1028 case '4':
1029 case '5':
1030 case '6':
1031 case '7':
1032 case '8':
1033 case '9':
1034 {
1035 /* It's a number. */
1036 int got_dot = 0, got_e = 0, toktype;
1037 char *p = tokstart;
1038 int hex = input_radix > 10;
1039
1040 if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
1041 {
1042 p += 2;
1043 hex = 1;
1044 }
1045 else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
1046 {
1047 p += 2;
1048 hex = 0;
1049 }
1050
1051 for (;; ++p)
1052 {
1053 /* This test includes !hex because 'e' is a valid hex digit
1054 and thus does not indicate a floating point number when
1055 the radix is hex. */
1056 if (!hex && !got_e && (*p == 'e' || *p == 'E'))
1057 got_dot = got_e = 1;
1058 /* This test does not include !hex, because a '.' always indicates
1059 a decimal floating point number regardless of the radix. */
1060 else if (!got_dot && *p == '.')
1061 got_dot = 1;
1062 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
1063 && (*p == '-' || *p == '+'))
1064 /* This is the sign of the exponent, not the end of the
1065 number. */
1066 continue;
1067 /* We will take any letters or digits. parse_number will
1068 complain if past the radix, or if L or U are not final. */
1069 else if ((*p < '0' || *p > '9')
1070 && ((*p < 'a' || *p > 'z')
1071 && (*p < 'A' || *p > 'Z')))
1072 break;
1073 }
1074 toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylvalpascal_lval);
1075 if (toktype == ERROR268)
1076 {
1077 char *err_copy = (char *) alloca (p - tokstart + 1)__builtin_alloca(p - tokstart + 1);
1078
1079 memcpy (err_copy, tokstart, p - tokstart);
1080 err_copy[p - tokstart] = 0;
1081 error ("Invalid number \"%s\".", err_copy);
1082 }
1083 lexptr = p;
1084 return toktype;
1085 }
1086
1087 case '+':
1088 case '-':
1089 case '*':
1090 case '/':
1091 case '|':
1092 case '&':
1093 case '^':
1094 case '~':
1095 case '!':
1096 case '@':
1097 case '<':
1098 case '>':
1099 case '[':
1100 case ']':
1101 case '?':
1102 case ':':
1103 case '=':
1104 case '{':
1105 case '}':
1106 symbol:
1107 lexptr++;
1108 return c;
1109
1110 case '"':
1111
1112 /* Build the gdb internal form of the input string in tempbuf,
1113 translating any standard C escape forms seen. Note that the
1114 buffer is null byte terminated *only* for the convenience of
1115 debugging gdb itself and printing the buffer contents when
1116 the buffer contains no embedded nulls. Gdb does not depend
1117 upon the buffer being null byte terminated, it uses the length
1118 string instead. This allows gdb to handle C strings (as well
1119 as strings in other languages) with embedded null bytes */
1120
1121 tokptr = ++tokstart;
1122 tempbufindex = 0;
1123
1124 do {
1125 /* Grow the static temp buffer if necessary, including allocating
1126 the first one on demand. */
1127 if (tempbufindex + 1 >= tempbufsize)
1128 {
1129 tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
1130 }
1131
1132 switch (*tokptr)
1133 {
1134 case '\0':
1135 case '"':
1136 /* Do nothing, loop will terminate. */
1137 break;
1138 case '\\':
1139 tokptr++;
1140 c = parse_escape (&tokptr);
1141 if (c == -1)
1142 {
1143 continue;
1144 }
1145 tempbuf[tempbufindex++] = c;
1146 break;
1147 default:
1148 tempbuf[tempbufindex++] = *tokptr++;
1149 break;
1150 }
1151 } while ((*tokptr != '"') && (*tokptr != '\0'));
1152 if (*tokptr++ != '"')
1153 {
1154 error ("Unterminated string in expression.");
1155 }
1156 tempbuf[tempbufindex] = '\0'; /* See note above */
1157 yylvalpascal_lval.sval.ptr = tempbuf;
1158 yylvalpascal_lval.sval.length = tempbufindex;
1159 lexptr = tokptr;
1160 return (STRING259);
1161 }
1162
1163 if (!(c == '_' || c == '$'
1164 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
1165 /* We must have come across a bad character (e.g. ';'). */
1166 error ("Invalid character '%c' in expression.", c);
1167
1168 /* It's a name. See how long it is. */
1169 namelen = 0;
1170 for (c = tokstart[namelen];
1171 (c == '_' || c == '$' || (c >= '0' && c <= '9')
1172 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
1173 {
1174 /* Template parameter lists are part of the name.
1175 FIXME: This mishandles `print $a<4&&$a>3'. */
1176 if (c == '<')
1177 {
1178 int i = namelen;
1179 int nesting_level = 1;
1180 while (tokstart[++i])
1181 {
1182 if (tokstart[i] == '<')
1183 nesting_level++;
1184 else if (tokstart[i] == '>')
1185 {
1186 if (--nesting_level == 0)
1187 break;
1188 }
1189 }
1190 if (tokstart[i] == '>')
1191 namelen = i;
1192 else
1193 break;
1194 }
1195
1196 /* do NOT uppercase internals because of registers !!! */
1197 c = tokstart[++namelen];
1198 }
1199
1200 uptokstart = uptok(tokstart,namelen);
1201
1202 /* The token "if" terminates the expression and is NOT
1203 removed from the input stream. */
1204 if (namelen == 2 && uptokstart[0] == 'I' && uptokstart[1] == 'F')
1205 {
1206 return 0;
1207 }
1208
1209 lexptr += namelen;
1210
1211 tryname:
1212
1213 /* Catch specific keywords. Should be done with a data structure. */
1214 switch (namelen)
1215 {
1216 case 6:
1217 if (DEPRECATED_STREQ (uptokstart, "OBJECT")(strcmp ((uptokstart), ("OBJECT")) == 0))
1218 return CLASS265;
1219 if (DEPRECATED_STREQ (uptokstart, "RECORD")(strcmp ((uptokstart), ("RECORD")) == 0))
1220 return STRUCT264;
1221 if (DEPRECATED_STREQ (uptokstart, "SIZEOF")(strcmp ((uptokstart), ("SIZEOF")) == 0))
1222 return SIZEOF266;
1223 break;
1224 case 5:
1225 if (DEPRECATED_STREQ (uptokstart, "CLASS")(strcmp ((uptokstart), ("CLASS")) == 0))
1226 return CLASS265;
1227 if (DEPRECATED_STREQ (uptokstart, "FALSE")(strcmp ((uptokstart), ("FALSE")) == 0))
1228 {
1229 yylvalpascal_lval.lval = 0;
1230 return FALSEKEYWORD272;
1231 }
1232 break;
1233 case 4:
1234 if (DEPRECATED_STREQ (uptokstart, "TRUE")(strcmp ((uptokstart), ("TRUE")) == 0))
1235 {
1236 yylvalpascal_lval.lval = 1;
1237 return TRUEKEYWORD271;
1238 }
1239 if (DEPRECATED_STREQ (uptokstart, "SELF")(strcmp ((uptokstart), ("SELF")) == 0))
1240 {
1241 /* here we search for 'this' like
1242 inserted in FPC stabs debug info */
1243 static const char this_name[] = "this";
1244
1245 if (lookup_symbol (this_name, expression_context_block,
1246 VAR_DOMAIN, (int *) NULL((void*)0),
1247 (struct symtab **) NULL((void*)0)))
1248 return THIS270;
1249 }
1250 break;
1251 default:
1252 break;
1253 }
1254
1255 yylvalpascal_lval.sval.ptr = tokstart;
1256 yylvalpascal_lval.sval.length = namelen;
1257
1258 if (*tokstart == '$')
1259 {
1260 /* $ is the normal prefix for pascal hexadecimal values
1261 but this conflicts with the GDB use for debugger variables
1262 so in expression to enter hexadecimal values
1263 we still need to use C syntax with 0xff */
1264 write_dollar_variable (yylvalpascal_lval.sval);
1265 return VARIABLE269;
1266 }
1267
1268 /* Use token-type BLOCKNAME for symbols that happen to be defined as
1269 functions or symtabs. If this is not so, then ...
1270 Use token-type TYPENAME for symbols that happen to be defined
1271 currently as names of types; NAME for other symbols.
1272 The caller is not constrained to care about the distinction. */
1273 {
1274 char *tmp = copy_name (yylvalpascal_lval.sval);
1275 struct symbol *sym;
1276 int is_a_field_of_this = 0;
1277 int is_a_field = 0;
1278 int hextype;
1279
1280
1281 if (search_field && current_type)
1282 is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL((void*)0));
1283 if (is_a_field)
1284 sym = NULL((void*)0);
1285 else
1286 sym = lookup_symbol (tmp, expression_context_block,
1287 VAR_DOMAIN,
1288 &is_a_field_of_this,
1289 (struct symtab **) NULL((void*)0));
1290 /* second chance uppercased (as Free Pascal does). */
1291 if (!sym && !is_a_field_of_this && !is_a_field)
1292 {
1293 for (i = 0; i <= namelen; i++)
1294 {
1295 if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
1296 tmp[i] -= ('a'-'A');
1297 }
1298 if (search_field && current_type)
1299 is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL((void*)0));
1300 if (is_a_field)
1301 sym = NULL((void*)0);
1302 else
1303 sym = lookup_symbol (tmp, expression_context_block,
1304 VAR_DOMAIN,
1305 &is_a_field_of_this,
1306 (struct symtab **) NULL((void*)0));
1307 if (sym || is_a_field_of_this || is_a_field)
1308 for (i = 0; i <= namelen; i++)
1309 {
1310 if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
1311 tokstart[i] -= ('a'-'A');
1312 }
1313 }
1314 /* Third chance Capitalized (as GPC does). */
1315 if (!sym && !is_a_field_of_this && !is_a_field)
1316 {
1317 for (i = 0; i <= namelen; i++)
1318 {
1319 if (i == 0)
1320 {
1321 if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
1322 tmp[i] -= ('a'-'A');
1323 }
1324 else
1325 if ((tmp[i] >= 'A' && tmp[i] <= 'Z'))
1326 tmp[i] -= ('A'-'a');
1327 }
1328 if (search_field && current_type)
1329 is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL((void*)0));
1330 if (is_a_field)
1331 sym = NULL((void*)0);
1332 else
1333 sym = lookup_symbol (tmp, expression_context_block,
1334 VAR_DOMAIN,
1335 &is_a_field_of_this,
1336 (struct symtab **) NULL((void*)0));
1337 if (sym || is_a_field_of_this || is_a_field)
1338 for (i = 0; i <= namelen; i++)
1339 {
1340 if (i == 0)
1341 {
1342 if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
1343 tokstart[i] -= ('a'-'A');
1344 }
1345 else
1346 if ((tokstart[i] >= 'A' && tokstart[i] <= 'Z'))
1347 tokstart[i] -= ('A'-'a');
1348 }
1349 }
1350
1351 if (is_a_field)
1352 {
1353 tempbuf = (char *) xrealloc (tempbuf, namelen + 1);
1354 strncpy (tempbuf, tokstart, namelen); tempbuf [namelen] = 0;
1355 yylvalpascal_lval.sval.ptr = tempbuf;
1356 yylvalpascal_lval.sval.length = namelen;
1357 return FIELDNAME260;
1358 }
1359 /* Call lookup_symtab, not lookup_partial_symtab, in case there are
1360 no psymtabs (coff, xcoff, or some future change to blow away the
1361 psymtabs once once symbols are read). */
1362 if ((sym && SYMBOL_CLASS (sym)(sym)->aclass == LOC_BLOCK) ||
1363 lookup_symtab (tmp))
1364 {
1365 yylvalpascal_lval.ssym.sym = sym;
1366 yylvalpascal_lval.ssym.is_a_field_of_this = is_a_field_of_this;
1367 return BLOCKNAME290;
1368 }
1369 if (sym && SYMBOL_CLASS (sym)(sym)->aclass == LOC_TYPEDEF)
1370 {
1371#if 1
1372 /* Despite the following flaw, we need to keep this code enabled.
1373 Because we can get called from check_stub_method, if we don't
1374 handle nested types then it screws many operations in any
1375 program which uses nested types. */
1376 /* In "A::x", if x is a member function of A and there happens
1377 to be a type (nested or not, since the stabs don't make that
1378 distinction) named x, then this code incorrectly thinks we
1379 are dealing with nested types rather than a member function. */
1380
1381 char *p;
1382 char *namestart;
1383 struct symbol *best_sym;
1384
1385 /* Look ahead to detect nested types. This probably should be
1386 done in the grammar, but trying seemed to introduce a lot
1387 of shift/reduce and reduce/reduce conflicts. It's possible
1388 that it could be done, though. Or perhaps a non-grammar, but
1389 less ad hoc, approach would work well. */
1390
1391 /* Since we do not currently have any way of distinguishing
1392 a nested type from a non-nested one (the stabs don't tell
1393 us whether a type is nested), we just ignore the
1394 containing type. */
1395
1396 p = lexptr;
1397 best_sym = sym;
1398 while (1)
1399 {
1400 /* Skip whitespace. */
1401 while (*p == ' ' || *p == '\t' || *p == '\n')
1402 ++p;
1403 if (*p == ':' && p[1] == ':')
1404 {
1405 /* Skip the `::'. */
1406 p += 2;
1407 /* Skip whitespace. */
1408 while (*p == ' ' || *p == '\t' || *p == '\n')
1409 ++p;
1410 namestart = p;
1411 while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
1412 || (*p >= 'a' && *p <= 'z')
1413 || (*p >= 'A' && *p <= 'Z'))
1414 ++p;
1415 if (p != namestart)
1416 {
1417 struct symbol *cur_sym;
1418 /* As big as the whole rest of the expression, which is
1419 at least big enough. */
1420 char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3)__builtin_alloca(strlen (tmp)+strlen (namestart)+3);
1421 char *tmp1;
1422
1423 tmp1 = ncopy;
1424 memcpy (tmp1, tmp, strlen (tmp));
1425 tmp1 += strlen (tmp);
1426 memcpy (tmp1, "::", 2);
1427 tmp1 += 2;
1428 memcpy (tmp1, namestart, p - namestart);
1429 tmp1[p - namestart] = '\0';
1430 cur_sym = lookup_symbol (ncopy, expression_context_block,
1431 VAR_DOMAIN, (int *) NULL((void*)0),
1432 (struct symtab **) NULL((void*)0));
1433 if (cur_sym)
1434 {
1435 if (SYMBOL_CLASS (cur_sym)(cur_sym)->aclass == LOC_TYPEDEF)
1436 {
1437 best_sym = cur_sym;
1438 lexptr = p;
1439 }
1440 else
1441 break;
1442 }
1443 else
1444 break;
1445 }
1446 else
1447 break;
1448 }
1449 else
1450 break;
1451 }
1452
1453 yylvalpascal_lval.tsym.type = SYMBOL_TYPE (best_sym)(best_sym)->type;
1454#else /* not 0 */
1455 yylvalpascal_lval.tsym.type = SYMBOL_TYPE (sym)(sym)->type;
1456#endif /* not 0 */
1457 return TYPENAME262;
1458 }
1459 yylvalpascal_lval.tsym.type
1460 = language_lookup_primitive_type_by_name (current_language,
1461 current_gdbarch, tmp);
1462 if (yylvalpascal_lval.tsym.type != NULL((void*)0))
1463 return TYPENAME262;
1464
1465 /* Input names that aren't symbols but ARE valid hex numbers,
1466 when the input radix permits them, can be names or numbers
1467 depending on the parse. Note we support radixes > 16 here. */
1468 if (!sym &&
1469 ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
1470 (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
1471 {
1472 YYSTYPE newlval; /* Its value is ignored. */
1473 hextype = parse_number (tokstart, namelen, 0, &newlval);
1474 if (hextype == INT257)
1475 {
1476 yylvalpascal_lval.ssym.sym = sym;
1477 yylvalpascal_lval.ssym.is_a_field_of_this = is_a_field_of_this;
1478 return NAME_OR_INT263;
1479 }
1480 }
1481
1482 free(uptokstart);
1483 /* Any other kind of symbol */
1484 yylvalpascal_lval.ssym.sym = sym;
1485 yylvalpascal_lval.ssym.is_a_field_of_this = is_a_field_of_this;
1486 return NAME261;
1487 }
1488}
1489
1490void
1491yyerrorpascal_error (msg)
1492 char *msg;
1493{
1494 if (prev_lexptr)
1495 lexptr = prev_lexptr;
1496
1497 error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
1498}
1499/* allocate initial stack or double stack size, up to YYMAXDEPTH */
1500static int yygrowstack(void)
1501{
1502 unsigned int newsize;
1503 long sslen;
1504 short *newss;
1505 YYSTYPE *newvs;
1506
1507 if ((newsize = yystacksize) == 0)
1508 newsize = YYINITSTACKSIZE200;
1509 else if (newsize >= YYMAXDEPTH10000)
1510 return -1;
1511 else if ((newsize *= 2) > YYMAXDEPTH10000)
1512 newsize = YYMAXDEPTH10000;
1513 sslen = yyssp - yyss;
1514#ifdef SIZE_MAX
1515#define YY_SIZE_MAX0xffffffffU SIZE_MAX
1516#else
1517#define YY_SIZE_MAX0xffffffffU 0xffffffffU
1518#endif
1519 if (newsize && YY_SIZE_MAX0xffffffffU / newsize < sizeof *newss)
1520 goto bail;
1521 newss = (short *)xrealloc(yyss, newsize * sizeof *newss);
1522 if (newss == NULL((void*)0))
1523 goto bail;
1524 yyss = newss;
1525 yyssp = newss + sslen;
1526 if (newsize && YY_SIZE_MAX0xffffffffU / newsize < sizeof *newvs)
1527 goto bail;
1528 newvs = (YYSTYPE *)xrealloc(yyvs, newsize * sizeof *newvs);
1529 if (newvs == NULL((void*)0))
1530 goto bail;
1531 yyvs = newvs;
1532 yyvsp = newvs + sslen;
1533 yystacksize = newsize;
1534 yysslim = yyss + newsize - 1;
1535 return 0;
1536bail:
1537 if (yyss)
1538 free(yyss);
1539 if (yyvs)
1540 free(yyvs);
1541 yyss = yyssp = NULL((void*)0);
1542 yyvs = yyvsp = NULL((void*)0);
1543 yystacksize = 0;
1544 return -1;
1545}
1546
1547#define YYABORTgoto yyabort goto yyabort
1548#define YYREJECTgoto yyabort goto yyabort
1549#define YYACCEPTgoto yyaccept goto yyaccept
1550#define YYERRORgoto yyerrlab goto yyerrlab
1551int
1552yyparsepascal_parse(void)
1553{
1554 int yym, yyn, yystatepascal_state;
1555#if YYDEBUG1
1556 const char *yyspascal_s;
1557
1558 if ((yyspascal_s = getenv("YYDEBUG")))
1
Assuming 'pascal_s' is null
2
Taking false branch
1559 {
1560 yyn = *yyspascal_s;
1561 if (yyn >= '0' && yyn <= '9')
1562 yydebugpascal_debug = yyn - '0';
1563 }
1564#endif /* YYDEBUG */
1565
1566 yynerrspascal_nerrs = 0;
1567 yyerrflagpascal_errflag = 0;
1568 yycharpascal_char = (-1);
1569
1570 if (yyss == NULL((void*)0) && yygrowstack()) goto yyoverflow;
3
Assuming 'yyss' is not equal to NULL
1571 yyssp = yyss;
1572 yyvsp = yyvs;
1573 *yyssp = yystatepascal_state = 0;
1574
1575yyloop:
1576 if ((yyn = yydefredpascal_yydefred[yystatepascal_state]) != 0) goto yyreduce;
4
Taking true branch
5
Control jumps to line 1679
16
Taking false branch
39
Assuming the condition is true
40
Taking true branch
41
Control jumps to line 1679
1577 if (yycharpascal_char < 0)
17
Taking true branch
1578 {
1579 if ((yycharpascal_char = yylexpascal_lex()) < 0) yycharpascal_char = 0;
18
Assuming the condition is false
19
Taking false branch
1580#if YYDEBUG1
1581 if (yydebugpascal_debug)
20
Assuming 'pascal_debug' is 0
21
Taking false branch
1582 {
1583 yyspascal_s = 0;
1584 if (yycharpascal_char <= YYMAXTOKEN290) yyspascal_s = yynamepascal_name[yycharpascal_char];
1585 if (!yyspascal_s) yyspascal_s = "illegal-symbol";
1586 printf("%sdebug: state %d, reading %d (%s)\n",
1587 YYPREFIX"yy", yystatepascal_state, yycharpascal_char, yyspascal_s);
1588 }
1589#endif
1590 }
1591 if ((yyn = yysindexpascal_yysindex[yystatepascal_state]) && (yyn += yycharpascal_char) >= 0 &&
22
Assuming 'yyn' is not equal to 0
23
Assuming the condition is false
1592 yyn <= YYTABLESIZE1160 && yycheckpascal_yycheck[yyn] == yycharpascal_char)
1593 {
1594#if YYDEBUG1
1595 if (yydebugpascal_debug)
1596 printf("%sdebug: state %d, shifting to state %d\n",
1597 YYPREFIX"yy", yystatepascal_state, yytablepascal_yytable[yyn]);
1598#endif
1599 if (yyssp >= yysslim && yygrowstack())
1600 {
1601 goto yyoverflow;
1602 }
1603 *++yyssp = yystatepascal_state = yytablepascal_yytable[yyn];
1604 *++yyvsp = yylvalpascal_lval;
1605 yycharpascal_char = (-1);
1606 if (yyerrflagpascal_errflag > 0) --yyerrflagpascal_errflag;
1607 goto yyloop;
1608 }
1609 if ((yyn = yyrindexpascal_yyrindex[yystatepascal_state]) && (yyn += yycharpascal_char) >= 0 &&
24
Assuming 'yyn' is 0
1610 yyn <= YYTABLESIZE1160 && yycheckpascal_yycheck[yyn] == yycharpascal_char)
1611 {
1612 yyn = yytablepascal_yytable[yyn];
1613 goto yyreduce;
1614 }
1615 if (yyerrflagpascal_errflag) goto yyinrecovery;
25
Assuming 'pascal_errflag' is not equal to 0
26
Taking true branch
27
Control jumps to line 1627
1616#if defined(__GNUC__4)
1617 goto yynewerror;
1618#endif
1619yynewerror:
1620 yyerrorpascal_error("syntax error");
1621#if defined(__GNUC__4)
1622 goto yyerrlab;
1623#endif
1624yyerrlab:
1625 ++yynerrspascal_nerrs;
1626yyinrecovery:
1627 if (yyerrflagpascal_errflag < 3)
28
Assuming 'pascal_errflag' is < 3
29
Taking true branch
1628 {
1629 yyerrflagpascal_errflag = 3;
1630 for (;;)
30
Loop condition is true. Entering loop body
1631 {
1632 if ((yyn = yysindexpascal_yysindex[*yyssp]) && (yyn += YYERRCODE256) >= 0 &&
31
Assuming 'yyn' is not equal to 0
32
Assuming the condition is true
35
Taking true branch
1633 yyn <= YYTABLESIZE1160 && yycheckpascal_yycheck[yyn] == YYERRCODE256)
33
Assuming 'yyn' is <= YYTABLESIZE
34
Assuming the condition is true
1634 {
1635#if YYDEBUG1
1636 if (yydebugpascal_debug)
36
Taking false branch
1637 printf("%sdebug: state %d, error recovery shifting\
1638 to state %d\n", YYPREFIX"yy", *yyssp, yytablepascal_yytable[yyn]);
1639#endif
1640 if (yyssp >= yysslim && yygrowstack())
37
Assuming 'yyssp' is < 'yysslim'
1641 {
1642 goto yyoverflow;
1643 }
1644 *++yyssp = yystatepascal_state = yytablepascal_yytable[yyn];
1645 *++yyvsp = yylvalpascal_lval;
1646 goto yyloop;
38
Control jumps to line 1576
1647 }
1648 else
1649 {
1650#if YYDEBUG1
1651 if (yydebugpascal_debug)
1652 printf("%sdebug: error recovery discarding state %d\n",
1653 YYPREFIX"yy", *yyssp);
1654#endif
1655 if (yyssp <= yyss) goto yyabort;
1656 --yyssp;
1657 --yyvsp;
1658 }
1659 }
1660 }
1661 else
1662 {
1663 if (yycharpascal_char == 0) goto yyabort;
1664#if YYDEBUG1
1665 if (yydebugpascal_debug)
1666 {
1667 yyspascal_s = 0;
1668 if (yycharpascal_char <= YYMAXTOKEN290) yyspascal_s = yynamepascal_name[yycharpascal_char];
1669 if (!yyspascal_s) yyspascal_s = "illegal-symbol";
1670 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
1671 YYPREFIX"yy", yystatepascal_state, yycharpascal_char, yyspascal_s);
1672 }
1673#endif
1674 yycharpascal_char = (-1);
1675 goto yyloop;
1676 }
1677yyreduce:
1678#if YYDEBUG1
1679 if (yydebugpascal_debug)
6
Assuming 'pascal_debug' is 0
7
Taking false branch
42
Taking false branch
1680 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
1681 YYPREFIX"yy", yystatepascal_state, yyn, yyrulepascal_rule[yyn]);
1682#endif
1683 yym = yylenpascal_yylen[yyn];
1684 if (yym
7.1
'yym' is 0
)
8
Taking false branch
43
Assuming 'yym' is 0
44
Taking false branch
1685 yyvalpascal_val = yyvsp[1-yym];
1686 else
1687 memset(&yyvalpascal_val, 0, sizeof yyvalpascal_val);
1688 switch (yyn)
9
Control jumps to 'case 1:' at line 1690
45
Control jumps to 'case 46:' at line 1914
1689 {
1690case 1:
1691#line 234 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1692{ current_type = NULL((void*)0);
1693 search_field = 0;
1694 }
1695break;
10
Execution continues on line 2191
1696case 2:
1697#line 237 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1698{}
1699break;
1700case 5:
1701#line 246 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1702{ write_exp_elt_opcode(OP_TYPE);
1703 write_exp_elt_type(yyvsp[0].tval);
1704 write_exp_elt_opcode(OP_TYPE);
1705 current_type = yyvsp[0].tval; }
1706break;
1707case 7:
1708#line 254 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1709{ write_exp_elt_opcode (BINOP_COMMA); }
1710break;
1711case 8:
1712#line 259 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1713{ write_exp_elt_opcode (UNOP_IND);
1714 if (current_type)
1715 current_type = TYPE_TARGET_TYPE (current_type)(current_type)->main_type->target_type; }
1716break;
1717case 9:
1718#line 265 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1719{ write_exp_elt_opcode (UNOP_ADDR);
1720 if (current_type)
1721 current_type = TYPE_POINTER_TYPE (current_type)(current_type)->pointer_type; }
1722break;
1723case 10:
1724#line 271 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1725{ write_exp_elt_opcode (UNOP_NEG); }
1726break;
1727case 11:
1728#line 275 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1729{ write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
1730break;
1731case 12:
1732#line 279 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1733{ write_exp_elt_opcode (UNOP_PREINCREMENT); }
1734break;
1735case 13:
1736#line 283 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1737{ write_exp_elt_opcode (UNOP_PREDECREMENT); }
1738break;
1739case 14:
1740#line 286 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1741{ search_field = 1; }
1742break;
1743case 15:
1744#line 289 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1745{ write_exp_elt_opcode (STRUCTOP_STRUCT);
1746 write_exp_string (yyvsp[0].sval);
1747 write_exp_elt_opcode (STRUCTOP_STRUCT);
1748 search_field = 0;
1749 if (current_type)
1750 { while (TYPE_CODE (current_type)(current_type)->main_type->code == TYPE_CODE_PTR)
1751 current_type = TYPE_TARGET_TYPE (current_type)(current_type)->main_type->target_type;
1752 current_type = lookup_struct_elt_type (
1753 current_type, yyvsp[0].sval.ptr, 0); };
1754 }
1755break;
1756case 16:
1757#line 301 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1758{ char *arrayname;
1759 int arrayfieldindex;
1760 arrayfieldindex = is_pascal_string_type (
1761 current_type, NULL((void*)0), NULL((void*)0),
1762 NULL((void*)0), NULL((void*)0), &arrayname);
1763 if (arrayfieldindex)
1764 {
1765 struct stoken stringsval;
1766 stringsval.ptr = alloca (strlen (arrayname) + 1)__builtin_alloca(strlen (arrayname) + 1);
1767 stringsval.length = strlen (arrayname);
1768 strcpy (stringsval.ptr, arrayname);
1769 current_type = TYPE_FIELD_TYPE (current_type,(((current_type)->main_type->fields[arrayfieldindex - 1
]).type)
1770 arrayfieldindex - 1)(((current_type)->main_type->fields[arrayfieldindex - 1
]).type)
;
1771 write_exp_elt_opcode (STRUCTOP_STRUCT);
1772 write_exp_string (stringsval);
1773 write_exp_elt_opcode (STRUCTOP_STRUCT);
1774 }
1775 push_current_type (); }
1776break;
1777case 17:
1778#line 320 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1779{ pop_current_type ();
1780 write_exp_elt_opcode (BINOP_SUBSCRIPT);
1781 if (current_type)
1782 current_type = TYPE_TARGET_TYPE (current_type)(current_type)->main_type->target_type; }
1783break;
1784case 18:
1785#line 329 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1786{ push_current_type ();
1787 start_arglist (); }
1788break;
1789case 19:
1790#line 332 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1791{ write_exp_elt_opcode (OP_FUNCALL);
1792 write_exp_elt_longcst ((LONGESTlong) end_arglist ());
1793 write_exp_elt_opcode (OP_FUNCALL);
1794 pop_current_type (); }
1795break;
1796case 21:
1797#line 340 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1798{ arglist_len = 1; }
1799break;
1800case 22:
1801#line 342 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1802{ arglist_len++; }
1803break;
1804case 23:
1805#line 346 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1806{ if (current_type)
1807 {
1808 /* Allow automatic dereference of classes. */
1809 if ((TYPE_CODE (current_type)(current_type)->main_type->code == TYPE_CODE_PTR)
1810 && (TYPE_CODE (TYPE_TARGET_TYPE (current_type))((current_type)->main_type->target_type)->main_type->
code
== TYPE_CODE_CLASSTYPE_CODE_STRUCT)
1811 && (TYPE_CODE (yyvsp[-3].tval)(yyvsp[-3].tval)->main_type->code == TYPE_CODE_CLASSTYPE_CODE_STRUCT))
1812 write_exp_elt_opcode (UNOP_IND);
1813 }
1814 write_exp_elt_opcode (UNOP_CAST);
1815 write_exp_elt_type (yyvsp[-3].tval);
1816 write_exp_elt_opcode (UNOP_CAST);
1817 current_type = yyvsp[-3].tval; }
1818break;
1819case 24:
1820#line 361 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1821{ }
1822break;
1823case 25:
1824#line 367 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1825{ write_exp_elt_opcode (BINOP_MUL); }
1826break;
1827case 26:
1828#line 371 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1829{ write_exp_elt_opcode (BINOP_DIV); }
1830break;
1831case 27:
1832#line 375 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1833{ write_exp_elt_opcode (BINOP_INTDIV); }
1834break;
1835case 28:
1836#line 379 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1837{ write_exp_elt_opcode (BINOP_REM); }
1838break;
1839case 29:
1840#line 383 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1841{ write_exp_elt_opcode (BINOP_ADD); }
1842break;
1843case 30:
1844#line 387 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1845{ write_exp_elt_opcode (BINOP_SUB); }
1846break;
1847case 31:
1848#line 391 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1849{ write_exp_elt_opcode (BINOP_LSH); }
1850break;
1851case 32:
1852#line 395 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1853{ write_exp_elt_opcode (BINOP_RSH); }
1854break;
1855case 33:
1856#line 399 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1857{ write_exp_elt_opcode (BINOP_EQUAL); }
1858break;
1859case 34:
1860#line 403 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1861{ write_exp_elt_opcode (BINOP_NOTEQUAL); }
1862break;
1863case 35:
1864#line 407 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1865{ write_exp_elt_opcode (BINOP_LEQ); }
1866break;
1867case 36:
1868#line 411 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1869{ write_exp_elt_opcode (BINOP_GEQ); }
1870break;
1871case 37:
1872#line 415 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1873{ write_exp_elt_opcode (BINOP_LESS); }
1874break;
1875case 38:
1876#line 419 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1877{ write_exp_elt_opcode (BINOP_GTR); }
1878break;
1879case 39:
1880#line 423 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1881{ write_exp_elt_opcode (BINOP_BITWISE_AND); }
1882break;
1883case 40:
1884#line 427 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1885{ write_exp_elt_opcode (BINOP_BITWISE_XOR); }
1886break;
1887case 41:
1888#line 431 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1889{ write_exp_elt_opcode (BINOP_BITWISE_IOR); }
1890break;
1891case 42:
1892#line 435 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1893{ write_exp_elt_opcode (BINOP_ASSIGN); }
1894break;
1895case 43:
1896#line 439 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1897{ write_exp_elt_opcode (OP_BOOL);
1898 write_exp_elt_longcst ((LONGESTlong) yyvsp[0].lval);
1899 write_exp_elt_opcode (OP_BOOL); }
1900break;
1901case 44:
1902#line 445 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1903{ write_exp_elt_opcode (OP_BOOL);
1904 write_exp_elt_longcst ((LONGESTlong) yyvsp[0].lval);
1905 write_exp_elt_opcode (OP_BOOL); }
1906break;
1907case 45:
1908#line 451 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1909{ write_exp_elt_opcode (OP_LONG);
1910 write_exp_elt_type (yyvsp[0].typed_val_int.type);
1911 write_exp_elt_longcst ((LONGESTlong)(yyvsp[0].typed_val_int.val));
1912 write_exp_elt_opcode (OP_LONG); }
1913break;
1914case 46:
1915#line 458 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1916{ YYSTYPE val;
1917 parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
46
Calling 'parse_number'
59
Returning from 'parse_number'
1918 write_exp_elt_opcode (OP_LONG);
1919 write_exp_elt_type (val.typed_val_int.type);
60
1st function call argument is an uninitialized value
1920 write_exp_elt_longcst ((LONGESTlong)val.typed_val_int.val);
1921 write_exp_elt_opcode (OP_LONG);
1922 }
1923break;
1924case 47:
1925#line 469 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1926{ write_exp_elt_opcode (OP_DOUBLE);
1927 write_exp_elt_type (yyvsp[0].typed_val_float.type);
1928 write_exp_elt_dblcst (yyvsp[0].typed_val_float.dval);
1929 write_exp_elt_opcode (OP_DOUBLE); }
1930break;
1931case 50:
1932#line 483 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1933{ write_exp_elt_opcode (OP_LONG);
1934 write_exp_elt_type (builtin_type_int);
1935 CHECK_TYPEDEF (yyvsp[-1].tval)(yyvsp[-1].tval) = check_typedef (yyvsp[-1].tval);
1936 write_exp_elt_longcst ((LONGESTlong) TYPE_LENGTH (yyvsp[-1].tval)(yyvsp[-1].tval)->length);
1937 write_exp_elt_opcode (OP_LONG); }
1938break;
1939case 51:
1940#line 491 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1941{ /* C strings are converted into array constants with
1942 an explicit null byte added at the end. Thus
1943 the array upper bound is the string length.
1944 There is no such thing in C as a completely empty
1945 string. */
1946 char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
1947 while (count-- > 0)
1948 {
1949 write_exp_elt_opcode (OP_LONG);
1950 write_exp_elt_type (builtin_type_char);
1951 write_exp_elt_longcst ((LONGESTlong)(*sp++));
1952 write_exp_elt_opcode (OP_LONG);
1953 }
1954 write_exp_elt_opcode (OP_LONG);
1955 write_exp_elt_type (builtin_type_char);
1956 write_exp_elt_longcst ((LONGESTlong)'\0');
1957 write_exp_elt_opcode (OP_LONG);
1958 write_exp_elt_opcode (OP_ARRAY);
1959 write_exp_elt_longcst ((LONGESTlong) 0);
1960 write_exp_elt_longcst ((LONGESTlong) (yyvsp[0].sval.length));
1961 write_exp_elt_opcode (OP_ARRAY); }
1962break;
1963case 52:
1964#line 516 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1965{
1966 struct value * this_val;
1967 struct type * this_type;
1968 write_exp_elt_opcode (OP_THIS);
1969 write_exp_elt_opcode (OP_THIS);
1970 /* we need type of this */
1971 this_val = value_of_this (0);
1972 if (this_val)
1973 this_type = this_val->type;
1974 else
1975 this_type = NULL((void*)0);
1976 if (this_type)
1977 {
1978 if (TYPE_CODE (this_type)(this_type)->main_type->code == TYPE_CODE_PTR)
1979 {
1980 this_type = TYPE_TARGET_TYPE (this_type)(this_type)->main_type->target_type;
1981 write_exp_elt_opcode (UNOP_IND);
1982 }
1983 }
1984
1985 current_type = this_type;
1986 }
1987break;
1988case 53:
1989#line 543 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
1990{
1991 if (yyvsp[0].ssym.sym != 0)
1992 yyvalpascal_val.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym)(yyvsp[0].ssym.sym)->ginfo.value.block;
1993 else
1994 {
1995 struct symtab *tem =
1996 lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
1997 if (tem)
1998 yyvalpascal_val.bval = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK)((tem)->blockvector)->block[STATIC_BLOCK];
1999 else
2000 error ("No file or function \"%s\".",
2001 copy_name (yyvsp[0].ssym.stoken));
2002 }
2003 }
2004break;
2005case 54:
2006#line 560 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2007{ struct symbol *tem
2008 = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
2009 VAR_DOMAIN, (int *) NULL((void*)0),
2010 (struct symtab **) NULL((void*)0));
2011 if (!tem || SYMBOL_CLASS (tem)(tem)->aclass != LOC_BLOCK)
2012 error ("No function \"%s\" in specified context.",
2013 copy_name (yyvsp[0].sval));
2014 yyvalpascal_val.bval = SYMBOL_BLOCK_VALUE (tem)(tem)->ginfo.value.block; }
2015break;
2016case 55:
2017#line 571 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2018{ struct symbol *sym;
2019 sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
2020 VAR_DOMAIN, (int *) NULL((void*)0),
2021 (struct symtab **) NULL((void*)0));
2022 if (sym == 0)
2023 error ("No symbol \"%s\" in specified context.",
2024 copy_name (yyvsp[0].sval));
2025
2026 write_exp_elt_opcode (OP_VAR_VALUE);
2027 /* block_found is set by lookup_symbol. */
2028 write_exp_elt_block (block_found);
2029 write_exp_elt_sym (sym);
2030 write_exp_elt_opcode (OP_VAR_VALUE); }
2031break;
2032case 56:
2033#line 587 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2034{
2035 struct type *type = yyvsp[-2].tval;
2036 if (TYPE_CODE (type)(type)->main_type->code != TYPE_CODE_STRUCT
2037 && TYPE_CODE (type)(type)->main_type->code != TYPE_CODE_UNION)
2038 error ("`%s' is not defined as an aggregate type.",
2039 TYPE_NAME (type)(type)->main_type->name);
2040
2041 write_exp_elt_opcode (OP_SCOPE);
2042 write_exp_elt_type (type);
2043 write_exp_string (yyvsp[0].sval);
2044 write_exp_elt_opcode (OP_SCOPE);
2045 }
2046break;
2047case 58:
2048#line 603 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2049{
2050 char *name = copy_name (yyvsp[0].sval);
2051 struct symbol *sym;
2052 struct minimal_symbol *msymbol;
2053
2054 sym =
2055 lookup_symbol (name, (const struct block *) NULL((void*)0),
2056 VAR_DOMAIN, (int *) NULL((void*)0),
2057 (struct symtab **) NULL((void*)0));
2058 if (sym)
2059 {
2060 write_exp_elt_opcode (OP_VAR_VALUE);
2061 write_exp_elt_block (NULL((void*)0));
2062 write_exp_elt_sym (sym);
2063 write_exp_elt_opcode (OP_VAR_VALUE);
2064 break;
2065 }
2066
2067 msymbol = lookup_minimal_symbol (name, NULL((void*)0), NULL((void*)0));
2068 if (msymbol != NULL((void*)0))
2069 {
2070 write_exp_msymbol (msymbol,
2071 lookup_function_type (builtin_type_int),
2072 builtin_type_int);
2073 }
2074 else
2075 if (!have_full_symbols () && !have_partial_symbols ())
2076 error ("No symbol table is loaded. Use the \"file\" command.");
2077 else
2078 error ("No symbol \"%s\" in current context.", name);
2079 }
2080break;
2081case 59:
2082#line 637 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2083{ struct symbol *sym = yyvsp[0].ssym.sym;
2084
2085 if (sym)
2086 {
2087 if (symbol_read_needs_frame (sym))
2088 {
2089 if (innermost_block == 0 ||
2090 contained_in (block_found,
2091 innermost_block))
2092 innermost_block = block_found;
2093 }
2094
2095 write_exp_elt_opcode (OP_VAR_VALUE);
2096 /* We want to use the selected frame, not
2097 another more inner frame which happens to
2098 be in the same block. */
2099 write_exp_elt_block (NULL((void*)0));
2100 write_exp_elt_sym (sym);
2101 write_exp_elt_opcode (OP_VAR_VALUE);
2102 current_type = sym->type; }
2103 else if (yyvsp[0].ssym.is_a_field_of_this)
2104 {
2105 struct value * this_val;
2106 struct type * this_type;
2107 /* Object pascal: it hangs off of `this'. Must
2108 not inadvertently convert from a method call
2109 to data ref. */
2110 if (innermost_block == 0 ||
2111 contained_in (block_found, innermost_block))
2112 innermost_block = block_found;
2113 write_exp_elt_opcode (OP_THIS);
2114 write_exp_elt_opcode (OP_THIS);
2115 write_exp_elt_opcode (STRUCTOP_PTR);
2116 write_exp_string (yyvsp[0].ssym.stoken);
2117 write_exp_elt_opcode (STRUCTOP_PTR);
2118 /* we need type of this */
2119 this_val = value_of_this (0);
2120 if (this_val)
2121 this_type = this_val->type;
2122 else
2123 this_type = NULL((void*)0);
2124 if (this_type)
2125 current_type = lookup_struct_elt_type (
2126 this_type,
2127 copy_name (yyvsp[0].ssym.stoken), 0);
2128 else
2129 current_type = NULL((void*)0);
2130 }
2131 else
2132 {
2133 struct minimal_symbol *msymbol;
2134 char *arg = copy_name (yyvsp[0].ssym.stoken);
2135
2136 msymbol =
2137 lookup_minimal_symbol (arg, NULL((void*)0), NULL((void*)0));
2138 if (msymbol != NULL((void*)0))
2139 {
2140 write_exp_msymbol (msymbol,
2141 lookup_function_type (builtin_type_int),
2142 builtin_type_int);
2143 }
2144 else if (!have_full_symbols () && !have_partial_symbols ())
2145 error ("No symbol table is loaded. Use the \"file\" command.");
2146 else
2147 error ("No symbol \"%s\" in current context.",
2148 copy_name (yyvsp[0].ssym.stoken));
2149 }
2150 }
2151break;
2152case 62:
2153#line 721 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2154{ yyvalpascal_val.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); }
2155break;
2156case 63:
2157#line 726 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2158{ yyvalpascal_val.tval = lookup_pointer_type (yyvsp[0].tval); }
2159break;
2160case 64:
2161#line 728 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2162{ yyvalpascal_val.tval = yyvsp[0].tsym.type; }
2163break;
2164case 65:
2165#line 730 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2166{ yyvalpascal_val.tval = lookup_struct (copy_name (yyvsp[0].sval),
2167 expression_context_block); }
2168break;
2169case 66:
2170#line 733 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2171{ yyvalpascal_val.tval = lookup_struct (copy_name (yyvsp[0].sval),
2172 expression_context_block); }
2173break;
2174case 67:
2175#line 740 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2176{ yyvalpascal_val.sval = yyvsp[0].ssym.stoken; }
2177break;
2178case 68:
2179#line 741 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2180{ yyvalpascal_val.sval = yyvsp[0].ssym.stoken; }
2181break;
2182case 69:
2183#line 742 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2184{ yyvalpascal_val.sval = yyvsp[0].tsym.stoken; }
2185break;
2186case 70:
2187#line 743 "/usr/src/gnu/usr.bin/binutils/gdb/p-exp.y"
2188{ yyvalpascal_val.sval = yyvsp[0].ssym.stoken; }
2189break;
2190 }
2191 yyssp -= yym;
2192 yystatepascal_state = *yyssp;
2193 yyvsp -= yym;
2194 yym = yylhspascal_yylhs[yyn];
2195 if (yystatepascal_state == 0 && yym
10.2
'yym' is not equal to 0
== 0)
11
Taking false branch
2196 {
2197#if YYDEBUG1
2198 if (yydebugpascal_debug)
2199 printf("%sdebug: after reduction, shifting from state 0 to\
2200 state %d\n", YYPREFIX"yy", YYFINAL1);
2201#endif
2202 yystatepascal_state = YYFINAL1;
2203 *++yyssp = YYFINAL1;
2204 *++yyvsp = yyvalpascal_val;
2205 if (yycharpascal_char < 0)
2206 {
2207 if ((yycharpascal_char = yylexpascal_lex()) < 0) yycharpascal_char = 0;
2208#if YYDEBUG1
2209 if (yydebugpascal_debug)
2210 {
2211 yyspascal_s = 0;
2212 if (yycharpascal_char <= YYMAXTOKEN290) yyspascal_s = yynamepascal_name[yycharpascal_char];
2213 if (!yyspascal_s) yyspascal_s = "illegal-symbol";
2214 printf("%sdebug: state %d, reading %d (%s)\n",
2215 YYPREFIX"yy", YYFINAL1, yycharpascal_char, yyspascal_s);
2216 }
2217#endif
2218 }
2219 if (yycharpascal_char == 0) goto yyaccept;
2220 goto yyloop;
2221 }
2222 if ((yyn = yygindexpascal_yygindex[yym]) && (yyn += yystatepascal_state) >= 0 &&
12
Assuming 'yyn' is 0
2223 yyn <= YYTABLESIZE1160 && yycheckpascal_yycheck[yyn] == yystatepascal_state)
2224 yystatepascal_state = yytablepascal_yytable[yyn];
2225 else
2226 yystatepascal_state = yydgotopascal_yydgoto[yym];
2227#if YYDEBUG1
2228 if (yydebugpascal_debug)
13
Taking false branch
2229 printf("%sdebug: after reduction, shifting from state %d \
2230to state %d\n", YYPREFIX"yy", *yyssp, yystatepascal_state);
2231#endif
2232 if (yyssp >= yysslim && yygrowstack())
14
Assuming 'yyssp' is < 'yysslim'
2233 {
2234 goto yyoverflow;
2235 }
2236 *++yyssp = yystatepascal_state;
2237 *++yyvsp = yyvalpascal_val;
2238 goto yyloop;
15
Control jumps to line 1576
2239yyoverflow:
2240 yyerrorpascal_error("yacc stack overflow");
2241yyabort:
2242 if (yyss)
2243 free(yyss);
2244 if (yyvs)
2245 free(yyvs);
2246 yyss = yyssp = NULL((void*)0);
2247 yyvs = yyvsp = NULL((void*)0);
2248 yystacksize = 0;
2249 return (1);
2250yyaccept:
2251 if (yyss)
2252 free(yyss);
2253 if (yyvs)
2254 free(yyvs);
2255 yyss = yyssp = NULL((void*)0);
2256 yyvs = yyvsp = NULL((void*)0);
2257 yystacksize = 0;
2258 return (0);
2259}