~ubuntu-branches/ubuntu/trusty/anjuta/trusty

« back to all changes in this revision

Viewing changes to plugins/parser-cxx/cxxparser/scope-parser.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-08-17 23:48:26 UTC
  • mfrom: (1.1.50)
  • Revision ID: package-import@ubuntu.com-20120817234826-fvk3rfp6nmfaqi9p
Tags: 2:3.5.5-0ubuntu1
* New upstream release.
* debian/control.in:
  - Bump vala dependency to 0.18 series
  - Drop graphviz from build-depends
* debian/watch: Watch for unstable releases

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 
2
/*
 
3
 * anjuta
 
4
 * Copyright (C) Eran Ifrah (Main file for CodeLite www.codelite.org/ )
 
5
 * Copyright (C) Massimo Cora' 2009 <maxcvs@email.it> (Customizations for Anjuta)
 
6
 * 
 
7
 * anjuta is free software: you can redistribute it and/or modify it
 
8
 * under the terms of the GNU General Public License as published by the
 
9
 * Free Software Foundation, either version 3 of the License, or
 
10
 * (at your option) any later version.
 
11
 * 
 
12
 * anjuta is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
15
 * See the GNU General Public License for more details.
 
16
 * 
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
#ifndef lint
 
22
static char yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93";
 
23
#endif
 
24
#define YYBYACC 1
 
25
#define YYMAJOR 1
 
26
#define YYMINOR 9
 
27
#define yyclearin (yychar=(-1))
 
28
#define yyerrok (yyerrflag=0)
 
29
#define YYRECOVERING (yyerrflag!=0)
 
30
#define yyparse cl_scope_parse
 
31
#define yylex cl_scope_lex
 
32
#define yyerror cl_scope_error
 
33
#define yychar cl_scope_char
 
34
#define yyval cl_scope_val
 
35
#define yylval cl_scope_lval
 
36
#define yydebug cl_scope_debug
 
37
#define yynerrs cl_scope_nerrs
 
38
#define yyerrflag cl_scope_errflag
 
39
#define yyss cl_scope_ss
 
40
#define yyssp cl_scope_ssp
 
41
#define yyvs cl_scope_vs
 
42
#define yyvsp cl_scope_vsp
 
43
#define yylhs cl_scope_lhs
 
44
#define yylen cl_scope_len
 
45
#define yydefred cl_scope_defred
 
46
#define yydgoto cl_scope_dgoto
 
47
#define yysindex cl_scope_sindex
 
48
#define yyrindex cl_scope_rindex
 
49
#define yygindex cl_scope_gindex
 
50
#define yytable cl_scope_table
 
51
#define yycheck cl_scope_check
 
52
#define yyname cl_scope_name
 
53
#define yyrule cl_scope_rule
 
54
#define YYPREFIX "cl_scope_"
 
55
/* Copyright Eran Ifrah(c)*/
 
56
/*************** Includes and Defines *****************************/
 
57
#include "string"
 
58
#include "vector"
 
59
#include "stdio.h"
 
60
#include "map"
 
61
 
 
62
#define YYDEBUG_LEXER_TEXT (cl_scope_lval)
 
63
#define YYSTYPE std::string
 
64
#define YYDEBUG 0        /* get the pretty debugging code to compile*/
 
65
 
 
66
int cl_scope_parse();
 
67
void cl_scope_error(char *string);
 
68
void syncParser();
 
69
 
 
70
static std::vector<std::string> gs_additionlNS;
 
71
 
 
72
/*---------------------------------------------*/
 
73
/* externs defined in the lexer*/
 
74
/*---------------------------------------------*/
 
75
extern char *cl_scope_text;
 
76
extern int cl_scope_lex();
 
77
extern bool setLexerInput(const std::string &in, const std::map<std::string, std::string> &ignoreTokens);
 
78
extern int cl_scope_lineno;
 
79
extern std::vector<std::string> currentScope;
 
80
extern void printScopeName();   /*print the current scope name*/
 
81
extern void increaseScope();    /*increase scope with anonymouse value*/
 
82
extern std::string getCurrentScope();
 
83
extern void cl_scope_lex_clean();
 
84
extern void cl_scope_less(int count);
 
85
 
 
86
/*************** Standard ytab.c continues here *********************/
 
87
#define LE_AUTO 257
 
88
#define LE_DOUBLE 258
 
89
#define LE_INT 259
 
90
#define LE_STRUCT 260
 
91
#define LE_BREAK 261
 
92
#define LE_ELSE 262
 
93
#define LE_LONG 263
 
94
#define LE_SWITCH 264
 
95
#define LE_CASE 265
 
96
#define LE_ENUM 266
 
97
#define LE_REGISTER 267
 
98
#define LE_TYPEDEF 268
 
99
#define LE_CHAR 269
 
100
#define LE_EXTERN 270
 
101
#define LE_RETURN 271
 
102
#define LE_UNION 272
 
103
#define LE_CONST 273
 
104
#define LE_FLOAT 274
 
105
#define LE_SHORT 275
 
106
#define LE_UNSIGNED 276
 
107
#define LE_CONTINUE 277
 
108
#define LE_FOR 278
 
109
#define LE_SIGNED 279
 
110
#define LE_VOID 280
 
111
#define LE_DEFAULT 281
 
112
#define LE_GOTO 282
 
113
#define LE_SIZEOF 283
 
114
#define LE_VOLATILE 284
 
115
#define LE_DO 285
 
116
#define LE_IF 286
 
117
#define LE_STATIC 287
 
118
#define LE_WHILE 288
 
119
#define LE_NEW 289
 
120
#define LE_DELETE 290
 
121
#define LE_THIS 291
 
122
#define LE_OPERATOR 292
 
123
#define LE_CLASS 293
 
124
#define LE_PUBLIC 294
 
125
#define LE_PROTECTED 295
 
126
#define LE_PRIVATE 296
 
127
#define LE_VIRTUAL 297
 
128
#define LE_FRIEND 298
 
129
#define LE_INLINE 299
 
130
#define LE_OVERLOAD 300
 
131
#define LE_TEMPLATE 301
 
132
#define LE_TYPENAME 302
 
133
#define LE_THROW 303
 
134
#define LE_CATCH 304
 
135
#define LE_IDENTIFIER 305
 
136
#define LE_STRINGliteral 306
 
137
#define LE_FLOATINGconstant 307
 
138
#define LE_INTEGERconstant 308
 
139
#define LE_CHARACTERconstant 309
 
140
#define LE_OCTALconstant 310
 
141
#define LE_HEXconstant 311
 
142
#define LE_POUNDPOUND 312
 
143
#define LE_CComment 313
 
144
#define LE_CPPComment 314
 
145
#define LE_NAMESPACE 315
 
146
#define LE_USING 316
 
147
#define LE_TYPEDEFname 317
 
148
#define LE_ARROW 318
 
149
#define LE_ICR 319
 
150
#define LE_DECR 320
 
151
#define LE_LS 321
 
152
#define LE_RS 322
 
153
#define LE_LE 323
 
154
#define LE_GE 324
 
155
#define LE_EQ 325
 
