~ubuntu-branches/ubuntu/karmic/codelite/karmic-backports

« back to all changes in this revision

Viewing changes to gdbparser/gdb_result_parser.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Backport
  • Date: 2010-03-10 00:42:25 UTC
  • mfrom: (10.1.3 lucid)
  • Revision ID: james.westby@ubuntu.com-20100310004225-ccjgjj2vvdy4q7qs
Tags: 2.2.0.3681+dfsg-0ubuntu1~karmic1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef lint
 
2
static char yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93";
 
3
#endif
 
4
#define YYBYACC 1
 
5
#define YYMAJOR 1
 
6
#define YYMINOR 9
 
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)*/
 
36
 
 
37
#include <string>
 
38
#include <vector>
 
39
#include <map>
 
40
#include <cstdio>
 
41
#define YYSTYPE std::string
 
42
#define YYDEBUG 0        /* get the pretty debugging code to compile*/
 
43
 
 
44
#ifdef yylex
 
45
#undef yylex
 
46
#define yylex gdb_result_lex
 
47
#endif
 
48
 
 
49
int  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();
 
54
void cleanup();
 
55
 
 
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;
 
60
#define GDB_DONE 257
 
61
#define GDB_RUNNING 258
 
62
#define GDB_CONNECTED 259
 
63
#define GDB_ERROR 260
 
64
#define GDB_EXIT 261
 
65
#define GDB_STACK_ARGS 262
 
66
#define GDB_VALUE 263
 
67
#define GDB_ARGS 264
 
68
#define GDB_FRAME 265
 
69
#define GDB_NAME 266
 
70
#define GDB_STRING 267
 
71
#define GDB_LEVEL 268
 
72
#define GDB_ESCAPED_STRING 269
 
73
#define GDB_LOCALS 270
 
74
#define GDB_INTEGER 271
 
75
#define GDB_OCTAL 272
 
76
#define GDB_HEX 273
 
77
#define GDB_FLOAT 274
 
78
#define GDB_IDENTIFIER 275
 
79
#define GDB_NUMCHILD 276
 
80
#define GDB_TYPE 277
 
81
#define GDB_DATA 278
 
82
#define GDB_ADDR 279
 
83
#define GDB_ASCII 280
 
84
#define GDB_CHILDREN 281
 
85
#define GDB_CHILD 282
 
86
#define GDB_MORE 283
 
87
#define GDB_VAROBJ 284
 
88
#define GDB_BREAKPOINT_TABLE 285
 
89
#define GDB_NR_ROWS 286
 
90
#define GDB_NR_COLS 287
 
91
#define GDB_HDR 288
 
92
#define GDB_BODY 289
 
93
#define GDB_BKPT 290
 
94
#define YYERRCODE 256
 
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,
 
100
   20,   20,   20,   20,
 
101
};
 
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,
 
107
    1,    1,    1,    1,
 
108
};
 
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,
 
123
    0,   16,   18,
 
124
};
 
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,
 
128
   74,
 
129
};
 
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,
 
144
 -153,    0,    0,
 
145
};
 
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,
 
160
    0,    0,    0,
 
161
};
 
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,
 
165
    0,
 
166
};
 
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,
 
195
};
 
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,
 
223
};
 
224
#define YYFINAL 2
 
225
#ifndef YYDEBUG
 
226
#define YYDEBUG 1
 
227
#endif
 
228
#define YYMAXTOKEN 290
 
229
#if YYDEBUG
 
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",
 
244
"GDB_BKPT",
 
245
};
 
246
char *gdb_result_rule[] = {
 
247
"$accept : parse",
 
248
"parse : children_list",
 
249
"parse : parse children_list",
 
250
"$$1 :",
 
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",
 
254
"$$2 :",
 
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",
 
268
"$$3 :",
 
269
"breakpoints : GDB_BKPT '=' list_open child_attributes list_close $$3 ',' breakpoints",
 
270
"mac_locals : GDB_VAROBJ '=' '{' child_attributes '}'",
 
271
"$$4 :",
 
272
"mac_locals : GDB_VAROBJ '=' '{' child_attributes '}' $$4 ',' mac_locals",
 
273
"locals : '{' child_attributes '}'",
 
274
"$$5 :",
 
275
"locals : '{' child_attributes '}' $$5 ',' locals",
 
276
"list_open : '['",
 
277
"list_open : '{'",
 
278
"list_close : ']'",
 
279
"list_close : '}'",
 
280
"children : GDB_CHILD '=' '{' child_attributes '}'",
 
281
"$$6 :",
 
282
"children : GDB_CHILD '=' '{' child_attributes '}' $$6 ',' children",
 
283
"child_attributes : child_key '=' GDB_STRING",
 
284
"$$7 :",
 
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",
 
292
};
 
293
#endif
 
294
#ifndef YYSTYPE
 
295
typedef int YYSTYPE;
 
296
#endif
 
297
#ifdef YYSTACKSIZE
 
298
#undef YYMAXDEPTH
 
299
#define YYMAXDEPTH YYSTACKSIZE
 
