File: clang_result_parser.cpp

package info (click to toggle)
codelite 12.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (732 lines) | stat: -rw-r--r-- 21,775 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright            : (C) 2014 Eran Ifrah
// file name            : clang_result_parser.cpp
//
// -------------------------------------------------------------------------
// A
//              _____           _      _     _ _
//             /  __ \         | |    | |   (_) |
//             | /  \/ ___   __| | ___| |    _| |_ ___
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/
//              \____/\___/ \__,_|\___\_____/_|\__\___|
//
//                                                  F i l e
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

#ifndef lint
static char yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
#endif
#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define yyclearin (yychar=(-1))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING (yyerrflag!=0)
#define yyparse clang_result_parse
#define yylex clang_result_lex
#define yyerror clang_result_error
#define yychar clang_result_char
#define yyval clang_result_val
#define yylval clang_result_lval
#define yydebug clang_result_debug
#define yynerrs clang_result_nerrs
#define yyerrflag clang_result_errflag
#define yyss clang_result_ss
#define yyssp clang_result_ssp
#define yyvs clang_result_vs
#define yyvsp clang_result_vsp
#define yylhs clang_result_lhs
#define yylen clang_result_len
#define yydefred clang_result_defred
#define yydgoto clang_result_dgoto
#define yysindex clang_result_sindex
#define yyrindex clang_result_rindex
#define yygindex clang_result_gindex
#define yytable clang_result_table
#define yycheck clang_result_check
#define yyname clang_result_name
#define yyrule clang_result_rule
#define YYPREFIX "clang_result_"
/* Copyright Eran Ifrah(c)*/
#include <string>
#include <stdio.h>
#include <vector>

#include "clang_output_parser_api.h"

#define YYSTYPE std::string
#define YYDEBUG 0        /* get the pretty debugging code to compile*/

#ifdef yylex
#undef yylex
#define yylex clang_yylex
#endif

extern int  clang_yylex();
extern void clang_yyless(int count);
int         clang_result_parse();

/** defined in grammer.l **/
extern bool        clang_set_lexer_input(const std::string &in);
extern const std::string& clang_lex_get_string();
extern void        clang_lex_clean();

/** the parser entry point **/
void clang_parse_string(const std::string& str);

void clang_result_error(char*);
/** read the signature **/
void clang_read_signature();
void clang_read_type_name(std::string &store);
void clang_read_entry_name(std::string &store);