156
#define LE_NE 326
 
157
#define LE_ANDAND 327
 
158
#define LE_OROR 328
 
159
#define LE_ELLIPSIS 329
 
160
#define LE_CLCL 330
 
161
#define LE_DOTstar 331
 
162
#define LE_ARROWstar 332
 
163
#define LE_MULTassign 333
 
164
#define LE_DIVassign 334
 
165
#define LE_MODassign 335
 
166
#define LE_PLUSassign 336
 
167
#define LE_MINUSassign 337
 
168
#define LE_LSassign 338
 
169
#define LE_RSassign 339
 
170
#define LE_ANDassign 340
 
171
#define LE_ERassign 341
 
172
#define LE_ORassign 342
 
173
#define LE_MACRO 343
 
174
#define LE_DYNAMIC_CAST 344
 
175
#define LE_STATIC_CAST 345
 
176
#define LE_CONST_CAST 346
 
177
#define LE_REINTERPRET_CAST 347
 
178
#define YYERRCODE 256
 
179
short cl_scope_lhs[] = {                                        -1,
 
180
    1,    1,    1,    1,    1,    1,    1,    1,    1,    0,
 
181
    0,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 
182
    2,   12,   12,   14,   14,   13,   13,   15,   15,   16,
 
183
   16,   16,   17,   19,   19,   18,   18,   18,   18,   20,
 
184
   20,   20,   21,   21,   21,    8,    7,    7,   26,   26,
 
185
    3,    3,    9,   10,   11,   27,   27,   28,   28,   29,
 
186
   29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
 
187
   29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
 
188
   29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
 
189
   29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
 
190
   30,   30,   31,   31,   34,    6,   35,    6,   36,    6,
 
191
   23,   23,   37,   38,   37,   32,   32,   22,   22,   39,
 
192
   39,   40,   40,   24,   25,   25,   25,   33,   33,   33,
 
193
   42,    4,   43,   43,   43,   43,   44,   41,   41,   41,
 
194
    5,
 
195
};
 
196
short cl_scope_len[] = {                                         2,
 
197
    1,    1,    1,    1,    1,    1,    1,    1,    1,    0,
 
198
    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
199
    1,    0,    2,    1,    3,    1,    1,    0,    4,    0,
 
200
    1,    3,    3,    0,    3,    0,    1,    1,    1,    0,
 
201
    1,    3,    4,    4,    7,    5,    4,    3,    0,    1,
 
202
    6,    8,    1,    1,    1,    1,    1,    1,    2,    1,
 
203
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
204
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
205
    1,    1,    1,    1,    1,    2,    2,    1,    1,    1,
 
206
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 
207
    1,    1,    0,    4,    0,   12,    0,    9,    0,   11,
 
208
    0,    2,    2,    0,    4,    0,    1,    0,    1,    0,
 
209
    1,    0,    2,    2,    0,    1,    1,    3,    3,    6,
 
210
    0,    7,    0,    2,    2,    2,    2,    0,    1,    3,
 
211
    4,
 
212
};
 
213
short cl_scope_defred[] = {                                     10,
 
214
    0,   21,    0,  126,   54,  127,   53,   55,   11,   12,
 
215
   13,   14,   15,   16,   17,   18,   19,   20,    0,  111,
 
216
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
217
   48,   57,   56,  117,    0,    0,    0,  112,  131,  141,
 
218
   26,   27,   24,    0,    0,   47,   50,    0,  119,  111,
 
219
  113,  114,   46,    0,   23,    0,   29,    0,    0,  111,
 
220
    0,    0,    0,  139,   25,   51,    0,    6,    1,    4,
 
221
    2,    5,    3,    8,    7,    9,    0,    0,    0,  122,
 
222
    0,    0,  115,    0,  137,    0,  132,   37,   39,   38,
 
223
    0,   31,    0,   88,   89,   76,   80,   81,   72,   73,
 
224
   82,   83,   84,   85,   74,   75,   79,   77,   91,   92,
 
225
   93,   94,   95,   96,   97,   98,   99,  100,   90,   70,
 
226
   71,   60,   61,   62,   63,   64,   65,   66,   67,   68,
 
227
   69,   78,    0,    0,   59,    0,  129,    0,   58,    0,
 
228
  128,  107,    0,    0,  136,  135,  134,  140,    0,   52,
 
229
    0,   86,   87,    0,   41,  111,  123,  121,  124,  109,
 
230
    0,  105,   32,    0,   33,    0,  122,    0,    0,  101,
 
231
  102,  108,    0,    0,   42,  130,    0,  122,    0,    0,
 
232
   35,    0,   43,   44,  110,    0,    0,    0,    0,  106,
 
233
  122,    0,   45,  104,
 
234
};
 
235
short cl_scope_dgoto[] = {                                       1,
 
236
   80,    9,   10,   11,   12,   13,   14,   15,   16,   17,
 
237
   18,   43,   44,   45,   25,   91,   92,   93,  165,  154,
 
238
  155,  156,   26,  137,   19,   48,   35,   81,  135,  172,
 
239
  187,   36,   60,  173,  161,  169,   38,   61,  159,  138,
 
240
   63,   54,   85,   64,
 
241
};
 
242
short cl_scope_sindex[] = {                                      0,
 
243
  -37,    0, -290,    0,    0,    0,    0,    0,    0,    0,
 
244
    0,    0,    0,    0,    0,    0,    0,    0, -223,    0,
 
245
 -242, -231,   25, -105, -210, -201,  -13,    2, -247,    9,
 
246
    0,    0,    0,    0, -227, -178,  -58,    0,    0,    0,
 
247
    0,    0,    0, -188,    3,    0,    0, -171,    0,    0,
 
248
    0,    0,    0, -164,    0, -247,    0,  -20,  108,    0,
 
249
 -187,   81,  -12,    0,    0,    0, -156,    0,    0,    0,
 
250
    0,    0,    0,    0,    0,    0,  -33,  -57, -248,    0,
 
251
  110, -191,    0, -180,    0, -164,    0,    0,    0,    0,
 
252
   -4,    0, -157,    0,    0,    0,    0,    0,    0,    0,
 
253
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
254
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
255
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
256
    0,    0,  112,   58,    0, -178,    0,   67,    0,  114,
 
257
    0,    0,  -54,  117,    0,    0,    0,    0, -156,    0,
 
258
   96,    0,    0,    4,    0,    0,    0,    0,    0,    0,
 
259
  -16,    0,    0, -178,    0, -178,    0, -207, -178,    0,
 
260
    0,    0, -178,   38,    0,    0,  -52,    0,   41, -135,
 
261
    0, -178,    0,    0,    0,  129,   47,   40, -178,    0,
 
262
    0,   71,    0,    0,
 
263
};
 