300
#else
 
301
#ifdef YYMAXDEPTH
 
302
#define YYSTACKSIZE YYMAXDEPTH
 
303
#else
 
304
#define YYSTACKSIZE 500
 
305
#define YYMAXDEPTH 500
 
306
#endif
 
307
#endif
 
308
int yydebug;
 
309
int yynerrs;
 
310
int yyerrflag;
 
311
int yychar;
 
312
short *yyssp;
 
313
YYSTYPE *yyvsp;
 
314
YYSTYPE yyval;
 
315
YYSTYPE yylval;
 
316
short yyss[YYSTACKSIZE];
 
317
YYSTYPE yyvs[YYSTACKSIZE];
 
318
#define yystacksize YYSTACKSIZE
 
319
void cleanup()
 
320
{
 
321
        sg_attributes.clear();
 
322
        sg_children.clear();
 
323
        sg_locals.clear();
 
324
}
 
325
 
 
326
void gdbParseListChildren( const std::string &in, std::vector<std::map<std::string, std::string> > &children)
 
327
{
 
328
        cleanup();
 
329
 
 
330
        setGdbLexerInput(in, true, false);
 
331
        gdb_result_parse();
 
332
 
 
333
        children = sg_children;
 
334
        gdb_result_lex_clean();
 
335
}
 
336
#define YYABORT goto yyabort
 
337
#define YYREJECT goto yyabort
 
338
#define YYACCEPT goto yyaccept
 
339
#define YYERROR goto yyerrlab
 
340
int
 
341
yyparse()
 
342
{
 
343
    register int yym, yyn, yystate;
 
344
#if YYDEBUG
 
345
    register char *yys;
 
346
    extern char *getenv();
 
347
 
 
348
    if (yys = getenv("YYDEBUG"))
 
349
    {
 
350
        yyn = *yys;
 
351
        if (yyn >= '0' && yyn <= '9')
 
352
            yydebug = yyn - '0';
 
353
    }
 
354
#endif
 
355
 
 
356
    yynerrs = 0;
 
357
    yyerrflag = 0;
 
358
    yychar = (-1);
 
359
 
 
360
    yyssp = yyss;
 
361
    yyvsp = yyvs;
 
362
    *yyssp = yystate = 0;
 
363
 
 
364
yyloop:
 
365
    if (yyn = yydefred[yystate]) goto yyreduce;
 
366
    if (yychar < 0)
 
367
    {
 
368
        if ((yychar = yylex()) < 0) yychar = 0;
 
369
#if YYDEBUG
 
370
        if (yydebug)
 
371
        {
 
372
            yys = 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);
 
377
        }
 
378
#endif
 
379
    }
 
380
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
 
381
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
 
382
    {
 
383
#if YYDEBUG
 
384
        if (yydebug)
 
385
            printf("%sdebug: state %d, shifting to state %d\n",
 
386
                    YYPREFIX, yystate, yytable[yyn]);
 
387
#endif
 
388
        if (yyssp >= yyss + yystacksize - 1)
 
389
        {
 
390
            goto yyoverflow;
 
391
        }
 
392
        *++yyssp = yystate = yytable[yyn];
 
393
        *++yyvsp = yylval;
 
394
        yychar = (-1);
 
395
        if (yyerrflag > 0)  --yyerrflag;
 
396
        goto yyloop;
 
397
    }
 
398
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
 
399
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
 
400
    {
 
401
        yyn = yytable[yyn];
 
402
        goto yyreduce;
 
403
    }
 
404
    if (yyerrflag) goto yyinrecovery;
 
405
#ifdef lint
 
406
    goto yynewerror;
 
407
#endif
 
408
yynewerror:
 
409
    yyerror("syntax error");
 
410
#ifdef lint
 
411
    goto yyerrlab;
 
412
#endif
 
413
yyerrlab:
 
414
    ++yynerrs;
 
415
yyinrecovery:
 
416
    if (yyerrflag < 3)
 
417
    {
 
418
        yyerrflag = 3;
 
419
        for (;;)
 
420
        {
 
421
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
 
422
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
 
423
            {
 
424
#if YYDEBUG
 
425
                if (yydebug)
 
426
                    printf("%sdebug: state %d, error recovery shifting\
 
427
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
 
428
#endif
 
429
                if (yyssp >= yyss + yystacksize - 1)
 
430
                {
 
431
                    goto yyoverflow;
 
432
                }
 
433
                *++yyssp = yystate = yytable[yyn];
 
434
                *++yyvsp = yylval;
 
435
                goto yyloop;
 
436
            }
 
437
            else
 
438
            {
 
439
#if YYDEBUG
 
440
                if (yydebug)
 
441
                    printf("%sdebug: error recovery discarding state %d\n",
 
442
                            YYPREFIX, *yyssp);
 
443
#endif
 
444
                if (yyssp <= yyss) goto yyabort;
 
445
                --yyssp;
 
446
                --yyvsp;
 
447
            }
 
448
        }
 
449
    }
 
450
    else
 
451
    {
 
452
        if (yychar == 0) goto yyabort;
 
453
#if YYDEBUG
 
454
        if (yydebug)
 
455
        {
 
456
            yys = 0;
 
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);
 
461
        }
 
462
#endif
 
463
        yychar = (-1);
 
464
        goto yyloop;
 
465
    }
 