/** holds the last signature read **/
static ClangEntry       clang_entry;
static ClangEntryVector clangEntryVector;
extern std::string      clang_result_lval;
#define CLANG_COMPLETION 257
#define CLANG_HIDDEN 258
#define CLANG_DELIM_OPEN 259
#define CLANG_DELIM_CLOSE 260
#define CLANG_ARG_DELIM_OPEN 261
#define CLANG_ARG_DELIM_CLOSE 262
#define CLANG_ARG_OPT_DELIM_OPEN 263
#define CLANG_ARG_OPT_DELIM_CLOSE 264
#define CLANG_STAR 265
#define CLANG_AMP 266
#define CLANG_TILDE 267
#define CLANG_ENUM 268
#define CLANG_ANONYMOUS 269
#define CLANG_CLCL 270
#define CLANG_OP_ASSIGN 271
#define CLANG_OP_DOTstar 272
#define CLANG_OP_ARROW 273
#define CLANG_OP_ARROWstar 274
#define CLANG_OP_ICR 275
#define CLANG_OP_DECR 276
#define CLANG_OP_LS 277
#define CLANG_OP_RS 278
#define CLANG_OP_LE 279
#define CLANG_OP_GE 280
#define CLANG_OP_EQ 281
#define CLANG_OP_NE 282
#define CLANG_ELLIPSIS 283
#define CLANG_NAME 284
#define CLANG_OPERATOR 285
#define YYERRCODE 256
short clang_result_lhs[] = {                                        -1,
    0,    0,    3,    1,    1,    2,    8,    8,    8,    8,
    8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
    4,    4,    4,    4,    7,    9,    7,   10,   11,   10,
    6,    6,   12,    5,    5,    5,
};
short clang_result_len[] = {                                         2,
    1,    2,    0,    2,    1,    8,    1,    1,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    2,    2,
    0,    1,    2,    2,    0,    0,    4,    0,    0,    3,
    0,    4,    0,    3,    2,    1,
};
short clang_result_defred[] = {                                      0,
    5,    0,    1,    0,    2,    0,    4,    0,    0,   22,
    0,    0,   24,    9,   11,    7,    8,   14,   10,   16,
   18,   15,   13,   12,   17,    0,    0,   23,    0,   19,
   20,   33,    0,    0,    0,   35,    0,    0,   34,    0,
    0,    0,   26,    6,   32,    0,    0,   29,   27,    0,
   30,
};
short clang_result_dgoto[] = {                                       2,
    3,    7,    4,   12,   34,   38,   44,   28,   46,   49,
   50,   35,
};
short clang_result_sindex[] = {                                   -252,
    0, -252,    0, -251,    0,  -50,    0, -264, -274,    0,
  -40,  -47,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,  -29,  -79,    0, -257,    0,
    0,    0, -255, -243, -242,    0, -267, -264,    0, -248,
  -21, -237,    0,    0,    0,  -17, -234,    0,    0, -232,
    0,
};
short clang_result_rindex[] = {                                   -231,
    0, -231,    0,    0,    0,    0,    0,  -28,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    1,    5,    0,    0,    0,    7,    0,    0,
    9,    0,    0,    0,    0,    0,   13,    0,    0,    0,
    0,
};
short clang_result_gindex[] = {                                      0,
   27,    0,    0,   -7,    0,    0,    0,    0,    0,    0,
    0,    0,
};
#define YYTABLESIZE 290
short clang_result_table[] = {                                      26,
   36,   32,    9,    1,   31,    6,   21,    8,   25,   13,
   29,   30,   28,   31,   36,   37,   40,   39,   43,   10,
   11,   42,   45,   47,   48,    3,   33,   51,    5,   21,
   41,    0,    0,    0,    0,    0,    0,    0,    0,    0,
   36,    0,    0,    0,   31,    0,   21,    0,    0,    0,
   27,    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,    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,    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,    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,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
   14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
   24,   25,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   36,   36,    0,   36,
   31,   31,   21,   21,   25,   25,    0,   36,   28,   28,
    0,   31,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,   36,   36,    0,    0,   31,   31,
};
short clang_result_check[] = {                                      40,
    0,  259,  267,  256,    0,  257,    0,   58,    0,  284,
   58,   41,    0,   93,  270,  259,  284,  260,   40,  284,
  285,  270,  260,   41,  259,  257,  284,  260,    2,   58,
   38,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   40,   -1,   -1,   -1,   40,   -1,   40,   -1,   -1,   -1,
   91,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
  271,  272,  273,  274,  275,  276,  277,  278,  279,  280,
  281,  282,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,   -1,   -1,  256,  257,   -1,  259,
  256,  257,  256,  257,  256,  257,   -1,  267,  256,  257,
   -1,  267,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,  284,  285,   -1,   -1,  284,  285,
};
#define YYFINAL 2
#ifndef YYDEBUG
#define YYDEBUG 1
#endif
#define YYMAXTOKEN 285
#if YYDEBUG
char *clang_result_name[] = {
"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,
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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
"CLANG_COMPLETION","CLANG_HIDDEN","CLANG_DELIM_OPEN","CLANG_DELIM_CLOSE",
"CLANG_ARG_DELIM_OPEN","CLANG_ARG_DELIM_CLOSE","CLANG_ARG_OPT_DELIM_OPEN",
"CLANG_ARG_OPT_DELIM_CLOSE","CLANG_STAR","CLANG_AMP","CLANG_TILDE","CLANG_ENUM",
"CLANG_ANONYMOUS","CLANG_CLCL","CLANG_OP_ASSIGN","CLANG_OP_DOTstar",
"CLANG_OP_ARROW","CLANG_OP_ARROWstar","CLANG_OP_ICR","CLANG_OP_DECR",
"CLANG_OP_LS","CLANG_OP_RS","CLANG_OP_LE","CLANG_OP_GE","CLANG_OP_EQ",
"CLANG_OP_NE","CLANG_ELLIPSIS","CLANG_NAME","CLANG_OPERATOR",
};
char *clang_result_rule[] = {
"$accept : parse",
"parse : completion_output",
"parse : parse completion_output",
"$$1 :",
"completion_output : $$1 completion_entry",
"completion_output : error",
"completion_entry : CLANG_COMPLETION ':' entry_name ':' type_name scope entry_name function_part",
"any_operator : CLANG_OP_ARROW",
"any_operator : CLANG_OP_ARROWstar",
"any_operator : CLANG_OP_ASSIGN",
"any_operator : CLANG_OP_DECR",
"any_operator : CLANG_OP_DOTstar",
"any_operator : CLANG_OP_EQ",
"any_operator : CLANG_OP_GE",
"any_operator : CLANG_OP_ICR",
"any_operator : CLANG_OP_LE",
"any_operator : CLANG_OP_LS",
"any_operator : CLANG_OP_NE",
"any_operator : CLANG_OP_RS",
"any_operator : '(' ')'",
"any_operator : '[' ']'",
"entry_name :",
"entry_name : CLANG_NAME",
"entry_name : CLANG_OPERATOR any_operator",
"entry_name : CLANG_TILDE CLANG_NAME",
"function_part :",
"$$2 :",
"function_part : '(' $$2 ')' function_suffix",
"function_suffix :",
"$$3 :",
"function_suffix : CLANG_DELIM_OPEN $$3 CLANG_DELIM_CLOSE",
"scope :",
"scope : CLANG_DELIM_OPEN CLANG_NAME CLANG_CLCL CLANG_DELIM_CLOSE",
"$$4 :",
"type_name : CLANG_DELIM_OPEN $$4 CLANG_DELIM_CLOSE",
"type_name : CLANG_NAME CLANG_CLCL",
"type_name : CLANG_NAME",
};
#endif
#ifndef YYSTYPE
typedef int YYSTYPE;
#endif
#ifdef YYSTACKSIZE
#undef YYMAXDEPTH
#define YYMAXDEPTH YYSTACKSIZE
#else
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 500
#define YYMAXDEPTH 500
#endif
#endif
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#define yystacksize YYSTACKSIZE

