1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4
* Copyright (C) Eran Ifrah (Main file for CodeLite www.codelite.org/ )
5
* Copyright (C) Massimo Cora' 2009 <maxcvs@email.it> (Customizations for Anjuta)
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.
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.
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/>.
22
static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
27
#define yyclearin (yychar=(-1))
28
#define yyerrok (yyerrflag=0)
29
#define YYRECOVERING (yyerrflag!=0)
30
#define yyparse cl_expr_parse
31
#define yylex cl_expr_lex
32
#define yyerror cl_expr_error
33
#define yychar cl_expr_char
34
#define yyval cl_expr_val
35
#define yylval cl_expr_lval
36
#define yydebug cl_expr_debug
37
#define yynerrs cl_expr_nerrs
38
#define yyerrflag cl_expr_errflag
39
#define yyss cl_expr_ss
40
#define yyssp cl_expr_ssp
41
#define yyvs cl_expr_vs
42
#define yyvsp cl_expr_vsp
43
#define yylhs cl_expr_lhs
44
#define yylen cl_expr_len
45
#define yydefred cl_expr_defred
46
#define yydgoto cl_expr_dgoto
47
#define yysindex cl_expr_sindex
48
#define yyrindex cl_expr_rindex
49
#define yygindex cl_expr_gindex
50
#define yytable cl_expr_table
51
#define yycheck cl_expr_check
52
#define yyname cl_expr_name
53
#define yyrule cl_expr_rule
54
#define YYPREFIX "cl_expr_"
56
/* Copyright Eran Ifrah(c)*/
57
/*************** Includes and Defines *****************************/
62
#include "expression-result.h"
64
#define YYSTYPE std::string
65
#define YYDEBUG 0 /* get the pretty debugging code to compile*/
67
void cl_expr_error(char *string);
69
static ExpressionResult result;
71
/*---------------------------------------------*/
72
/* externs defined in the lexer*/
73
/*---------------------------------------------*/
74
extern char *cl_expr_text;
75
extern int cl_expr_lex();
76
extern int cl_expr_parse();
77
extern int cl_expr_lineno;
78
extern std::vector<std::string> currentScope;
79
extern bool setExprLexerInput(const std::string &in);
80
extern void cl_expr_lex_clean();
82
/*************** Standard ytab.c continues here *********************/
93
#define LE_REGISTER 267
94
#define LE_TYPEDEF 268
102
#define LE_UNSIGNED 276
103
#define LE_CONTINUE 277
105
#define LE_SIGNED 279
107
#define LE_DEFAULT 281
109
#define LE_SIZEOF 283
110
#define LE_VOLATILE 284
113
#define LE_STATIC 287
116
#define LE_DELETE 290
118
#define LE_OPERATOR 292
120
#define LE_PUBLIC 294
121
#define LE_PROTECTED 295
122
#define LE_PRIVATE 296
123
#define LE_VIRTUAL 297
124
#define LE_FRIEND 298
125
#define LE_INLINE 299
126
#define LE_OVERLOAD 300
127
#define LE_TEMPLATE 301
128
#define LE_TYPENAME 302
131
#define LE_IDENTIFIER 305
132
#define LE_STRINGliteral 306
133
#define LE_FLOATINGconstant 307
134
#define LE_INTEGERconstant 308
135
#define LE_CHARACTERconstant 309
136
#define LE_OCTALconstant 310
137
#define LE_HEXconstant 311
138
#define LE_POUNDPOUND 312
139
#define LE_CComment 313
140
#define LE_CPPComment 314
141
#define LE_NAMESPACE 315
143
#define LE_TYPEDEFname 317
153
#define LE_ANDAND 327
155
#define LE_ELLIPSIS 329
157
#define LE_DOTstar 331
158
#define LE_ARROWstar 332
159
#define LE_MULTassign 333
160
#define LE_DIVassign 334
161
#define LE_MODassign 335
162
#define LE_PLUSassign 336
163
#define LE_MINUSassign 337
164
#define LE_LSassign 338
165
#define LE_RSassign 339
166
#define LE_ANDassign 340
167
#define LE_ERassign 341
168
#define LE_ORassign 342
170
#define LE_DYNAMIC_CAST 344
171
#define LE_STATIC_CAST 345
172
#define LE_CONST_CAST 346
173
#define LE_REINTERPRET_CAST 347
174
#define YYERRCODE 256
175
short cl_expr_lhs[] = { -1,
176
0, 0, 3, 1, 1, 4, 4, 5, 5, 5,
177
5, 5, 5, 5, 5, 5, 6, 6, 6, 7,
178
7, 7, 2, 2, 2, 2, 2, 2, 2, 13,
179
14, 14, 15, 15, 11, 11, 11, 11, 17, 17,
180
18, 18, 9, 10, 10, 10, 12, 12, 8, 8,
183
short cl_expr_len[] = { 2,
184
0, 2, 0, 2, 1, 0, 1, 1, 1, 1,
185
1, 1, 1, 1, 1, 1, 0, 1, 3, 4,
186
4, 7, 6, 2, 3, 3, 6, 5, 8, 2,
187
0, 3, 0, 1, 1, 1, 1, 1, 0, 1,
188
0, 2, 2, 0, 1, 1, 6, 3, 0, 2,
191
short cl_expr_defred[] = { 1,
192
0, 5, 2, 0, 45, 46, 4, 0, 24, 35,
193
36, 37, 38, 0, 0, 0, 0, 49, 0, 0,
194
25, 0, 26, 0, 0, 50, 49, 0, 0, 41,
195
53, 30, 51, 0, 0, 0, 41, 0, 48, 0,
196
0, 7, 49, 0, 18, 34, 28, 0, 0, 0,
197
42, 40, 43, 27, 0, 0, 32, 23, 0, 41,
198
13, 8, 11, 9, 12, 10, 15, 14, 16, 0,
199
41, 19, 29, 47, 0, 20, 21, 0, 41, 22,
201
short cl_expr_dgoto[] = { 1,
202
3, 7, 4, 43, 71, 44, 45, 19, 39, 8,
203
17, 20, 23, 35, 47, 32, 53, 40, 26,
205
short cl_expr_sindex[] = { 0,
206
-240, 0, 0, 15, 0, 0, 0, -17, 0, 0,
207
0, 0, 0, -5, -247, -287, -23, 0, -251, 21,
208
0, -35, 0, -91, 17, 0, 0, 34, -58, 0,
209
0, 0, 0, -195, 42, 22, 0, -195, 0, -11,
210
-226, 0, 0, -24, 0, 0, 0, 43, -226, -22,
211
0, 0, 0, 0, -178, -195, 0, 0, 49, 0,
212
0, 0, 0, 0, 0, 0, 0, 0, 0, -57,
213
0, 0, 0, 0, -195, 0, 0, 8, 0, 0,
215
short cl_expr_rindex[] = { 0,
216
-25, 0, 0, -21, 0, 0, 0, -213, 0, 0,
217
0, 0, 0, -213, 0, 0, 0, 0, 0, 0,
218
0, 1, 0, 5, 9, 0, 0, 0, -12, 0,
219
0, 0, 0, -38, 13, 0, 0, -38, 0, -34,
220
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
221
0, 0, 0, 0, 0, -170, 0, 0, 0, 0,
222
0, 0, 0, 0, 0, 0, 0, 0, 0, -30,
223
0, 0, 0, 0, -38, 0, 0, 0, 0, 0,
225
short cl_expr_gindex[] = { 0,
226
0, 0, 0, 0, 0, -27, 38, -4, 16, 0,
227
0, 39, 20, 0, 0, 0, 0, 0, 0,
229
#define YYTABLESIZE 360
230
short cl_expr_table[] = { 31,
231
52, 38, 75, 16, 52, 17, 39, 41, 31, 39,
232
50, 41, 33, 41, 3, 2, 3, 24, 44, 56,
233
44, 56, 14, 17, 15, 41, 52, 39, 41, 41,
234
51, 41, 3, 3, 18, 25, 27, 57, 55, 60,
235
52, 52, 52, 21, 52, 41, 52, 78, 31, 41,
236
31, 56, 49, 29, 33, 31, 28, 22, 52, 52,
237
54, 30, 52, 52, 52, 36, 31, 31, 59, 79,
238
33, 33, 6, 5, 37, 74, 34, 42, 22, 61,
239
62, 46, 58, 48, 63, 76, 77, 6, 6, 73,
240
64, 49, 6, 72, 80, 65, 66, 67, 6, 0,
241
68, 69, 0, 6, 6, 6, 0, 0, 6, 6,
242
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243
0, 0, 0, 0, 0, 0, 70, 0, 0, 0,
244
0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
245
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
248
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
249
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
250
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
251
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
252
0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
253
6, 0, 0, 0, 6, 0, 0, 0, 0, 0,
254
6, 0, 0, 0, 0, 6, 6, 6, 33, 0,
255
6, 6, 0, 0, 0, 0, 0, 0, 0, 0,
256
0, 0, 0, 0, 0, 0, 52, 0, 0, 0,
257
52, 0, 0, 0, 31, 3, 6, 0, 33, 44,
258
39, 33, 33, 9, 0, 0, 0, 0, 0, 3,
259
0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
260
0, 52, 0, 0, 0, 52, 0, 0, 0, 31,
261
0, 0, 0, 33, 0, 52, 0, 0, 0, 52,
262
0, 0, 0, 31, 0, 0, 0, 33, 3, 3,
263
3, 3, 44, 44, 44, 44, 10, 11, 12, 13,
264
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
265
0, 0, 0, 0, 52, 52, 52, 52, 52, 52,
266
52, 52, 31, 31, 31, 31, 33, 33, 33, 33,
268
short cl_expr_check[] = { 91,
269
0, 60, 60, 8, 0, 44, 41, 38, 0, 44,
270
38, 42, 0, 44, 40, 256, 42, 305, 40, 44,
271
42, 44, 40, 62, 42, 38, 38, 62, 41, 42,
272
42, 62, 58, 59, 40, 16, 60, 62, 43, 62,
273
40, 41, 42, 291, 40, 30, 42, 75, 40, 62,
274
42, 44, 37, 305, 42, 91, 18, 305, 58, 59,
275
41, 41, 58, 59, 60, 27, 58, 59, 49, 62,
276
58, 59, 58, 59, 41, 60, 60, 273, 305, 258,
277
259, 40, 40, 62, 263, 70, 71, 258, 259, 41,
278
269, 305, 263, 56, 79, 274, 275, 276, 269, -1,
279
279, 280, -1, 274, 275, 276, -1, -1, 279, 280,
280
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
281
-1, -1, -1, -1, -1, -1, 305, -1, -1, -1,
282
-1, -1, -1, -1, 305, -1, -1, -1, -1, -1,
283
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
284
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
285
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
286
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
287
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
288
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
289
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
290
-1, -1, -1, -1, -1, -1, -1, -1, -1, 258,
291
259, -1, -1, -1, 263, -1, -1, -1, -1, -1,
292
269, -1, -1, -1, -1, 274, 275, 276, 330, -1,
293
279, 280, -1, -1, -1, -1, -1, -1, -1, -1,
294
-1, -1, -1, -1, -1, -1, 256, -1, -1, -1,
295
256, -1, -1, -1, 256, 291, 305, -1, 256, 291,
296
305, 330, 330, 291, -1, -1, -1, -1, -1, 305,
297
-1, -1, -1, 305, -1, -1, -1, -1, -1, -1,
298
-1, 291, -1, -1, -1, 291, -1, -1, -1, 291,
299
-1, -1, -1, 291, -1, 305, -1, -1, -1, 305,
300
-1, -1, -1, 305, -1, -1, -1, 305, 344, 345,
301
346, 347, 344, 345, 346, 347, 344, 345, 346, 347,
302
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
303
-1, -1, -1, -1, 344, 345, 346, 347, 344, 345,
304
346, 347, 344, 345, 346, 347, 344, 345, 346, 347,
310
#define YYMAXTOKEN 347
312
char *cl_expr_name[] = {
313
"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,
314
0,0,0,0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",
315
"'<'",0,"'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,0,
316
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
317
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
318
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
319
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
320
0,0,0,"LE_AUTO","LE_DOUBLE","LE_INT","LE_STRUCT","LE_BREAK","LE_ELSE","LE_LONG",
321
"LE_SWITCH","LE_CASE","LE_ENUM","LE_REGISTER","LE_TYPEDEF","LE_CHAR",
322
"LE_EXTERN","LE_RETURN","LE_UNION","LE_CONST","LE_FLOAT","LE_SHORT",
323
"LE_UNSIGNED","LE_CONTINUE","LE_FOR","LE_SIGNED","LE_VOID","LE_DEFAULT",
324
"LE_GOTO","LE_SIZEOF","LE_VOLATILE","LE_DO","LE_IF","LE_STATIC","LE_WHILE",
325
"LE_NEW","LE_DELETE","LE_THIS","LE_OPERATOR","LE_CLASS","LE_PUBLIC",
326
"LE_PROTECTED","LE_PRIVATE","LE_VIRTUAL","LE_FRIEND","LE_INLINE","LE_OVERLOAD",
327
"LE_TEMPLATE","LE_TYPENAME","LE_THROW","LE_CATCH","LE_IDENTIFIER",
328
"LE_STRINGliteral","LE_FLOATINGconstant","LE_INTEGERconstant",
329
"LE_CHARACTERconstant","LE_OCTALconstant","LE_HEXconstant","LE_POUNDPOUND",
330
"LE_CComment","LE_CPPComment","LE_NAMESPACE","LE_USING","LE_TYPEDEFname",
331
"LE_ARROW","LE_ICR","LE_DECR","LE_LS","LE_RS","LE_LE","LE_GE","LE_EQ","LE_NE",
332
"LE_ANDAND","LE_OROR","LE_ELLIPSIS","LE_CLCL","LE_DOTstar","LE_ARROWstar",
333
"LE_MULTassign","LE_DIVassign","LE_MODassign","LE_PLUSassign","LE_MINUSassign",
334
"LE_LSassign","LE_RSassign","LE_ANDassign","LE_ERassign","LE_ORassign",
335
"LE_MACRO","LE_DYNAMIC_CAST","LE_STATIC_CAST","LE_CONST_CAST",
336
"LE_REINTERPRET_CAST",
338
char *cl_expr_rule[] = {
339
"$accept : translation_unit",
340
"translation_unit :",
341
"translation_unit : translation_unit primary_expr",
343
"primary_expr : $$1 simple_expr",
344
"primary_expr : error",
346
"const_spec : LE_CONST",
347
"basic_type_name : LE_INT",
348
"basic_type_name : LE_CHAR",
349
"basic_type_name : LE_SHORT",
350
"basic_type_name : LE_LONG",
351
"basic_type_name : LE_FLOAT",
352
"basic_type_name : LE_DOUBLE",
353
"basic_type_name : LE_SIGNED",
354
"basic_type_name : LE_UNSIGNED",
355
"basic_type_name : LE_VOID",
357
"parameter_list : template_parameter",
358
"parameter_list : parameter_list ',' template_parameter",
359
"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER special_star_amp",
360
"template_parameter : const_spec nested_scope_specifier basic_type_name special_star_amp",
361
"template_parameter : const_spec nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp",
362
"simple_expr : stmnt_starter special_cast '<' cast_type '>' '('",
363
"simple_expr : stmnt_starter LE_THIS",
364
"simple_expr : stmnt_starter '*' LE_THIS",
365
"simple_expr : stmnt_starter '*' identifier_name",
366
"simple_expr : stmnt_starter '(' cast_type ')' special_star_amp identifier_name",
367
"simple_expr : stmnt_starter nested_scope_specifier identifier_name optional_template_init_list optinal_postifx",
368
"simple_expr : stmnt_starter '(' '(' cast_type ')' special_star_amp identifier_name ')'",
369
"identifier_name : LE_IDENTIFIER array_brackets",
370
"optional_template_init_list :",
371
"optional_template_init_list : '<' parameter_list '>'",
373
"optinal_postifx : '('",
374
"special_cast : LE_DYNAMIC_CAST",
375
"special_cast : LE_STATIC_CAST",
376
"special_cast : LE_CONST_CAST",
377
"special_cast : LE_REINTERPRET_CAST",
381
"star_list : star_list '*'",
382
"special_star_amp : star_list amp_item",
384
"stmnt_starter : ';'",
385
"stmnt_starter : ':'",
386
"cast_type : nested_scope_specifier LE_IDENTIFIER '<' parameter_list '>' special_star_amp",
387
"cast_type : nested_scope_specifier LE_IDENTIFIER special_star_amp",
388
"nested_scope_specifier :",
389
"nested_scope_specifier : nested_scope_specifier scope_specifier",
390
"scope_specifier : LE_IDENTIFIER LE_CLCL",
392
"array_brackets : '['",
400
#define YYMAXDEPTH YYSTACKSIZE
403
#define YYSTACKSIZE YYMAXDEPTH
405
#define YYSTACKSIZE 500
406
#define YYMAXDEPTH 500
417
short yyss[YYSTACKSIZE];
418
YYSTYPE yyvs[YYSTACKSIZE];
419
#define yystacksize YYSTACKSIZE
420
void yyerror(char *s) {}
422
void expr_consumBracketsContent(char openBrace)
427
case '(': closeBrace = ')'; break;
428
case '[': closeBrace = ']'; break;
429
case '<': closeBrace = '>'; break;
430
case '{': closeBrace = '}'; break;
440
int ch = cl_expr_lex();
450
else if(ch == openBrace)
458
void expr_FuncArgList()
463
int ch = cl_expr_lex();
464
//printf("ch=%d\n", ch);
483
void expr_consumeTemplateDecl()
488
int ch = cl_expr_lex();
489
//printf("ch=%d\n", ch);
508
void expr_syncParser(){
509
//dont do anything, a hook to allow us to implement some
510
//nice error recovery if needed
513
// return the scope name at the end of the input string
514
ExpressionResult &parse_expression(const std::string &in)
517
//provide the lexer with new input
518
if( !setExprLexerInput(in) ){
522
//printf("parsing...\n");
524
//do the lexer cleanup
529
#define YYABORT goto yyabort
530
#define YYREJECT goto yyabort
531
#define YYACCEPT goto yyaccept
532
#define YYERROR goto yyerrlab
536
register int yym, yyn, yystate;
540
extern char *getenv(const char *name);
542
if (yys = getenv("YYDEBUG"))
545
if (yyn >= '0' && yyn <= '9')
557
*yyssp = yystate = 0;
560
if (yyn = yydefred[yystate]) goto yyreduce;
563
if ((yychar = yylex()) < 0) yychar = 0;
568
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
569
if (!yys) yys = "illegal-symbol";
570
printf("%sdebug: state %d, reading %d (%s)\n",
571
YYPREFIX, yystate, yychar, yys);
575
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
576
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
580
printf("%sdebug: state %d, shifting to state %d\n",
581
YYPREFIX, yystate, yytable[yyn]);
583
if (yyssp >= yyss + yystacksize - 1)
587
*++yyssp = yystate = yytable[yyn];
590
if (yyerrflag > 0) --yyerrflag;
593
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
594
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
599
if (yyerrflag) goto yyinrecovery;
604
yyerror("syntax error");
616
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
617
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
621
printf("%sdebug: state %d, error recovery shifting\
622
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
624
if (yyssp >= yyss + yystacksize - 1)
628
*++yyssp = yystate = yytable[yyn];
636
printf("%sdebug: error recovery discarding state %d\n",
639
if (yyssp <= yyss) goto yyabort;
647
if (yychar == 0) goto yyabort;
652
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
653
if (!yys) yys = "illegal-symbol";
654
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
655
YYPREFIX, yystate, yychar, yys);
664
printf("%sdebug: state %d, reducing by rule %d (%s)\n",
665
YYPREFIX, yystate, yyn, yyrule[yyn]);
668
yyval = yyvsp[1-yym];
676
yyclearin; /*clear lookahead token*/
678
/*fprintf(stderr, "CodeLite: syntax error, unexpected token '%s' found at line %d \n", cl_expr_text, cl_expr_lineno);*/
687
{ yyval = yyvsp[0]; }
690
{ yyval = yyvsp[0]; }
693
{ yyval = yyvsp[0]; }
696
{ yyval = yyvsp[0]; }
699
{ yyval = yyvsp[0]; }
702
{ yyval = yyvsp[0]; }
705
{ yyval = yyvsp[0]; }
708
{ yyval = yyvsp[0]; }
711
{ yyval = yyvsp[0]; }
714
{ yyval = yyvsp[0]; }
723
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
726
{yyval = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1] +yyvsp[0];}
729
{yyval = yyvsp[-3] + " " + yyvsp[-2] + " " + yyvsp[-1] +yyvsp[0];}
732
{yyval = yyvsp[-6] + " " + yyvsp[-5] + " " + yyvsp[-4] +yyvsp[-3] + yyvsp[-2] + yyvsp[-1];}
738
result.m_isaType = true;
739
result.m_name = yyvsp[-2];
740
result.m_isFunc = false;
741
/*printf("Rule 1\n"); */
747
result.m_isaType = false;
748
result.m_name = yyval;
749
result.m_isFunc = false;
750
result.m_isThis = true;
751
result.m_isPtr = true;
752
/*printf("Rule 2\n"); */
758
result.m_isaType = false;
759
result.m_name = yyval;
760
result.m_isFunc = false;
761
result.m_isThis = true;
762
/*printf("Rule 3\n"); */
768
result.m_isaType = false;
769
result.m_name = yyval;
770
result.m_isFunc = false;
771
result.m_isThis = false;
772
result.m_isPtr = false;
773
/*printf("Rule 4\n"); */
779
result.m_isaType = true;
780
result.m_name = yyval;
781
result.m_isFunc = false;
782
result.m_isThis = false;
783
/*printf("Rule 5\n"); */
788
result.m_isaType = false;
789
result.m_name = yyvsp[-2];
790
result.m_isThis = false;
791
yyvsp[-3].erase(yyvsp[-3].find_last_not_of(":")+1);
792
result.m_scope = yyvsp[-3];
793
result.m_isTemplate = yyvsp[-1].empty() ? false : true;
794
result.m_templateInitList = yyvsp[-1];
795
/*printf("Rule 6\n"); */
801
result.m_isaType = true;
802
result.m_name = yyval;
803
result.m_isFunc = false;
804
result.m_isThis = false;
805
/*printf("Rule 7\n"); */
815
{yyval = yyvsp[-2] + yyvsp[-1] + yyvsp[0];}
824
result.m_isFunc = true;
843
{ yyval = yyvsp[0]; }
849
{yyval = yyvsp[-1] + yyvsp[0];}
852
{ yyval = yyvsp[-1] + yyvsp[0]; }
865
yyval = yyvsp[-5] + yyvsp[-4];
866
yyvsp[-5].erase(yyvsp[-5].find_last_not_of(":")+1);
867
result.m_scope = yyvsp[-5];
868
result.m_name = yyvsp[-4];
869
result.m_isPtr = (yyvsp[0].find("*") != (size_t)-1);;
870
result.m_isTemplate = true;
871
result.m_templateInitList = yyvsp[-3] + yyvsp[-2] + yyvsp[-1];
876
yyval = yyvsp[-2] + yyvsp[-1];
877
yyvsp[-2].erase(yyvsp[-2].find_last_not_of(":")+1);
878
result.m_scope = yyvsp[-2];
879
result.m_name = yyvsp[-1];
880
result.m_isPtr = (yyvsp[0].find("*") != (size_t)-1);;
887
{ yyval = yyvsp[-1] + yyvsp[0];}
890
{yyval = yyvsp[-1]+ yyvsp[0];}
896
{ expr_consumBracketsContent('['); yyval = "[]";}
903
if (yystate == 0 && yym == 0)
907
printf("%sdebug: after reduction, shifting from state 0 to\
908
state %d\n", YYPREFIX, YYFINAL);
915
if ((yychar = yylex()) < 0) yychar = 0;
920
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
921
if (!yys) yys = "illegal-symbol";
922
printf("%sdebug: state %d, reading %d (%s)\n",
923
YYPREFIX, YYFINAL, yychar, yys);
927
if (yychar == 0) goto yyaccept;
930
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
931
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
932
yystate = yytable[yyn];
934
yystate = yydgoto[yym];
937
printf("%sdebug: after reduction, shifting from state %d \
938
to state %d\n", YYPREFIX, *yyssp, yystate);
940
if (yyssp >= yyss + yystacksize - 1)
948
yyerror("yacc stack overflow");