466
yyreduce:
 
467
#if YYDEBUG
 
468
    if (yydebug)
 
469
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
 
470
                YYPREFIX, yystate, yyn, yyrule[yyn]);
 
471
#endif
 
472
    yym = yylen[yyn];
 
473
    yyval = yyvsp[1-yym];
 
474
    switch (yyn)
 
475
    {
 
476
case 3:
 
477
{ cleanup(); }
 
478
break;
 
479
case 5:
 
480
{
 
481
                                /*printf("CodeLite: syntax error, unexpected token '%s' found\n", gdb_result_lval.c_str());*/
 
482
                                }
 
483
break;
 
484
case 7:
 
485
{sg_attributes[yyvsp[-3]] = yyvsp[-1];}
 
486
break;
 
487
case 8:
 
488
{
 
489
                                        sg_children.push_back( sg_attributes );
 
490
                                        sg_attributes.clear();
 
491
                                }
 
492
break;
 
493
case 20:
 
494
{ sg_children.push_back( sg_attributes ); sg_attributes.clear();}
 
495
break;
 
496
case 21:
 
497
{ sg_children.push_back( sg_attributes ); sg_attributes.clear();}
 
498
break;
 
499
case 23:
 
500
{
 
501
                                sg_children.push_back( sg_attributes );
 
502
                                sg_attributes.clear();
 
503
                        }
 
504
break;
 
505
case 24:
 
506
{sg_children.push_back( sg_attributes ); sg_attributes.clear(); }
 
507
break;
 
508
case 26:
 
509
{
 
510
                                sg_children.push_back( sg_attributes );
 
511
                                sg_attributes.clear();
 
512
                        }
 
513
break;
 
514
case 27:
 
515
{sg_children.push_back( sg_attributes ); sg_attributes.clear(); }
 
516
break;
 
517
case 33:
 
518
{
 
519
                                        sg_children.push_back( sg_attributes );
 
520
                                        sg_attributes.clear();
 
521
                                }
 
522
break;
 
523
case 34:
 
524
{sg_children.push_back( sg_attributes ); sg_attributes.clear(); }
 
525
break;
 
526
case 36:
 
527
{ sg_attributes[yyvsp[-2]] = yyvsp[0]; }
 
528
break;
 
529
case 37:
 
530
{ sg_attributes[yyvsp[-2]] = yyvsp[0]; }
 
531
break;
 
532
case 39:
 
533
{yyval = yyvsp[0];}
 
534
break;
 
535
case 40:
 
536
{yyval = yyvsp[0];}
 
537
break;
 
538
case 41:
 
539
{yyval = yyvsp[0];}
 
540
break;
 
541
case 42:
 
542
{yyval = yyvsp[0];}
 
543
break;
 
544
case 43:
 
545
{yyval = yyvsp[0];}
 
546
break;
 
547
case 44:
 
548
{yyval = yyvsp[0];}
 
549
break;
 
550
    }
 
551
    yyssp -= yym;
 
552
    yystate = *yyssp;
 
553
    yyvsp -= yym;
 
554
    yym = yylhs[yyn];
 
555
    if (yystate == 0 && yym == 0)
 
556
    {
 
557
#if YYDEBUG
 
558
        if (yydebug)
 
559
            printf("%sdebug: after reduction, shifting from state 0 to\
 
560
 state %d\n", YYPREFIX, YYFINAL);
 
561
#endif
 
562
        yystate = YYFINAL;
 
563
        *++yyssp = YYFINAL;
 
564
        *++yyvsp = yyval;
 
565
        if (yychar < 0)
 
566
        {
 
567
            if ((yychar = yylex()) < 0) yychar = 0;
 
568
#if YYDEBUG
 
569
            if (yydebug)
 
570
            {
 
571
                yys = 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);
 
576
            }
 
577
#endif
 
578
        }
 
579
        if (yychar == 0) goto yyaccept;
 
580
        goto yyloop;
 
581
    }
 
582
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
 
583
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
 
584
        yystate = yytable[yyn];
 
585
    else
 
586
        yystate = yydgoto[yym];
 
587
#if YYDEBUG
 
588
    if (yydebug)
 
589
        printf("%sdebug: after reduction, shifting from state %d \
 
590
to state %d\n", YYPREFIX, *yyssp, yystate);
 
591
#endif
 
592
    if (yyssp >= yyss + yystacksize - 1)
 
593
    {
 
594
        goto yyoverflow;
 
595
    }
 
596
    *++yyssp = yystate;
 
597
    *++yyvsp = yyval;
 
598
    goto yyloop;
 
599
yyoverflow:
 
600
    yyerror("yacc stack overflow");
 
601
yyabort:
 
602
    return (1);
 
603
yyaccept:
 
604
    return (0);
 
605
}