void clang_parse_string(const std::string& str){
	clangEntryVector.clear();
	clang_lex_clean();
	clang_set_lexer_input(str);
	clang_result_parse();
	clang_lex_clean();
}

const ClangEntryVector& clang_results() {
	return clangEntryVector;
}

void clang_result_error(char*){
}

void clang_read_signature() {
	clang_entry.signature = "(";
	int depth = 1;
	while(depth > 0)
	{
		int ch = clang_yylex();
		if(ch == 0){
			break;
		}
		
		switch(ch) {
		case CLANG_ARG_DELIM_OPEN:
		case CLANG_ARG_DELIM_CLOSE:
		case CLANG_ARG_OPT_DELIM_OPEN:
		case CLANG_ARG_OPT_DELIM_CLOSE:
			break;
			
		case (int)'(':
			depth++;
			break;
			
		case (int)')':
			depth--;
			if(depth == 0)
				clang_yyless(0);
			break;
			
		default:
			clang_entry.signature += clang_lex_get_string();
			clang_entry.signature += " ";
			break;
		}
	}
	clang_entry.signature += ")";
}

void clang_read_type_name(std::string &store){
	store.clear();
	int depth = 1;
	while(true)
	{
		int ch = clang_yylex();
		if(ch == 0){
			break;
		}
		
		switch(ch) {
		case CLANG_DELIM_CLOSE:
			clang_yyless(0);
			return;
			
		default:
			store += clang_lex_get_string();
			store += " ";
			break;
		}
	}
}

void clang_read_entry_name(std::string &store){
	store.clear();
	while(true)
	{
		int ch = clang_yylex();
		if(ch == 0){
			break;
		}
		
		switch(ch) {
		case (int)':':
			clang_yyless(0);
			return;
			
		default:
			store += clang_lex_get_string();
			store += " ";
			break;
		}
	}
}
#define YYABORT goto yyabort
#define YYREJECT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse()
{
    register int yym, yyn, yystate;
#if YYDEBUG
    register char *yys;
    extern char *getenv();

    if (yys = getenv("YYDEBUG"))
    {
        yyn = *yys;
        if (yyn >= '0' && yyn <= '9')
            yydebug = yyn - '0';
    }
#endif

    yynerrs = 0;
    yyerrflag = 0;
    yychar = (-1);

    yyssp = yyss;
    yyvsp = yyvs;
    *yyssp = yystate = 0;

yyloop:
    if (yyn = yydefred[yystate]) goto yyreduce;
    if (yychar < 0)
    {
        if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, reading %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
    }
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: state %d, shifting to state %d\n",
                    YYPREFIX, yystate, yytable[yyn]);
#endif
        if (yyssp >= yyss + yystacksize - 1)
        {
            goto yyoverflow;
        }
        *++yyssp = yystate = yytable[yyn];
        *++yyvsp = yylval;
        yychar = (-1);
        if (yyerrflag > 0)  --yyerrflag;
        goto yyloop;
    }
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
    {
        yyn = yytable[yyn];
        goto yyreduce;
    }
    if (yyerrflag) goto yyinrecovery;
#ifdef lint
    goto yynewerror;
#endif
yynewerror:
    yyerror("syntax error");
#ifdef lint
    goto yyerrlab;
#endif
yyerrlab:
    ++yynerrs;
yyinrecovery:
    if (yyerrflag < 3)
    {
        yyerrflag = 3;
        for (;;)
        {
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: state %d, error recovery shifting\
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
#endif
                if (yyssp >= yyss + yystacksize - 1)
                {
                    goto yyoverflow;
                }
                *++yyssp = yystate = yytable[yyn];
                *++yyvsp = yylval;
                goto yyloop;
            }
            else
            {
#if YYDEBUG
                if (yydebug)
                    printf("%sdebug: error recovery discarding state %d\n",
                            YYPREFIX, *yyssp);
#endif
                if (yyssp <= yyss) goto yyabort;
                --yyssp;
                --yyvsp;
            }
        }
    }
    else
    {
        if (yychar == 0) goto yyabort;
#if YYDEBUG
        if (yydebug)
        {
            yys = 0;
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
            if (!yys) yys = "illegal-symbol";
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
                    YYPREFIX, yystate, yychar, yys);
        }