264
short cl_scope_rindex[] = {                                      0,
 
265
 -114,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
266
    0,    0,    0,    0,    0,    0,    0,    0,   76,    0,
 
267
    0,    0,    0,    0,  -47,    0,    0,    0,   46,    0,
 
268
    0,    0,    0,    0, -134,  116,    0,    0,    0,    0,
 
269
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
270
    0,    0,    0,   -7,    0,   46,    0,    0,    0,    0,
 
271
    0,   -5,    0,    0,    0,    0,  -24,    0,    0,    0,
 
272
    0,    0,    0,    0,    0,    0,    0,  -23,    0,    0,
 
273
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
274
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
275
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
276
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
277
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
278
    0,    0,    0,    0,    0,   -9,    0,   -8,    0,    0,
 
279
    0,    0,  132,    0,    0,    0,    0,    0, -132,    0,
 
280
    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
281
    0,    0,    0,  -28,    0, -199,    0,    0,   51,    0,
 
282
    0,    0, -100,    0,    0,    0,   85,    0,    0,   52,
 
283
    0,   -9,    0,    0,    0,    0,    0,    0,   53,    0,
 
284
    0,    0,    0,    0,
 
285
};
 
286
short cl_scope_gindex[] = {                                      0,
 
287
    8,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
288
    0,  121,    0,    0,    0,    0,   31,    0,    0,  -93,
 
289
   15,   -6,  -19,  -56,    0,    0,    0,   54,    0,    0,
 
290
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
291
    0,    0,    0,   98,
 
292
};
 
293
#define YYTABLESIZE 421
 
294
short cl_scope_table[] = {                                     131,
 
295
   53,   52,  136,  126,  128,   52,  133,  182,  124,  122,
 
296
  119,  125,  132,  125,  122,   40,   58,   31,  122,   30,
 
297
    6,    4,  118,  141,   20,    8,  120,  123,  121,   50,
 
298
   59,   86,  120,   40,   40,  120,  138,   67,  133,  149,
 
299
   82,  171,   21,   77,   34,   41,   56,  166,   22,   32,
 
300
   68,   69,   40,  120,   42,   70,  139,  134,  118,  118,
 
301
  127,   71,   27,  118,   57,  167,   72,   73,   74,  118,
 
302
  174,   75,   76,   28,  118,  118,  118,   23,  116,  118,
 
303
  118,  166,   33,  166,   29,    5,   34,    7,  188,   22,
 
304
  129,   24,  130,   40,   49,  192,   40,  177,   30,  181,
 
305
   77,  191,   66,   37,  158,  118,  170,   22,  157,   39,
 
306
  176,  194,   87,  143,  166,   47,   55,  138,  150,  133,
 
307
  183,  184,  122,   34,   40,  122,  122,  145,  122,  146,
 
308
  147,   46,  140,   58,  193,  144,  168,   88,   89,   90,
 
309
   62,   84,   83,  125,  125,  125,  122,  151,  125,  142,
 
310
  153,  125,  152,  160,  125,  164,  162,  125,  125,  125,
 
311
  125,  125,  179,  185,  125,  125,  180,  186,  189,  190,
 
312
   49,   58,   36,  118,  103,  178,   65,  125,  125,  163,
 
313
  175,    0,  125,  148,    0,    0,  125,    0,    0,    0,
 
314
  125,    0,    0,    0,    0,    0,    0,    0,    0,   30,
 
315
  125,   28,  118,    0,    0,    0,    0,    0,    0,    0,
 
316
  116,  116,    0,    0,    0,  116,    0,    0,    2,    0,
 
317
    0,  116,    0,    0,    0,  116,  116,  116,  116,  118,
 
318
  118,  116,  116,   79,  118,    0,    0,    0,    0,    0,
 
319
  118,  118,    0,    0,  116,  118,  118,  118,  118,  118,
 
320
  118,  118,    0,  118,    0,   94,   95,  116,    0,  118,
 
321
    0,    0,    0,    0,  118,  118,  118,    0,  122,  118,
 
322
  118,   51,   51,    0,    0,   51,  118,   51,    3,    0,
 
323
   36,  122,    0,  120,   96,   97,   98,   99,  100,  101,
 
324
  102,  103,  104,  105,  106,  118,  120,  107,  108,  109,
 
325
  110,  111,  112,  113,  114,  115,  116,  117,  118,    0,
 
326
  118,  118,    0,    0,    0,  118,    0,    0,    0,    0,
 
327
  114,  118,    0,    0,    0,    0,  118,  118,  118,    0,
 
328
    0,  118,  118,   28,   28,   28,    0,    0,   28,    0,
 
329
    0,    0,    0,    0,   28,    0,    0,    0,   28,   28,
 
330
   28,   28,    0,    0,   28,   28,    0,  118,    0,    0,
 
331
    0,    0,    0,    0,    0,   68,   69,   28,   28,    0,
 
332
   70,    0,   28,  118,  118,    0,   71,    0,  118,    0,
 
333
   28,   72,   73,   74,  118,    0,   75,   76,    0,  118,
 
334
  118,  118,    0,    0,  118,  118,    0,    0,    0,   77,
 
335
    0,    0,    0,    0,    0,    0,    0,  118,    0,    0,
 
336
    0,    0,   78,    0,    0,    0,    0,    0,    0,    0,
 
337
  118,
 
338
};
 
339
short cl_scope_check[] = {                                      33,
 
340
   59,   60,   60,   37,   38,   60,   40,   60,   42,   43,
 
341
   44,  126,   46,   47,   38,   44,   40,  123,   42,   44,
 
342
   58,   59,  123,   80,  315,   63,   60,   61,   62,   36,
 
343
   50,   44,   41,   62,   44,   44,   44,   58,   44,   44,
 
344
   60,   58,  266,  292,   44,  293,   44,   44,  272,  260,
 
345
  258,  259,   62,   62,  302,  263,  305,   91,  258,  259,
 
346
   94,  269,  305,  263,   62,   62,  274,  275,  276,  269,
 
347
  164,  279,  280,  305,  274,  275,  276,  301,  126,  279,
 
348
  280,   44,  293,   44,   60,  123,  297,  125,  182,   44,
 
349
  124,  315,  126,   41,  273,  189,   44,  305,  123,   62,
 
350
  292,   62,  123,  305,   38,  305,  123,   62,   42,  123,
 
351
  167,   41,  125,  305,   44,  343,  305,  125,  123,  125,
 
352
  177,  178,   38,  123,  123,   41,   42,  308,   44,  310,
 
353
  311,  123,   79,  305,  191,   82,  156,  294,  295,  296,
 
354
  305,   61,  330,  258,  259,  260,   62,  305,  263,   40,
 
355
   93,  266,   41,   40,  269,   60,   40,  272,  273,  274,
 
356
  275,  276,  169,  123,  279,  280,  173,  303,   40,  123,
 
357
  305,   40,  305,  123,  123,  168,   56,  292,  293,  149,
 
358
  166,   -1,  297,   86,   -1,   -1,  301,   -1,   -1,   -1,
 
359
  305,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  305,
 
360
  315,  126,  303,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
 
361
  258,  259,   -1,   -1,   -1,  263,   -1,   -1,  256,   -1,
 
362
   -1,  269,   -1,   -1,   -1,  273,  274,  275,  276,  258,
 
363
  259,  279,  280,  126,  263,   -1,   -1,   -1,   -1,   -1,
 
364
  269,  126,   -1,   -1,  292,  274,  275,  276,  258,  259,
 
365
  279,  280,   -1,  263,   -1,  289,  290,  305,   -1,  269,
 
366
   -1,   -1,   -1,   -1,  274,  275,  276,   -1,  292,  279,
 
367
  280,  330,  330,   -1,   -1,  330,  305,  330,  316,   -1,
 
368
  305,  305,   -1,  292,  318,  319,  320,  321,  322,  323,
 
369
  324,  325,  326,  327,  328,  305,  305,  331,  332,  333,
 
370
  334,  335,  336,  337,  338,  339,  340,  341,  342,   -1,
 
371
  258,  259,   -1,   -1,   -1,  263,   -1,   -1,   -1,   -1,
 
372
  330,  269,   -1,   -1,   -1,   -1,  274,  275,  276,   -1,
 
373
   -1,  279,  280,  258,  259,  260,   -1,   -1,  263,   -1,
 
374
   -1,   -1,   -1,   -1,  269,   -1,   -1,   -1,  273,  274,
 
375
  275,  276,   -1,   -1,  279,  280,   -1,  305,   -1,   -1,
 
376
   -1,   -1,   -1,   -1,   -1,  258,  259,  292,  293,   -1,
 
377
  263,   -1,  297,  258,  259,   -1,  269,   -1,  263,   -1,
 
378
  305,  274,  275,  276,  269,   -1,  279,  280,   -1,  274,
 
379
  275,  276,   -1,   -1,  279,  280,   -1,   -1,   -1,  292,
 
380
   -1,   -1,   -1,   -1,   -1,   -1,   -1,  292,   -1,   -1,
 
381
   -1,   -1,  305,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
 
382
  305,
 
383
};
 
