2
static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
7
#define yyclearin (yychar=(-1))
8
#define yyerrok (yyerrflag=0)
9
#define YYRECOVERING (yyerrflag!=0)
10
#define yyparse gdb_result_parse
11
#define yylex gdb_result_lex
12
#define yyerror gdb_result_error
13
#define yychar gdb_result_char
14
#define yyval gdb_result_val
15
#define yylval gdb_result_lval
16
#define yydebug gdb_result_debug
17
#define yynerrs gdb_result_nerrs
18
#define yyerrflag gdb_result_errflag
19
#define yyss gdb_result_ss
20
#define yyssp gdb_result_ssp
21
#define yyvs gdb_result_vs
22
#define yyvsp gdb_result_vsp
23
#define yylhs gdb_result_lhs
24
#define yylen gdb_result_len
25
#define yydefred gdb_result_defred
26
#define yydgoto gdb_result_dgoto
27
#define yysindex gdb_result_sindex
28
#define yyrindex gdb_result_rindex
29
#define yygindex gdb_result_gindex
30
#define yytable gdb_result_table
31
#define yycheck gdb_result_check
32
#define yyname gdb_result_name
33
#define yyrule gdb_result_rule
34
#define YYPREFIX "gdb_result_"
35
/* Copyright Eran Ifrah(c)*/
41
#define YYSTYPE std::string
42
#define YYDEBUG 0 /* get the pretty debugging code to compile*/
46
#define yylex gdb_result_lex
50
void gdb_result_error(const char*);
51
bool setGdbLexerInput(const std::string &in, bool ascii, bool wantWhitespace);
52
void gdb_result_lex_clean();
53
int gdb_result_parse();
56
extern std::string gdb_result_lval;
57
static std::map<std::string, std::string> sg_attributes;
58
static std::vector<std::map<std::string, std::string> > sg_children;
59
static std::vector<std::string> sg_locals;
61
#define GDB_RUNNING 258
62
#define GDB_CONNECTED 259
65
#define GDB_STACK_ARGS 262
70
#define GDB_STRING 267
72
#define GDB_ESCAPED_STRING 269
73
#define GDB_LOCALS 270
74
#define GDB_INTEGER 271
78
#define GDB_IDENTIFIER 275
79
#define GDB_NUMCHILD 276
84
#define GDB_CHILDREN 281
87
#define GDB_VAROBJ 284
88
#define GDB_BREAKPOINT_TABLE 285
89
#define GDB_NR_ROWS 286
90
#define GDB_NR_COLS 287
95
short gdb_result_lhs[] = { -1,
96
0, 0, 3, 1, 1, 2, 8, 2, 2, 2,
97
2, 2, 2, 11, 13, 13, 14, 14, 12, 15,
98
16, 15, 10, 17, 10, 9, 18, 9, 4, 4,
99
6, 6, 5, 19, 5, 7, 21, 7, 20, 20,
102
short gdb_result_len[] = { 2,
103
1, 2, 0, 2, 1, 12, 0, 9, 8, 8,
104
20, 20, 9, 13, 3, 5, 3, 5, 6, 5,
105
0, 8, 5, 0, 8, 3, 0, 6, 1, 1,
106
1, 1, 5, 0, 8, 3, 0, 6, 1, 1,
109
short gdb_result_defred[] = { 0,
110
5, 0, 1, 0, 2, 0, 4, 0, 0, 0,
111
0, 0, 0, 0, 0, 0, 0, 0, 0, 30,
112
29, 0, 0, 0, 0, 0, 0, 7, 0, 0,
113
0, 0, 0, 0, 0, 0, 0, 0, 42, 39,
114
44, 40, 41, 43, 0, 0, 32, 31, 9, 10,
115
0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
116
0, 0, 13, 0, 0, 0, 0, 0, 0, 0,
117
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
118
28, 0, 0, 6, 0, 0, 0, 0, 0, 38,
119
0, 0, 0, 19, 0, 25, 0, 0, 0, 0,
120
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
121
0, 0, 0, 0, 35, 0, 0, 0, 0, 0,
122
0, 0, 14, 22, 11, 12, 0, 0, 0, 0,
125
short gdb_result_dgoto[] = { 2,
126
3, 7, 4, 116, 76, 49, 45, 37, 31, 32,
127
35, 54, 117, 122, 87, 112, 80, 66, 105, 46,
130
short gdb_result_sindex[] = { -246,
131
0, -246, 0, -78, 0, -237, 0, -23, -244, -36,
132
-34, -32, -31, -30, -83, -243, -83, -234, -83, 0,
133
0, -231, -9, -123, -6, -238, -19, 0, -12, -201,
134
-82, -82, -230, -11, 9, -83, -201, -69, 0, 0,
135
0, 0, 0, 0, -70, -1, 0, 0, 0, 0,
136
2, -206, -222, -82, -200, 0, -201, 0, -198, -83,
137
27, 11, 0, 16, -46, 38, 0, -199, -202, -83,
138
-178, 0, -24, 57, 43, -82, 45, -183, 64, 65,
139
0, -201, -10, 0, -157, 50, -82, -152, -170, 0,
140
-201, 71, -83, 0, 55, 0, -8, -169, -201, -83,
141
0, 59, -82, -123, 74, -83, 0, -82, -82, -199,
142
-83, 77, -82, -82, 0, -153, -82, -183, -82, -82,
143
62, -82, 0, 0, 0, 0, -143, 81, 83, -83,
146
short gdb_result_rindex[] = { 34,
147
0, 34, 0, 0, 0, 0, 0, 0, 0, 0,
148
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
149
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
150
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
151
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
152
0, 0, 0, 0, 0, 0, 0, -41, 0, 0,
153
0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
154
0, -37, 0, 0, 0, 0, 0, 0, 0, 0,
155
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
156
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
157
-35, 0, 0, 0, 0, 0, -27, 0, 0, 0,
158
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
159
0, 0, 0, 0, 0, 0, 0, -81, -79, 0,
162
short gdb_result_gindex[] = { 0,
163
127, 0, 0, -13, 20, -17, -18, 0, -68, -76,
164
0, 0, 3, 4, 13, 0, 0, 0, 0, 0,
167
#define YYTABLESIZE 257
168
short gdb_result_table[] = { 30,
169
36, 22, 27, 24, 81, 26, 24, 21, 34, 1,
170
48, 15, 96, 17, 50, 6, 21, 10, 56, 8,
171
9, 11, 55, 23, 15, 12, 16, 109, 17, 18,
172
19, 13, 25, 27, 28, 108, 63, 33, 65, 20,
173
14, 36, 47, 15, 37, 17, 68, 34, 38, 52,
174
51, 26, 53, 57, 58, 23, 78, 33, 84, 59,
175
61, 39, 60, 90, 40, 20, 62, 64, 67, 94,
176
69, 70, 97, 41, 42, 43, 71, 44, 72, 99,
177
103, 73, 75, 26, 77, 107, 104, 23, 79, 33,
178
113, 114, 111, 36, 36, 119, 120, 20, 30, 123,
179
82, 125, 126, 83, 128, 85, 86, 88, 89, 92,
180
93, 95, 91, 29, 98, 100, 101, 110, 102, 106,
181
118, 121, 127, 129, 130, 36, 131, 3, 5, 115,
182
124, 0, 132, 0, 133, 0, 0, 0, 0, 0,
183
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
184
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
185
29, 0, 0, 0, 0, 0, 0, 0, 0, 0,
186
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
187
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
188
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
189
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
190
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
191
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
192
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
193
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
194
0, 0, 0, 0, 0, 0, 36,
196
short gdb_result_check[] = { 123,
197
0, 15, 44, 17, 73, 19, 44, 91, 44, 256,
198
93, 93, 89, 93, 32, 94, 44, 262, 37, 257,
199
44, 266, 36, 267, 61, 270, 61, 104, 61, 61,
200
61, 276, 267, 265, 44, 104, 54, 44, 57, 123,
201
285, 61, 125, 125, 44, 125, 60, 286, 61, 61,
202
281, 93, 44, 123, 125, 93, 70, 93, 76, 61,
203
267, 263, 61, 82, 266, 93, 289, 268, 267, 87,
204
44, 61, 91, 275, 276, 277, 61, 279, 125, 93,
205
99, 44, 282, 125, 287, 103, 100, 125, 267, 125,
206
108, 109, 106, 93, 94, 113, 114, 125, 123, 117,
207
44, 119, 120, 61, 122, 61, 290, 44, 44, 267,
208
61, 264, 123, 284, 44, 61, 125, 44, 288, 61,
209
44, 275, 61, 267, 44, 125, 44, 94, 2, 110,
210
118, -1, 130, -1, 131, -1, -1, -1, -1, -1,
211
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
212
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
213
284, -1, -1, -1, -1, -1, -1, -1, -1, -1,
214
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
215
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
216
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
217
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
218
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
219
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
220
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
221
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
222
-1, -1, -1, -1, -1, -1, 256,
228
#define YYMAXTOKEN 290
230
char *gdb_result_name[] = {
231
"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,
232
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,
233
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,
234
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,
235
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,0,
236
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,0,
237
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,
238
"GDB_DONE","GDB_RUNNING","GDB_CONNECTED","GDB_ERROR","GDB_EXIT",
239
"GDB_STACK_ARGS","GDB_VALUE","GDB_ARGS","GDB_FRAME","GDB_NAME","GDB_STRING",
240
"GDB_LEVEL","GDB_ESCAPED_STRING","GDB_LOCALS","GDB_INTEGER","GDB_OCTAL",
241
"GDB_HEX","GDB_FLOAT","GDB_IDENTIFIER","GDB_NUMCHILD","GDB_TYPE","GDB_DATA",
242
"GDB_ADDR","GDB_ASCII","GDB_CHILDREN","GDB_CHILD","GDB_MORE","GDB_VAROBJ",
243
"GDB_BREAKPOINT_TABLE","GDB_NR_ROWS","GDB_NR_COLS","GDB_HDR","GDB_BODY",
246
char *gdb_result_rule[] = {
248
"parse : children_list",
249
"parse : parse children_list",
251
"children_list : $$1 child_pattern",
252
"children_list : error",
253
"child_pattern : '^' GDB_DONE ',' GDB_NUMCHILD '=' GDB_STRING ',' GDB_CHILDREN '=' list_open children list_close",
255
"child_pattern : '^' GDB_DONE ',' GDB_NAME '=' GDB_STRING ',' $$2 child_attributes",
256
"child_pattern : '^' GDB_DONE ',' GDB_LOCALS '=' list_open locals list_close",
257
"child_pattern : '^' GDB_DONE ',' GDB_LOCALS '=' list_open mac_locals list_close",
258
"child_pattern : '^' GDB_DONE ',' GDB_STACK_ARGS '=' list_open GDB_FRAME '=' list_open GDB_LEVEL '=' GDB_STRING ',' GDB_ARGS '=' list_open locals list_close list_close list_close",
259
"child_pattern : '^' GDB_DONE ',' GDB_STACK_ARGS '=' list_open GDB_FRAME '=' list_open GDB_LEVEL '=' GDB_STRING ',' GDB_ARGS '=' list_open mac_locals list_close list_close list_close",
260
"child_pattern : '^' GDB_DONE ',' GDB_BREAKPOINT_TABLE '=' list_open bpt_table_hdr bpt_table_body list_close",
261
"bpt_table_hdr : GDB_NR_ROWS '=' GDB_STRING ',' GDB_NR_COLS '=' GDB_STRING ',' GDB_HDR '=' list_open bpt_hdr_table_description list_close",
262
"bpt_hdr_table_description : list_open bpt_table_description_attr list_close",
263
"bpt_hdr_table_description : list_open bpt_table_description_attr list_close ',' bpt_hdr_table_description",
264
"bpt_table_description_attr : GDB_IDENTIFIER '=' GDB_STRING",
265
"bpt_table_description_attr : GDB_IDENTIFIER '=' GDB_STRING ',' bpt_table_description_attr",
266
"bpt_table_body : ',' GDB_BODY '=' list_open breakpoints list_close",
267
"breakpoints : GDB_BKPT '=' list_open child_attributes list_close",
269
"breakpoints : GDB_BKPT '=' list_open child_attributes list_close $$3 ',' breakpoints",
270
"mac_locals : GDB_VAROBJ '=' '{' child_attributes '}'",
272
"mac_locals : GDB_VAROBJ '=' '{' child_attributes '}' $$4 ',' mac_locals",
273
"locals : '{' child_attributes '}'",
275
"locals : '{' child_attributes '}' $$5 ',' locals",
280
"children : GDB_CHILD '=' '{' child_attributes '}'",
282
"children : GDB_CHILD '=' '{' child_attributes '}' $$6 ',' children",
283
"child_attributes : child_key '=' GDB_STRING",
285
"child_attributes : child_key '=' GDB_STRING $$7 ',' child_attributes",
286
"child_key : GDB_NAME",
287
"child_key : GDB_NUMCHILD",
288
"child_key : GDB_TYPE",
289
"child_key : GDB_VALUE",
290
"child_key : GDB_ADDR",
291
"child_key : GDB_IDENTIFIER",
299
#define YYMAXDEPTH YYSTACKSIZE
302
#define YYSTACKSIZE YYMAXDEPTH
304
#define YYSTACKSIZE 500
305
#define YYMAXDEPTH 500
316
short yyss[YYSTACKSIZE];
317
YYSTYPE yyvs[YYSTACKSIZE];
318
#define yystacksize YYSTACKSIZE
321
sg_attributes.clear();
326
void gdbParseListChildren( const std::string &in, std::vector<std::map<std::string, std::string> > &children)
330
setGdbLexerInput(in, true, false);
333
children = sg_children;
334
gdb_result_lex_clean();
336
#define YYABORT goto yyabort
337
#define YYREJECT goto yyabort
338
#define YYACCEPT goto yyaccept
339
#define YYERROR goto yyerrlab
343
register int yym, yyn, yystate;
346
extern char *getenv();
348
if (yys = getenv("YYDEBUG"))
351
if (yyn >= '0' && yyn <= '9')
362
*yyssp = yystate = 0;
365
if (yyn = yydefred[yystate]) goto yyreduce;
368
if ((yychar = yylex()) < 0) yychar = 0;
373
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
374
if (!yys) yys = "illegal-symbol";
375
printf("%sdebug: state %d, reading %d (%s)\n",
376
YYPREFIX, yystate, yychar, yys);
380
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
381
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
385
printf("%sdebug: state %d, shifting to state %d\n",
386
YYPREFIX, yystate, yytable[yyn]);
388
if (yyssp >= yyss + yystacksize - 1)
392
*++yyssp = yystate = yytable[yyn];
395
if (yyerrflag > 0) --yyerrflag;
398
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
399
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
404
if (yyerrflag) goto yyinrecovery;
409
yyerror("syntax error");
421
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
422
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
426
printf("%sdebug: state %d, error recovery shifting\
427
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
429
if (yyssp >= yyss + yystacksize - 1)
433
*++yyssp = yystate = yytable[yyn];
441
printf("%sdebug: error recovery discarding state %d\n",
444
if (yyssp <= yyss) goto yyabort;
452
if (yychar == 0) goto yyabort;
457
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
458
if (!yys) yys = "illegal-symbol";
459
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
460
YYPREFIX, yystate, yychar, yys);
469
printf("%sdebug: state %d, reducing by rule %d (%s)\n",
470
YYPREFIX, yystate, yyn, yyrule[yyn]);
473
yyval = yyvsp[1-yym];
481
/*printf("CodeLite: syntax error, unexpected token '%s' found\n", gdb_result_lval.c_str());*/
485
{sg_attributes[yyvsp[-3]] = yyvsp[-1];}
489
sg_children.push_back( sg_attributes );
490
sg_attributes.clear();
494
{ sg_children.push_back( sg_attributes ); sg_attributes.clear();}
497
{ sg_children.push_back( sg_attributes ); sg_attributes.clear();}
501
sg_children.push_back( sg_attributes );
502
sg_attributes.clear();
506
{sg_children.push_back( sg_attributes ); sg_attributes.clear(); }
510
sg_children.push_back( sg_attributes );
511
sg_attributes.clear();
515
{sg_children.push_back( sg_attributes ); sg_attributes.clear(); }
519
sg_children.push_back( sg_attributes );
520
sg_attributes.clear();
524
{sg_children.push_back( sg_attributes ); sg_attributes.clear(); }
527
{ sg_attributes[yyvsp[-2]] = yyvsp[0]; }
530
{ sg_attributes[yyvsp[-2]] = yyvsp[0]; }
555
if (yystate == 0 && yym == 0)
559
printf("%sdebug: after reduction, shifting from state 0 to\
560
state %d\n", YYPREFIX, YYFINAL);
567
if ((yychar = yylex()) < 0) yychar = 0;
572
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
573
if (!yys) yys = "illegal-symbol";
574
printf("%sdebug: state %d, reading %d (%s)\n",
575
YYPREFIX, YYFINAL, yychar, yys);
579
if (yychar == 0) goto yyaccept;
582
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
583
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
584
yystate = yytable[yyn];
586
yystate = yydgoto[yym];
589
printf("%sdebug: after reduction, shifting from state %d \
590
to state %d\n", YYPREFIX, *yyssp, yystate);
592
if (yyssp >= yyss + yystacksize - 1)
600
yyerror("yacc stack overflow");