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); }
1271 class_entry identifier { $1; $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1272 | class_entry base_strict_type
1274 $1; $$ = DeclClass(globalContext.nextID++, $2.name);
1277 ++defaultMemberAccess;
1278 memberAccessStack[defaultMemberAccess] = privateAccess;
1280 | identifier class_entry identifier { $2; $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1281 | identifier class_entry base_strict_type { $2; $$ = DeclClass(globalContext.nextID++, $3.name); FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1283 | class_entry identifier '<' template_parameters_list '>' { $1; $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); $$.templateParams = $4; FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1284 | class_entry base_strict_type '<' template_parameters_list '>'
1286 $1; $$ = DeclClass(globalContext.nextID++, $2.name);
1287 $$.templateParams = $4;
1290 ++defaultMemberAccess;
1291 memberAccessStack[defaultMemberAccess] = privateAccess;
1293 | 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; }
1294 | 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; }
1304 // Added this for unit classes...
1307 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1309 PopContext(curContext);
1312 | class_decl '{' '}'
1314 $$ = MkClass($1, null, MkList()); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1316 PopContext(curContext);
1318 | class_head '{' '}'
1320 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1322 PopContext(curContext);
1325 | class_entry identifier ';'
1327 $1; $$ = MkClass(DeclClassAddNameSpace(0, $2.string), null, null); FreeIdentifier($2);
1329 PopContext(curContext);
1331 | class_entry type ';'
1333 $1; $$ = MkClass(DeclClass(0, $2.name), null, null); FreeSpecifier($2);
1335 PopContext(curContext);
1340 class_decl ':' inheritance_specifiers
1342 $$ = MkClass($1, $3, null);
1347 class_decl '{' struct_declaration_list_error
1349 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1351 PopContext(curContext);
1353 | class_head '{' struct_declaration_list_error
1355 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1357 PopContext(curContext);
1359 | class_decl '{' struct_declaration_list
1361 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1363 PopContext(curContext);
1365 | class_head '{' struct_declaration_list
1367 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1369 PopContext(curContext);
1371 | class_decl '{' error
1373 $$ = MkClass($1, null, MkList()); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1375 PopContext(curContext);
1377 | class_head '{' error
1379 $$ = $1; $$.definitions = MkList(); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1381 PopContext(curContext);
1385 /**** EXPRESSIONS ********************************************************************/
1389 { $$ = MkIdentifier(yytext); $$.loc = @1; }
1393 simple_primary_expression
1394 | '(' expression ')'
1395 { $$ = MkExpBrackets($2); $$.loc = @$; }
1399 string_literal { $$ = MkExpString($1); delete $1; $$.loc = @$; }
1400 | '$' string_literal { $$ = MkExpIntlString($2, null); delete $2; $$.loc = @$; }
1401 | '$' string_literal '.' string_literal { $$ = MkExpIntlString($4, $2); delete $2; delete $4; $$.loc = @$; }
1404 simple_primary_expression:
1405 identifier { $$ = MkExpIdentifier($1); $$.loc = @$; }
1406 | instantiation_unnamed { $$ = MkExpInstance($1); $$.loc = @$; }
1407 | EXTENSION '(' compound_statement ')' { $$ = MkExpExtensionCompound($3); $$.loc = @$; }
1408 | EXTENSION '(' expression ')' { $$ = MkExpExtensionExpression($3); $$.loc = @$; }
1409 | EXTENSION '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, $5); $$.loc = @$; }
1410 | EXTENSION '(' type_name ')' '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, MkInitializerAssignment(MkExpExtensionInitializer($6, $8))); $$.loc = @$; }
1411 | CONSTANT { $$ = MkExpConstant(yytext); $$.loc = @$; }
1413 | '(' ')' { Expression exp = MkExpDummy(); exp.loc.start = @1.end; exp.loc.end = @2.start; $$ = MkExpBrackets(MkListOne(exp)); $$.loc = @$; yyerror(); }
1414 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1415 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1416 | NEWOP new_specifiers '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1417 | NEWOP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1418 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1419 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1420 | NEW0OP new_specifiers '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1421 | NEW0OP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1422 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1423 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1424 | RENEW constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1425 | RENEW constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1426 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1427 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1428 | RENEW0 constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1429 | RENEW0 constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1430 | CLASS '(' declaration_specifiers ')' { $$ = MkExpClass($3, null); $$.loc = @$; }
1431 | CLASS '(' declaration_specifiers abstract_declarator ')' { $$ = MkExpClass($3, $4); $$.loc = @$; }
1432 | CLASS '(' identifier ')' { $$ = MkExpClass(MkListOne(MkSpecifierName($3.string)), null); FreeIdentifier($3); $$.loc = @$; }
1433 | VAARG '(' assignment_expression ',' type_name ')' { $$ = MkExpVaArg($3, $5); $$.loc = @$; }
1435 | CLASS_DATA '(' identifier ')' { $$ = MkExpClassData($3); $$.loc = @$; }
1441 | '[' argument_expression_list /*expression*/ ']' { $$ = MkExpArray($2); $$.loc = @$; }
1444 anon_instantiation_expression:
1445 instantiation_anon { $$ = MkExpInstance($1); $$.loc = @$; }
1448 anon_instantiation_expression_error:
1449 instantiation_anon_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1452 primary_expression_error:
1453 '(' expression { $$ = MkExpBrackets($2); $$.loc = @$; }
1454 | '(' expression_error { $$ = MkExpBrackets($2); $$.loc = @$; }
1460 | postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1461 | postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1462 | postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1463 | postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1464 | 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; }
1465 | postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1466 | postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1467 | postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1468 | postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1470 | postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1471 | postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1472 | postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1473 | postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1474 | postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1475 | postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1476 | postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1477 | postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1480 simple_postfix_expression:
1481 simple_primary_expression
1483 | simple_postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1484 | simple_postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1485 | simple_postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1486 | simple_postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1487 | 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; }
1488 | simple_postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1489 | simple_postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1490 | simple_postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1491 | simple_postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1493 | simple_postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1494 | simple_postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1495 | simple_postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1496 | simple_postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1497 | simple_postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1498 | simple_postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1499 | simple_postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1500 | simple_postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1503 argument_expression_list:
1504 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1505 | anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1506 | argument_expression_list ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1507 | argument_expression_list ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1510 argument_expression_list_error:
1511 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
1512 | anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
1513 | argument_expression_list ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
1514 | argument_expression_list ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
1515 | argument_expression_list ',' { Expression exp = MkExpDummy(); exp.loc.start = @2.end; exp.loc.end = @2.end; $$ = $1; ListAdd($1, exp); }
1518 common_unary_expression:
1519 INC_OP unary_expression { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1520 | DEC_OP unary_expression { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1521 | unary_operator cast_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1522 | unary_operator anon_instantiation_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1523 | SIZEOF '(' unary_expression ')' { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1524 | SIZEOF simple_unary_expression { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1525 | SIZEOF '(' guess_type_name ')' { $$ = MkExpTypeSize($3); $$.loc = @$; }
1526 | SIZEOF '(' CLASS type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1527 | SIZEOF '(' CLASS guess_type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1531 common_unary_expression
1532 | postfix_expression
1535 simple_unary_expression:
1536 common_unary_expression
1537 | simple_postfix_expression
1547 | DELETE { $$ = DELETE; }
1548 | _INCREF { $$ = _INCREF; }
1553 | '(' type_name ')' cast_expression { $$ = MkExpCast($2, $4); $$.loc = @$; }
1556 multiplicative_expression:
1558 | multiplicative_expression '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1559 | multiplicative_expression '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1560 | multiplicative_expression '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1561 | multiplicative_expression_error '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1562 | multiplicative_expression_error '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1563 | multiplicative_expression_error '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1566 additive_expression:
1567 multiplicative_expression
1568 | additive_expression '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1569 | additive_expression '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1570 | additive_expression_error '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1571 | additive_expression_error '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1576 | shift_expression LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1577 | shift_expression RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1578 | shift_expression_error LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1579 | shift_expression_error RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1582 relational_expression_smaller_than:
1583 relational_expression '<'
1590 relational_expression:
1592 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression { skipErrors = false; $$ = MkExpOp($1, '<', $2/*$3*/); $$.loc = @$; }
1593 | relational_expression '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1594 | relational_expression LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1595 | relational_expression GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1596 | relational_expression_error '<' shift_expression { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1597 | relational_expression_error '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1598 | relational_expression_error LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1599 | relational_expression_error GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1603 : relational_expression
1604 | equality_expression EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1605 | equality_expression NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1606 | equality_expression_error EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1607 | equality_expression_error NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1609 | equality_expression EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1610 | equality_expression NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1611 | equality_expression_error EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1612 | equality_expression_error NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1616 : equality_expression
1617 | and_expression '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1618 | and_expression_error '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1620 | and_expression '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1621 | and_expression_error '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1624 exclusive_or_expression
1626 | exclusive_or_expression '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1627 | exclusive_or_expression_error '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1629 | exclusive_or_expression '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1630 | exclusive_or_expression_error '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1633 inclusive_or_expression
1634 : exclusive_or_expression
1635 | inclusive_or_expression '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1636 | inclusive_or_expression_error '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1638 | inclusive_or_expression '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1639 | inclusive_or_expression_error '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1642 logical_and_expression
1643 : inclusive_or_expression
1644 | logical_and_expression AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1645 | logical_and_expression_error AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1648 logical_or_expression
1649 : logical_and_expression
1650 | logical_or_expression OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1651 | logical_or_expression_error OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1654 conditional_expression
1655 : logical_or_expression
1656 | logical_or_expression '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1657 | logical_or_expression '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1658 | logical_or_expression_error '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1659 | logical_or_expression_error '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1661 | logical_or_expression '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1662 | logical_or_expression '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1663 | logical_or_expression_error '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1664 | logical_or_expression_error '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1666 | logical_or_expression '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1667 | logical_or_expression '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1668 | logical_or_expression_error '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1669 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1671 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1672 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1673 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1674 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1677 assignment_expression:
1678 conditional_expression
1679 | unary_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1680 | unary_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1681 | conditional_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; } // TODO: Generate error here:
1682 | conditional_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; } // TODO: Generate error here:
1684 | unary_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1685 | unary_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1686 | conditional_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1687 | conditional_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1690 assignment_operator:
1692 | MUL_ASSIGN { $$ = MUL_ASSIGN; }
1693 | DIV_ASSIGN { $$ = DIV_ASSIGN; }
1694 | MOD_ASSIGN { $$ = MOD_ASSIGN; }
1695 | ADD_ASSIGN { $$ = ADD_ASSIGN; }
1696 | SUB_ASSIGN { $$ = SUB_ASSIGN; }
1697 | LEFT_ASSIGN { $$ = LEFT_ASSIGN; }
1698 | RIGHT_ASSIGN { $$ = RIGHT_ASSIGN; }
1699 | AND_ASSIGN { $$ = AND_ASSIGN; }
1700 | XOR_ASSIGN { $$ = XOR_ASSIGN; }
1701 | OR_ASSIGN { $$ = OR_ASSIGN; }
1705 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1706 | expression ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1707 | expression_error ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1708 | expression_error ')'
1711 expression_anon_inst:
1712 anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1713 | expression ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1714 | expression_error ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1717 postfix_expression_error:
1718 primary_expression_error
1719 | error { $$ = MkExpDummy(); $$.loc = @$; /*printf("Sorry, didn't mean that syntax error\n");*/ }
1720 | postfix_expression error
1721 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1723 | postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1724 | postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1726 | postfix_expression '(' argument_expression_list { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1727 | postfix_expression '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1728 /* Useless rules due to conflicts
1729 | postfix_expression '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; $$.call.argLoc.end.charPos++;}
1730 | postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; }
1732 | postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1734 | 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++;}
1735 /* Useless rules due to conflicts
1736 | 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++;}
1737 | postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1739 | postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1742 simple_postfix_expression_error:
1743 error { $$ = MkExpDummy(); $$.loc = @$; }
1744 | simple_postfix_expression error
1745 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1747 | simple_postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1748 | simple_postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1750 | simple_postfix_expression '(' argument_expression_list { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1751 | 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++;}
1752 /* Useless rules due to conflicts
1753 | 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++;}
1754 | simple_postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; }
1756 | simple_postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1758 | 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++;}
1759 /* Useless rules due to conflicts
1760 | 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++;}
1761 | simple_postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1763 | simple_postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1766 common_unary_expression_error:
1767 INC_OP unary_expression_error { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1768 | DEC_OP unary_expression_error { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1769 | unary_operator cast_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1770 | unary_operator anon_instantiation_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1771 | SIZEOF '(' unary_expression_error { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1772 | SIZEOF simple_unary_expression_error { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1773 | SIZEOF '(' guess_type_name ')' error { $$ = MkExpTypeSize($3); $$.loc = @$; }
1774 | SIZEOF '(' CLASS type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1775 | SIZEOF '(' CLASS guess_type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1778 unary_expression_error:
1779 common_unary_expression_error
1780 | postfix_expression_error
1783 simple_unary_expression_error:
1784 common_unary_expression_error
1785 | simple_postfix_expression_error
1789 cast_expression_error:
1790 unary_expression_error
1791 | '(' type_name ')' cast_expression_error { $$ = MkExpCast($2, $4); $$.loc = @$; }
1794 multiplicative_expression_error:
1795 cast_expression_error
1796 | multiplicative_expression '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1797 | multiplicative_expression '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1798 | multiplicative_expression '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1799 | multiplicative_expression_error '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1800 | multiplicative_expression_error '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1801 | multiplicative_expression_error '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1804 additive_expression_error:
1805 multiplicative_expression_error
1806 | additive_expression '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1807 /* Useless rules due to conflicts
1808 | additive_expression '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1810 | additive_expression '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1811 /* Useless rules due to conflicts
1812 | additive_expression '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1814 | additive_expression_error '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1815 /* Useless rules due to conflicts
1816 | additive_expression_error '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1818 | additive_expression_error '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1819 /* Useless rules due to conflicts
1820 | additive_expression_error '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1824 shift_expression_error:
1825 additive_expression_error
1826 | shift_expression LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1827 | shift_expression RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1828 | shift_expression_error LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1829 | shift_expression_error RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1832 relational_expression_error:
1833 shift_expression_error
1834 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression_error
1836 if($1.type == identifierExp)
1838 if($1.identifier._class && !$1.identifier._class.name)
1842 strcat(name, $1.identifier.string);
1843 _DeclClass(0, name);
1846 _DeclClass(0, $1.identifier.string);
1848 // printf("Declaring Class %s\n", $1.identifier.string);
1854 fileInput.Seek(@1.start.pos, start);
1855 resetScannerPos(&@1.start);
1860 YY_STACK_PRINT (yyss, yyssp);
1864 YY_STACK_PRINT (yyss, yyssp);
1868 YY_STACK_PRINT (yyss, yyssp);
1872 YY_STACK_PRINT (yyss, yyssp);
1880 $$ = MkExpOp($1, '<', $2);
1885 | relational_expression '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1886 | relational_expression LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1887 | relational_expression GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1888 | relational_expression_error '<' shift_expression_error { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1889 | relational_expression_error '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1890 | relational_expression_error LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1891 | relational_expression_error GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1894 equality_expression_error:
1895 relational_expression_error
1896 | equality_expression EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1897 | equality_expression NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1898 | equality_expression_error EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1899 | equality_expression_error NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1900 /* Useless rules due to conflicts
1901 | equality_expression EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1902 | equality_expression NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1903 | equality_expression_error EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1904 | equality_expression_error NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1906 | equality_expression EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1907 | equality_expression NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1908 | equality_expression_error EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1909 | equality_expression_error NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1912 and_expression_error:
1913 equality_expression_error
1914 | and_expression '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1915 | and_expression_error '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1917 | and_expression '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1918 | and_expression_error '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1921 exclusive_or_expression_error:
1922 and_expression_error
1923 | exclusive_or_expression '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1924 | exclusive_or_expression_error '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1926 | exclusive_or_expression '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1927 | exclusive_or_expression_error '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1930 inclusive_or_expression_error:
1931 exclusive_or_expression_error
1932 | inclusive_or_expression '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1933 | inclusive_or_expression_error '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1935 | inclusive_or_expression '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1936 | inclusive_or_expression_error '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1939 logical_and_expression_error:
1940 inclusive_or_expression_error
1941 | logical_and_expression AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1942 | logical_and_expression_error AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1945 logical_or_expression_error:
1946 logical_and_expression_error
1947 | logical_or_expression OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1948 | logical_or_expression_error OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1951 conditional_expression_error:
1952 logical_or_expression_error
1953 | logical_or_expression '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1954 | logical_or_expression '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1955 | logical_or_expression_error '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1956 | logical_or_expression_error '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1957 | logical_or_expression '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1958 | logical_or_expression '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1959 | logical_or_expression_error '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1960 | logical_or_expression_error '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1962 | logical_or_expression '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1963 | logical_or_expression '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1964 | logical_or_expression_error '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1965 | logical_or_expression_error '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1966 | logical_or_expression '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1967 | logical_or_expression '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1968 | logical_or_expression_error '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1969 | logical_or_expression_error '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1971 | logical_or_expression '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1972 | logical_or_expression '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1973 | logical_or_expression_error '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1974 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1976 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1977 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1978 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1979 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1981 | logical_or_expression '?' ':'
1983 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy());
1985 ((Expression)$$.cond.exp->last).loc = @2;
1986 $$.cond.elseExp.loc = @3;
1988 | logical_or_expression_error '?' ':'
1990 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @3;
1992 | logical_or_expression '?'
1994 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
1996 | logical_or_expression_error '?'
1998 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
2002 assignment_expression_error:
2003 conditional_expression_error
2004 | unary_expression assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2005 /* Useless rules due to conflicts
2006 | unary_expression assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
2008 | unary_expression_error assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2009 /* Useless rules due to conflicts
2010 | unary_expression_error assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
2013 | unary_expression assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2014 | unary_expression_error assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2018 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
2019 | assignment_expression error { $$ = MkList(); ListAdd($$, $1); }
2020 | expression ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
2021 | expression_error ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
2022 /* Useless rules due to conflicts
2023 | expression ',' error
2024 | expression_error ',' error
2027 | expression expression { $$ = $1; FreeList($2, FreeExpression); }
2028 | expression_error expression { $$ = $1; FreeList($2, FreeExpression); }
2029 | expression expression_error { $$ = $1; FreeList($2, FreeExpression); }
2032 expression_anon_inst_error:
2033 anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
2034 | anon_instantiation_expression error { $$ = MkList(); ListAdd($$, $1); }
2035 | expression ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
2036 | expression_error ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
2040 constant_expression: conditional_expression;
2042 constant_expression_error: conditional_expression_error;
2044 /**** TYPES **************************************************************************/
2045 storage_class_specifier:
2046 TYPEDEF { $$ = MkSpecifier(TYPEDEF); }
2047 | EXTERN { $$ = MkSpecifier(EXTERN); }
2048 | STATIC { $$ = MkSpecifier(STATIC); }
2049 | AUTO { $$ = MkSpecifier(AUTO); }
2050 | REGISTER { $$ = MkSpecifier(REGISTER); }
2053 external_storage_class_specifier:
2054 TYPEDEF { $$ = MkSpecifier(TYPEDEF); declMode = defaultAccess; }
2055 | EXTERN { $$ = MkSpecifier(EXTERN); }
2056 | STATIC { $$ = MkSpecifier(STATIC); declMode = staticAccess; }
2057 | AUTO { $$ = MkSpecifier(AUTO); }
2058 | REGISTER { $$ = MkSpecifier(REGISTER); }
2062 identifier { $$ = MkEnumerator($1, null); }
2063 | identifier '=' constant_expression { $$ = MkEnumerator($1, $3); }
2064 | identifier '=' constant_expression_error { $$ = MkEnumerator($1, $3); }
2068 enumerator { $$ = MkList(); ListAdd($$, $1); }
2069 | enumerator_list ',' enumerator { $$ = $1; ListAdd($1, $3); }
2070 | enumerator_list ','
2074 ENUM { memberAccessStack[++defaultMemberAccess] = publicAccess; }
2077 enum_specifier_nocompound:
2078 enum_specifier identifier { $$ = MkEnum($2, null); POP_DEFAULT_ACCESS }
2079 | enum_specifier strict_type { $$ = MkEnum(MkIdentifier($2.name), null); POP_DEFAULT_ACCESS }
2082 enum_specifier_compound:
2083 enum_specifier_compound_error '}' { $$.loc = @$; POP_DEFAULT_ACCESS $$ = $1; }
2084 | enum_specifier identifier '{' '}' { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2085 | enum_specifier strict_type '{' '}' { $$ = MkEnum(MkIdentifier($2.name), null); FreeSpecifier($2); $$.loc = @$; POP_DEFAULT_ACCESS }
2088 enum_specifier_compound_error:
2089 enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2090 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2092 | enum_specifier identifier '{' enumerator_list { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2093 | enum_specifier identifier '{' enumerator_list error { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2094 | enum_specifier identifier '{' error { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2095 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2096 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2098 | enum_specifier strict_type '{' enumerator_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2099 | enum_specifier strict_type '{' enumerator_list error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2100 | enum_specifier strict_type '{' error { $$ = MkEnum(MkIdentifier($2.name), null); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2101 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2102 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2106 enum_specifier identifier { $$ = $2; if(declMode) DeclClassAddNameSpace(globalContext.nextID++, $2.string); }
2107 | enum_specifier strict_type { $$ = MkIdentifier($2.name); if(declMode) DeclClass(globalContext.nextID++, $2.name); FreeSpecifier($2); }
2111 enum_class_error '}' { $$ = $1; $$.loc = @$; }
2112 | enum_decl ':' inheritance_specifiers '{' '}' { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2113 | enum_decl '{' '}' { $$ = MkEnum($1, null); POP_DEFAULT_ACCESS }
2117 enum_decl ':' inheritance_specifiers '{' enumerator_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2118 | enum_decl ':' inheritance_specifiers '{' enumerator_list error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2119 | enum_decl ':' inheritance_specifiers '{' error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2120 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2121 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2122 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2123 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2124 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2125 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list_error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2127 | enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2128 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2130 | enum_decl '{' enumerator_list { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2131 | enum_decl '{' enumerator_list error { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2132 | enum_decl '{' error { $$ = MkEnum($1, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2133 | enum_decl '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2134 | enum_decl '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2142 class_specifier_error:
2144 | struct_class_error
2148 EXT_STORAGE { $$ = MkSpecifierExtended(yytext); }
2149 | ext_decl { $$ = MkSpecifierExtended($1); delete $1; }
2153 CONST { $$ = MkSpecifier(CONST); }
2154 | VOLATILE { $$ = MkSpecifier(VOLATILE); }
2155 | ext_storage { $$ = $1; }
2159 type_qualifier_list:
2160 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2161 | type_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2165 VOID { $$ = MkSpecifier(VOID); }
2166 | CHAR { $$ = MkSpecifier(CHAR); }
2167 | SHORT { $$ = MkSpecifier(SHORT); }
2168 | INT { $$ = MkSpecifier(INT); }
2169 | UINT { $$ = MkSpecifier(UINT); }
2170 | INT64 { $$ = MkSpecifier(INT64); }
2171 | VALIST { $$ = MkSpecifier(VALIST); }
2172 | LONG { $$ = MkSpecifier(LONG); }
2173 | FLOAT { $$ = MkSpecifier(FLOAT); }
2174 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2175 | SIGNED { $$ = MkSpecifier(SIGNED); }
2176 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2177 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2178 | struct_or_union_specifier_nocompound
2179 | enum_specifier_nocompound
2181 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2182 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2183 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2184 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2185 | TYPED_OBJECT { $$ = MkSpecifier(TYPED_OBJECT); }
2186 | ANY_OBJECT { $$ = MkSpecifier(ANY_OBJECT); }
2189 strict_type_specifier:
2190 VOID { $$ = MkSpecifier(VOID); }
2191 | CHAR { $$ = MkSpecifier(CHAR); }
2192 | SHORT { $$ = MkSpecifier(SHORT); }
2193 | INT { $$ = MkSpecifier(INT); }
2194 | UINT { $$ = MkSpecifier(UINT); }
2195 | INT64 { $$ = MkSpecifier(INT64); }
2196 | VALIST { $$ = MkSpecifier(VALIST); }
2197 | LONG { $$ = MkSpecifier(LONG); }
2198 | FLOAT { $$ = MkSpecifier(FLOAT); }
2199 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2200 | SIGNED { $$ = MkSpecifier(SIGNED); }
2201 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2202 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2203 | struct_or_union_specifier_nocompound
2204 | enum_specifier_nocompound
2206 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2207 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2208 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2209 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2212 // TESTING declarator_nofunction here... For function declarations
2215 declarator_nofunction
2216 { $$ = MkStructDeclarator($1, null); $$.loc = @$; }
2217 | declarator_nofunction ext_attrib
2218 { $$ = MkStructDeclarator($1, null); $$.structDecl.attrib = $2; $$.loc = @$; }
2219 | ':' constant_expression
2220 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2221 | declarator_nofunction ':' constant_expression
2222 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2223 | declarator_nofunction ':' constant_expression ':' constant_expression
2224 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2225 | ':' constant_expression_error
2226 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2227 | declarator_nofunction ':' constant_expression_error
2228 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2229 | declarator_nofunction ':' constant_expression ':' constant_expression_error
2230 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2231 | declarator_nofunction ':' constant_expression_error ':' constant_expression_error
2232 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2233 | declarator_nofunction ':' constant_expression_error ':' constant_expression
2234 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2237 struct_declarator_list:
2238 struct_declarator { $$ = MkList(); ListAdd($$, $1); }
2239 | struct_declarator_list ',' struct_declarator { $$ = $1; ListAdd($1, $3); }
2243 struct_or_union identifier
2245 $$ = MkStructOrUnion($1, $2, null);
2246 $$.addNameSpace = true;
2247 $$.ctx = PushContext();
2249 | struct_or_union base_strict_type
2251 $$ = MkStructOrUnion($1, MkIdentifier($2.name), null);
2252 $$.ctx = PushContext();
2257 struct_or_union_specifier_compound:
2258 struct_or_union_specifier_compound_error '}' { $$ = $1; $$.loc = @$; }
2259 | struct_entry '{' '}' { $$ = $1; $$.loc = @$; POP_DEFAULT_ACCESS PopContext(curContext); }
2260 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2263 struct_or_union_specifier_compound_error:
2264 struct_entry '{' struct_declaration_list { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2265 | struct_entry '{' struct_declaration_list_error { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2266 | struct_entry '{' error { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2268 | struct_or_union '{' struct_declaration_list { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2269 | struct_or_union '{' struct_declaration_list_error { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2270 | struct_or_union '{' error { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2273 struct_or_union_specifier_nocompound:
2274 struct_entry { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2283 ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2286 | struct_entry '<' template_parameters_list '>'
2288 Symbol symbol = ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2290 symbol.templateParams = $3;
2295 struct_decl ':' inheritance_specifiers
2299 SetupBaseSpecs(null, $3);
2304 struct_class_error '}' { $$ = $1; $$.loc = @$; }
2305 | struct_head '{' '}'
2306 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2307 | struct_decl '{' '}' { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2308 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2312 struct_head '{' struct_declaration_list
2315 $$.definitions = $3;
2317 PopContext(curContext);
2319 | struct_head '{' struct_declaration_list_error
2322 $$.definitions = $3;
2324 PopContext(curContext);
2326 | struct_head '{' error
2327 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext);}
2329 | struct_decl '{' struct_declaration_list
2331 PopContext(curContext);
2334 $$ = MkStructOrUnion($1.type, $1.id, $3);
2339 $$.definitions = $3;
2342 | struct_decl '{' struct_declaration_list_error
2344 PopContext(curContext);
2348 $$ = MkStructOrUnion($1.type, $1.id, $3);
2353 $$.definitions = $3;
2356 | struct_decl '{' error
2357 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2359 | struct_or_union '{' struct_declaration_list
2360 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2361 | struct_or_union '{' struct_declaration_list_error
2362 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2363 | struct_or_union '{' error
2364 { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2368 STRUCT { $$ = structSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2369 | UNION { $$ = unionSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2372 specifier_qualifier_list:
2373 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2374 | specifier_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2375 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2376 | specifier_qualifier_list type_specifier { $$ = $1; ListAdd($1, $2); }
2377 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2378 | specifier_qualifier_list enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2379 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2380 | specifier_qualifier_list struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2383 guess_specifier_qualifier_list:
2384 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2385 | guess_specifier_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2386 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2387 | guess_specifier_qualifier_list type_specifier { $$ = $1; ListAdd($1, $2); }
2388 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2389 | guess_specifier_qualifier_list guess_type { $$ = $1; ListAdd($1, $2); }
2390 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2391 | guess_specifier_qualifier_list enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2392 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2393 | guess_specifier_qualifier_list struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2396 declaration_specifiers:
2397 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2398 | declaration_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2399 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2400 | declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2401 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2402 | declaration_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2403 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2404 | declaration_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2405 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2406 | declaration_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2409 guess_declaration_specifiers:
2410 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2411 | guess_declaration_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2412 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2413 | guess_declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2414 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2415 | guess_declaration_specifiers type_specifier { $$ = $1; ListAdd($1, $2); }
2416 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2417 | guess_declaration_specifiers guess_type { $$ = $1; ListAdd($1, $2); }
2418 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2419 | guess_declaration_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2420 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2421 | guess_declaration_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2424 external_guess_declaration_specifiers:
2425 external_storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2426 | external_guess_declaration_specifiers external_storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2427 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2428 | external_guess_declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2429 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2430 | external_guess_declaration_specifiers type_specifier { $$ = $1; ListAdd($1, $2); }
2431 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2432 | external_guess_declaration_specifiers guess_type { $$ = $1; ListAdd($1, $2); }
2433 | class_specifier { $$ = MkList(); ListAdd($$, $1); }
2434 | external_guess_declaration_specifiers class_specifier { $$ = $1; ListAdd($1, $2); }
2437 external_guess_declaration_specifiers_error:
2438 class_specifier_error { $$ = MkList(); ListAdd($$, $1); }
2439 | external_guess_declaration_specifiers class_specifier_error { $$ = $1; ListAdd($1, $2); }
2442 _inheritance_specifiers:
2443 PRIVATE { $$ = MkList(); ListAdd($$, MkSpecifier(PRIVATE)); }
2444 | PUBLIC { $$ = MkList(); ListAdd($$, MkSpecifier(PUBLIC)); }
2445 | storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2446 | _inheritance_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2447 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2448 | _inheritance_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2449 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2450 | _inheritance_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2452 { _DeclClass(0, $1.string); $$ = MkListOne(MkSpecifierName($1.string)); FreeIdentifier($1); }
2453 | _inheritance_specifiers identifier { $$ = $1; _DeclClass(0, $2.string); ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2); }
2455 | identifier '<' template_arguments_list '>'
2457 // if($1._class && !$1._class.name)
2461 strcpy(name, $1._class.name ? $1._class.name : "");
2463 strcat(name, $1.string);
2464 _DeclClass(0, name);
2467 _DeclClass(0, $1.string);
2470 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2473 | _inheritance_specifiers identifier '<' template_arguments_list '>'
2476 if($2._class && !$2._class.name)
2480 strcat(name, $2.string);
2481 _DeclClass(0, name);
2484 _DeclClass(0, $2.string);
2485 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2490 inheritance_specifiers:
2491 _inheritance_specifiers
2492 | struct_or_union { $$ = MkListOne(MkStructOrUnion($1, null, null)); POP_DEFAULT_ACCESS }
2495 property_specifiers:
2496 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2497 | property_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2498 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2499 | property_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2500 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2501 | property_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2502 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2503 | property_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2504 | identifier '<' template_arguments_list '>'
2506 // if($1._class && !$1._class.name)
2510 strcpy(name, $1._class.name ? $1._class.name : "");
2512 strcat(name, $1.string);
2513 _DeclClass(0, name);
2516 _DeclClass(0, $1.string);
2519 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2522 | property_specifiers identifier '<' template_arguments_list '>'
2524 if($2._class && !$2._class.name)
2528 strcat(name, $2.string);
2529 _DeclClass(0, name);
2532 _DeclClass(0, $2.string);
2533 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2539 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2540 | renew_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2541 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2542 | renew_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2543 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2544 | renew_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2545 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2546 | renew_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2547 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2548 | renew_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2549 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2550 | renew_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2551 | identifier '<' template_arguments_list '>'
2553 // if($1._class && !$1._class.name)
2557 strcpy(name, $1._class.name ? $1._class.name : "");
2559 strcat(name, $1.string);
2560 _DeclClass(0, name);
2563 _DeclClass(0, $1.string);
2566 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2569 | renew_specifiers identifier '<' template_arguments_list '>'
2571 if($2._class && !$2._class.name)
2575 strcat(name, $2.string);
2576 _DeclClass(0, name);
2579 _DeclClass(0, $2.string);
2580 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2586 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2587 | new_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2588 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2589 | new_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2590 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2591 | new_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2592 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2593 | new_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2594 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2595 | new_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2596 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2597 | new_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2598 | identifier '<' template_arguments_list '>'
2600 // if($1._class && !$1._class.name)
2604 strcpy(name, $1._class.name ? $1._class.name : "");
2606 strcat(name, $1.string);
2607 _DeclClass(0, name);
2610 _DeclClass(0, $1.string);
2613 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2616 | new_specifiers identifier '<' template_arguments_list '>'
2618 if($2._class && !$2._class.name)
2622 strcat(name, $2.string);
2623 _DeclClass(0, name);
2626 _DeclClass(0, $2.string);
2627 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2632 identifier_list_error:
2633 identifier_list ',' error { $$ = $1; ListAdd($1, null); }
2634 | identifier_list_error ',' error { $$ = $1; ListAdd($1, null); }
2638 identifier { $$ = MkList(); ListAdd($$, MkTypeName(null, MkDeclaratorIdentifier($1))); }
2639 | identifier_list ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2640 | identifier_list_error ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2641 | parameter_list ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2642 | parameter_list_error ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2645 direct_declarator_nofunction:
2646 identifier { $$ = MkDeclaratorIdentifier($1); }
2647 | '(' declarator ')' { $$ = MkDeclaratorBrackets($2); }
2648 | direct_declarator_nofunction '[' constant_expression ']' { $$ = MkDeclaratorArray($1, $3); }
2649 | direct_declarator_nofunction '[' constant_expression_error ']' { $$ = MkDeclaratorArray($1, $3); }
2650 | direct_declarator_nofunction '[' type ']' { $$ = MkDeclaratorEnumArray($1, $3); }
2651 | direct_declarator_nofunction '[' ']' { $$ = MkDeclaratorArray($1, null); }
2654 direct_declarator_function_start:
2655 direct_declarator_nofunction '('
2658 direct_declarator_function:
2659 direct_declarator_function_start parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2660 | direct_declarator_function_start parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2661 | direct_declarator_function_start identifier_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2662 | direct_declarator_function_start identifier_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2663 | direct_declarator_function_start ')' { $$ = MkDeclaratorFunction($1, null); }
2666 // Tricky stuff here for overriding...
2667 direct_declarator_function_error:
2668 direct_declarator_function_start identifier_list_error
2670 $$ = MkDeclaratorFunction($1, $2);
2671 fileInput.Seek(@1.end.pos, start);
2673 resetScannerPos(&@1.end);
2674 @$.start = @1.start;
2677 | direct_declarator_function_start error
2679 $$ = MkDeclaratorFunction($1, null);
2680 fileInput.Seek(@1.end.pos, start);
2682 resetScannerPos(&@1.end);
2683 @$.start = @1.start;
2686 | direct_declarator_function_start parameter_list '('
2688 $$ = MkDeclaratorFunction($1, $2);
2689 fileInput.Seek(@1.end.pos, start);
2691 resetScannerPos(&@1.end);
2692 @$.start = @1.start;
2695 | direct_declarator_function_start guess_declaration_specifiers identifier '('
2697 $$ = MkDeclaratorFunction($1, null);
2698 fileInput.Seek(@1.end.pos, start);
2700 resetScannerPos(&@1.end);
2701 @$.start = @1.start;
2703 FreeList($2, FreeSpecifier);
2709 direct_declarator_function
2710 | direct_declarator_nofunction
2711 | ext_decl direct_declarator_function
2712 { $$ = MkDeclaratorExtended($1, $2); }
2713 | ext_decl direct_declarator_nofunction
2714 { $$ = MkDeclaratorExtended($1, $2); }
2719 ASM '(' STRING_LITERAL { $<string>$ = CopyString(yytext); } STRING_LITERAL { $<string>$ = CopyString(yytext); }
2722 strcpy(temp, "__asm__(");
2723 strcat(temp, $<string>4);
2725 strcat(temp, $<string>6);
2728 $<string>$ = CopyString(temp);
2733 EXT_DECL { $$ = CopyString(yytext); }
2738 strcpy(temp, $<string>1);
2741 $$ = CopyString(temp);
2743 | asm_start STRING_LITERAL { $$ = CopyString(yytext); } ')'
2746 strcpy(temp, $<string>1);
2748 strcat(temp, $<string>3);
2752 $$ = CopyString(temp);
2758 EXT_DECL { $$ = CopyString(yytext); }
2760 | ASM '(' string_literal ')'
2763 strcpy(temp, "__asm__(");
2766 $$ = CopyString(temp);
2772 EXT_ATTRIB { $$ = CopyString(yytext); }
2776 direct_abstract_declarator:
2777 '(' abstract_declarator ')'
2778 { $$ = MkDeclaratorBrackets($2); }
2780 { $$ = MkDeclaratorArray(null, null); }
2781 | '[' constant_expression ']'
2782 { $$ = MkDeclaratorArray(null, $2); }
2783 | '[' constant_expression_error ']'
2784 { $$ = MkDeclaratorArray(null, $2); }
2786 { $$ = MkDeclaratorEnumArray(null, $2); }
2787 | direct_abstract_declarator '[' ']'
2788 { $$ = MkDeclaratorArray($1, null); }
2789 | direct_abstract_declarator '[' constant_expression ']'
2790 { $$ = MkDeclaratorArray($1, $3); }
2791 | direct_abstract_declarator '[' type']'
2792 { $$ = MkDeclaratorEnumArray($1, $3); }
2793 | direct_abstract_declarator '[' constant_expression_error ']'
2794 { $$ = MkDeclaratorArray($1, $3); }
2796 { $$ = MkDeclaratorFunction(null, null); }
2797 | '(' parameter_type_list ')'
2798 { $$ = MkDeclaratorFunction(null, $2); }
2799 | '(' parameter_type_list_error ')'
2800 { $$ = MkDeclaratorFunction(null, $2); }
2801 | direct_abstract_declarator '(' ')'
2802 { $$ = MkDeclaratorFunction($1, null); }
2803 | direct_abstract_declarator '(' parameter_type_list ')'
2804 { $$ = MkDeclaratorFunction($1, $3); }
2805 | direct_abstract_declarator '(' parameter_type_list_error ')'
2806 { $$ = MkDeclaratorFunction($1, $3); }
2809 direct_abstract_declarator_noarray:
2810 '(' abstract_declarator_noarray ')'
2811 { $$ = MkDeclaratorBrackets($2); }
2813 { $$ = MkDeclaratorFunction(null, null); }
2814 | '(' parameter_type_list ')'
2815 { $$ = MkDeclaratorFunction(null, $2); }
2816 | '(' parameter_type_list_error ')'
2817 { $$ = MkDeclaratorFunction(null, $2); }
2818 | direct_abstract_declarator_noarray '(' ')'
2819 { $$ = MkDeclaratorFunction($1, null); }
2820 | direct_abstract_declarator_noarray '(' parameter_type_list ')'
2821 { $$ = MkDeclaratorFunction($1, $3); }
2822 | direct_abstract_declarator_noarray '(' parameter_type_list_error ')'
2823 { $$ = MkDeclaratorFunction($1, $3); }
2827 '*' { $$ = MkPointer(null, null); }
2828 | '*' type_qualifier_list { $$ = MkPointer($2, null); }
2829 | '*' pointer { $$ = MkPointer(null, $2); }
2830 | '*' type_qualifier_list pointer { $$ = MkPointer($2, $3); }
2833 abstract_declarator:
2834 pointer { $$ = MkDeclaratorPointer($1, null); }
2835 | direct_abstract_declarator
2836 | pointer direct_abstract_declarator { $$ = MkDeclaratorPointer($1, $2); }
2837 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
2838 | ext_decl direct_abstract_declarator { $$ = MkDeclaratorExtended($1, $2); }
2839 | ext_decl pointer direct_abstract_declarator { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2842 abstract_declarator_noarray:
2843 pointer { $$ = MkDeclaratorPointer($1, null); }
2844 | direct_abstract_declarator_noarray
2845 | pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorPointer($1, $2); }
2846 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
2847 | ext_decl direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, $2); }
2848 | ext_decl pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2853 | pointer direct_declarator
2854 { $$ = MkDeclaratorPointer($1, $2); }
2855 | ext_decl pointer direct_declarator
2856 { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2857 | declarator ext_decl
2858 { $$ = MkDeclaratorExtendedEnd($2, $1); }
2861 declarator_function:
2862 direct_declarator_function
2863 | pointer direct_declarator_function { $$ = MkDeclaratorPointer($1, $2); }
2864 | ext_decl direct_declarator_function { $$ = MkDeclaratorExtended($1, $2); }
2865 | ext_decl pointer direct_declarator_function { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2866 | pointer ext_decl direct_declarator_function { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2869 declarator_function_error:
2870 direct_declarator_function_error
2871 | pointer direct_declarator_function_error { $$ = MkDeclaratorPointer($1, $2); }
2872 | ext_decl direct_declarator_function_error { $$ = MkDeclaratorExtended($1, $2); }
2873 | ext_decl pointer direct_declarator_function_error { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2874 | pointer ext_decl direct_declarator_function_error { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2877 declarator_nofunction:
2878 direct_declarator_nofunction
2879 | pointer direct_declarator_nofunction { $$ = MkDeclaratorPointer($1, $2); }
2880 | ext_decl direct_declarator_nofunction { $$ = MkDeclaratorExtended($1, $2); }
2881 | ext_decl pointer direct_declarator_nofunction { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2882 | pointer ext_decl direct_declarator_nofunction { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2886 assignment_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2887 | '{' initializer_list '}' { $$ = MkInitializerList($2); $$.loc = @$; }
2888 | '{' initializer_list ',' '}'
2890 $$ = MkInitializerList($2);
2894 Expression exp = MkExpDummy();
2895 Initializer init = MkInitializerAssignment(exp);
2904 assignment_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2905 | '{' initializer_list '}' error { $$ = MkInitializerList($2); $$.loc = @$; }
2906 | '{' initializer_list { $$ = MkInitializerList($2); $$.loc = @$; }
2907 | '{' initializer_list ',' '}' error
2909 $$ = MkInitializerList($2);
2913 Expression exp = MkExpDummy();
2914 Initializer init = MkInitializerAssignment(exp);
2920 | '{' initializer_list ','
2922 $$ = MkInitializerList($2);
2926 Expression exp = MkExpDummy();
2927 Initializer init = MkInitializerAssignment(exp);
2935 initializer_condition:
2936 conditional_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2937 | anon_instantiation_expression
2938 { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2941 initializer_condition_error:
2942 conditional_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2943 | anon_instantiation_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2947 initializer { $$ = MkList(); ListAdd($$, $1); }
2948 | initializer_error { $$ = MkList(); ListAdd($$, $1); }
2949 | initializer_list ',' initializer { $$ = $1; ListAdd($1, $3); }
2950 | initializer_list ',' initializer_error { $$ = $1; ListAdd($1, $3); }
2953 | initializer_list initializer { $$ = $1; ListAdd($1, $2); }
2954 | initializer_list initializer_error { $$ = $1; ListAdd($1, $2); }
2958 declarator { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
2959 | declarator '=' initializer { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
2962 init_declarator_error:
2963 declarator error { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
2964 /* Useless rules due to conflicts
2965 | declarator '=' error { $$ = MkInitDeclarator($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.initializer.loc = @2; $$.initializer.exp.loc = @2; }
2967 | declarator '=' initializer_error { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
2970 init_declarator_list:
2971 init_declarator { $$ = MkList(); ListAdd($$, $1); }
2972 | init_declarator_list ',' init_declarator { $$ = $1; ListAdd($1, $3); }
2973 | init_declarator_list_error ',' init_declarator { $$ = $1; ListAdd($1, $3); }
2976 init_declarator_list_error:
2977 init_declarator_error { $$ = MkList(); ListAdd($$, $1); }
2978 | init_declarator error { $$ = MkList(); ListAdd($$, $1); }
2979 | init_declarator_list ',' init_declarator_error { $$ = $1; ListAdd($1, $3); }
2980 | init_declarator_list_error ',' init_declarator_error { $$ = $1; ListAdd($1, $3); }
2984 specifier_qualifier_list { $$ = MkTypeName($1, null); }
2985 | specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
2989 guess_specifier_qualifier_list { $$ = MkTypeName($1, null); }
2990 | guess_specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
2993 /*** PARAMETERS **********************************************************************/
2994 parameter_declaration:
2995 guess_declaration_specifiers declarator { $$ = MkTypeName($1, $2); }
2996 | guess_declaration_specifiers abstract_declarator { $$ = MkTypeName($1, $2); }
2997 | guess_declaration_specifiers '&' { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), null)); }
2998 | guess_declaration_specifiers '&' declarator { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), $3)); }
2999 | guess_declaration_specifiers { $$ = MkTypeName($1, null); }
3001 { $$ = MkTypeName(MkListOne(MkSpecifier(CLASS)), null); }
3004 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), null); }
3006 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), null)); }
3007 | TYPED_OBJECT declarator
3008 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), $2); }
3009 | TYPED_OBJECT '&' declarator
3010 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), $3)); }
3012 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), null); }
3013 | ANY_OBJECT declarator
3014 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), $2); }
3018 parameter_declaration_error:
3019 guess_declaration_specifiers declarator error { $$ = MkTypeName($1, $2); }
3020 | guess_declaration_specifiers abstract_declarator error { $$ = MkTypeName($1, $2); }
3024 parameter_declaration { $$ = MkList(); ListAdd($$, $1); }
3025 | parameter_list ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3026 | parameter_list error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3027 | parameter_list_error ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3028 | parameter_list_error error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3029 | error ',' parameter_declaration { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3031 | identifier_list ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3032 | identifier_list error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3033 | identifier_list_error ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3034 | identifier_list_error error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3037 parameter_list_error:
3038 parameter_declaration_error { $$ = MkList(); ListAdd($$, $1); }
3039 | parameter_list ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3040 | parameter_list_error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3041 | parameter_list_error error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $4); }
3042 | error ',' parameter_declaration_error { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3044 | identifier_list ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3045 | identifier_list_error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3046 | identifier_list_error error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $4); }
3049 parameter_type_list:
3051 | parameter_list ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3052 | parameter_list_error ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3053 | identifier_list ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3054 | identifier_list_error ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3055 | error ',' ELLIPSIS { $$ = MkList(); ListAdd($$, MkTypeName(null, null)); }
3058 parameter_type_list_error:
3059 parameter_list_error
3060 | parameter_list ',' error { $$ = $1; ListAdd($1, null); }
3061 | parameter_list_error error
3064 /****** STATEMENTS *******************************************************************/
3067 | EXT_ATTRIB { $$ = MkExpressionStmt(null); } // Ignoring this for now... ( For __attribute__ ((__unused__)) )
3068 | compound_statement
3069 | ';' { $$ = MkExpressionStmt(null); }
3070 | ':' { $$ = MkExpressionStmt(null); }
3071 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3072 | selection_statement
3073 | iteration_statement
3078 | watch_definition ';'
3082 labeled_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3083 | iteration_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3084 | compound_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3085 | selection_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3086 | jump_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3087 | jump_statement error { $$ = $1; Compiler_Error("syntax error\n"); }
3088 | expression_error { $$ = MkExpressionStmt($1); Compiler_Error("syntax error\n"); $$.loc = @1; }
3092 string_literal { $$ = MkAsmField($1, null); $$.loc = @1; }
3093 | string_literal '(' assignment_expression ')' { $$ = MkAsmField($1, $3); $$.loc = @$; }
3097 asm_field { $$ = MkListOne($1); }
3098 | asm_field_list ',' asm_field { ListAdd($$, $3); }
3103 ASM type_qualifier '(' string_literal ')' ';' { $$ = MkAsmStmt($2, $4, null, null, null); $$.loc = @$; }
3104 | ASM type_qualifier '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, null); $$.loc = @$; }
3105 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, null); $$.loc = @$; }
3106 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, $10); $$.loc = @$; }
3108 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, null); $$.loc = @$; }
3109 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, $8); $$.loc = @$; }
3110 | ASM type_qualifier '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, $8); $$.loc = @$; }
3112 | ASM '(' string_literal ')' ';' { $$ = MkAsmStmt(null, $3, null, null, null); $$.loc = @$; }
3113 | ASM '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, null); $$.loc = @$; }
3114 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, null); $$.loc = @$; }
3115 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, $9); $$.loc = @$; }
3117 | ASM '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, null); $$.loc = @$; }
3118 | ASM '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, $7); $$.loc = @$; }
3119 | ASM '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, $7); $$.loc = @$; }
3123 identifier ':' statement { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3124 | CASE constant_expression ':' statement { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3125 | CASE constant_expression_error ':' statement { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3126 | CASE ':' statement { $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3127 | DEFAULT ':' statement { $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3130 labeled_statement_error
3131 : identifier ':' statement_error { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3132 | CASE constant_expression ':' statement_error { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3133 | CASE constant_expression_error ':' statement_error { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3134 | CASE ':' statement_error { $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3135 | CASE ':' { $$ = MkCaseStmt(MkExpDummy(), null); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3136 | DEFAULT ':' statement_error { $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3137 | DEFAULT ':' { $$ = MkCaseStmt(null, null); $$.loc = @$; }
3141 PUBLIC { $$ = declMode = publicAccess; }
3142 | PRIVATE { $$ = declMode = privateAccess; }
3143 | DEFAULT { $$ = declMode = defaultAccess; }
3147 PUBLIC { $$ = publicAccess; }
3148 | PRIVATE { $$ = privateAccess; }
3152 declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3153 | declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3154 | instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3155 | declaration_error ';' { $$ = $1; }
3158 external_guess_declaration:
3159 external_guess_declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3160 | external_guess_declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3161 | external_guess_declaration_specifiers_error init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3163 | external_guess_instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3164 | DEFINE identifier '=' conditional_expression ';' { $$ = MkDeclarationDefine($2, $4); $$.loc = @$; }
3165 | STATIC DEFINE identifier '=' conditional_expression ';' { declMode = staticAccess; $$ = MkDeclarationDefine($3, $5); $$.loc = @$; }
3168 external_guess_declaration_error:
3169 external_guess_declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; yyerrok; }
3173 declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; }
3174 | declaration_error error {}
3176 | instantiation_named_error error { $$ = MkDeclarationInst($1); $$.loc = @$; }
3177 | instantiation_named error { $$ = MkDeclarationInst($1); $$.loc = @$; }
3178 | declaration_specifiers init_declarator_list_error { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3182 declaration { $$ = MkList(); ListAdd($$, $1); /*declMode = defaultDeclMode;*/ }
3183 | declaration_list declaration { $$ = $1; ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3184 | declaration_list_error declaration { $$ = $1; ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3185 | declaration_list error ';' { $$ = $1; }
3188 declaration_list_error:
3189 declaration_error { $$ = MkList(); ListAdd($$, $1); }
3190 | declaration_list declaration_error { $$ = $1; ListAdd($1, $2); }
3194 statement { $$ = MkList(); ListAdd($$, $1); }
3195 | statement_list statement { $$ = $1; ListAdd($1, $2); }
3196 | statement_list_error statement { $$ = $1; ListAdd($1, $2); }
3199 statement_list_error:
3200 statement_error { $$ = MkList(); ListAdd($$, $1); }
3201 | statement_list statement_error { $$ = $1; ListAdd($1, $2); }
3202 | statement_list_error statement_error { $$ = $1; ListAdd($1, $2); }
3203 | statement_list declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3204 | statement_list_error declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3205 | statement_list declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3206 | statement_list_error declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3210 statement_list { $$ = MkCompoundStmt(null, $1); }
3211 | declaration_list { $$ = MkCompoundStmt($1, null); }
3212 | declaration_list statement_list { $$ = MkCompoundStmt($1, $2); }
3213 | declaration_list_error statement_list { $$ = MkCompoundStmt($1, $2); }
3216 compound_inside_error:
3217 statement_list_error { $$ = MkCompoundStmt(null, $1); }
3218 | declaration_list_error { $$ = MkCompoundStmt($1, null); }
3219 | declaration_list statement_list_error { $$ = MkCompoundStmt($1, $2); }
3220 | declaration_list_error statement_list_error { $$ = MkCompoundStmt($1, $2); }
3224 '{' { $<context>$ = PushContext(); }
3228 compound_statement_error '}' { $$ = $1; $$.loc = @$; }
3231 compound_statement_error:
3232 compound_start compound_inside_error
3233 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3235 { $$ = MkCompoundStmt(null, null); $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3237 | compound_start compound_inside
3238 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3242 expression_statement:
3243 ';' { $$ = MkExpressionStmt(null); $$.loc = @$; }
3244 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3245 | expression_error ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3248 selection_statement:
3249 IF '(' expression ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3250 | IF '(' expression_error ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3251 | IF '(' expression ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3252 | IF '(' expression_error ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3253 | SWITCH '(' expression ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3254 | SWITCH '(' expression_error ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3257 selection_statement_error:
3258 IF '(' expression_error { $$ = MkIfStmt($3, null, null); $$.loc = @$; }
3259 | selection_statement error
3262 iteration_statement:
3263 WHILE '(' expression ')' statement { $$ = MkWhileStmt($3, $5); $$.loc = @$; }
3264 | WHILE '(' expression_error statement { $$ = MkWhileStmt($3, $4); $$.loc = @$; }
3265 | WHILE '(' ')' statement { $$ = MkWhileStmt(null, $4); $$.loc = @$; }
3267 | DO statement WHILE '(' expression ')' ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3268 | DO statement WHILE '(' expression_error ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3270 | FOR '(' expression_statement expression_statement ')' statement { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; }
3271 | FOR '(' expression_statement ')' statement { $$ = MkForStmt($3, null, null, $5); $$.loc = @$; }
3272 | FOR '(' expression_statement expression_statement expression ')' statement { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; }
3273 | FOR '(' expression_statement expression_statement expression_error statement { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; }
3274 | FOR '(' ')' statement { $$ = MkForStmt(null, null, null, $4); $$.loc = @$; }
3276 | FOR '(' identifier ':' expression ')' statement { $$ = MkForEachStmt($3, $5, null, $7); $$.loc = @$; }
3277 | FOR '(' identifier ':' expression ';' expression ')' statement { $$ = MkForEachStmt($3, $5, $7, $9); $$.loc = @$; }
3280 iteration_statement_error:
3281 FOR '(' error { $$ = MkForStmt(null, null, null, null); $$.loc = @$; } |
3282 FOR '(' expression_error error { $$ = MkForStmt(MkExpressionStmt($3), null, null, null); $$.forStmt.init.loc = @3; $$.loc = @$; } |
3283 FOR '(' expression_statement error { $$ = MkForStmt($3, null, null, null); $$.loc = @$; } |
3284 FOR '(' expression_statement expression_error error { $$ = MkForStmt($3, MkExpressionStmt($4), null, null); $$.loc = @$; $$.forStmt.check.loc = @4; } |
3285 /* Useless rules due to conflicts
3286 FOR '(' expression_statement expression_statement error { $$ = MkForStmt($3, $4, null, null); $$.loc = @$; } |
3288 FOR '(' expression_statement expression_statement expression_error { $$ = MkForStmt($3, $4, $5, null); $$.loc = @$; } |
3289 FOR '(' expression_statement expression_statement ')' statement_error { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; } |
3290 FOR '(' expression_statement expression_statement expression ')' statement_error { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; } |
3291 FOR '(' expression_statement expression_statement expression_error statement_error { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; } |
3293 DO statement WHILE '(' expression ')' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3294 DO statement WHILE '(' expression { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3295 DO statement WHILE '(' expression_error { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3296 DO statement WHILE '(' { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3297 DO statement WHILE { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3298 DO statement { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3299 DO { $$ = MkDoWhileStmt(null, null); $$.loc = @$; } |
3302 WHILE error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3303 /* Useless rules due to conflicts
3304 WHILE '(' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3306 WHILE '(' ')' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3307 WHILE '(' expression_error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3308 /* Useless rules due to conflicts
3309 WHILE '(' expression_error error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3311 WHILE '(' expression ')' statement_error { $$ = MkWhileStmt($3, $5); $$.loc = @$; } |
3312 WHILE '(' expression_error statement_error { $$ = MkWhileStmt($3, $4 ); $$.loc = @$; }
3316 GOTO identifier ';' { $$ = MkGotoStmt($2); $$.loc = @$; }
3317 | CONTINUE ';' { $$ = MkContinueStmt(); $$.loc = @$; }
3318 | BREAK ';' { $$ = MkBreakStmt(); $$.loc = @$; }
3319 | RETURN ';' { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc = @2; }
3320 | RETURN expression ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3321 | RETURN expression_error ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3322 | RETURN anon_instantiation_expression ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3323 | RETURN anon_instantiation_expression_error ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3326 jump_statement_error:
3327 RETURN expression_error { $$ = MkReturnStmt($2); $$.loc = @$; } |
3328 RETURN anon_instantiation_expression_error { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; } |
3329 RETURN { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc.start = exp.loc.end = @1.end; } |
3330 GOTO { $$ = MkGotoStmt(null); $$.loc = @$; }
3333 /*************************************************************************************/
3335 function_definition:
3336 external_guess_declaration_specifiers declarator_function declaration_list compound_statement { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; }
3337 | external_guess_declaration_specifiers declarator_function compound_statement
3338 { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; }
3340 | declarator_function declaration_list compound_statement { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; }
3341 | declarator_function compound_statement { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$;}
3343 function_definition_error:
3344 external_guess_declaration_specifiers declarator_function declaration_list compound_statement_error { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; $$.loc.end = $4.loc.end; }
3345 | external_guess_declaration_specifiers declarator_function compound_statement_error { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3346 | declarator_function declaration_list compound_statement_error { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3347 | declarator_function compound_statement_error { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
3351 STRING_LITERAL { $$ = CopyString(yytext); }
3352 | string_literal STRING_LITERAL
3354 int len1 = strlen($1);
3355 int len2 = strlen(yytext);
3356 $$ = new byte[len1-1 + len2-1 + 1];
3357 memcpy($$, $1, len1-1);
3358 memcpy($$ + len1-1, yytext+1, len2);
3363 external_declaration:
3364 function_definition { $$ = MkExternalFunction($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3366 { $$ = MkExternalClass($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3368 | external_guess_declaration_specifiers class
3369 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; FreeList($1, FreeSpecifier); }
3371 | external_guess_declaration
3372 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3373 | IMPORT string_literal { $$ = MkExternalImport($2, normalImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3374 | IMPORT STATIC string_literal { $$ = MkExternalImport($3, staticImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3375 | IMPORT identifier string_literal
3377 bool isRemote = !strcmp($2.string, "remote");
3378 $$ = MkExternalImport($3, isRemote ? remoteImport : normalImport, (declMode != defaultAccess) ? declMode : privateAccess);
3385 | ';' { $$ = null; }
3387 | declaration_mode function_definition { $$ = MkExternalFunction($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3388 | declaration_mode class
3389 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; declMode = defaultDeclMode; }
3390 | declaration_mode external_guess_declaration { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3391 | declaration_mode IMPORT string_literal { $$ = MkExternalImport($3, normalImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; declMode = defaultDeclMode; }
3392 | declaration_mode IMPORT STATIC string_literal { $$ = MkExternalImport($4, staticImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; declMode = defaultDeclMode; }
3393 | declaration_mode IMPORT identifier string_literal
3395 bool isRemote = !strcmp($3.string, "remote");
3396 $$ = MkExternalImport($4, isRemote ? remoteImport : normalImport, ($1 != defaultAccess) ? $1 : privateAccess);
3399 declMode = defaultDeclMode;
3403 | declaration_mode ':' { defaultDeclMode = $1; $$ = null; }
3404 | STATIC ':' { defaultDeclMode = staticAccess; $$ = null; }
3405 | NAMESPACE identifier { $$ = MkExternalNameSpace($2); $$.loc = @$; }
3406 | NAMESPACE strict_type { $$ = MkExternalNameSpace(MkIdentifier($2.name)); FreeSpecifier($2); $$.loc = @$; }
3407 | dbtable_definition { $$ = MkExternalDBTable($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3408 | declaration_mode dbtable_definition { $$ = MkExternalDBTable($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3411 external_declaration_error:
3412 class_error { $$ = MkExternalClass($1); $$.loc = $1.loc; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3413 | external_guess_declaration_specifiers class_error
3415 FreeList($1, FreeSpecifier);
3416 $$ = MkExternalClass($2);
3418 $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess;
3419 declMode = defaultDeclMode;
3421 | function_definition_error { $$ = MkExternalFunction($1); $$.loc = $1.loc; $1.declMode = declMode; declMode = defaultDeclMode; }
3423 | declaration_mode class_error { $$ = MkExternalClass($2); $$.loc = $2.loc; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; declMode = defaultDeclMode; }
3424 | declaration_mode function_definition_error { $$ = MkExternalFunction($2); $$.loc = $2.loc; $2.declMode = $1; declMode = defaultDeclMode; }
3426 | external_guess_declaration_error
3427 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3428 | declaration_mode external_guess_declaration_error { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3431 translation_unit_error:
3432 external_declaration_error { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3433 | translation_unit external_declaration_error { $$ = $1; ListAdd($1, $2); }
3434 | translation_unit_error external_declaration_error { $$ = $1; ListAdd($1, $2); }
3435 | translation_unit error
3436 | translation_unit_error error
3440 external_declaration { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3441 | translation_unit external_declaration { $$ = $1; ListAdd($1, $2); }
3442 | translation_unit_error class
3443 { External _class = MkExternalClass($2); $$ = $1; ListAdd($1, _class); _class.loc = @2; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3444 | translation_unit_error declaration_mode class
3445 { External _class = MkExternalClass($3); $$ = $1; ListAdd($1, _class); _class.loc = @3; $3.declMode = ($2 != defaultAccess) ? $2 : privateAccess; declMode = defaultDeclMode; }
3450 | translation_unit_error
3451 | { ast = MkList(); }
3455 DBTABLE string_literal identifier '{' dbfield_definition_list '}' { Symbol symbol = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3456 | DBTABLE string_literal strict_type '{' dbfield_definition_list '}' { Symbol symbol = DeclClass(globalContext.nextID++, $3.name); FreeSpecifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3457 | DBTABLE string_literal '{' dbfield_definition_list '}' { $$ = MkDBTableDef($2, null, $4); }
3461 guess_declaration_specifiers identifier string_literal ';' { $$ = MkDBFieldEntry(MkTypeName($1, null), $2, $3); }
3465 identifier { $$ = MkDBIndexItem($1, ascending); }
3466 | '>' identifier { $$ = MkDBIndexItem($2, descending); }
3467 | '<' identifier { $$ = MkDBIndexItem($2, ascending); }
3471 dbindex_item { $$ = MkList(); ListAdd($$, $1); }
3472 | dbindex_item_list ',' dbindex_item { ListAdd($1, $3); }
3476 DBINDEX dbindex_item_list ';' { $$ = MkDBIndexEntry($2, null); }
3477 | DBINDEX dbindex_item_list identifier ';' { $$ = MkDBIndexEntry($2, $3); }
3480 dbfield_definition_list:
3481 dbfield_entry { $$ = MkList(); ListAdd($$, $1); }
3482 | dbindex_entry { $$ = MkList(); ListAdd($$, $1); }
3483 | dbfield_definition_list dbfield_entry { ListAdd($1, $2); }
3484 | dbfield_definition_list dbindex_entry { ListAdd($1, $2); }
3488 DATABASE_OPEN '(' assignment_expression ',' assignment_expression ')' { $$ = MkExpDBOpen($3, $5); }
3492 DBFIELD '(' string_literal ',' identifier ')' { $$ = MkExpDBField($3, $5); }
3496 DBINDEX '(' string_literal ',' identifier ')' { $$ = MkExpDBIndex($3, $5); }
3500 DBTABLE '(' string_literal ')' { $$ = MkExpDBTable($3); }