384
#define YYFINAL 1
 
385
#ifndef YYDEBUG
 
386
#define YYDEBUG 1
 
387
#endif
 
388
#define YYMAXTOKEN 347
 
389
#if YYDEBUG
 
390
char *cl_scope_name[] = {
 
391
"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,
 
392
"'!'",0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'","','",0,"'.'","'/'",0,0,0,0,0,
 
393
0,0,0,0,0,"':'","';'","'<'","'='","'>'","'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
394
0,0,0,0,0,0,0,0,0,0,"'['",0,"']'","'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
395
0,0,0,0,0,0,0,0,"'{'","'|'","'}'","'~'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
396
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
397
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
398
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"LE_AUTO",
 
399
"LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG","LE_SWITCH",
 
400
"LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR","LE_EXTERN",
 
401
"LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT","LE_UNSIGNED",
 
402
"LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID","LE_DEFAULT","LE_GOTO","LE_SIZEOF",
 
403
"LE_VOLATILE","LE_DO","LE_IF","LE_STATIC","LE_WHILE","LE_NEW","LE_DELETE",
 
404
"LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC","LE_PROTECTED","LE_PRIVATE",
 
405
"LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD","LE_TEMPLATE","LE_TYPENAME",
 
406
"LE_THROW","LE_CATCH","LE_IDENTIFIER","LE_STRINGliteral","LE_FLOATINGconstant",
 
407
"LE_INTEGERconstant","LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant",
 
408
"LE_POUNDPOUND","LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING",
 
409
"LE_TYPEDEFname","LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE",
 
410
"LE_EQ","LE_NE","LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar",
 
411
"LE_ARROWstar","LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign",
 
412
"LE_MINUSassign","LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign",
 
413
"LE_ORassign","LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST",
 
414
"LE_REINTERPRET_CAST",
 
415
};
 
