4 #define YYLTYPE Location
8 # define YYLLOC_DEFAULT(Current, Rhs, N) \
9 (Current).start = (Rhs)[1].start; \
10 (Current).end = (Rhs)[N].end;
14 extern File fileInput;
20 bool deleteWatchable = false;
22 #define MAX_STRUCT_LEVELS 256
23 AccessMode memberAccessStack[MAX_STRUCT_LEVELS];
24 int defaultMemberAccess = -1;
26 #define POP_DEFAULT_ACCESS if(defaultMemberAccess > -1) defaultMemberAccess--;
36 SpecifierType specifierType;
43 Enumerator enumerator;
44 Declarator declarator;
46 Initializer initializer;
47 InitDeclarator initDeclarator;
49 Declaration declaration;
51 FunctionDefinition function;
56 Instantiation instance;
57 MembersInit membersInit;
58 MemberInit memberInit;
59 ClassFunction classFunction;
60 ClassDefinition _class;
65 PropertyWatch propertyWatch;
66 TemplateParameter templateParameter;
67 TemplateArgument templateArgument;
68 TemplateDatatype templateDatatype;
70 DBTableEntry dbtableEntry;
71 DBIndexItem dbindexItem;
72 DBTableDef dbtableDef;
77 %type <symbol> class_decl
78 %type <specifierType> struct_or_union
79 %type <i> unary_operator assignment_operator
80 %type <declMode> member_access declaration_mode
81 %type <id> identifier enum_decl
82 %type <exp> primary_expression primary_expression_error postfix_expression unary_expression cast_expression
83 multiplicative_expression additive_expression shift_expression
84 relational_expression relational_expression_smaller_than equality_expression and_expression
85 exclusive_or_expression inclusive_or_expression logical_and_expression
86 logical_or_expression conditional_expression assignment_expression
87 constant_expression constant_expression_error
88 anon_instantiation_expression anon_instantiation_expression_error i18n_string
89 postfix_expression_error unary_expression_error cast_expression_error
90 multiplicative_expression_error additive_expression_error shift_expression_error
91 relational_expression_error equality_expression_error and_expression_error
92 exclusive_or_expression_error inclusive_or_expression_error logical_and_expression_error
93 logical_or_expression_error conditional_expression_error assignment_expression_error
94 simple_primary_expression
95 simple_postfix_expression simple_postfix_expression_error
96 common_unary_expression common_unary_expression_error
97 simple_unary_expression simple_unary_expression_error
98 database_open dbfield dbindex dbtable
100 %type <list> argument_expression_list expression expression_anon_inst expression_anon_inst_error enumerator_list type_qualifier_list
101 struct_declarator_list struct_declaration_list
102 declaration_specifiers identifier_list identifier_list_error initializer_list init_declarator_list
103 parameter_list parameter_list_error parameter_type_list parameter_type_list_error declaration_list declaration_list_error statement_list statement_list_error
104 translation_unit members_initialization_list members_initialization_list_coloned members_initialization_list_error data_member_initialization_list data_member_initialization_list_coloned
105 default_property_list data_member_initialization_list_error
106 expression_error init_declarator_list_error argument_expression_list_error default_property_list_error struct_declaration_list_error
107 translation_unit_error
108 guess_declaration_specifiers
109 external_guess_declaration_specifiers external_guess_declaration_specifiers_error
110 specifier_qualifier_list guess_specifier_qualifier_list
111 _inheritance_specifiers inheritance_specifiers property_specifiers
112 new_specifiers renew_specifiers asm_field_list
113 property_watch_list watch_property_list
114 dbindex_item_list dbfield_definition_list
115 template_arguments_list template_parameters_list
117 %type <asmField> asm_field
118 %type <specifier> storage_class_specifier enum_specifier_compound enum_specifier_nocompound type_qualifier type_specifier class_specifier class_specifier_error
119 struct_or_union_specifier_compound struct_or_union_specifier_nocompound ext_storage type strict_type guess_type enum_class strict_type_specifier struct_class
120 struct_or_union_specifier_compound_error struct_class_error struct_decl
121 enum_specifier_compound_error enum_class_error external_storage_class_specifier
122 base_strict_type struct_head struct_entry
123 %type <enumerator> enumerator
124 %type <declarator> declarator direct_declarator direct_abstract_declarator abstract_declarator
125 direct_abstract_declarator_noarray abstract_declarator_noarray
126 struct_declarator direct_declarator_function direct_declarator_function_start declarator_function_error direct_declarator_function_error declarator_function direct_declarator_nofunction
127 declarator_nofunction
128 %type <pointer> pointer
129 %type <initializer> initializer initializer_error initializer_condition initializer_condition_error
130 %type <initDeclarator> init_declarator init_declarator_error
131 %type <typeName> type_name guess_type_name parameter_declaration parameter_declaration_error
132 %type <stmt> statement labeled_statement labeled_statement_error compound_statement compound_statement_error expression_statement
133 selection_statement selection_statement_error iteration_statement jump_statement jump_statement_error compound_inside compound_inside_error
134 iteration_statement_error statement_error asm_statement
135 stopwatching watch_definition firewatchers
137 %type <declaration> declaration declaration_error external_guess_declaration external_guess_declaration_error
138 %type <function> function_definition function_definition_error
139 %type <external> external_declaration external_declaration_error
141 %type <instance> instantiation_named instantiation_named_error instantiation_unnamed instantiation_unnamed_error guess_instantiation_named guess_instantiation_named_error external_guess_instantiation_named
142 instantiation_anon instantiation_anon_error
143 %type <memberInit> data_member_initialization data_member_initialization_error default_property default_property_error
144 %type <classFunction> class_function_definition class_function_definition_error class_function_definition_start
145 class_function_definition_start_error virtual_class_function_definition_start virtual_class_function_definition_start_error
146 constructor_function_definition_start destructor_function_definition_start
147 %type <classFunction> instance_class_function_definition instance_class_function_definition_error instance_class_function_definition_start instance_class_function_definition_start_error
148 %type <_class> class class_error class_head
149 %type <classDef> struct_declaration struct_declaration_error
150 %type <string> ext_decl string_literal ext_attrib base_strict_type_name
151 %type <prop> property property_start property_body class_property class_property_start class_property_body
152 %type <propertyWatch> property_watch self_watch_definition
154 %type <templateParameter> template_parameter template_type_parameter template_identifier_parameter template_expression_parameter
155 %type <templateArgument> template_argument template_type_argument template_identifier_argument template_expression_argument
156 %type <templateDatatype> template_datatype
158 %type <dbtableEntry> dbindex_entry dbfield_entry
159 %type <dbindexItem> dbindex_item
160 %type <dbtableDef> dbtable_definition
161 %type <context> compound_start class_entry
163 %token IDENTIFIER CONSTANT STRING_LITERAL SIZEOF
164 %token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP
165 %token AND_OP OR_OP MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN
166 %token SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN
167 %token XOR_ASSIGN OR_ASSIGN TYPE_NAME
169 %token TYPEDEF EXTERN STATIC AUTO REGISTER
170 %token CHAR SHORT INT UINT INT64 LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID VALIST
171 %token STRUCT UNION ENUM ELLIPSIS
173 %token CASE DEFAULT IF SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN
177 %token CLASS THISCLASS CLASS_NAME
178 %token PROPERTY SETPROP GETPROP NEWOP RENEW DELETE EXT_DECL EXT_STORAGE IMPORT DEFINE VIRTUAL EXT_ATTRIB
179 %token PUBLIC PRIVATE
180 %token TYPED_OBJECT ANY_OBJECT _INCREF EXTENSION ASM TYPEOF
181 %token WATCH STOPWATCHING FIREWATCHERS WATCHABLE CLASS_DESIGNER CLASS_NO_EXPANSION CLASS_FIXED ISPROPSET
182 %token CLASS_DEFAULT_PROPERTY PROPERTY_CATEGORY CLASS_DATA CLASS_PROPERTY SUBCLASS NAMESPACE
183 %token NEW0OP RENEW0 VAARG
184 %token DBTABLE DBFIELD DBINDEX DATABASE_OPEN
186 %destructor { FreeIdentifier($$); } identifier
187 %destructor { FreePointer($$); } pointer
188 %destructor { FreeExpression($$); } primary_expression primary_expression_error postfix_expression unary_expression cast_expression
189 multiplicative_expression additive_expression shift_expression
190 relational_expression equality_expression and_expression
191 exclusive_or_expression inclusive_or_expression logical_and_expression
192 logical_or_expression conditional_expression assignment_expression
193 constant_expression constant_expression_error
194 postfix_expression_error unary_expression_error cast_expression_error
195 multiplicative_expression_error additive_expression_error shift_expression_error
196 relational_expression_error equality_expression_error and_expression_error
197 exclusive_or_expression_error inclusive_or_expression_error logical_and_expression_error
198 logical_or_expression_error conditional_expression_error assignment_expression_error i18n_string
199 %destructor { FreeSpecifier($$); } storage_class_specifier enum_specifier_compound enum_specifier_nocompound type_qualifier type_specifier class_specifier class_specifier_error
200 struct_or_union_specifier_compound struct_or_union_specifier_nocompound ext_storage type strict_type guess_type enum_class strict_type_specifier struct_class
201 struct_or_union_specifier_compound_error struct_class_error struct_decl
202 enum_specifier_compound_error enum_class_error external_storage_class_specifier
203 base_strict_type struct_head struct_entry
204 %destructor { FreeEnumerator($$); } enumerator
205 %destructor { FreeDeclarator($$); } declarator direct_declarator direct_abstract_declarator abstract_declarator
206 direct_abstract_declarator_noarray abstract_declarator_noarray
207 struct_declarator direct_declarator_function direct_declarator_function_start declarator_function_error direct_declarator_function_error declarator_function direct_declarator_nofunction
208 declarator_nofunction
210 %destructor { FreeInitializer($$); } initializer initializer_error initializer_condition initializer_condition_error
211 %destructor { FreeInitDeclarator($$); } init_declarator init_declarator_error
212 %destructor { FreeTypeName($$); } type_name guess_type_name parameter_declaration parameter_declaration_error
213 %destructor { FreeStatement($$); } statement labeled_statement labeled_statement_error compound_statement compound_statement_error expression_statement
214 selection_statement selection_statement_error iteration_statement jump_statement jump_statement_error compound_inside compound_inside_error
215 iteration_statement_error statement_error
217 %destructor { FreeDeclaration($$); } declaration
218 %destructor { FreeFunction($$); } function_definition function_definition_error
219 %destructor { FreeExternal($$); } external_declaration external_declaration_error
221 %destructor { FreeInstance($$); } instantiation_named instantiation_named_error instantiation_unnamed instantiation_unnamed_error
223 %destructor { FreeMemberInit($$); } data_member_initialization data_member_initialization_error default_property default_property_error
225 %destructor { FreeClassFunction($$); } class_function_definition class_function_definition_error class_function_definition_start
226 class_function_definition_start_error virtual_class_function_definition_start virtual_class_function_definition_start_error
227 constructor_function_definition_start destructor_function_definition_start
228 instance_class_function_definition instance_class_function_definition_error instance_class_function_definition_start instance_class_function_definition_start_error
229 %destructor { Context ctx = curContext; PopContext(ctx); FreeContext(ctx); delete ctx; } class_entry
230 %destructor { Context ctx = curContext; PopContext(ctx); FreeContext(ctx); delete ctx; } class_decl
231 %destructor { FreeClass($$); } class class_error class_head
232 %destructor { FreeClassDef($$); } struct_declaration struct_declaration_error
233 %destructor { delete $$; } ext_decl string_literal
234 %destructor { FreeProperty($$); } property
236 %destructor { FreeList($$, FreeExpression); } argument_expression_list expression expression_error argument_expression_list_error
237 %destructor { FreeList($$, FreeEnumerator); } enumerator_list
238 %destructor { FreeList($$, FreeSpecifier); } type_qualifier_list specifier_qualifier_list declaration_specifiers inheritance_specifiers _inheritance_specifiers external_guess_declaration_specifiers external_guess_declaration_specifiers_error
239 guess_declaration_specifiers guess_specifier_qualifier_list
240 %destructor { FreeList($$, FreeDeclarator); } struct_declarator_list
241 %destructor { FreeList($$, FreeDeclaration); } declaration_list declaration_list_error
242 %destructor { FreeList($$, FreeInitializer); } initializer_list
243 %destructor { FreeList($$, FreeInitDeclarator); } init_declarator_list init_declarator_list_error
244 %destructor { FreeList($$, FreeTypeName); } parameter_list parameter_list_error parameter_type_list parameter_type_list_error identifier_list identifier_list_error
245 %destructor { FreeList($$, FreeStatement); } statement_list statement_list_error
246 %destructor { if($$ != ast) FreeList($$, FreeExternal); } translation_unit translation_unit_error
247 %destructor { FreeList($$, FreeClassDef); } struct_declaration_list struct_declaration_list_error
248 %destructor { FreeList($$, FreeMemberInit); } default_property_list default_property_list_error data_member_initialization_list data_member_initialization_list_coloned data_member_initialization_list_error
249 %destructor { FreeList($$, FreeMembersInit); } members_initialization_list members_initialization_list_coloned members_initialization_list_error
250 %destructor { PopContext($$); FreeContext($$); delete $$; } compound_start
251 %destructor { FreeTemplateParameter($$); } template_parameter template_type_parameter template_identifier_parameter template_expression_parameter
252 %destructor { FreeTemplateArgument($$); } template_argument template_type_argument template_identifier_argument template_expression_argument
253 %destructor { FreeTemplateDataType($$); } template_datatype
254 %destructor { FreeList($$, FreeTemplateParameter); } template_parameters_list
255 %destructor { FreeList($$, FreeTemplateArgument); } template_arguments_list
256 %destructor { } declaration_mode
266 // if($1._class && !$1._class.name)
270 strcpy(name, $1._class.name ? $1._class.name : "");
272 strcat(name, $1.string);
276 _DeclClass(0, $1.string);
280 fileInput.Seek(@1.start.pos, start);
281 resetScannerPos(&@1.start);
286 YY_STACK_PRINT (yyss, yyssp);
289 YY_STACK_PRINT (yyss, yyssp);
296 // if($1._class && !$1._class.name)
300 strcpy(name, $1._class.name ? $1._class.name : "");
302 strcat(name, $1.string);
306 _DeclClass(0, $1.string);
310 fileInput.Seek(@1.start.pos, start);
311 resetScannerPos(&@1.start);
316 YY_STACK_PRINT (yyss, yyssp);
319 YY_STACK_PRINT (yyss, yyssp);
323 /* | identifier '*' '<' template_arguments_list '>'
325 //if($1._class && !$1._class.name)
329 strcpy(name, $1._class.name ? $1._class.name : "");
331 strcat(name, $1.string);
335 _DeclClass(0, $1.string);
336 fileInput.Seek(@1.start.pos, start);
337 resetScannerPos(&@1.start);
342 YY_STACK_PRINT (yyss, yyssp);
345 YY_STACK_PRINT (yyss, yyssp);
351 strict_type { $$ = $1; }
352 | identifier identifier
355 // if($1._class && !$1._class.name)
359 strcpy(name, $1._class.name ? $1._class.name : "");
361 strcat(name, $1.string);
365 _DeclClass(0, $1.string);
369 fileInput.Seek(@1.start.pos, start);
370 resetScannerPos(&@1.start);
375 YY_STACK_PRINT (yyss, yyssp);
378 YY_STACK_PRINT (yyss, yyssp);
381 Location tmpLoc = yylloc; $$ = $2; yylloc = @1;
382 Compiler_Error($"Not a type: %s\n", $1.string);
383 yylloc = tmpLoc; $2.badID = $1;
390 //if($1._class && !$1._class.name)
394 strcpy(name, $1._class.name ? $1._class.name : "");
396 strcat(name, $1.string);
400 _DeclClass(0, $1.string);
401 fileInput.Seek(@1.start.pos, start);
402 resetScannerPos(&@1.start);
407 YY_STACK_PRINT (yyss, yyssp);
410 YY_STACK_PRINT (yyss, yyssp);
414 /* | strict_type '<' template_arguments_list '>' { $$ = $1; }
415 | identifier identifier '<' template_arguments_list '>'
418 // if($1._class && !$1._class.name)
422 strcpy(name, $1._class.name ? $1._class.name : "");
424 strcat(name, $1.string);
428 _DeclClass(0, $1.string);
432 fileInput.Seek(@1.start.pos, start);
433 resetScannerPos(&@1.start);
438 YY_STACK_PRINT (yyss, yyssp);
441 YY_STACK_PRINT (yyss, yyssp);
444 Location tmpLoc = yylloc; $$ = $2; yylloc = @1;
445 Compiler_Error($"Not a type: %s\n", $1.string);
446 yylloc = tmpLoc; $2.badID = $1;
452 TYPE_NAME { $$ = MkSpecifierName(yytext); }
455 base_strict_type_name:
456 TYPE_NAME { $$ = CopyString(yytext); }
460 | base_strict_type '<' template_arguments_list '>' { $$ = $1; SetClassTemplateArgs($$, $3); $$.loc = @$; }
461 | base_strict_type '<' template_arguments_list RIGHT_OP
464 SetClassTemplateArgs($$, $3);
468 fileInput.Seek(@4.end.pos, start);
469 resetScannerPos(&@4.end);
473 /* | identifier '<' template_arguments_list '>' */
474 /*| identifier '<' error
476 // if($1._class && !$1._class.name)
480 strcpy(name, $1._class.name ? $1._class.name : "");
482 strcat(name, $1.string);
486 _DeclClass(0, $1.string);
490 fileInput.Seek(@1.start.pos, start);
491 resetScannerPos(&@1.start);
496 YY_STACK_PRINT (yyss, yyssp);
499 YY_STACK_PRINT (yyss, yyssp);
502 YY_STACK_PRINT (yyss, yyssp);
505 /* $$ = MkSpecifierNameArgs($1.string, $3); $$.loc = @$; FreeIdentifier($1); */
509 class_function_definition_start:
510 guess_declaration_specifiers declarator_function
511 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
512 | declarator_function
513 { $$ = MkClassFunction(null, null, $1, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
516 constructor_function_definition_start:
517 guess_declaration_specifiers '(' ')'
518 { $$ = MkClassFunction(null, null, null, null); $$.isConstructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; FreeList($1, FreeSpecifier); }
521 destructor_function_definition_start:
522 '~' guess_declaration_specifiers '(' ')'
523 { $$ = MkClassFunction(null, null, null, null); $$.isDestructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; FreeList($2, FreeSpecifier) }
526 virtual_class_function_definition_start:
527 VIRTUAL guess_declaration_specifiers declarator_function
528 { $$ = MkClassFunction($2, null, $3, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
529 | VIRTUAL declarator_function
530 { $$ = MkClassFunction(null, null, $2, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
533 class_function_definition_start_error:
534 guess_declaration_specifiers declarator_function_error
535 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
536 | declarator_function_error
537 { $$ = MkClassFunction(null, null, $1, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
540 virtual_class_function_definition_start_error:
541 VIRTUAL guess_declaration_specifiers declarator_function_error
542 { $$ = MkClassFunction($2, null, $3, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
543 | VIRTUAL declarator_function_error
544 { $$ = MkClassFunction(null, null, $2, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
547 class_function_definition:
548 class_function_definition_start compound_statement
549 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
550 | virtual_class_function_definition_start compound_statement
551 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
552 | virtual_class_function_definition_start ';'
553 { ProcessClassFunctionBody($1, null); $$.loc = @$; }
554 | constructor_function_definition_start compound_statement
555 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
556 | destructor_function_definition_start compound_statement
557 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
560 | class_function_definition_start ';'
561 { ProcessClassFunctionBody($1, null); $$.loc = @$; }
564 class_function_definition_error:
565 class_function_definition_start compound_statement_error
566 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
567 | class_function_definition_start_error
568 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
569 | virtual_class_function_definition_start compound_statement_error
570 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
571 | virtual_class_function_definition_start_error
572 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
573 | virtual_class_function_definition_start_error ';'
574 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
577 // In Instances, return type is required to distinguish from calling the function
578 instance_class_function_definition_start:
579 declaration_specifiers declarator_function
580 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
581 | declaration_specifiers declarator_nofunction
582 { $$ = MkClassFunction($1, null, MkDeclaratorFunction($2, null), null); $$.loc = @$; $$.id = ++globalContext.nextID; }
585 instance_class_function_definition_start_error:
586 declaration_specifiers declarator_function_error
587 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
590 instance_class_function_definition:
591 instance_class_function_definition_start compound_statement
592 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
595 instance_class_function_definition_error:
596 instance_class_function_definition_start compound_statement_error
597 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; $$.loc.end.charPos++; $$.loc.end.pos++;}
598 | instance_class_function_definition_start_error
599 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
600 | instance_class_function_definition_start
601 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
604 data_member_initialization:
605 postfix_expression '=' initializer_condition { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end;}
606 | initializer_condition { $$ = MkMemberInit(null, $1); $$.loc = @$; $$.realLoc = @$;}
609 data_member_initialization_error:
610 postfix_expression '=' initializer_condition_error { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end;}
611 | postfix_expression '=' error
613 $$ = MkMemberInitExp($1, MkInitializerAssignment(MkExpDummy()));
614 $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = $$.initializer.loc.end = @2.end;
616 fileInput.Seek(@2.end.pos, start);
618 resetScannerPos(&@2.end);
622 | initializer_condition_error { $$ = MkMemberInit(null, $1); $$.loc = @$; $$.realLoc = @$;}
625 data_member_initialization_list:
626 data_member_initialization { $$ = MkList(); ListAdd($$, $1); }
627 | data_member_initialization_list ',' data_member_initialization
628 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
629 | data_member_initialization_list_error ',' data_member_initialization
630 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
633 data_member_initialization_list_error:
634 data_member_initialization_error { $$ = MkList(); ListAdd($$, $1); }
635 | data_member_initialization_list ',' data_member_initialization_error
636 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
637 | data_member_initialization_list_error ',' data_member_initialization_error
638 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
640 | data_member_initialization_list ',' error
641 { ((MemberInit)$1->last).loc.end = @2.end;
643 Initializer dummy = MkInitializerAssignment(MkExpDummy());
644 MemberInit memberInit = MkMemberInit(null, dummy);
645 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @2.end;
646 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @2.end;
647 ListAdd($1, memberInit);
652 data_member_initialization_list_error ',' error
653 { ((MemberInit)$1->last).loc.end = @2.end;
655 Initializer dummy = MkInitializerAssignment(MkExpDummy());
656 MemberInit memberInit = MkMemberInit(null, dummy);
657 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @2.end;
658 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @2.end;
659 ListAdd($1, memberInit);
665 Initializer dummy = MkInitializerAssignment(MkExpDummy());
666 MemberInit memberInit = MkMemberInit(null, dummy);
667 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @1.start;
668 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @1.start;
671 ListAdd($$, memberInit);
673 dummy = MkInitializerAssignment(MkExpDummy());
674 memberInit = MkMemberInit(null, dummy);
675 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @1.end;
676 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @1.end;
677 ListAdd($$, memberInit);
681 data_member_initialization_list_coloned:
682 data_member_initialization_list ';'
683 { if($1->last) ((MemberInit)$1->last).loc.end = @2.end; $$ = $1; }
684 | data_member_initialization_list_error ';'
685 { if($1->last) ((MemberInit)$1->last).loc.end = @2.end; $$ = $1; }
688 members_initialization_list_coloned:
689 data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($1); $$ = MkList(); ListAdd($$, members); members.loc = @1; }
690 | instance_class_function_definition { $$ = MkList(); ListAdd($$, MkMembersInitMethod($1)); ((MembersInit)$$->last).loc = @1; }
691 | members_initialization_list_error data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($2); ListAdd($$, members); members.loc = @2; $$ = $1; }
692 | members_initialization_list_error instance_class_function_definition { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
693 | members_initialization_list_coloned data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($2); ListAdd($$, members); members.loc = @2; $$ = $1; }
694 | members_initialization_list_coloned instance_class_function_definition { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
695 | ';' { MembersInit members = MkMembersInitList(MkList()); $$ = MkList(); ListAdd($$, members); members.loc = @1; }
696 | members_initialization_list_error ';'
697 | members_initialization_list_coloned ';' { MembersInit members = MkMembersInitList(MkList()); ListAdd($$, members); members.loc = @2; $$ = $1; }
700 members_initialization_list:
701 members_initialization_list_coloned
702 | data_member_initialization_list { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @1; }
703 | members_initialization_list_coloned data_member_initialization_list { ListAdd($1, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
704 | members_initialization_list_error data_member_initialization_list { ListAdd($1, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
707 members_initialization_list_error:
708 instance_class_function_definition_error { $$ = MkList(); ListAdd($$, MkMembersInitMethod($1)); ((MembersInit)$$->last).loc = @1; }
709 | members_initialization_list instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
710 | members_initialization_list_error instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
711 | members_initialization_list_coloned instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
712 | members_initialization_list_coloned data_member_initialization_list_error { ListAdd($$, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
713 | data_member_initialization_list_error { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @1; }
714 | data_member_initialization_list error { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @2; }
718 instantiation_named_error '}'
719 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
720 | instantiation_named_error error '}'
721 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
724 instantiation_named_error:
725 declaration_specifiers identifier '{' members_initialization_list_error
726 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
727 | declaration_specifiers identifier '{' members_initialization_list error
728 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
729 | declaration_specifiers identifier '{' members_initialization_list
730 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
731 | declaration_specifiers identifier '{'
732 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
733 | declaration_specifiers identifier '{' error
734 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
739 declaration_specifiers identifier '{' members_initialization_list '}'
740 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
741 | declaration_specifiers identifier '{' members_initialization_list_error '}'
742 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
743 | declaration_specifiers identifier '{' '}'
744 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
747 instantiation_named_error:
748 declaration_specifiers identifier '{' members_initialization_list_error
749 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
750 | declaration_specifiers identifier '{' members_initialization_list error
751 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
752 | declaration_specifiers identifier '{' members_initialization_list
753 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
754 | declaration_specifiers identifier '{'
755 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
756 | declaration_specifiers identifier '{' error
757 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
762 guess_instantiation_named:
763 guess_instantiation_named_error '}'
764 { $$.loc = @$; $$.insideLoc.end = @2.start; }
765 | guess_instantiation_named_error error '}'
766 { $$.loc = @$; $$.insideLoc.end = @2.start; }
769 guess_instantiation_named_error:
770 guess_declaration_specifiers identifier '{' members_initialization_list_error
771 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
772 | guess_declaration_specifiers identifier '{' members_initialization_list error
773 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
774 | guess_declaration_specifiers identifier '{' members_initialization_list
775 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
776 | guess_declaration_specifiers identifier '{'
777 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
778 | guess_declaration_specifiers identifier '{' error
779 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
783 guess_instantiation_named:
784 guess_declaration_specifiers identifier '{' members_initialization_list '}'
785 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
786 | guess_declaration_specifiers identifier '{' members_initialization_list_error '}'
787 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
788 | guess_declaration_specifiers identifier '{' '}'
789 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
792 guess_instantiation_named_error:
793 guess_declaration_specifiers identifier '{' members_initialization_list_error
794 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
795 | guess_declaration_specifiers identifier '{' members_initialization_list error
796 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
797 | guess_declaration_specifiers identifier '{' members_initialization_list
798 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
799 | guess_declaration_specifiers identifier '{'
800 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
801 | guess_declaration_specifiers identifier '{' error
802 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), null);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
806 external_guess_instantiation_named:
807 external_guess_declaration_specifiers identifier '{' members_initialization_list '}'
808 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
809 | external_guess_declaration_specifiers identifier '{' members_initialization_list_error '}'
810 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
811 | external_guess_declaration_specifiers identifier '{' '}'
812 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
815 instantiation_unnamed:
816 instantiation_unnamed_error '}'
817 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
818 | instantiation_unnamed_error error '}'
819 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
822 instantiation_unnamed_error:
823 strict_type '{' members_initialization_list
824 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
825 | identifier '{' members_initialization_list
826 { Location tmpLoc = yylloc; yylloc = @1;
827 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; FreeIdentifier($1); }
829 | strict_type '{' members_initialization_list_error
830 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
832 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
833 | strict_type '{' members_initialization_list error
834 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
835 | strict_type '{' error
836 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
840 | identifier '{' members_initialization_list_error
841 { Location tmpLoc = yylloc; yylloc = @1;
842 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
844 { Location tmpLoc = yylloc; yylloc = @1;
845 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
846 | identifier '{' members_initialization_list error
847 { Location tmpLoc = yylloc; yylloc = @1;
848 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
849 | identifier '{' error
850 { Location tmpLoc = yylloc; yylloc = @1;
851 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
855 instantiation_unnamed:
856 strict_type '{' members_initialization_list '}'
857 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; }
858 | strict_type '{' members_initialization_list error '}'
859 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @5.start; }
860 | strict_type '{' members_initialization_list_error '}'
861 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; }
862 | strict_type '{' '}'
863 { $$ = MkInstantiation($1, null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.start;}
864 | strict_type '{' error '}'
865 { $$ = MkInstantiation($1, null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start;}
868 | identifier '{' members_initialization_list '}'
869 { Location tmpLoc = yylloc; yylloc = @1;
870 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
871 | identifier '{' members_initialization_list_error '}'
872 { Location tmpLoc = yylloc; yylloc = @1;
873 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
874 | identifier '{' members_initialization_list error '}'
876 $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @5.start; FreeIdentifier($1); }
878 { Location tmpLoc = yylloc; yylloc = @1;
879 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.start; FreeIdentifier($1);}
880 | identifier '{' error '}'
881 { Location tmpLoc = yylloc; yylloc = @1;
882 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
886 instantiation_unnamed_error:
887 strict_type '{' members_initialization_list_error
888 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
890 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
891 | strict_type '{' members_initialization_list error
892 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
893 | strict_type '{' error
894 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
898 | identifier '{' members_initialization_list_error
899 { Location tmpLoc = yylloc; yylloc = @1;
900 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
902 { Location tmpLoc = yylloc; yylloc = @1;
903 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
904 | identifier '{' members_initialization_list error
905 { Location tmpLoc = yylloc; yylloc = @1;
906 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
907 | identifier '{' error
908 { Location tmpLoc = yylloc; yylloc = @1;
909 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
914 instantiation_anon_error '}'
915 { $$.loc = @$; $$.insideLoc.end = @2.start; }
916 | instantiation_anon_error error '}'
917 { $$.loc = @$; $$.insideLoc.end = @2.start; }
920 instantiation_anon_error:
921 '{' members_initialization_list_error
922 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
923 | '{' members_initialization_list error
924 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
926 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
928 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
929 | '{' members_initialization_list
930 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
935 '{' members_initialization_list '}'
936 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start; }
937 | '{' members_initialization_list error '}'
938 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @4.start; }
939 | '{' members_initialization_list_error '}'
940 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start; }
942 { $$ = MkInstantiation(null, null, MkList()); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.start;}
944 { $$ = MkInstantiation(null, null, MkList()); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start;}
947 instantiation_anon_error:
948 '{' members_initialization_list_error
949 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
951 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
952 | '{' members_initialization_list error
953 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
955 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
960 postfix_expression '=' initializer_condition { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; }
963 default_property_error:
964 postfix_expression '=' initializer_condition_error { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end; }
965 | postfix_expression '=' error { $$ = MkMemberInitExp($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end; $$.initializer.loc.end = @2.end; }
966 | postfix_expression error { $$ = MkMemberInitExp($1, null); $$.loc = @$; $$.realLoc = @$; }
969 default_property_list:
970 default_property { $$ = MkList(); ListAdd($$, $1); ((MemberInit)$$->last).loc = @$; }
971 | default_property_list ',' default_property { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
972 | default_property_list_error ',' default_property { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
975 default_property_list_error:
976 default_property_error { $$ = MkList(); ListAdd($$, $1); ((MemberInit)$$->last).loc = @$; }
977 | default_property_list ',' default_property_error { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
978 | default_property_list_error ',' default_property_error { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
979 | default_property_list error
983 PROPERTY property_specifiers identifier '{'
984 { $$ = MkProperty($2, null, $3, null, null); $$.loc = @$; }
986 | PROPERTY property_specifiers abstract_declarator identifier '{'
987 { $$ = MkProperty($2, $3, $4, null, null); $$.loc = @$; }
989 | PROPERTY property_specifiers '{'
990 { $$ = MkProperty($2, null, null, null, null); $$.loc = @$; }
992 | PROPERTY property_specifiers abstract_declarator '{'
993 { $$ = MkProperty($2, $3, null, null, null); $$.loc = @$; }
996 { $$ = MkProperty(null, null, null, null, null); $$.loc = @$; }
1001 | property_body SETPROP compound_statement
1002 { $1.setStmt = $3; }
1003 | property_body GETPROP compound_statement
1004 { $1.getStmt = $3; }
1005 | property_body ISPROPSET compound_statement
1006 { $1.issetStmt = $3; }
1007 | property_body WATCHABLE
1008 { $1.isWatchable = true; }
1009 | property_body PROPERTY_CATEGORY i18n_string
1010 { $1.category = $3; }
1014 property_body '}' { $1.loc.end = @2.end; $$ = $1; }
1017 class_property_start:
1018 CLASS_PROPERTY property_specifiers identifier '{'
1019 { $$ = MkProperty($2, null, $3, null, null); $$.loc = @$; }
1021 | CLASS_PROPERTY property_specifiers abstract_declarator identifier '{'
1022 { $$ = MkProperty($2, $3, $4, null, null); $$.loc = @$; }
1024 | CLASS_PROPERTY property_specifiers '{'
1025 { $$ = MkProperty($2, null, null, null, null); $$.loc = @$; }
1027 | CLASS_PROPERTY property_specifiers abstract_declarator '{'
1028 { $$ = MkProperty($2, $3, null, null, null); $$.loc = @$; }
1030 | CLASS_PROPERTY error '{'
1031 { $$ = MkProperty(null, null, null, null, null); $$.loc = @$; }
1034 class_property_body:
1035 class_property_start
1036 | class_property_body SETPROP compound_statement
1037 { $1.setStmt = $3; }
1038 | class_property_body GETPROP compound_statement
1039 { $1.getStmt = $3; }
1043 class_property_body '}' { $1.loc.end = @2.end; }
1046 watch_property_list:
1048 { $$ = MkListOne($1); }
1049 | watch_property_list identifier
1050 { ListAdd($1, $2); }
1054 watch_property_list compound_statement
1055 { $$ = MkPropertyWatch($1, $2); }
1056 | DELETE compound_statement
1057 { $$ = MkDeleteWatch($2); }
1060 property_watch_list:
1062 { $$ = MkListOne($1); }
1063 | property_watch_list property_watch
1064 { ListAdd($1, $2); }
1067 self_watch_definition:
1068 WATCH '(' watch_property_list ')' compound_statement
1069 { $$ = MkPropertyWatch($3, $5); }
1073 WATCH '(' assignment_expression ')' '{' property_watch_list '}'
1074 { $$ = MkWatchStmt(null, $3, $6); }
1075 | assignment_expression '.' WATCH '(' assignment_expression ')' '{' property_watch_list '}'
1076 { $$ = MkWatchStmt($1, $5, $8); }
1080 STOPWATCHING '(' assignment_expression ',' watch_property_list ')'
1081 { $$ = MkStopWatchingStmt(null, $3, $5); }
1082 | assignment_expression '.' STOPWATCHING '(' assignment_expression ',' watch_property_list ')'
1083 { $$ = MkStopWatchingStmt($1, $5, $7); }
1084 | STOPWATCHING '(' assignment_expression ')'
1085 { $$ = MkStopWatchingStmt(null, $3, null); }
1086 | assignment_expression '.' STOPWATCHING '(' assignment_expression ')'
1087 { $$ = MkStopWatchingStmt($1, $5, null); }
1092 { $$ = MkFireWatchersStmt(null, null); }
1093 | FIREWATCHERS watch_property_list
1094 { $$ = MkFireWatchersStmt(null, $2); }
1095 | postfix_expression '.' FIREWATCHERS
1096 { $$ = MkFireWatchersStmt($1, null); }
1097 | assignment_expression '.' FIREWATCHERS watch_property_list
1098 { $$ = MkFireWatchersStmt($1, $4); }
1102 guess_declaration_specifiers struct_declarator_list ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($1, $2, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1103 | guess_declaration_specifiers ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($1, null, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1104 | instantiation_unnamed ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1105 | guess_instantiation_named ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1106 | class_function_definition { $$ = MkClassDefFunction($1); $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1107 | property { $$ = MkClassDefProperty($1); $$.loc = @$; globalContext.nextID++; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1109 | member_access guess_declaration_specifiers struct_declarator_list ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($2, $3, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = $1; }
1110 | member_access guess_declaration_specifiers ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($2, null, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = $1; }
1111 | member_access instantiation_unnamed ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = $1; }
1112 | member_access guess_instantiation_named ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = $1; }
1113 | member_access class_function_definition { $$ = MkClassDefFunction($2); $$.loc = @$; $$.memberAccess = $1; }
1114 | member_access property { $$ = MkClassDefProperty($2); $$.loc = @$; globalContext.nextID++; $$.memberAccess = $1; }
1116 | default_property_list ';' { $$ = MkClassDefDefaultProperty($1); if($1->last) ((MemberInit)$1->last).loc.end = @2.start; $$.loc = @$; }
1117 | CLASS_DATA guess_declaration_specifiers struct_declarator_list ';' { $$ = MkClassDefClassData(MkStructDeclaration($2, $3, null)); $$.decl.loc = @$; $$.loc = @$; }
1118 | class_property { $$ = MkClassDefClassProperty($1); $$.loc = @$; globalContext.nextID++; }
1119 | self_watch_definition ';' { $$ = MkClassDefPropertyWatch($1); $$.loc = @$; globalContext.nextID++; }
1120 | WATCHABLE { $$ = null; deleteWatchable = true; }
1121 | CLASS_DESIGNER identifier ';' { $$ = MkClassDefDesigner($2.string); FreeIdentifier($2); }
1122 | CLASS_DESIGNER strict_type ';' { $$ = MkClassDefDesigner($2.name); FreeSpecifier($2); }
1123 | CLASS_NO_EXPANSION { $$ = MkClassDefNoExpansion(); }
1124 | CLASS_FIXED { $$ = MkClassDefFixed(); }
1125 | CLASS_DEFAULT_PROPERTY identifier ';' { $$ = MkClassDefDesignerDefaultProperty($2); }
1126 | CLASS_PROPERTY '(' identifier ')' '=' initializer_condition ';' { $$ = MkClassDefClassPropertyValue($3, $6); $$.loc = @$; }
1128 | ';' { $$ = null; }
1129 | member_access ':' { memberAccessStack[defaultMemberAccess] = $1; if(defaultMemberAccess == 0) { $$ = MkClassDefMemberAccess(); $$.memberAccess = $1; $$.loc = @$; } else $$ = null; }
1131 | member_access '(' identifier ')' { $$ = MkClassDefAccessOverride($1, $3); $$.loc = @$; }
1134 struct_declaration_error:
1135 class_function_definition_error { $$ = MkClassDefFunction($1); $$.loc = $1.loc; $$.loc.end.charPos++; $$.loc.end.pos++; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1136 | guess_instantiation_named_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1137 | instantiation_unnamed_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1138 | guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1139 | instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1141 | member_access class_function_definition_error { $$ = MkClassDefFunction($2); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.memberAccess = $1; }
1142 | member_access guess_instantiation_named_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1143 | member_access instantiation_unnamed_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1144 | member_access guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1145 | member_access instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1147 | default_property_list_error { $$ = MkClassDefDefaultProperty($1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
1150 struct_declaration_list:
1151 struct_declaration { $$ = MkList(); ListAdd($$, $1); }
1152 | struct_declaration_list struct_declaration { $$ = $1; ListAdd($1, $2); }
1153 | struct_declaration_list_error struct_declaration { $$ = $1; ListAdd($1, $2); }
1156 struct_declaration_list_error:
1157 struct_declaration_error { $$ = MkList(); ListAdd($$, $1); }
1158 | struct_declaration_list error
1159 | struct_declaration_list_error error
1160 | struct_declaration_list struct_declaration_error { $$ = $1; ListAdd($$, $2); }
1161 | struct_declaration_list_error struct_declaration_error { $$ = $1; ListAdd($$, $2); }
1165 declaration_specifiers { $$ = MkTemplateDatatype($1, null); }
1166 | declaration_specifiers abstract_declarator { $$ = MkTemplateDatatype($1, $2); }
1167 | identifier { $$ = MkTemplateDatatype(MkListOne(MkSpecifierName($1.string)), null); FreeIdentifier($1); }
1170 template_type_argument:
1171 template_datatype { $$ = MkTemplateTypeArgument($1); }
1174 template_type_parameter:
1175 CLASS identifier { $$ = MkTypeTemplateParameter($2, null, null); }
1176 | CLASS identifier '=' template_type_argument { $$ = MkTypeTemplateParameter($2, null, $4); }
1177 | CLASS identifier ':' template_datatype { $$ = MkTypeTemplateParameter($2, $4, null); }
1178 | CLASS identifier ':' template_datatype '=' template_type_argument { $$ = MkTypeTemplateParameter($2, $4, $6); }
1179 | CLASS base_strict_type_name { $$ = MkTypeTemplateParameter(MkIdentifier($2), null, null); delete $2; }
1180 | CLASS base_strict_type_name '=' template_type_argument { $$ = MkTypeTemplateParameter(MkIdentifier($2), null, $4); }
1181 | CLASS base_strict_type_name ':' template_datatype { $$ = MkTypeTemplateParameter(MkIdentifier($2), $4, null); }
1182 | CLASS base_strict_type_name ':' template_datatype '=' template_type_argument { $$ = MkTypeTemplateParameter(MkIdentifier($2), $4, $6); }
1185 template_identifier_argument:
1186 identifier { $$ = MkTemplateIdentifierArgument($1); }
1189 template_identifier_parameter:
1190 identifier { $$ = MkIdentifierTemplateParameter($1, dataMember, null); }
1191 | identifier '=' template_identifier_argument { $$ = MkIdentifierTemplateParameter($1, dataMember, $3); }
1194 template_expression_argument:
1195 constant_expression { $$ = MkTemplateExpressionArgument($1); }
1198 template_expression_parameter:
1199 template_datatype identifier { $$ = MkExpressionTemplateParameter($2, $1, null); }
1200 | template_datatype identifier '=' template_expression_argument { $$ = MkExpressionTemplateParameter($2, $1, $4); }
1204 template_type_parameter
1205 | template_identifier_parameter
1206 | template_expression_parameter
1209 template_parameters_list:
1210 template_parameter { $$ = MkList(); ListAdd($$, $1); }
1211 | template_parameters_list ',' template_parameter { $$ = $1; ListAdd($1, $3); }
1215 template_expression_argument
1216 | template_identifier_argument
1217 | template_type_argument
1218 | identifier '=' template_expression_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1219 | identifier '=' template_identifier_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1220 | identifier '=' template_type_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1221 | template_datatype '=' template_expression_argument
1224 if($1.specifiers && $1.specifiers->first)
1226 Specifier spec = $1.specifiers->first;
1227 if(spec.type == nameSpecifier)
1228 $$.name = MkIdentifier(spec.name);
1230 FreeTemplateDataType($1);
1233 | template_datatype '=' template_identifier_argument
1236 if($1.specifiers && $1.specifiers->first)
1238 Specifier spec = $1.specifiers->first;
1239 if(spec.type == nameSpecifier)
1240 $$.name = MkIdentifier(spec.name);
1242 FreeTemplateDataType($1);
1245 | template_datatype '=' template_type_argument
1248 if($1.specifiers && $1.specifiers->first)
1250 Specifier spec = $1.specifiers->first;
1251 if(spec.type == nameSpecifier)
1252 $$.name = MkIdentifier(spec.name);
1254 FreeTemplateDataType($1);
1259 template_arguments_list:
1260 template_argument { $$ = MkList(); ListAdd($$, $1); }
1261 | template_arguments_list ',' template_argument { $$ = $1; ListAdd($1, $3); }
1267 if(curContext != globalContext)
1268 PopContext(curContext);
1273 class_entry identifier { $1; $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1274 | class_entry base_strict_type
1276 $1; $$ = DeclClass(globalContext.nextID++, $2.name);
1279 ++defaultMemberAccess;
1280 memberAccessStack[defaultMemberAccess] = privateAccess;
1282 | identifier class_entry identifier { $2; $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1283 | identifier class_entry base_strict_type { $2; $$ = DeclClass(globalContext.nextID++, $3.name); FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1285 | class_entry identifier '<' template_parameters_list '>' { $1; $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); $$.templateParams = $4; FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1286 | class_entry base_strict_type '<' template_parameters_list '>'
1288 $1; $$ = DeclClass(globalContext.nextID++, $2.name);
1289 $$.templateParams = $4;
1292 ++defaultMemberAccess;
1293 memberAccessStack[defaultMemberAccess] = privateAccess;
1295 | identifier class_entry identifier '<' template_parameters_list '>' { $2; $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); $$.templateParams = $5; FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1296 | identifier class_entry base_strict_type '<' template_parameters_list '>' { $2; $$ = DeclClass(globalContext.nextID++, $3.name); $$.templateParams = $5; FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1306 // Added this for unit classes...
1309 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1311 PopContext(curContext);
1314 | class_decl '{' '}'
1316 $$ = MkClass($1, null, MkList()); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1318 PopContext(curContext);
1320 | class_head '{' '}'
1322 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1324 PopContext(curContext);
1327 | class_entry identifier ';'
1329 $1; $$ = MkClass(DeclClassAddNameSpace(0, $2.string), null, null); FreeIdentifier($2);
1331 PopContext(curContext);
1333 | class_entry type ';'
1335 $1; $$ = MkClass(DeclClass(0, $2.name), null, null); FreeSpecifier($2);
1337 PopContext(curContext);
1342 class_decl ':' inheritance_specifiers
1344 $$ = MkClass($1, $3, null);
1349 class_decl '{' struct_declaration_list_error
1351 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1353 PopContext(curContext);
1355 | class_head '{' struct_declaration_list_error
1357 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1359 PopContext(curContext);
1361 | class_decl '{' struct_declaration_list
1363 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1365 PopContext(curContext);
1367 | class_head '{' struct_declaration_list
1369 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1371 PopContext(curContext);
1373 | class_decl '{' error
1375 $$ = MkClass($1, null, MkList()); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1377 PopContext(curContext);
1379 | class_head '{' error
1381 $$ = $1; $$.definitions = MkList(); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1383 PopContext(curContext);
1387 /**** EXPRESSIONS ********************************************************************/
1391 { $$ = MkIdentifier(yytext); $$.loc = @1; }
1395 simple_primary_expression
1396 | '(' expression ')'
1397 { $$ = MkExpBrackets($2); $$.loc = @$; }
1401 string_literal { $$ = MkExpString($1); delete $1; $$.loc = @$; }
1402 | '$' string_literal { $$ = MkExpIntlString($2, null); delete $2; $$.loc = @$; }
1403 | '$' string_literal '.' string_literal { $$ = MkExpIntlString($4, $2); delete $2; delete $4; $$.loc = @$; }
1406 simple_primary_expression:
1407 identifier { $$ = MkExpIdentifier($1); $$.loc = @$; }
1408 | instantiation_unnamed { $$ = MkExpInstance($1); $$.loc = @$; }
1409 | EXTENSION '(' compound_statement ')' { $$ = MkExpExtensionCompound($3); $$.loc = @$; }
1410 | EXTENSION '(' expression ')' { $$ = MkExpExtensionExpression($3); $$.loc = @$; }
1411 | EXTENSION '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, $5); $$.loc = @$; }
1412 | EXTENSION '(' type_name ')' '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, MkInitializerAssignment(MkExpExtensionInitializer($6, $8))); $$.loc = @$; }
1413 | CONSTANT { $$ = MkExpConstant(yytext); $$.loc = @$; }
1415 | '(' ')' { Expression exp = MkExpDummy(); exp.loc.start = @1.end; exp.loc.end = @2.start; $$ = MkExpBrackets(MkListOne(exp)); $$.loc = @$; yyerror(); }
1416 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1417 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1418 | NEWOP new_specifiers '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1419 | NEWOP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1420 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1421 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1422 | NEW0OP new_specifiers '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1423 | NEW0OP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1424 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1425 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1426 | RENEW constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1427 | RENEW constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1428 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1429 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1430 | RENEW0 constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1431 | RENEW0 constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1432 | CLASS '(' declaration_specifiers ')' { $$ = MkExpClass($3, null); $$.loc = @$; }
1433 | CLASS '(' declaration_specifiers abstract_declarator ')' { $$ = MkExpClass($3, $4); $$.loc = @$; }
1434 | CLASS '(' identifier ')' { $$ = MkExpClass(MkListOne(MkSpecifierName($3.string)), null); FreeIdentifier($3); $$.loc = @$; }
1435 | VAARG '(' assignment_expression ',' type_name ')' { $$ = MkExpVaArg($3, $5); $$.loc = @$; }
1437 | CLASS_DATA '(' identifier ')' { $$ = MkExpClassData($3); $$.loc = @$; }
1443 | '[' argument_expression_list /*expression*/ ']' { $$ = MkExpArray($2); $$.loc = @$; }
1446 anon_instantiation_expression:
1447 instantiation_anon { $$ = MkExpInstance($1); $$.loc = @$; }
1450 anon_instantiation_expression_error:
1451 instantiation_anon_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1454 primary_expression_error:
1455 '(' expression { $$ = MkExpBrackets($2); $$.loc = @$; }
1456 | '(' expression_error { $$ = MkExpBrackets($2); $$.loc = @$; }
1462 | postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1463 | postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1464 | postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1465 | postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1466 | postfix_expression '(' argument_expression_list_error ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; if($3->last) ((Expression)$3->last).loc.end = @4.start; }
1467 | postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1468 | postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1469 | postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1470 | postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1472 | postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1473 | postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1474 | postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1475 | postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1476 | postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1477 | postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1478 | postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1479 | postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1482 simple_postfix_expression:
1483 simple_primary_expression
1485 | simple_postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1486 | simple_postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1487 | simple_postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1488 | simple_postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1489 | simple_postfix_expression '(' argument_expression_list_error ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; if($3->last) ((Expression)$3->last).loc.end = @4.start; }
1490 | simple_postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1491 | simple_postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1492 | simple_postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1493 | simple_postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1495 | simple_postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1496 | simple_postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1497 | simple_postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1498 | simple_postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1499 | simple_postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1500 | simple_postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1501 | simple_postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1502 | simple_postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1505 argument_expression_list:
1506 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1507 | anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1508 | argument_expression_list ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1509 | argument_expression_list ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1512 argument_expression_list_error:
1513 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
1514 | anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
1515 | argument_expression_list ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
1516 | argument_expression_list ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
1517 | argument_expression_list ',' { Expression exp = MkExpDummy(); exp.loc.start = @2.end; exp.loc.end = @2.end; $$ = $1; ListAdd($1, exp); }
1520 common_unary_expression:
1521 INC_OP unary_expression { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1522 | DEC_OP unary_expression { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1523 | unary_operator cast_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1524 | unary_operator anon_instantiation_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1525 | SIZEOF '(' unary_expression ')' { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1526 | SIZEOF simple_unary_expression { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1527 | SIZEOF '(' guess_type_name ')' { $$ = MkExpTypeSize($3); $$.loc = @$; }
1528 | SIZEOF '(' CLASS type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1529 | SIZEOF '(' CLASS guess_type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1533 common_unary_expression
1534 | postfix_expression
1537 simple_unary_expression:
1538 common_unary_expression
1539 | simple_postfix_expression
1549 | DELETE { $$ = DELETE; }
1550 | _INCREF { $$ = _INCREF; }
1555 | '(' type_name ')' cast_expression { $$ = MkExpCast($2, $4); $$.loc = @$; }
1558 multiplicative_expression:
1560 | multiplicative_expression '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1561 | multiplicative_expression '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1562 | multiplicative_expression '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1563 | multiplicative_expression_error '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1564 | multiplicative_expression_error '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1565 | multiplicative_expression_error '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1568 additive_expression:
1569 multiplicative_expression
1570 | additive_expression '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1571 | additive_expression '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1572 | additive_expression_error '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1573 | additive_expression_error '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1578 | shift_expression LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1579 | shift_expression RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1580 | shift_expression_error LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1581 | shift_expression_error RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1584 relational_expression_smaller_than:
1585 relational_expression '<'
1592 relational_expression:
1594 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression { skipErrors = false; $$ = MkExpOp($1, '<', $2/*$3*/); $$.loc = @$; }
1595 | relational_expression '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1596 | relational_expression LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1597 | relational_expression GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1598 | relational_expression_error '<' shift_expression { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1599 | relational_expression_error '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1600 | relational_expression_error LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1601 | relational_expression_error GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1605 : relational_expression
1606 | equality_expression EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1607 | equality_expression NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1608 | equality_expression_error EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1609 | equality_expression_error NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1611 | equality_expression EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1612 | equality_expression NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1613 | equality_expression_error EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1614 | equality_expression_error NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1618 : equality_expression
1619 | and_expression '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1620 | and_expression_error '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1622 | and_expression '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1623 | and_expression_error '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1626 exclusive_or_expression
1628 | exclusive_or_expression '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1629 | exclusive_or_expression_error '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1631 | exclusive_or_expression '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1632 | exclusive_or_expression_error '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1635 inclusive_or_expression
1636 : exclusive_or_expression
1637 | inclusive_or_expression '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1638 | inclusive_or_expression_error '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1640 | inclusive_or_expression '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1641 | inclusive_or_expression_error '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1644 logical_and_expression
1645 : inclusive_or_expression
1646 | logical_and_expression AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1647 | logical_and_expression_error AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1650 logical_or_expression
1651 : logical_and_expression
1652 | logical_or_expression OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1653 | logical_or_expression_error OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1656 conditional_expression
1657 : logical_or_expression
1658 | logical_or_expression '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1659 | logical_or_expression '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1660 | logical_or_expression_error '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1661 | logical_or_expression_error '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1663 | logical_or_expression '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1664 | logical_or_expression '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1665 | logical_or_expression_error '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1666 | logical_or_expression_error '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1668 | logical_or_expression '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1669 | logical_or_expression '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1670 | logical_or_expression_error '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1671 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1673 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1674 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1675 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1676 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1679 assignment_expression:
1680 conditional_expression
1681 | unary_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1682 | unary_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1683 | conditional_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; } // TODO: Generate error here:
1684 | conditional_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; } // TODO: Generate error here:
1686 | unary_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1687 | unary_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1688 | conditional_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1689 | conditional_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1692 assignment_operator:
1694 | MUL_ASSIGN { $$ = MUL_ASSIGN; }
1695 | DIV_ASSIGN { $$ = DIV_ASSIGN; }
1696 | MOD_ASSIGN { $$ = MOD_ASSIGN; }
1697 | ADD_ASSIGN { $$ = ADD_ASSIGN; }
1698 | SUB_ASSIGN { $$ = SUB_ASSIGN; }
1699 | LEFT_ASSIGN { $$ = LEFT_ASSIGN; }
1700 | RIGHT_ASSIGN { $$ = RIGHT_ASSIGN; }
1701 | AND_ASSIGN { $$ = AND_ASSIGN; }
1702 | XOR_ASSIGN { $$ = XOR_ASSIGN; }
1703 | OR_ASSIGN { $$ = OR_ASSIGN; }
1707 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1708 | expression ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1709 | expression_error ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1710 | expression_error ')'
1713 expression_anon_inst:
1714 anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1715 | expression ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1716 | expression_error ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1719 postfix_expression_error:
1720 primary_expression_error
1721 | error { $$ = MkExpDummy(); $$.loc = @$; /*printf("Sorry, didn't mean that syntax error\n");*/ }
1722 | postfix_expression error
1723 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1725 | postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1726 | postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1728 | postfix_expression '(' argument_expression_list { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1729 | postfix_expression '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1730 /* Useless rules due to conflicts
1731 | postfix_expression '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; $$.call.argLoc.end.charPos++;}
1732 | postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; }
1734 | postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1736 | postfix_expression_error '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.call.argLoc.end.charPos++;}
1737 /* Useless rules due to conflicts
1738 | postfix_expression_error '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.call.argLoc.end.charPos++;}
1739 | postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1741 | postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1744 simple_postfix_expression_error:
1745 error { $$ = MkExpDummy(); $$.loc = @$; }
1746 | simple_postfix_expression error
1747 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1749 | simple_postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1750 | simple_postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1752 | simple_postfix_expression '(' argument_expression_list { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1753 | simple_postfix_expression '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1754 /* Useless rules due to conflicts
1755 | simple_postfix_expression '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; $$.call.argLoc.end.charPos++;}
1756 | simple_postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; }
1758 | simple_postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1760 | simple_postfix_expression_error '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.call.argLoc.end.charPos++;}
1761 /* Useless rules due to conflicts
1762 | simple_postfix_expression_error '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.call.argLoc.end.charPos++;}
1763 | simple_postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1765 | simple_postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1768 common_unary_expression_error:
1769 INC_OP unary_expression_error { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1770 | DEC_OP unary_expression_error { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1771 | unary_operator cast_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1772 | unary_operator anon_instantiation_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1773 | SIZEOF '(' unary_expression_error { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1774 | SIZEOF simple_unary_expression_error { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1775 | SIZEOF '(' guess_type_name ')' error { $$ = MkExpTypeSize($3); $$.loc = @$; }
1776 | SIZEOF '(' CLASS type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1777 | SIZEOF '(' CLASS guess_type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1780 unary_expression_error:
1781 common_unary_expression_error
1782 | postfix_expression_error
1785 simple_unary_expression_error:
1786 common_unary_expression_error
1787 | simple_postfix_expression_error
1791 cast_expression_error:
1792 unary_expression_error
1793 | '(' type_name ')' cast_expression_error { $$ = MkExpCast($2, $4); $$.loc = @$; }
1796 multiplicative_expression_error:
1797 cast_expression_error
1798 | multiplicative_expression '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1799 | multiplicative_expression '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1800 | multiplicative_expression '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1801 | multiplicative_expression_error '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1802 | multiplicative_expression_error '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1803 | multiplicative_expression_error '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1806 additive_expression_error:
1807 multiplicative_expression_error
1808 | additive_expression '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1809 /* Useless rules due to conflicts
1810 | additive_expression '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1812 | additive_expression '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1813 /* Useless rules due to conflicts
1814 | additive_expression '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1816 | additive_expression_error '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1817 /* Useless rules due to conflicts
1818 | additive_expression_error '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1820 | additive_expression_error '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1821 /* Useless rules due to conflicts
1822 | additive_expression_error '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1826 shift_expression_error:
1827 additive_expression_error
1828 | shift_expression LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1829 | shift_expression RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1830 | shift_expression_error LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1831 | shift_expression_error RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1834 relational_expression_error:
1835 shift_expression_error
1836 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression_error
1838 if($1.type == identifierExp)
1840 if($1.identifier._class && !$1.identifier._class.name)
1844 strcat(name, $1.identifier.string);
1845 _DeclClass(0, name);
1848 _DeclClass(0, $1.identifier.string);
1850 // printf("Declaring Class %s\n", $1.identifier.string);
1856 fileInput.Seek(@1.start.pos, start);
1857 resetScannerPos(&@1.start);
1862 YY_STACK_PRINT (yyss, yyssp);
1866 YY_STACK_PRINT (yyss, yyssp);
1870 YY_STACK_PRINT (yyss, yyssp);
1874 YY_STACK_PRINT (yyss, yyssp);
1882 $$ = MkExpOp($1, '<', $2);
1887 | relational_expression '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1888 | relational_expression LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1889 | relational_expression GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1890 | relational_expression_error '<' shift_expression_error { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1891 | relational_expression_error '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1892 | relational_expression_error LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1893 | relational_expression_error GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1896 equality_expression_error:
1897 relational_expression_error
1898 | equality_expression EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1899 | equality_expression NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1900 | equality_expression_error EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1901 | equality_expression_error NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1902 /* Useless rules due to conflicts
1903 | equality_expression EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1904 | equality_expression NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1905 | equality_expression_error EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1906 | equality_expression_error NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1908 | equality_expression EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1909 | equality_expression NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1910 | equality_expression_error EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1911 | equality_expression_error NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1914 and_expression_error:
1915 equality_expression_error
1916 | and_expression '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1917 | and_expression_error '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1919 | and_expression '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1920 | and_expression_error '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1923 exclusive_or_expression_error:
1924 and_expression_error
1925 | exclusive_or_expression '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1926 | exclusive_or_expression_error '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1928 | exclusive_or_expression '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1929 | exclusive_or_expression_error '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1932 inclusive_or_expression_error:
1933 exclusive_or_expression_error
1934 | inclusive_or_expression '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1935 | inclusive_or_expression_error '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1937 | inclusive_or_expression '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1938 | inclusive_or_expression_error '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1941 logical_and_expression_error:
1942 inclusive_or_expression_error
1943 | logical_and_expression AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1944 | logical_and_expression_error AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1947 logical_or_expression_error:
1948 logical_and_expression_error
1949 | logical_or_expression OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1950 | logical_or_expression_error OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1953 conditional_expression_error:
1954 logical_or_expression_error
1955 | logical_or_expression '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1956 | logical_or_expression '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1957 | logical_or_expression_error '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1958 | logical_or_expression_error '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1959 | logical_or_expression '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1960 | logical_or_expression '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1961 | logical_or_expression_error '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1962 | logical_or_expression_error '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1964 | logical_or_expression '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1965 | logical_or_expression '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1966 | logical_or_expression_error '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1967 | logical_or_expression_error '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1968 | logical_or_expression '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1969 | logical_or_expression '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1970 | logical_or_expression_error '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1971 | logical_or_expression_error '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1973 | logical_or_expression '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1974 | logical_or_expression '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1975 | logical_or_expression_error '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1976 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1978 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1979 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1980 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1981 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1983 | logical_or_expression '?' ':'
1985 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy());
1987 ((Expression)$$.cond.exp->last).loc = @2;
1988 $$.cond.elseExp.loc = @3;
1990 | logical_or_expression_error '?' ':'
1992 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @3;
1994 | logical_or_expression '?'
1996 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
1998 | logical_or_expression_error '?'
2000 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
2004 assignment_expression_error:
2005 conditional_expression_error
2006 | unary_expression assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2007 /* Useless rules due to conflicts
2008 | unary_expression assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
2010 | unary_expression_error assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2011 /* Useless rules due to conflicts
2012 | unary_expression_error assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
2015 | unary_expression assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2016 | unary_expression_error assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2020 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
2021 | assignment_expression error { $$ = MkList(); ListAdd($$, $1); }
2022 | expression ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
2023 | expression_error ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
2024 /* Useless rules due to conflicts
2025 | expression ',' error
2026 | expression_error ',' error
2029 | expression expression { $$ = $1; FreeList($2, FreeExpression); }
2030 | expression_error expression { $$ = $1; FreeList($2, FreeExpression); }
2031 | expression expression_error { $$ = $1; FreeList($2, FreeExpression); }
2034 expression_anon_inst_error:
2035 anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
2036 | anon_instantiation_expression error { $$ = MkList(); ListAdd($$, $1); }
2037 | expression ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
2038 | expression_error ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
2042 constant_expression: conditional_expression;
2044 constant_expression_error: conditional_expression_error;
2046 /**** TYPES **************************************************************************/
2047 storage_class_specifier:
2048 TYPEDEF { $$ = MkSpecifier(TYPEDEF); }
2049 | EXTERN { $$ = MkSpecifier(EXTERN); }
2050 | STATIC { $$ = MkSpecifier(STATIC); }
2051 | AUTO { $$ = MkSpecifier(AUTO); }
2052 | REGISTER { $$ = MkSpecifier(REGISTER); }
2055 external_storage_class_specifier:
2056 TYPEDEF { $$ = MkSpecifier(TYPEDEF); declMode = defaultAccess; }
2057 | EXTERN { $$ = MkSpecifier(EXTERN); }
2058 | STATIC { $$ = MkSpecifier(STATIC); declMode = staticAccess; }
2059 | AUTO { $$ = MkSpecifier(AUTO); }
2060 | REGISTER { $$ = MkSpecifier(REGISTER); }
2064 identifier { $$ = MkEnumerator($1, null); }
2065 | identifier '=' constant_expression { $$ = MkEnumerator($1, $3); }
2066 | identifier '=' constant_expression_error { $$ = MkEnumerator($1, $3); }
2070 enumerator { $$ = MkList(); ListAdd($$, $1); }
2071 | enumerator_list ',' enumerator { $$ = $1; ListAdd($1, $3); }
2072 | enumerator_list ','
2076 ENUM { memberAccessStack[++defaultMemberAccess] = publicAccess; }
2079 enum_specifier_nocompound:
2080 enum_specifier identifier { $$ = MkEnum($2, null); POP_DEFAULT_ACCESS }
2081 | enum_specifier strict_type { $$ = MkEnum(MkIdentifier($2.name), null); POP_DEFAULT_ACCESS }
2084 enum_specifier_compound:
2085 enum_specifier_compound_error '}' { $$.loc = @$; POP_DEFAULT_ACCESS $$ = $1; }
2086 | enum_specifier identifier '{' '}' { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2087 | enum_specifier strict_type '{' '}' { $$ = MkEnum(MkIdentifier($2.name), null); FreeSpecifier($2); $$.loc = @$; POP_DEFAULT_ACCESS }
2090 enum_specifier_compound_error:
2091 enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2092 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2094 | enum_specifier identifier '{' enumerator_list { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2095 | enum_specifier identifier '{' enumerator_list error { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2096 | enum_specifier identifier '{' error { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2097 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2098 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2100 | enum_specifier strict_type '{' enumerator_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2101 | enum_specifier strict_type '{' enumerator_list error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2102 | enum_specifier strict_type '{' error { $$ = MkEnum(MkIdentifier($2.name), null); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2103 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2104 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2108 enum_specifier identifier { $$ = $2; if(declMode) DeclClassAddNameSpace(globalContext.nextID++, $2.string); }
2109 | enum_specifier strict_type { $$ = MkIdentifier($2.name); if(declMode) DeclClass(globalContext.nextID++, $2.name); FreeSpecifier($2); }
2113 enum_class_error '}' { $$ = $1; $$.loc = @$; }
2114 | enum_decl ':' inheritance_specifiers '{' '}' { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2115 | enum_decl '{' '}' { $$ = MkEnum($1, null); POP_DEFAULT_ACCESS }
2119 enum_decl ':' inheritance_specifiers '{' enumerator_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2120 | enum_decl ':' inheritance_specifiers '{' enumerator_list error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2121 | enum_decl ':' inheritance_specifiers '{' error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2122 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2123 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2124 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2125 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2126 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2127 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list_error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2129 | enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2130 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2132 | enum_decl '{' enumerator_list { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2133 | enum_decl '{' enumerator_list error { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2134 | enum_decl '{' error { $$ = MkEnum($1, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2135 | enum_decl '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2136 | enum_decl '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2144 class_specifier_error:
2146 | struct_class_error
2150 EXT_STORAGE { $$ = MkSpecifierExtended(yytext); }
2151 | ext_decl { $$ = MkSpecifierExtended($1); delete $1; }
2155 CONST { $$ = MkSpecifier(CONST); }
2156 | VOLATILE { $$ = MkSpecifier(VOLATILE); }
2157 | ext_storage { $$ = $1; }
2161 type_qualifier_list:
2162 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2163 | type_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2167 VOID { $$ = MkSpecifier(VOID); }
2168 | CHAR { $$ = MkSpecifier(CHAR); }
2169 | SHORT { $$ = MkSpecifier(SHORT); }
2170 | INT { $$ = MkSpecifier(INT); }
2171 | UINT { $$ = MkSpecifier(UINT); }
2172 | INT64 { $$ = MkSpecifier(INT64); }
2173 | VALIST { $$ = MkSpecifier(VALIST); }
2174 | LONG { $$ = MkSpecifier(LONG); }
2175 | FLOAT { $$ = MkSpecifier(FLOAT); }
2176 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2177 | SIGNED { $$ = MkSpecifier(SIGNED); }
2178 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2179 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2180 | struct_or_union_specifier_nocompound
2181 | enum_specifier_nocompound
2183 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2184 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2185 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2186 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2187 | TYPED_OBJECT { $$ = MkSpecifier(TYPED_OBJECT); }
2188 | ANY_OBJECT { $$ = MkSpecifier(ANY_OBJECT); }
2191 strict_type_specifier:
2192 VOID { $$ = MkSpecifier(VOID); }
2193 | CHAR { $$ = MkSpecifier(CHAR); }
2194 | SHORT { $$ = MkSpecifier(SHORT); }
2195 | INT { $$ = MkSpecifier(INT); }
2196 | UINT { $$ = MkSpecifier(UINT); }
2197 | INT64 { $$ = MkSpecifier(INT64); }
2198 | VALIST { $$ = MkSpecifier(VALIST); }
2199 | LONG { $$ = MkSpecifier(LONG); }
2200 | FLOAT { $$ = MkSpecifier(FLOAT); }
2201 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2202 | SIGNED { $$ = MkSpecifier(SIGNED); }
2203 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2204 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2205 | struct_or_union_specifier_nocompound
2206 | enum_specifier_nocompound
2208 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2209 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2210 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2211 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2214 // TESTING declarator_nofunction here... For function declarations
2217 declarator_nofunction
2218 { $$ = MkStructDeclarator($1, null); $$.loc = @$; }
2219 | declarator_nofunction ext_attrib
2220 { $$ = MkStructDeclarator($1, null); $$.structDecl.attrib = $2; $$.loc = @$; }
2221 | ':' constant_expression
2222 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2223 | declarator_nofunction ':' constant_expression
2224 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2225 | declarator_nofunction ':' constant_expression ':' constant_expression
2226 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2227 | ':' constant_expression_error
2228 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2229 | declarator_nofunction ':' constant_expression_error
2230 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2231 | declarator_nofunction ':' constant_expression ':' constant_expression_error
2232 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2233 | declarator_nofunction ':' constant_expression_error ':' constant_expression_error
2234 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2235 | declarator_nofunction ':' constant_expression_error ':' constant_expression
2236 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2239 struct_declarator_list:
2240 struct_declarator { $$ = MkList(); ListAdd($$, $1); }
2241 | struct_declarator_list ',' struct_declarator { $$ = $1; ListAdd($1, $3); }
2245 struct_or_union identifier
2247 $$ = MkStructOrUnion($1, $2, null);
2248 $$.addNameSpace = true;
2249 $$.ctx = PushContext();
2251 | struct_or_union base_strict_type
2253 $$ = MkStructOrUnion($1, MkIdentifier($2.name), null);
2254 $$.ctx = PushContext();
2259 struct_or_union_specifier_compound:
2260 struct_or_union_specifier_compound_error '}' { $$ = $1; $$.loc = @$; }
2261 | struct_entry '{' '}' { $$ = $1; $$.loc = @$; POP_DEFAULT_ACCESS PopContext(curContext); }
2262 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2265 struct_or_union_specifier_compound_error:
2266 struct_entry '{' struct_declaration_list { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2267 | struct_entry '{' struct_declaration_list_error { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2268 | struct_entry '{' error { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2270 | struct_or_union '{' struct_declaration_list { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2271 | struct_or_union '{' struct_declaration_list_error { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2272 | struct_or_union '{' error { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2275 struct_or_union_specifier_nocompound:
2276 struct_entry { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2285 ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2288 | struct_entry '<' template_parameters_list '>'
2290 Symbol symbol = ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2292 symbol.templateParams = $3;
2297 struct_decl ':' inheritance_specifiers
2301 SetupBaseSpecs(null, $3);
2306 struct_class_error '}' { $$ = $1; $$.loc = @$; }
2307 | struct_head '{' '}'
2308 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2309 | struct_decl '{' '}' { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2310 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2314 struct_head '{' struct_declaration_list
2317 $$.definitions = $3;
2319 PopContext(curContext);
2321 | struct_head '{' struct_declaration_list_error
2324 $$.definitions = $3;
2326 PopContext(curContext);
2328 | struct_head '{' error
2329 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext);}
2331 | struct_decl '{' struct_declaration_list
2333 PopContext(curContext);
2336 $$ = MkStructOrUnion($1.type, $1.id, $3);
2341 $$.definitions = $3;
2344 | struct_decl '{' struct_declaration_list_error
2346 PopContext(curContext);
2350 $$ = MkStructOrUnion($1.type, $1.id, $3);
2355 $$.definitions = $3;
2358 | struct_decl '{' error
2359 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2361 | struct_or_union '{' struct_declaration_list
2362 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2363 | struct_or_union '{' struct_declaration_list_error
2364 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2365 | struct_or_union '{' error
2366 { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2370 STRUCT { $$ = structSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2371 | UNION { $$ = unionSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2374 specifier_qualifier_list:
2375 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2376 | specifier_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2377 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2378 | specifier_qualifier_list type_specifier { $$ = $1; ListAdd($1, $2); }
2379 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2380 | specifier_qualifier_list enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2381 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2382 | specifier_qualifier_list struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2385 guess_specifier_qualifier_list:
2386 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2387 | guess_specifier_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2388 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2389 | guess_specifier_qualifier_list type_specifier { $$ = $1; ListAdd($1, $2); }
2390 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2391 | guess_specifier_qualifier_list guess_type { $$ = $1; ListAdd($1, $2); }
2392 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2393 | guess_specifier_qualifier_list enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2394 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2395 | guess_specifier_qualifier_list struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2398 declaration_specifiers:
2399 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2400 | declaration_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2401 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2402 | declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2403 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2404 | declaration_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2405 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2406 | declaration_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2407 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2408 | declaration_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2411 guess_declaration_specifiers:
2412 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2413 | guess_declaration_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2414 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2415 | guess_declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2416 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2417 | guess_declaration_specifiers type_specifier { $$ = $1; ListAdd($1, $2); }
2418 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2419 | guess_declaration_specifiers guess_type { $$ = $1; ListAdd($1, $2); }
2420 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2421 | guess_declaration_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2422 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2423 | guess_declaration_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2426 external_guess_declaration_specifiers:
2427 external_storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2428 | external_guess_declaration_specifiers external_storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2429 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2430 | external_guess_declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2431 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2432 | external_guess_declaration_specifiers type_specifier { $$ = $1; ListAdd($1, $2); }
2433 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2434 | external_guess_declaration_specifiers guess_type { $$ = $1; ListAdd($1, $2); }
2435 | class_specifier { $$ = MkList(); ListAdd($$, $1); }
2436 | external_guess_declaration_specifiers class_specifier { $$ = $1; ListAdd($1, $2); }
2439 external_guess_declaration_specifiers_error:
2440 class_specifier_error { $$ = MkList(); ListAdd($$, $1); }
2441 | external_guess_declaration_specifiers class_specifier_error { $$ = $1; ListAdd($1, $2); }
2444 _inheritance_specifiers:
2445 PRIVATE { $$ = MkList(); ListAdd($$, MkSpecifier(PRIVATE)); }
2446 | PUBLIC { $$ = MkList(); ListAdd($$, MkSpecifier(PUBLIC)); }
2447 | storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2448 | _inheritance_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2449 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2450 | _inheritance_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2451 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2452 | _inheritance_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2454 { _DeclClass(0, $1.string); $$ = MkListOne(MkSpecifierName($1.string)); FreeIdentifier($1); }
2455 | _inheritance_specifiers identifier { $$ = $1; _DeclClass(0, $2.string); ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2); }
2457 | identifier '<' template_arguments_list '>'
2459 // if($1._class && !$1._class.name)
2463 strcpy(name, $1._class.name ? $1._class.name : "");
2465 strcat(name, $1.string);
2466 _DeclClass(0, name);
2469 _DeclClass(0, $1.string);
2472 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2475 | _inheritance_specifiers identifier '<' template_arguments_list '>'
2478 if($2._class && !$2._class.name)
2482 strcat(name, $2.string);
2483 _DeclClass(0, name);
2486 _DeclClass(0, $2.string);
2487 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2492 inheritance_specifiers:
2493 _inheritance_specifiers
2494 | struct_or_union { $$ = MkListOne(MkStructOrUnion($1, null, null)); POP_DEFAULT_ACCESS }
2497 property_specifiers:
2498 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2499 | property_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2500 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2501 | property_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2502 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2503 | property_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2504 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2505 | property_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2506 | identifier '<' template_arguments_list '>'
2508 // if($1._class && !$1._class.name)
2512 strcpy(name, $1._class.name ? $1._class.name : "");
2514 strcat(name, $1.string);
2515 _DeclClass(0, name);
2518 _DeclClass(0, $1.string);
2521 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2524 | property_specifiers identifier '<' template_arguments_list '>'
2526 if($2._class && !$2._class.name)
2530 strcat(name, $2.string);
2531 _DeclClass(0, name);
2534 _DeclClass(0, $2.string);
2535 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2541 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2542 | renew_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2543 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2544 | renew_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2545 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2546 | renew_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2547 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2548 | renew_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2549 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2550 | renew_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2551 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2552 | renew_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2553 | identifier '<' template_arguments_list '>'
2555 // if($1._class && !$1._class.name)
2559 strcpy(name, $1._class.name ? $1._class.name : "");
2561 strcat(name, $1.string);
2562 _DeclClass(0, name);
2565 _DeclClass(0, $1.string);
2568 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2571 | renew_specifiers identifier '<' template_arguments_list '>'
2573 if($2._class && !$2._class.name)
2577 strcat(name, $2.string);
2578 _DeclClass(0, name);
2581 _DeclClass(0, $2.string);
2582 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2588 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2589 | new_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2590 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2591 | new_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2592 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2593 | new_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2594 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2595 | new_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2596 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2597 | new_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2598 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2599 | new_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2600 | identifier '<' template_arguments_list '>'
2602 // if($1._class && !$1._class.name)
2606 strcpy(name, $1._class.name ? $1._class.name : "");
2608 strcat(name, $1.string);
2609 _DeclClass(0, name);
2612 _DeclClass(0, $1.string);
2615 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2618 | new_specifiers identifier '<' template_arguments_list '>'
2620 if($2._class && !$2._class.name)
2624 strcat(name, $2.string);
2625 _DeclClass(0, name);
2628 _DeclClass(0, $2.string);
2629 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2634 identifier_list_error:
2635 identifier_list ',' error { $$ = $1; ListAdd($1, null); }
2636 | identifier_list_error ',' error { $$ = $1; ListAdd($1, null); }
2640 identifier { $$ = MkList(); ListAdd($$, MkTypeName(null, MkDeclaratorIdentifier($1))); }
2641 | identifier_list ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2642 | identifier_list_error ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2643 | parameter_list ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2644 | parameter_list_error ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2647 direct_declarator_nofunction:
2648 identifier { $$ = MkDeclaratorIdentifier($1); }
2649 | '(' declarator ')' { $$ = MkDeclaratorBrackets($2); }
2650 | direct_declarator_nofunction '[' constant_expression ']' { $$ = MkDeclaratorArray($1, $3); }
2651 | direct_declarator_nofunction '[' constant_expression_error ']' { $$ = MkDeclaratorArray($1, $3); }
2652 | direct_declarator_nofunction '[' type ']' { $$ = MkDeclaratorEnumArray($1, $3); }
2653 | direct_declarator_nofunction '[' ']' { $$ = MkDeclaratorArray($1, null); }
2656 direct_declarator_function_start:
2657 direct_declarator_nofunction '('
2660 direct_declarator_function:
2661 direct_declarator_function_start parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2662 | direct_declarator_function_start parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2663 | direct_declarator_function_start identifier_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2664 | direct_declarator_function_start identifier_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2665 | direct_declarator_function_start ')' { $$ = MkDeclaratorFunction($1, null); }
2668 // Tricky stuff here for overriding...
2669 direct_declarator_function_error:
2670 direct_declarator_function_start identifier_list_error
2672 $$ = MkDeclaratorFunction($1, $2);
2673 fileInput.Seek(@1.end.pos, start);
2675 resetScannerPos(&@1.end);
2676 @$.start = @1.start;
2679 | direct_declarator_function_start error
2681 $$ = MkDeclaratorFunction($1, null);
2682 fileInput.Seek(@1.end.pos, start);
2684 resetScannerPos(&@1.end);
2685 @$.start = @1.start;
2688 | direct_declarator_function_start parameter_list '('
2690 $$ = MkDeclaratorFunction($1, $2);
2691 fileInput.Seek(@1.end.pos, start);
2693 resetScannerPos(&@1.end);
2694 @$.start = @1.start;
2697 | direct_declarator_function_start guess_declaration_specifiers identifier '('
2699 $$ = MkDeclaratorFunction($1, null);
2700 fileInput.Seek(@1.end.pos, start);
2702 resetScannerPos(&@1.end);
2703 @$.start = @1.start;
2705 FreeList($2, FreeSpecifier);
2711 direct_declarator_function
2712 | direct_declarator_nofunction
2713 | ext_decl direct_declarator_function
2714 { $$ = MkDeclaratorExtended($1, $2); }
2715 | ext_decl direct_declarator_nofunction
2716 { $$ = MkDeclaratorExtended($1, $2); }
2721 ASM '(' STRING_LITERAL { $<string>$ = CopyString(yytext); } STRING_LITERAL { $<string>$ = CopyString(yytext); }
2724 strcpy(temp, "__asm__(");
2725 strcat(temp, $<string>4);
2727 strcat(temp, $<string>6);
2730 $<string>$ = CopyString(temp);
2735 EXT_DECL { $$ = CopyString(yytext); }
2740 strcpy(temp, $<string>1);
2743 $$ = CopyString(temp);
2745 | asm_start STRING_LITERAL { $$ = CopyString(yytext); } ')'
2748 strcpy(temp, $<string>1);
2750 strcat(temp, $<string>3);
2754 $$ = CopyString(temp);
2760 EXT_DECL { $$ = CopyString(yytext); }
2762 | ASM '(' string_literal ')'
2765 strcpy(temp, "__asm__(");
2768 $$ = CopyString(temp);
2774 EXT_ATTRIB { $$ = CopyString(yytext); }
2778 direct_abstract_declarator:
2779 '(' abstract_declarator ')'
2780 { $$ = MkDeclaratorBrackets($2); }
2782 { $$ = MkDeclaratorArray(null, null); }
2783 | '[' constant_expression ']'
2784 { $$ = MkDeclaratorArray(null, $2); }
2785 | '[' constant_expression_error ']'
2786 { $$ = MkDeclaratorArray(null, $2); }
2788 { $$ = MkDeclaratorEnumArray(null, $2); }
2789 | direct_abstract_declarator '[' ']'
2790 { $$ = MkDeclaratorArray($1, null); }
2791 | direct_abstract_declarator '[' constant_expression ']'
2792 { $$ = MkDeclaratorArray($1, $3); }
2793 | direct_abstract_declarator '[' type']'
2794 { $$ = MkDeclaratorEnumArray($1, $3); }
2795 | direct_abstract_declarator '[' constant_expression_error ']'
2796 { $$ = MkDeclaratorArray($1, $3); }
2798 { $$ = MkDeclaratorFunction(null, null); }
2799 | '(' parameter_type_list ')'
2800 { $$ = MkDeclaratorFunction(null, $2); }
2801 | '(' parameter_type_list_error ')'
2802 { $$ = MkDeclaratorFunction(null, $2); }
2803 | direct_abstract_declarator '(' ')'
2804 { $$ = MkDeclaratorFunction($1, null); }
2805 | direct_abstract_declarator '(' parameter_type_list ')'
2806 { $$ = MkDeclaratorFunction($1, $3); }
2807 | direct_abstract_declarator '(' parameter_type_list_error ')'
2808 { $$ = MkDeclaratorFunction($1, $3); }
2811 direct_abstract_declarator_noarray:
2812 '(' abstract_declarator_noarray ')'
2813 { $$ = MkDeclaratorBrackets($2); }
2815 { $$ = MkDeclaratorFunction(null, null); }
2816 | '(' parameter_type_list ')'
2817 { $$ = MkDeclaratorFunction(null, $2); }
2818 | '(' parameter_type_list_error ')'
2819 { $$ = MkDeclaratorFunction(null, $2); }
2820 | direct_abstract_declarator_noarray '(' ')'
2821 { $$ = MkDeclaratorFunction($1, null); }
2822 | direct_abstract_declarator_noarray '(' parameter_type_list ')'
2823 { $$ = MkDeclaratorFunction($1, $3); }
2824 | direct_abstract_declarator_noarray '(' parameter_type_list_error ')'
2825 { $$ = MkDeclaratorFunction($1, $3); }
2829 '*' { $$ = MkPointer(null, null); }
2830 | '*' type_qualifier_list { $$ = MkPointer($2, null); }
2831 | '*' pointer { $$ = MkPointer(null, $2); }
2832 | '*' type_qualifier_list pointer { $$ = MkPointer($2, $3); }
2835 abstract_declarator:
2836 pointer { $$ = MkDeclaratorPointer($1, null); }
2837 | direct_abstract_declarator
2838 | pointer direct_abstract_declarator { $$ = MkDeclaratorPointer($1, $2); }
2839 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
2840 | ext_decl direct_abstract_declarator { $$ = MkDeclaratorExtended($1, $2); }
2841 | ext_decl pointer direct_abstract_declarator { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2844 abstract_declarator_noarray:
2845 pointer { $$ = MkDeclaratorPointer($1, null); }
2846 | direct_abstract_declarator_noarray
2847 | pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorPointer($1, $2); }
2848 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
2849 | ext_decl direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, $2); }
2850 | ext_decl pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2855 | pointer direct_declarator
2856 { $$ = MkDeclaratorPointer($1, $2); }
2857 | ext_decl pointer direct_declarator
2858 { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2859 | declarator ext_decl
2860 { $$ = MkDeclaratorExtendedEnd($2, $1); }
2863 declarator_function:
2864 direct_declarator_function
2865 | pointer direct_declarator_function { $$ = MkDeclaratorPointer($1, $2); }
2866 | ext_decl direct_declarator_function { $$ = MkDeclaratorExtended($1, $2); }
2867 | ext_decl pointer direct_declarator_function { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2868 | pointer ext_decl direct_declarator_function { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2871 declarator_function_error:
2872 direct_declarator_function_error
2873 | pointer direct_declarator_function_error { $$ = MkDeclaratorPointer($1, $2); }
2874 | ext_decl direct_declarator_function_error { $$ = MkDeclaratorExtended($1, $2); }
2875 | ext_decl pointer direct_declarator_function_error { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2876 | pointer ext_decl direct_declarator_function_error { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2879 declarator_nofunction:
2880 direct_declarator_nofunction
2881 | pointer direct_declarator_nofunction { $$ = MkDeclaratorPointer($1, $2); }
2882 | ext_decl direct_declarator_nofunction { $$ = MkDeclaratorExtended($1, $2); }
2883 | ext_decl pointer direct_declarator_nofunction { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2884 | pointer ext_decl direct_declarator_nofunction { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2888 assignment_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2889 | '{' initializer_list '}' { $$ = MkInitializerList($2); $$.loc = @$; }
2890 | '{' initializer_list ',' '}'
2892 $$ = MkInitializerList($2);
2896 Expression exp = MkExpDummy();
2897 Initializer init = MkInitializerAssignment(exp);
2906 assignment_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2907 | '{' initializer_list '}' error { $$ = MkInitializerList($2); $$.loc = @$; }
2908 | '{' initializer_list { $$ = MkInitializerList($2); $$.loc = @$; }
2909 | '{' initializer_list ',' '}' error
2911 $$ = MkInitializerList($2);
2915 Expression exp = MkExpDummy();
2916 Initializer init = MkInitializerAssignment(exp);
2922 | '{' initializer_list ','
2924 $$ = MkInitializerList($2);
2928 Expression exp = MkExpDummy();
2929 Initializer init = MkInitializerAssignment(exp);
2937 initializer_condition:
2938 conditional_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2939 | anon_instantiation_expression
2940 { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2943 initializer_condition_error:
2944 conditional_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2945 | anon_instantiation_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2949 initializer { $$ = MkList(); ListAdd($$, $1); }
2950 | initializer_error { $$ = MkList(); ListAdd($$, $1); }
2951 | initializer_list ',' initializer { $$ = $1; ListAdd($1, $3); }
2952 | initializer_list ',' initializer_error { $$ = $1; ListAdd($1, $3); }
2955 | initializer_list initializer { $$ = $1; ListAdd($1, $2); }
2956 | initializer_list initializer_error { $$ = $1; ListAdd($1, $2); }
2960 declarator { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
2961 | declarator '=' initializer { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
2964 init_declarator_error:
2965 declarator error { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
2966 /* Useless rules due to conflicts
2967 | declarator '=' error { $$ = MkInitDeclarator($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.initializer.loc = @2; $$.initializer.exp.loc = @2; }
2969 | declarator '=' initializer_error { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
2972 init_declarator_list:
2973 init_declarator { $$ = MkList(); ListAdd($$, $1); }
2974 | init_declarator_list ',' init_declarator { $$ = $1; ListAdd($1, $3); }
2975 | init_declarator_list_error ',' init_declarator { $$ = $1; ListAdd($1, $3); }
2978 init_declarator_list_error:
2979 init_declarator_error { $$ = MkList(); ListAdd($$, $1); }
2980 | init_declarator error { $$ = MkList(); ListAdd($$, $1); }
2981 | init_declarator_list ',' init_declarator_error { $$ = $1; ListAdd($1, $3); }
2982 | init_declarator_list_error ',' init_declarator_error { $$ = $1; ListAdd($1, $3); }
2986 specifier_qualifier_list { $$ = MkTypeName($1, null); }
2987 | specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
2991 guess_specifier_qualifier_list { $$ = MkTypeName($1, null); }
2992 | guess_specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
2995 /*** PARAMETERS **********************************************************************/
2996 parameter_declaration:
2997 guess_declaration_specifiers declarator { $$ = MkTypeName($1, $2); }
2998 | guess_declaration_specifiers abstract_declarator { $$ = MkTypeName($1, $2); }
2999 | guess_declaration_specifiers '&' { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), null)); }
3000 | guess_declaration_specifiers '&' declarator { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), $3)); }
3001 | guess_declaration_specifiers { $$ = MkTypeName($1, null); }
3003 { $$ = MkTypeName(MkListOne(MkSpecifier(CLASS)), null); }
3006 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), null); }
3008 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), null)); }
3009 | TYPED_OBJECT declarator
3010 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), $2); }
3011 | TYPED_OBJECT '&' declarator
3012 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), $3)); }
3014 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), null); }
3015 | ANY_OBJECT declarator
3016 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), $2); }
3020 parameter_declaration_error:
3021 guess_declaration_specifiers declarator error { $$ = MkTypeName($1, $2); }
3022 | guess_declaration_specifiers abstract_declarator error { $$ = MkTypeName($1, $2); }
3026 parameter_declaration { $$ = MkList(); ListAdd($$, $1); }
3027 | parameter_list ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3028 | parameter_list error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3029 | parameter_list_error ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3030 | parameter_list_error error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3031 | error ',' parameter_declaration { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3033 | identifier_list ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3034 | identifier_list error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3035 | identifier_list_error ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3036 | identifier_list_error error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3039 parameter_list_error:
3040 parameter_declaration_error { $$ = MkList(); ListAdd($$, $1); }
3041 | parameter_list ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3042 | parameter_list_error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3043 | parameter_list_error error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $4); }
3044 | error ',' parameter_declaration_error { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3046 | identifier_list ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3047 | identifier_list_error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3048 | identifier_list_error error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $4); }
3051 parameter_type_list:
3053 | parameter_list ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3054 | parameter_list_error ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3055 | identifier_list ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3056 | identifier_list_error ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3057 | error ',' ELLIPSIS { $$ = MkList(); ListAdd($$, MkTypeName(null, null)); }
3060 parameter_type_list_error:
3061 parameter_list_error
3062 | parameter_list ',' error { $$ = $1; ListAdd($1, null); }
3063 | parameter_list_error error
3066 /****** STATEMENTS *******************************************************************/
3069 | EXT_ATTRIB { $$ = MkExpressionStmt(null); } // Ignoring this for now... ( For __attribute__ ((__unused__)) )
3070 | compound_statement
3071 | ';' { $$ = MkExpressionStmt(null); }
3072 | ':' { $$ = MkExpressionStmt(null); }
3073 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3074 | selection_statement
3075 | iteration_statement
3080 | watch_definition ';'
3084 labeled_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3085 | iteration_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3086 | compound_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3087 | selection_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3088 | jump_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3089 | jump_statement error { $$ = $1; Compiler_Error($"syntax error\n"); }
3090 | expression_error { $$ = MkExpressionStmt($1); Compiler_Error($"syntax error\n"); $$.loc = @1; }
3094 string_literal { $$ = MkAsmField($1, null); $$.loc = @1; }
3095 | string_literal '(' assignment_expression ')' { $$ = MkAsmField($1, $3); $$.loc = @$; }
3099 asm_field { $$ = MkListOne($1); }
3100 | asm_field_list ',' asm_field { ListAdd($$, $3); }
3105 ASM type_qualifier '(' string_literal ')' ';' { $$ = MkAsmStmt($2, $4, null, null, null); $$.loc = @$; }
3106 | ASM type_qualifier '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, null); $$.loc = @$; }
3107 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, null); $$.loc = @$; }
3108 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, $10); $$.loc = @$; }
3110 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, null); $$.loc = @$; }
3111 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, $8); $$.loc = @$; }
3112 | ASM type_qualifier '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, $8); $$.loc = @$; }
3114 | ASM '(' string_literal ')' ';' { $$ = MkAsmStmt(null, $3, null, null, null); $$.loc = @$; }
3115 | ASM '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, null); $$.loc = @$; }
3116 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, null); $$.loc = @$; }
3117 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, $9); $$.loc = @$; }
3119 | ASM '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, null); $$.loc = @$; }
3120 | ASM '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, $7); $$.loc = @$; }
3121 | ASM '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, $7); $$.loc = @$; }
3125 identifier ':' statement { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3126 | CASE constant_expression ':' statement { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3127 | CASE constant_expression_error ':' statement { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3128 | CASE ':' statement { $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3129 | DEFAULT ':' statement { $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3132 labeled_statement_error
3133 : identifier ':' statement_error { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3134 | CASE constant_expression ':' statement_error { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3135 | CASE constant_expression_error ':' statement_error { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3136 | CASE ':' statement_error { $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3137 | CASE ':' { $$ = MkCaseStmt(MkExpDummy(), null); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3138 | DEFAULT ':' statement_error { $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3139 | DEFAULT ':' { $$ = MkCaseStmt(null, null); $$.loc = @$; }
3143 PUBLIC { $$ = declMode = publicAccess; }
3144 | PRIVATE { $$ = declMode = privateAccess; }
3145 | DEFAULT { $$ = declMode = defaultAccess; }
3149 PUBLIC { $$ = publicAccess; }
3150 | PRIVATE { $$ = privateAccess; }
3154 declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3155 | declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3156 | instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3157 | declaration_error ';' { $$ = $1; }
3160 external_guess_declaration:
3161 external_guess_declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3162 | external_guess_declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3163 | external_guess_declaration_specifiers_error init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3165 | external_guess_instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3166 | DEFINE identifier '=' conditional_expression ';' { $$ = MkDeclarationDefine($2, $4); $$.loc = @$; }
3167 | STATIC DEFINE identifier '=' conditional_expression ';' { declMode = staticAccess; $$ = MkDeclarationDefine($3, $5); $$.loc = @$; }
3170 external_guess_declaration_error:
3171 external_guess_declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; yyerrok; }
3175 declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; }
3176 | declaration_error error {}
3178 | instantiation_named_error error { $$ = MkDeclarationInst($1); $$.loc = @$; }
3179 | instantiation_named error { $$ = MkDeclarationInst($1); $$.loc = @$; }
3180 | declaration_specifiers init_declarator_list_error { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3184 declaration { $$ = MkList(); ListAdd($$, $1); /*declMode = defaultDeclMode;*/ }
3185 | declaration_list declaration { $$ = $1; ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3186 | declaration_list_error declaration { $$ = $1; ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3187 | declaration_list error ';' { $$ = $1; }
3190 declaration_list_error:
3191 declaration_error { $$ = MkList(); ListAdd($$, $1); }
3192 | declaration_list declaration_error { $$ = $1; ListAdd($1, $2); }
3196 statement { $$ = MkList(); ListAdd($$, $1); }
3197 | statement_list statement { $$ = $1; ListAdd($1, $2); }
3198 | statement_list_error statement { $$ = $1; ListAdd($1, $2); }
3201 statement_list_error:
3202 statement_error { $$ = MkList(); ListAdd($$, $1); }
3203 | statement_list statement_error { $$ = $1; ListAdd($1, $2); }
3204 | statement_list_error statement_error { $$ = $1; ListAdd($1, $2); }
3205 | statement_list declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3206 | statement_list_error declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3207 | statement_list declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3208 | statement_list_error declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3212 statement_list { $$ = MkCompoundStmt(null, $1); }
3213 | declaration_list { $$ = MkCompoundStmt($1, null); }
3214 | declaration_list statement_list { $$ = MkCompoundStmt($1, $2); }
3215 | declaration_list_error statement_list { $$ = MkCompoundStmt($1, $2); }
3218 compound_inside_error:
3219 statement_list_error { $$ = MkCompoundStmt(null, $1); }
3220 | declaration_list_error { $$ = MkCompoundStmt($1, null); }
3221 | declaration_list statement_list_error { $$ = MkCompoundStmt($1, $2); }
3222 | declaration_list_error statement_list_error { $$ = MkCompoundStmt($1, $2); }
3226 '{' { $<context>$ = PushContext(); }
3230 compound_statement_error '}' { $$ = $1; $$.loc = @$; }
3233 compound_statement_error:
3234 compound_start compound_inside_error
3235 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3237 { $$ = MkCompoundStmt(null, null); $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3239 | compound_start compound_inside
3240 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3244 expression_statement:
3245 ';' { $$ = MkExpressionStmt(null); $$.loc = @$; }
3246 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3247 | expression_error ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3250 selection_statement:
3251 IF '(' expression ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3252 | IF '(' expression_error ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3253 | IF '(' expression ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3254 | IF '(' expression_error ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3255 | SWITCH '(' expression ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3256 | SWITCH '(' expression_error ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3259 selection_statement_error:
3260 IF '(' expression_error { $$ = MkIfStmt($3, null, null); $$.loc = @$; }
3261 | selection_statement error
3264 iteration_statement:
3265 WHILE '(' expression ')' statement { $$ = MkWhileStmt($3, $5); $$.loc = @$; }
3266 | WHILE '(' expression_error statement { $$ = MkWhileStmt($3, $4); $$.loc = @$; }
3267 | WHILE '(' ')' statement { $$ = MkWhileStmt(null, $4); $$.loc = @$; }
3269 | DO statement WHILE '(' expression ')' ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3270 | DO statement WHILE '(' expression_error ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3272 | FOR '(' expression_statement expression_statement ')' statement { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; }
3273 | FOR '(' expression_statement ')' statement { $$ = MkForStmt($3, null, null, $5); $$.loc = @$; }
3274 | FOR '(' expression_statement expression_statement expression ')' statement { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; }
3275 | FOR '(' expression_statement expression_statement expression_error statement { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; }
3276 | FOR '(' ')' statement { $$ = MkForStmt(null, null, null, $4); $$.loc = @$; }
3278 | FOR '(' identifier ':' expression ')' statement { $$ = MkForEachStmt($3, $5, null, $7); $$.loc = @$; }
3279 | FOR '(' identifier ':' expression ';' expression ')' statement { $$ = MkForEachStmt($3, $5, $7, $9); $$.loc = @$; }
3282 iteration_statement_error:
3283 FOR '(' error { $$ = MkForStmt(null, null, null, null); $$.loc = @$; } |
3284 FOR '(' expression_error error { $$ = MkForStmt(MkExpressionStmt($3), null, null, null); $$.forStmt.init.loc = @3; $$.loc = @$; } |
3285 FOR '(' expression_statement error { $$ = MkForStmt($3, null, null, null); $$.loc = @$; } |
3286 FOR '(' expression_statement expression_error error { $$ = MkForStmt($3, MkExpressionStmt($4), null, null); $$.loc = @$; $$.forStmt.check.loc = @4; } |
3287 /* Useless rules due to conflicts
3288 FOR '(' expression_statement expression_statement error { $$ = MkForStmt($3, $4, null, null); $$.loc = @$; } |
3290 FOR '(' expression_statement expression_statement expression_error { $$ = MkForStmt($3, $4, $5, null); $$.loc = @$; } |
3291 FOR '(' expression_statement expression_statement ')' statement_error { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; } |
3292 FOR '(' expression_statement expression_statement expression ')' statement_error { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; } |
3293 FOR '(' expression_statement expression_statement expression_error statement_error { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; } |
3295 DO statement WHILE '(' expression ')' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3296 DO statement WHILE '(' expression { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3297 DO statement WHILE '(' expression_error { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3298 DO statement WHILE '(' { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3299 DO statement WHILE { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3300 DO statement { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3301 DO { $$ = MkDoWhileStmt(null, null); $$.loc = @$; } |
3304 WHILE error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3305 /* Useless rules due to conflicts
3306 WHILE '(' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3308 WHILE '(' ')' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3309 WHILE '(' expression_error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3310 /* Useless rules due to conflicts
3311 WHILE '(' expression_error error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3313 WHILE '(' expression ')' statement_error { $$ = MkWhileStmt($3, $5); $$.loc = @$; } |
3314 WHILE '(' expression_error statement_error { $$ = MkWhileStmt($3, $4 ); $$.loc = @$; }
3318 GOTO identifier ';' { $$ = MkGotoStmt($2); $$.loc = @$; }
3319 | CONTINUE ';' { $$ = MkContinueStmt(); $$.loc = @$; }
3320 | BREAK ';' { $$ = MkBreakStmt(); $$.loc = @$; }
3321 | RETURN ';' { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc = @2; }
3322 | RETURN expression ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3323 | RETURN expression_error ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3324 | RETURN anon_instantiation_expression ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3325 | RETURN anon_instantiation_expression_error ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3328 jump_statement_error:
3329 RETURN expression_error { $$ = MkReturnStmt($2); $$.loc = @$; } |
3330 RETURN anon_instantiation_expression_error { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; } |
3331 RETURN { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc.start = exp.loc.end = @1.end; } |
3332 GOTO { $$ = MkGotoStmt(null); $$.loc = @$; }
3335 /*************************************************************************************/
3337 function_definition:
3338 external_guess_declaration_specifiers declarator_function declaration_list compound_statement { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; }
3339 | external_guess_declaration_specifiers declarator_function compound_statement
3340 { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; }
3342 | declarator_function declaration_list compound_statement { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; }
3343 | declarator_function compound_statement { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$;}
3345 function_definition_error:
3346 external_guess_declaration_specifiers declarator_function declaration_list compound_statement_error { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; $$.loc.end = $4.loc.end; }
3347 | external_guess_declaration_specifiers declarator_function compound_statement_error { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3348 | declarator_function declaration_list compound_statement_error { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3349 | declarator_function compound_statement_error { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
3353 STRING_LITERAL { $$ = CopyString(yytext); }
3354 | string_literal STRING_LITERAL
3356 int len1 = strlen($1);
3357 int len2 = strlen(yytext);
3358 $$ = new byte[len1-1 + len2-1 + 1];
3359 memcpy($$, $1, len1-1);
3360 memcpy($$ + len1-1, yytext+1, len2);
3365 external_declaration:
3366 function_definition { $$ = MkExternalFunction($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3368 { $$ = MkExternalClass($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3370 | external_guess_declaration_specifiers class
3371 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; FreeList($1, FreeSpecifier); }
3373 | external_guess_declaration
3374 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3375 | IMPORT string_literal { $$ = MkExternalImport($2, normalImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3376 | IMPORT STATIC string_literal { $$ = MkExternalImport($3, staticImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3377 | IMPORT identifier string_literal
3379 bool isRemote = !strcmp($2.string, "remote");
3380 $$ = MkExternalImport($3, isRemote ? remoteImport : normalImport, (declMode != defaultAccess) ? declMode : privateAccess);
3387 | ';' { $$ = null; }
3389 | declaration_mode function_definition { $$ = MkExternalFunction($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3390 | declaration_mode class
3391 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; declMode = defaultDeclMode; }
3392 | declaration_mode external_guess_declaration { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3393 | declaration_mode IMPORT string_literal { $$ = MkExternalImport($3, normalImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; declMode = defaultDeclMode; }
3394 | declaration_mode IMPORT STATIC string_literal { $$ = MkExternalImport($4, staticImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; declMode = defaultDeclMode; }
3395 | declaration_mode IMPORT identifier string_literal
3397 bool isRemote = !strcmp($3.string, "remote");
3398 $$ = MkExternalImport($4, isRemote ? remoteImport : normalImport, ($1 != defaultAccess) ? $1 : privateAccess);
3401 declMode = defaultDeclMode;
3405 | declaration_mode ':' { defaultDeclMode = $1; $$ = null; }
3406 | STATIC ':' { defaultDeclMode = staticAccess; $$ = null; }
3407 | NAMESPACE identifier { $$ = MkExternalNameSpace($2); $$.loc = @$; }
3408 | NAMESPACE strict_type { $$ = MkExternalNameSpace(MkIdentifier($2.name)); FreeSpecifier($2); $$.loc = @$; }
3409 | dbtable_definition { $$ = MkExternalDBTable($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3410 | declaration_mode dbtable_definition { $$ = MkExternalDBTable($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3413 external_declaration_error:
3414 class_error { $$ = MkExternalClass($1); $$.loc = $1.loc; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3415 | external_guess_declaration_specifiers class_error
3417 FreeList($1, FreeSpecifier);
3418 $$ = MkExternalClass($2);
3420 $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess;
3421 declMode = defaultDeclMode;
3423 | function_definition_error { $$ = MkExternalFunction($1); $$.loc = $1.loc; $1.declMode = declMode; declMode = defaultDeclMode; }
3425 | declaration_mode class_error { $$ = MkExternalClass($2); $$.loc = $2.loc; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; declMode = defaultDeclMode; }
3426 | declaration_mode function_definition_error { $$ = MkExternalFunction($2); $$.loc = $2.loc; $2.declMode = $1; declMode = defaultDeclMode; }
3428 | external_guess_declaration_error
3429 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3430 | declaration_mode external_guess_declaration_error { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3433 translation_unit_error:
3434 external_declaration_error { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3435 | translation_unit external_declaration_error { $$ = $1; ListAdd($1, $2); }
3436 | translation_unit_error external_declaration_error { $$ = $1; ListAdd($1, $2); }
3437 | translation_unit error
3438 | translation_unit_error error
3442 external_declaration { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3443 | translation_unit external_declaration { $$ = $1; ListAdd($1, $2); }
3444 | translation_unit_error class
3445 { External _class = MkExternalClass($2); $$ = $1; ListAdd($1, _class); _class.loc = @2; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3446 | translation_unit_error declaration_mode class
3447 { External _class = MkExternalClass($3); $$ = $1; ListAdd($1, _class); _class.loc = @3; $3.declMode = ($2 != defaultAccess) ? $2 : privateAccess; declMode = defaultDeclMode; }
3452 | translation_unit_error
3453 | { ast = MkList(); }
3457 DBTABLE string_literal identifier '{' dbfield_definition_list '}' { Symbol symbol = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3458 | DBTABLE string_literal strict_type '{' dbfield_definition_list '}' { Symbol symbol = DeclClass(globalContext.nextID++, $3.name); FreeSpecifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3459 | DBTABLE string_literal '{' dbfield_definition_list '}' { $$ = MkDBTableDef($2, null, $4); }
3463 guess_declaration_specifiers identifier string_literal ';' { $$ = MkDBFieldEntry(MkTypeName($1, null), $2, $3); }
3467 identifier { $$ = MkDBIndexItem($1, ascending); }
3468 | '>' identifier { $$ = MkDBIndexItem($2, descending); }
3469 | '<' identifier { $$ = MkDBIndexItem($2, ascending); }
3473 dbindex_item { $$ = MkList(); ListAdd($$, $1); }
3474 | dbindex_item_list ',' dbindex_item { ListAdd($1, $3); }
3478 DBINDEX dbindex_item_list ';' { $$ = MkDBIndexEntry($2, null); }
3479 | DBINDEX dbindex_item_list identifier ';' { $$ = MkDBIndexEntry($2, $3); }
3482 dbfield_definition_list:
3483 dbfield_entry { $$ = MkList(); ListAdd($$, $1); }
3484 | dbindex_entry { $$ = MkList(); ListAdd($$, $1); }
3485 | dbfield_definition_list dbfield_entry { ListAdd($1, $2); }
3486 | dbfield_definition_list dbindex_entry { ListAdd($1, $2); }
3490 DATABASE_OPEN '(' assignment_expression ',' assignment_expression ')' { $$ = MkExpDBOpen($3, $5); }
3494 DBFIELD '(' string_literal ',' identifier ')' { $$ = MkExpDBField($3, $5); }
3498 DBINDEX '(' string_literal ',' identifier ')' { $$ = MkExpDBIndex($3, $5); }
3502 DBTABLE '(' string_literal ')' { $$ = MkExpDBTable($3); }