#endif
        yychar = (-1);
        goto yyloop;
    }
yyreduce:
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
                YYPREFIX, yystate, yyn, yyrule[yyn]);
#endif
    yym = yylen[yyn];
    yyval = yyvsp[1-yym];
    switch (yyn)
    {
case 3:
{clang_entry.reset();}
break;
case 5:
{
				   /*printf("CodeLite: syntax error, unexpected token '%s' found\n", clang_lex_get_string().c_str());*/
				 }
break;
case 6:
{
					bool is_func = !clang_entry.signature.empty();
					clang_entry.parent       = yyvsp[-2];
					clang_entry.type_name    = is_func ? std::string() : clang_entry.tmp;
					clang_entry.return_value = is_func ? clang_entry.tmp : std::string();
					
					if (clang_entry.type == ClangEntry::TypeUnknown) {
						if(is_func)
							clang_entry.type = ClangEntry::TypeMethod;
						else 
							clang_entry.type = ClangEntry::TypeVariable;
					}
					clangEntryVector.push_back(clang_entry);
				}
break;
case 7:
{yyval = yyvsp[0];}
break;
case 8:
{yyval = yyvsp[0];}
break;
case 9:
{yyval = yyvsp[0];}
break;
case 10:
{yyval = yyvsp[0];}
break;
case 11:
{yyval = yyvsp[0];}
break;
case 12:
{yyval = yyvsp[0];}
break;
case 13:
{yyval = yyvsp[0];}
break;
case 14:
{yyval = yyvsp[0];}
break;
case 15:
{yyval = yyvsp[0];}
break;
case 16:
{yyval = yyvsp[0];}
break;
case 17:
{yyval = yyvsp[0];}
break;
case 18:
{yyval = yyvsp[0];}
break;
case 19:
{yyval = "()";}
break;
case 20:
{yyval = "[]";}
break;
case 21:
{ yyval = ""; }
break;
case 22:
{
				clang_entry.name.clear();
				clang_entry.name = yyvsp[0];
			}
break;
case 23:
{
				clang_entry.name.clear();
				clang_entry.name = yyvsp[-1] + yyvsp[0];
			}
break;
case 24:
{
				clang_entry.name.clear();
				clang_entry.name = yyvsp[-1] + yyvsp[0];
				clang_entry.type = ClangEntry::TypeDtor;
			}
break;
case 26:
{clang_read_signature();}
break;
case 29:
{clang_read_type_name(clang_entry.func_suffix);}
break;
case 31:
{yyval = "";}
break;
case 32:
{yyval = yyvsp[-2];}
break;
case 33:
{clang_read_type_name(clang_entry.tmp);}
break;
case 34:
{
				if(clang_entry.tmp.find("enum ") != std::string::npos) {
					clang_entry.type = ClangEntry::TypeEnum;
				}
			}
break;
case 35:
{
			  clang_entry.type = ClangEntry::TypeCtor;
		  }
break;
case 36:
{
			clang_entry.type = ClangEntry::TypeClass;
		  }
break;
    }
    yyssp -= yym;
    yystate = *yyssp;
    yyvsp -= yym;
    yym = yylhs[yyn];
    if (yystate == 0 && yym == 0)
    {
#if YYDEBUG
        if (yydebug)
            printf("%sdebug: after reduction, shifting from state 0 to\
 state %d\n", YYPREFIX, YYFINAL);
#endif
        yystate = YYFINAL;
        *++yyssp = YYFINAL;
        *++yyvsp = yyval;
        if (yychar < 0)
        {
            if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
            if (yydebug)
            {
                yys = 0;
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
                if (!yys) yys = "illegal-symbol";
                printf("%sdebug: state %d, reading %d (%s)\n",
                        YYPREFIX, YYFINAL, yychar, yys);
            }
#endif
        }
        if (yychar == 0) goto yyaccept;
        goto yyloop;
    }
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn];
    else
        yystate = yydgoto[yym];
#if YYDEBUG
    if (yydebug)
        printf("%sdebug: after reduction, shifting from state %d \
to state %d\n", YYPREFIX, *yyssp, yystate);
#endif
    if (yyssp >= yyss + yystacksize - 1)
    {
        goto yyoverflow;
    }
    *++yyssp = yystate;
    *++yyvsp = yyval;
    goto yyloop;
yyoverflow:
    yyerror("yacc stack overflow");
yyabort:
    return (1);
yyaccept:
    return (0);
}