416
char *cl_scope_rule[] = {
 
417
"$accept : translation_unit",
 
418
"basic_type_name : LE_INT",
 
419
"basic_type_name : LE_CHAR",
 
420
"basic_type_name : LE_SHORT",
 
421
"basic_type_name : LE_LONG",
 
422
"basic_type_name : LE_FLOAT",
 
423
"basic_type_name : LE_DOUBLE",
 
424
"basic_type_name : LE_SIGNED",
 
425
"basic_type_name : LE_UNSIGNED",
 
426
"basic_type_name : LE_VOID",
 
427
"translation_unit :",
 
428
"translation_unit : translation_unit external_decl",
 
429
"external_decl : class_decl",
 
430
"external_decl : enum_decl",
 
431
"external_decl : union_decl",
 
432
"external_decl : function_decl",
 
433
"external_decl : namespace_decl",
 
434
"external_decl : using_namespace",
 
435
"external_decl : scope_reducer",
 
436
"external_decl : scope_increaer",
 
437
"external_decl : question_expression",
 
438
"external_decl : error",
 
439
"template_arg :",
 
440
"template_arg : template_specifiter LE_IDENTIFIER",
 
441
"template_arg_list : template_arg",
 
442
"template_arg_list : template_arg_list ',' template_arg",
 
443
"template_specifiter : LE_CLASS",
 
444
"template_specifiter : LE_TYPENAME",
 
445
"opt_template_qualifier :",
 
446
"opt_template_qualifier : LE_TEMPLATE '<' template_arg_list '>'",
 
447
"derivation_list :",
 
448
"derivation_list : parent_class",
 
449
"derivation_list : derivation_list ',' parent_class",
 
450
"parent_class : access_specifier LE_IDENTIFIER opt_template_specifier",
 
451
"opt_template_specifier :",
 
452
"opt_template_specifier : '<' template_parameter_list '>'",
 
453
"access_specifier :",
 
454
"access_specifier : LE_PUBLIC",
 
455
"access_specifier : LE_PRIVATE",
 
456
"access_specifier : LE_PROTECTED",
 
457
"template_parameter_list :",
 
458
"template_parameter_list : template_parameter",
 
459
"template_parameter_list : template_parameter_list ',' template_parameter",
 
460
"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp",
 
461
"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp",
 
462
"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp",
 
463
"using_namespace : LE_USING LE_NAMESPACE nested_scope_specifier LE_IDENTIFIER ';'",
 
464
"namespace_decl : stmnt_starter LE_NAMESPACE LE_IDENTIFIER '{'",
 
465
"namespace_decl : stmnt_starter LE_NAMESPACE '{'",
 
466
"opt_class_qualifier :",
 
467
"opt_class_qualifier : LE_MACRO",
 
468
"class_decl : stmnt_starter opt_template_qualifier class_keyword opt_class_qualifier LE_IDENTIFIER '{'",
 
469
"class_decl : stmnt_starter opt_template_qualifier class_keyword opt_class_qualifier LE_IDENTIFIER ':' derivation_list '{'",
 
470
"scope_reducer : '}'",
 
471
"scope_increaer : '{'",
 
472
"question_expression : '?'",
 
473
"class_keyword : LE_CLASS",
 
474
"class_keyword : LE_STRUCT",
 
475
"func_name : LE_IDENTIFIER",
 
476
"func_name : LE_OPERATOR any_operator",
 
477
"any_operator : '+'",
 
478
"any_operator : '='",
 
479
"any_operator : '*'",
 
480
"any_operator : '/'",
 
481
"any_operator : '%'",
 
482
"any_operator : '^'",
 
483
"any_operator : '&'",
 
484
"any_operator : '|'",
 
485
"any_operator : '~'",
 
486
"any_operator : '!'",
 
487
"any_operator : '<'",
 
488
"any_operator : '>'",
 
489
"any_operator : LE_LS",
 
490
"any_operator : LE_RS",
 
491
"any_operator : LE_ANDAND",
 
492
"any_operator : LE_OROR",
 
493
"any_operator : LE_ARROW",
 
494
"any_operator : LE_ARROWstar",
 
495
"any_operator : '.'",
 
496
"any_operator : LE_DOTstar",
 
497
"any_operator : LE_ICR",
 
498
"any_operator : LE_DECR",
 
499
"any_operator : LE_LE",
 
500
"any_operator : LE_GE",
 
501
"any_operator : LE_EQ",
 
502
"any_operator : LE_NE",
 
503
"any_operator : '(' ')'",
 
504
"any_operator : '[' ']'",
 
505
"any_operator : LE_NEW",
 
506
"any_operator : LE_DELETE",
 
507
"any_operator : ','",
 
508
"any_operator : LE_MULTassign",
 
509
"any_operator : LE_DIVassign",
 
510
"any_operator : LE_MODassign",
 
511
"any_operator : LE_PLUSassign",
 
512
"any_operator : LE_MINUSassign",
 
513
"any_operator : LE_LSassign",
 
514
"any_operator : LE_RSassign",
 
515
"any_operator : LE_ANDassign",
 
516
"any_operator : LE_ERassign",
 
517
"any_operator : LE_ORassign",
 
518
"optional_initialization_list : '{'",
 
519
"optional_initialization_list : ':'",
 
520
"declare_throw :",
 
521
"declare_throw : LE_THROW '(' template_parameter_list ')'",
 
522
"$$1 :",
 
523
"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec variable_decl nested_scope_specifier func_name '(' $$1 const_spec declare_throw '{'",
 
524
"$$2 :",
 
525
"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec nested_scope_specifier func_name '(' $$2 optional_initialization_list",
 
526
"$$3 :",
 
527
"function_decl : stmnt_starter opt_template_qualifier virtual_spec const_spec nested_scope_specifier '~' func_name '(' $$3 const_spec '{'",
 
528
"nested_scope_specifier :",
 
529
"nested_scope_specifier : nested_scope_specifier scope_specifier",
 
530
"scope_specifier : LE_IDENTIFIER LE_CLCL",
 
531
"$$4 :",
 
532
"scope_specifier : LE_IDENTIFIER '<' $$4 LE_CLCL",
 
533
"virtual_spec :",
 
534
"virtual_spec : LE_VIRTUAL",
 
535
"const_spec :",
 
536
"const_spec : LE_CONST",
 
537
"amp_item :",
 
538
"amp_item : '&'",
 
539
"star_list :",
 
540
"star_list : star_list '*'",
 
541
"special_star_amp : star_list amp_item",
 
542
"stmnt_starter :",
 
543
"stmnt_starter : ';'",
 
544
"stmnt_starter : ':'",
 
545
"variable_decl : nested_scope_specifier basic_type_name special_star_amp",
 
546
"variable_decl : nested_scope_specifier LE_IDENTIFIER special_star_amp",
 
547
"variable_decl : nested_scope_specifier LE_IDENTIFIER '<' template_parameter_list '>' special_star_amp",
 
548
"$$5 :",
 
549
"enum_decl : stmnt_starter LE_ENUM LE_IDENTIFIER '{' $$5 enum_arg_list '}'",
 
550
"enum_optional_assign :",
 
551
"enum_optional_assign : '=' LE_HEXconstant",
 
552
"enum_optional_assign : '=' LE_OCTALconstant",
 
553
"enum_optional_assign : '=' LE_INTEGERconstant",
 
554
"enum_argument : LE_IDENTIFIER enum_optional_assign",
 
555
"enum_arg_list :",
 
556
"enum_arg_list : enum_argument",
 
557
"enum_arg_list : enum_arg_list ',' enum_argument",
 
558
"union_decl : stmnt_starter LE_UNION LE_IDENTIFIER '{'",
 
559
};
 
560
#endif
 
561
#ifndef YYSTYPE
 
562
typedef int YYSTYPE;
 
563
#endif
 
564
#ifdef YYSTACKSIZE
 
565
#undef YYMAXDEPTH
 
566
#define YYMAXDEPTH YYSTACKSIZE
 
567
#else
 
568
#ifdef YYMAXDEPTH
 
569
#define YYSTACKSIZE YYMAXDEPTH
 
570
#else
 
571
#define YYSTACKSIZE 500
 
572
#define YYMAXDEPTH 500
 
573
#endif
 
574
#endif
 
575
int yydebug;
 
576
int yynerrs;
 
577
int yyerrflag;
 
578
int yychar;
 
579
short *yyssp;
 
580
YYSTYPE *yyvsp;
 
581
YYSTYPE yyval;
 
582
YYSTYPE yylval;
 
583
short yyss[YYSTACKSIZE];
 
584
YYSTYPE yyvs[YYSTACKSIZE];
 
585
#define yystacksize YYSTACKSIZE
 
586
void yyerror(char *s) {}
 
587
 
 
588
void syncParser(){
 
589
        //move lexer to the next ';' line or scope opening '{'
 
590
        //int ch = cl_scope_lex();
 
591
}
 
592
 
 
593
//swallow all tokens up to the first '{'
 
594
void consumeInitializationList(){
 
595
        while( true ){
 
596
                int ch = cl_scope_lex();
 
597
                if(ch == 0){
 
598
                        break;
 
599
                }
 
600
 
 
601
                if(ch == '{'){
 
602
                        break;
 
603
                }
 
604
        }
 
605
}
 
606
 
 
607
//swallow all tokens up to the first '{'
 
608
void consumeBody (){
 
609
        std::string cs = "{";
 
610
        int depth = 1;
 
611
        while( true ) {
 
612
                int ch = cl_scope_lex();
 
613
                if(ch == 0){
 
614
                        break;
 
615
                }
 
616
 
 
617
                cs += cl_scope_text;
 
618
                cs += " ";
 
619
 
 
620
                if(ch == '{'){
 
621
                        depth++;
 
622
                }else if(ch == '}'){
 
623
                        depth--;
 
624
                        if(depth == 0){
 
625
                                cl_scope_less(0);
 
626
                                break;
 
627
                        }
 
628
                }
 
629
        }
 
630
        printf("Consumed body: [%s]\n", cs.c_str());
 
631
}
 
632
 
 
633
void consumeFuncArgList(){
 
634
        int depth = 1;
 
635
        while(depth > 0){
 
636
                int ch = cl_scope_lex();
 
637
                if(ch == 0){
 
638
                        break;
 
639
                }
 
640
 
 
641
                if(ch == ')'){
 
642
                        depth--;
 
643
                        continue;
 
644
                }
 
645
                else if(ch == '('){
 
646
                        depth ++ ;
 
647
                        continue;
 
648
                }
 
649
        }
 
650
}
 
651
 
 
652
/**
 
653
 * consume all token until matching closing brace is found
 
654
 */
 
655
void consumeDecl()
 
656
{
 
657
        int depth = 1;
 
658
        while(depth > 0)
 
659
        {
 
660
                int ch = cl_scope_lex();
 
661
                if(ch ==0)
 
662
                {
 
663
                        break;
 
664
                }
 
665
                if(ch == '}')
 
666
                {
 
667
                        depth--;
 
668
                        if(depth == 0) currentScope.pop_back();//reduce the scope
 
669
                        continue;
 
670
                }
 
671
                else if(ch == '{')
 
672
                {
 
673
                        depth ++ ;
 
674
                        continue;
 
675
                }
 
676
        }
 
677
 
 
678
}
 
679
 
 
680
void consumeTemplateDecl()
 
681
{
 
682
        int depth = 1;
 
683
        while(depth > 0)
 
684
        {
 
685
                int ch = cl_scope_lex();
 
686
                //printf("ch=%d\n", ch);
 
687
                fflush(stdout);
 
688
                if(ch ==0){
 
689
                        break;
 
690
                }
 
691
 
 
692
                if(ch == '>')
 
693
                {
 
694
                        depth--;
 
695
                        continue;
 
696
                }
 
697
                else if(ch == '<')
 
698
                {
 
699
                        depth ++ ;
 
700
                        continue;
 
701
                }
 
702
        }
 
703
}
 
704
 
 
705
//swallow all tokens up to the first '{'
 
706
void consumeNotIncluding(int ch){
 
707
        while( true ){
 
708
                int c = cl_scope_lex();
 
709
                if(c == 0){ // EOF?
 
710
                        break;
 
711
                }
 
712
 
 
713
                //keep the function signature
 
714
                if(c == ch){
 
715
                        cl_scope_less(0);
 
716
                        break;
 
717
                }
 
718
        }
 
719
}
 
720
 
 
721
// return the scope name at the end of the input string
 
722
std::string get_scope_name(     const std::string &in,
 
723
                                                        std::vector<std::string> &additionalNS,
 
724
                                                        const std::map<std::string, std::string> &ignoreTokens)
 
725
{
 
726
        if( !setLexerInput(in, ignoreTokens) ){
 
727
                return "";
 
728
        }
 
729
 
 
730
        //call tghe main parsing routine
 
731
        cl_scope_parse();
 
732
        std::string scope = getCurrentScope();
 
733
        //do the lexer cleanup
 
734
        cl_scope_lex_clean();
 
735
 
 
736
        for(size_t i=0; i<gs_additionlNS.size(); i++){
 
737
                additionalNS.push_back(gs_additionlNS.at(i));
 
738
        }
 
739
        gs_additionlNS.clear();
 
740
        return scope;
 
741
}
 
742
#define YYABORT goto yyabort
 
743
#define YYREJECT goto yyabort
 
744
#define YYACCEPT goto yyaccept
 
745
#define YYERROR goto yyerrlab
 
746
int
 
747
yyparse()
 
748
{
 
749
    register int yym, yyn, yystate;
 
750
#if YYDEBUG
 
751
    register char *yys;
 
752
    extern char *getenv();
 
753
 
 
754
    if (yys = getenv("YYDEBUG"))
 
755
    {
 
756
        yyn = *yys;
 
757
        if (yyn >= '0' && yyn <= '9')
 
758
            yydebug = yyn - '0';
 
759
    }
 
760
#endif
 
761
 
 
762
    yynerrs = 0;
 
763
    yyerrflag = 0;
 
764
    yychar = (-1);
 
765
 
 
766
    yyssp = yyss;
 
767
    yyvsp = yyvs;
 
768
    *yyssp = yystate = 0;
 
769
 
 
770
yyloop:
 
771
    if (yyn = yydefred[yystate]) goto yyreduce;
 
772
    if (yychar < 0)
 
773
    {
 
774
        if ((yychar = yylex()) < 0) yychar = 0;
 
775
#if YYDEBUG
 
776
        if (yydebug)
 
777
        {
 
778
            yys = 0;
 
779
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
 
780
            if (!yys) yys = "illegal-symbol";
 
781
            printf("%sdebug: state %d, reading %d (%s)\n",
 
782
                    YYPREFIX, yystate, yychar, yys);
 
783
        }
 
784
#endif
 
785
    }
 
786
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
 
787
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
 
788
    {
 
789
#if YYDEBUG
 
790
        if (yydebug)
 
791
            printf("%sdebug: state %d, shifting to state %d\n",
 
792
                    YYPREFIX, yystate, yytable[yyn]);
 
793
#endif
 
794
        if (yyssp >= yyss + yystacksize - 1)
 
795
        {
 
796
            goto yyoverflow;
 
797
        }
 
798
        *++yyssp = yystate = yytable[yyn];
 
799
        *++yyvsp = yylval;
 
800
        yychar = (-1);
 
801
        if (yyerrflag > 0)  --yyerrflag;
 
802
        goto yyloop;
 
803
    }
 
804
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
 
805
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
 
806
    {
 
807
        yyn = yytable[yyn];
 
808
        goto yyreduce;
 
809
    }
 
810
    if (yyerrflag) goto yyinrecovery;
 
811
#ifdef lint
 
812
    goto yynewerror;
 
813
#endif
 
814
yynewerror:
 
815
    yyerror("syntax error");
 
816
#ifdef lint
 
817
    goto yyerrlab;
 
818
#endif
 
819
yyerrlab:
 
820
    ++yynerrs;
 
821
yyinrecovery:
 
822
    if (yyerrflag < 3)
 
823
    {
 
824
        yyerrflag = 3;
 
825
        for (;;)
 
826
        {
 
827
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
 
828
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
 
829
            {
 
830
#if YYDEBUG
 
831
                if (yydebug)
 
832
                    printf("%sdebug: state %d, error recovery shifting\
 
833
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
 
834
#endif
 
835
                if (yyssp >= yyss + yystacksize - 1)
 
836
                {
 
837
                    goto yyoverflow;
 
838
                }
 
839
                *++yyssp = yystate = yytable[yyn];
 
840
                *++yyvsp = yylval;
 
841
                goto yyloop;
 
842
            }
 
843
            else
 
844
            {
 
845
#if YYDEBUG
 
846
                if (yydebug)
 
847
                    printf("%sdebug: error recovery discarding state %d\n",
 
848
                            YYPREFIX, *yyssp);
 
849
#endif
 
850
                if (yyssp <= yyss) goto yyabort;
 
851
                --yyssp;
 
852
                --yyvsp;
 
853
            }
 
854
        }
 
855
    }
 
856
    else
 
857
    {
 
858
        if (yychar == 0) goto yyabort;
 
859
#if YYDEBUG
 
860
        if (yydebug)
 
861
        {
 
862
            yys = 0;
 
863
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
 
864
            if (!yys) yys = "illegal-symbol";
 
865
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
 
866
                    YYPREFIX, yystate, yychar, yys);
 
867
        }
 
868
#endif
 
869
        yychar = (-1);
 
870
        goto yyloop;
 
871
    }
 
872
yyreduce:
 
873
#if YYDEBUG
 
874
    if (yydebug)
 
875
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
 
876
                YYPREFIX, yystate, yyn, yyrule[yyn]);
 
877
#endif
 
878
    yym = yylen[yyn];
 
879
    yyval = yyvsp[1-yym];
 
880
    switch (yyn)
 
881
    {
 
882
case 1:
 
883
{ yyval = yyvsp[0]; }
 
884
break;
 
885
case 2:
 
886
{ yyval = yyvsp[0]; }
 
887
break;
 
888
case 3:
 
889
{ yyval = yyvsp[0]; }
 
890
break;
 
891
case 4:
 
892
{ yyval = yyvsp[0]; }
 
893
break;
 
894
case 5:
 
895
{ yyval = yyvsp[0]; }
 
896
break;
 
897
case 6:
 
898
{ yyval = yyvsp[0]; }
 
899
break;
 
900
case 7:
 
901
{ yyval = yyvsp[0]; }
 
902
break;
 
903
case 8:
 
904
{ yyval = yyvsp[0]; }
 
905
break;
 
906
case 9:
 
907
{ yyval = yyvsp[0]; }
 
908
break;
 
909
case 21:
 
910
{
 
911
/*                                                              printf("CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_scope_text, cl_scope_lineno);*/
 
912
/*                                                              syncParser();*/
 
913
                                                        }
 
914
break;
 
915
case 22:
 
916
{ yyval = "";}
 
917
break;
 
918
case 23:
 
919
{yyval = yyvsp[-1] + " " + yyvsp[0];}
 
920
break;
 
921
case 24:
 
922
{ yyval = yyvsp[0]; }
 
923
break;
 
924
case 25:
 
925
{ yyval = yyvsp[-2] + " " + yyvsp[-1] + " " + yyvsp[0]; }
 
926
break;
 
927
case 26:
 
928
{ yyval = yyvsp[0]; }
 
929
break;
 
930
case 27:
 
931
{ yyval = yyvsp[0]; }
 
932
break;
 
933
case 29:
 
934
{ yyval = yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
 
935
break;
 
936
case 30:
 
937
{yyval = "";}
 
938
break;
 
939
case 31:
 
940
{yyval = yyvsp[0];}
 
941
break;
 
942
case 32:
 
943
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
 
944
break;
 
945
case 33:
 
946
{yyval = yyvsp[-2] + " " + yyvsp[-1] + yyvsp[0];}
 
947
break;
 
948
case 34:
 
949
{yyval = "";}
 
950
break;
 
951
case 35:
 
952
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
 
953
break;
 
954
case 36:
 
955
{yyval = "";}
 
956
break;
 
957
case 37:
 
958
{yyval = yyvsp[0];}
 
959
break;
 
960
case 38:
 
961
{yyval = yyvsp[0];}
 
962
break;
 
963
case 39:
 
964
{yyval = yyvsp[0];}
 
965
break;
 
966
case 40:
 
967
{yyval = "";}
 
968
break;
 
969
case 41:
 
970
{yyval = yyvsp[0];}
 
971
break;
 
972
case 42:
 
973
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
 
974
break;
 
975
case 43:
 
976
{
 
977
                                                        yyval = yyvsp[-3] +  yyvsp[-2] + yyvsp[-1] +yyvsp[0];
 
978
                                                }
 
979
break;
 
980
case 44:
 
981
{
 
982
                                                        yyval = yyvsp[-3] +  yyvsp[-2] + yyvsp[-1] +yyvsp[0];
 
983
                                                }
 
984
break;
 
985
case 45:
 
986
{
 
987
                                                        yyval = yyvsp[-6] + yyvsp[-5] + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1] + yyvsp[0] + " " ;
 
988
                                                }
 
989
break;
 
990
case 46:
 
991
{
 
992
                                                /*printf("Found using namespace %s\n", $3.c_str());*/
 
993
                                                gs_additionlNS.push_back(yyvsp[-2]+yyvsp[-1]);
 
994
                                        }
 
995
break;
 
996
case 47:
 
997
{
 
998
                                                        currentScope.push_back(yyvsp[-1]);
 
999
                                                        printScopeName();
 
1000
                                                }
 
1001
break;
 
1002
case 48:
 
1003
{
 
1004
                                                        /*anonymouse namespace*/
 
1005
                                                        increaseScope();
 
1006
                                                        printScopeName();
 
1007
                                                }
 
1008
break;
 
1009
case 49:
 
1010
{yyval = "";}
 
1011
break;
 
1012
case 50:
 
1013
{yyval = yyvsp[0];}
 
1014
break;
 
1015
case 51:
 
1016
{
 
1017
                                        /*increase the scope level*/
 
1018
                                        currentScope.push_back(yyvsp[-1]);
 
1019
                                        printScopeName();
 
1020
                                }
 
1021
break;
 
1022
case 52:
 
1023
{
 
1024
                                        /*increase the scope level*/
 
1025
                                        currentScope.push_back(yyvsp[-3]);
 
1026
                                        printScopeName();
 
1027
                                }
 
1028
break;
 
1029
case 53:
 
1030
{
 
1031
                                                                if(currentScope.empty())
 
1032
                                                                {
 
1033
                                                                        /*fatal error!*/
 
1034
                                                                        /*printf("CodeLite: fatal error - cant go beyond global scope!\n");*/
 
1035
                                                                }
 
1036
                                                                else
 
1037
                                                                {
 
1038
                                                                        currentScope.pop_back();
 
1039
                                                                        printScopeName();
 
1040
                                                                }
 
1041
                                                        }
 
1042
break;
 
1043
case 54:
 
1044
{
 
1045
                                                                /*increase random scope*/
 
1046
                                                                increaseScope();
 
1047
                                                                printScopeName();
 
1048
                                                         }
 
1049
break;
 
1050
case 55:
 
1051
{
 
1052
                                                        consumeNotIncluding(';');
 
1053
                                                }
 
1054
break;
 
1055
case 56:
 
1056
{yyval = yyvsp[0];}
 
1057
break;
 
1058
case 57:
 
1059
{yyval = yyvsp[0];}
 
1060
break;
 
1061
case 58:
 
1062
{yyval = yyvsp[0];}
 
1063
break;
 
1064
case 59:
 
1065
{yyval = yyvsp[-1];}
 
1066
break;
 
1067
case 101:
 
1068
{yyval = '{';}
 
1069
break;
 
1070
case 102:
 
1071
{consumeInitializationList() /*eat everything including the open brace*/;}
 
1072
break;
 
1073
case 103:
 
1074
{yyval = "";}
 
1075
break;
 
1076
case 104:
 
1077
{yyval = yyvsp[-1];}
 
1078
break;
 
1079
case 105:
 
1080
{consumeFuncArgList();}
 
1081
break;
 
1082
case 106:
 
1083
{
 
1084
                                                /*trim down trailing '::' from scope name*/
 
1085
                                                if(yyvsp[-6].find_last_not_of(":") != std::string::npos){
 
1086
                                                        yyvsp[-6].erase(yyvsp[-6].find_last_not_of(":")+1);
 
1087
                                                }
 
1088
                                                currentScope.push_back(yyvsp[-6]);
 
1089
                                                printScopeName();
 
1090
                                        }
 
1091
break;
 
1092
case 107:
 
1093
{consumeFuncArgList();}
 
1094
break;
 
1095
case 108:
 
1096
{
 
1097
 
 
1098
                                                /*trim down trailing '::' from scope name*/
 
1099
                                                if(yyvsp[-4].find_last_not_of(":") != std::string::npos){
 
1100
                                                        yyvsp[-4].erase(yyvsp[-4].find_last_not_of(":")+1);
 
1101
                                                }
 
1102
                                                currentScope.push_back(yyvsp[-4]);
 
1103
                                                printScopeName();
 
1104
                                        }
 
1105
break;
 
1106
case 109:
 
1107
{consumeFuncArgList();}
 
1108
break;
 
1109
case 110:
 
1110
{
 
1111
 
 
1112
                                                /*trim down trailing '::' from scope name*/
 
1113
                                                if(yyvsp[-6].find_last_not_of(":") != std::string::npos){
 
1114
                                                        yyvsp[-6].erase(yyvsp[-6].find_last_not_of(":")+1);
 
1115
                                                }
 
1116
                                                currentScope.push_back(yyvsp[-6]);
 
1117
                                                printScopeName();
 
1118
                                        }
 
1119
break;
 
1120
case 111:
 
1121
{yyval = "";}
 
1122
break;
 
1123
case 112:
 
1124
{       yyval = yyvsp[-1] + yyvsp[0];}
 
1125
break;
 
1126
case 113:
 
1127
{yyval = yyvsp[-1]+ yyvsp[0];}
 
1128
break;
 
1129
case 114:
 
1130
{consumeTemplateDecl();}
 
1131
break;
 
1132
case 115:
 
1133
{yyval = yyvsp[-3] + yyvsp[0];}
 
1134
break;
 
1135
case 116:
 
1136
{yyval = ""; }
 
1137
break;
 
1138
case 117:
 
1139
{ yyval = yyvsp[0]; }
 
1140
break;
 
1141
case 118:
 
1142
{yyval = ""; }
 
1143
break;
 
1144
case 119:
 
1145
{ yyval = yyvsp[0]; }
 
1146
break;
 
1147
case 120:
 
1148
{yyval = ""; }
 
1149
break;
 
1150
case 121:
 
1151
{ yyval = yyvsp[0]; }
 
1152
break;
 
1153
case 122:
 
1154
{yyval = ""; }
 
1155
break;
 
1156
case 123:
 
1157
{yyval = yyvsp[-1] + yyvsp[0];}
 
1158
break;
 
1159
case 124:
 
1160
{ yyval = yyvsp[-1] + yyvsp[0]; }
 
1161
break;
 
1162
case 125:
 
1163
{yyval = "";}
 
1164
break;
 
1165
case 126:
 
1166
{ yyval = ";";}
 
1167
break;
 
1168
case 127:
 
1169
{ yyval = ":";}
 
1170
break;
 
1171
case 128:
 
1172
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]  ;}
 
1173
break;
 
1174
case 129:
 
1175
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0]  ;}
 
1176
break;
 
1177
case 130:
 
1178
{yyval = yyvsp[-5] + yyvsp[-4] + yyvsp[-3]  + yyvsp[-2] + yyvsp[-1] + yyvsp[0] ;}
 
1179
break;
 
1180
case 131:
 
1181
{currentScope.push_back(yyvsp[-1]); printScopeName();}
 
1182
break;
 
1183
case 132:
 
1184
{
 
1185
                                                        currentScope.pop_back();/*reduce the scope*/
 
1186
                                                        printScopeName();
 
1187
                                                        /*printf("found enum: %s, args are: %s\n", $2.c_str(), $5.c_str());*/
 
1188
                                                }
 
1189
break;
 
1190
case 133:
 
1191
{yyval = "";}
 
1192
break;
 
1193
case 134:
 
1194
{yyval = yyvsp[-1] + yyvsp[0];}
 
1195
break;
 
1196
case 135:
 
1197
{yyval = yyvsp[-1] + yyvsp[0];}
 
1198
break;
 
1199
case 136:
 
1200
{yyval = yyvsp[-1] + yyvsp[0];}
 
1201
break;
 
1202
case 137:
 
1203
{yyval = yyvsp[-1] + yyvsp[0];}
 
1204
break;
 
1205
case 138:
 
1206
{yyval = "";}
 
1207
break;
 
1208
case 139:
 
1209
{yyval = yyvsp[0];}
 
1210
break;
 
1211
case 140:
 
1212
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
 
1213
break;
 
1214
case 141:
 
1215
{
 
1216
                                                                currentScope.push_back(yyvsp[-1]);
 
1217
                                                                printScopeName();
 
1218
                                                                consumeDecl();
 
1219
                                                                printScopeName();
 
1220
                                                        }
 
1221
break;
 
1222
    }
 
1223
    yyssp -= yym;
 
1224
    yystate = *yyssp;
 
1225
    yyvsp -= yym;
 
1226
    yym = yylhs[yyn];
 
1227
    if (yystate == 0 && yym == 0)
 
1228
    {
 
1229
#if YYDEBUG
 
1230
        if (yydebug)
 
1231
            printf("%sdebug: after reduction, shifting from state 0 to\
 
1232
 state %d\n", YYPREFIX, YYFINAL);
 
1233
#endif
 
1234
        yystate = YYFINAL;
 
1235
        *++yyssp = YYFINAL;
 
1236
        *++yyvsp = yyval;
 
1237
        if (yychar < 0)
 
1238
        {
 
1239
            if ((yychar = yylex()) < 0) yychar = 0;
 
1240
#if YYDEBUG
 
1241
            if (yydebug)
 
1242
            {
 
1243
                yys = 0;
 
1244
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
 
1245
                if (!yys) yys = "illegal-symbol";
 
1246
                printf("%sdebug: state %d, reading %d (%s)\n",
 
1247
                        YYPREFIX, YYFINAL, yychar, yys);
 
1248
            }
 
1249
#endif
 
1250
        }
 
1251
        if (yychar == 0) goto yyaccept;
 
1252
        goto yyloop;
 
1253
    }
 
1254
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
 
1255
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
 
1256
        yystate = yytable[yyn];
 
1257
    else
 
1258
        yystate = yydgoto[yym];
 
1259
#if YYDEBUG
 
1260
    if (yydebug)
 
1261
        printf("%sdebug: after reduction, shifting from state %d \
 
1262
to state %d\n", YYPREFIX, *yyssp, yystate);
 
1263
#endif
 
1264
    if (yyssp >= yyss + yystacksize - 1)
 
1265
    {
 
1266
        goto yyoverflow;
 
1267
    }
 
1268
    *++yyssp = yystate;
 
1269
    *++yyvsp = yyval;
 
1270
    goto yyloop;
 
1271
yyoverflow:
 
1272
    yyerror("yacc stack overflow");
 
1273
yyabort:
 
1274
    return (1);
 
1275
yyaccept:
 
1276
    return (0);
 
1277
}