4 #define YYLTYPE Location
7 # define YYLLOC_DEFAULT(Current, Rhs, N) \
8 (Current).start = (Rhs)[1].start; \
9 (Current).end = (Rhs)[N].end;
13 extern File fileInput;
19 bool deleteWatchable = false;
21 #define MAX_STRUCT_LEVELS 256
22 AccessMode memberAccessStack[MAX_STRUCT_LEVELS];
23 int defaultMemberAccess = -1;
25 #define POP_DEFAULT_ACCESS if(defaultMemberAccess > -1) defaultMemberAccess--;
35 SpecifierType specifierType;
42 Enumerator enumerator;
43 Declarator declarator;
45 Initializer initializer;
46 InitDeclarator initDeclarator;
48 Declaration declaration;
50 FunctionDefinition function;
55 Instantiation instance;
56 MembersInit membersInit;
57 MemberInit memberInit;
58 ClassFunction classFunction;
59 ClassDefinition _class;
64 PropertyWatch propertyWatch;
65 TemplateParameter templateParameter;
66 TemplateArgument templateArgument;
67 TemplateDatatype templateDatatype;
69 DBTableEntry dbtableEntry;
70 DBIndexItem dbindexItem;
71 DBTableDef dbtableDef;
76 %type <symbol> class_decl
77 %type <specifierType> struct_or_union
78 %type <i> unary_operator assignment_operator
79 %type <declMode> member_access declaration_mode
80 %type <id> identifier enum_decl
81 %type <exp> primary_expression primary_expression_error postfix_expression unary_expression cast_expression
82 multiplicative_expression additive_expression shift_expression
83 relational_expression relational_expression_smaller_than equality_expression and_expression
84 exclusive_or_expression inclusive_or_expression logical_and_expression
85 logical_or_expression conditional_expression assignment_expression
86 constant_expression constant_expression_error
87 anon_instantiation_expression anon_instantiation_expression_error
89 %type <exp> 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
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
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 { FreeClass($$); } class class_error
230 %destructor { FreeClassDef($$); } struct_declaration struct_declaration_error
231 %destructor { delete $$; } ext_decl string_literal
232 %destructor { FreeProperty($$); } property
234 %destructor { FreeList($$, FreeExpression); } argument_expression_list expression expression_error argument_expression_list_error
235 %destructor { FreeList($$, FreeEnumerator); } enumerator_list
236 %destructor { FreeList($$, FreeSpecifier); } type_qualifier_list specifier_qualifier_list declaration_specifiers inheritance_specifiers _inheritance_specifiers external_guess_declaration_specifiers external_guess_declaration_specifiers_error
237 guess_declaration_specifiers guess_specifier_qualifier_list
238 %destructor { FreeList($$, FreeDeclarator); } struct_declarator_list
239 %destructor { FreeList($$, FreeDeclaration); } declaration_list declaration_list_error
240 %destructor { FreeList($$, FreeInitializer); } initializer_list
241 %destructor { FreeList($$, FreeInitDeclarator); } init_declarator_list init_declarator_list_error
242 %destructor { FreeList($$, FreeTypeName); } parameter_list parameter_list_error parameter_type_list parameter_type_list_error identifier_list identifier_list_error
243 %destructor { FreeList($$, FreeStatement); } statement_list statement_list_error
244 %destructor { if($$ != ast) FreeList($$, FreeExternal); } translation_unit translation_unit_error
245 %destructor { FreeList($$, FreeClassDef); } struct_declaration_list struct_declaration_list_error
246 %destructor { FreeList($$, FreeMemberInit); } default_property_list default_property_list_error data_member_initialization_list data_member_initialization_list_coloned data_member_initialization_list_error
247 %destructor { FreeList($$, FreeMembersInit); } members_initialization_list members_initialization_list_coloned members_initialization_list_error
248 %destructor { PopContext($$); FreeContext($$); delete $$; } compound_start
249 %destructor { FreeTemplateParameter($$); } template_parameter template_type_parameter template_identifier_parameter template_expression_parameter
250 %destructor { FreeTemplateArgument($$); } template_argument template_type_argument template_identifier_argument template_expression_argument
251 %destructor { FreeTemplateDataType($$); } template_datatype
252 %destructor { } declaration_mode
261 // if($1._class && !$1._class.name)
265 strcpy(name, $1._class.name ? $1._class.name : "");
267 strcat(name, $1.string);
271 _DeclClass(0, $1.string);
275 fileInput.Seek(@1.start.pos, start);
276 resetScannerPos(&@1.start);
281 YY_STACK_PRINT (yyss, yyssp);
284 YY_STACK_PRINT (yyss, yyssp);
290 // if($1._class && !$1._class.name)
294 strcpy(name, $1._class.name ? $1._class.name : "");
296 strcat(name, $1.string);
300 _DeclClass(0, $1.string);
304 fileInput.Seek(@1.start.pos, start);
305 resetScannerPos(&@1.start);
310 YY_STACK_PRINT (yyss, yyssp);
313 YY_STACK_PRINT (yyss, yyssp);
317 /* | identifier '*' '<' template_arguments_list '>'
319 //if($1._class && !$1._class.name)
323 strcpy(name, $1._class.name ? $1._class.name : "");
325 strcat(name, $1.string);
329 _DeclClass(0, $1.string);
330 fileInput.Seek(@1.start.pos, start);
331 resetScannerPos(&@1.start);
336 YY_STACK_PRINT (yyss, yyssp);
339 YY_STACK_PRINT (yyss, yyssp);
345 strict_type { $$ = $1; }
346 | identifier identifier
349 // if($1._class && !$1._class.name)
353 strcpy(name, $1._class.name ? $1._class.name : "");
355 strcat(name, $1.string);
359 _DeclClass(0, $1.string);
363 fileInput.Seek(@1.start.pos, start);
364 resetScannerPos(&@1.start);
369 YY_STACK_PRINT (yyss, yyssp);
372 YY_STACK_PRINT (yyss, yyssp);
375 Location tmpLoc = yylloc; $$ = $2; yylloc = @1;
376 Compiler_Error("Not a type: %s\n", $1.string);
377 yylloc = tmpLoc; $2.badID = $1;
384 //if($1._class && !$1._class.name)
388 strcpy(name, $1._class.name ? $1._class.name : "");
390 strcat(name, $1.string);
394 _DeclClass(0, $1.string);
395 fileInput.Seek(@1.start.pos, start);
396 resetScannerPos(&@1.start);
401 YY_STACK_PRINT (yyss, yyssp);
404 YY_STACK_PRINT (yyss, yyssp);
408 /* | strict_type '<' template_arguments_list '>' { $$ = $1; }
409 | identifier identifier '<' template_arguments_list '>'
412 // if($1._class && !$1._class.name)
416 strcpy(name, $1._class.name ? $1._class.name : "");
418 strcat(name, $1.string);
422 _DeclClass(0, $1.string);
426 fileInput.Seek(@1.start.pos, start);
427 resetScannerPos(&@1.start);
432 YY_STACK_PRINT (yyss, yyssp);
435 YY_STACK_PRINT (yyss, yyssp);
438 Location tmpLoc = yylloc; $$ = $2; yylloc = @1;
439 Compiler_Error("Not a type: %s\n", $1.string);
440 yylloc = tmpLoc; $2.badID = $1;
446 TYPE_NAME { $$ = MkSpecifierName(yytext); }
449 base_strict_type_name:
450 TYPE_NAME { $$ = CopyString(yytext); }
454 | base_strict_type '<' template_arguments_list '>' { $$ = $1; SetClassTemplateArgs($$, $3); $$.loc = @$; }
455 | base_strict_type '<' template_arguments_list RIGHT_OP
458 SetClassTemplateArgs($$, $3);
462 fileInput.Seek(@4.end.pos, start);
463 resetScannerPos(&@4.end);
467 /* | identifier '<' template_arguments_list '>' */
468 /*| identifier '<' error
470 // if($1._class && !$1._class.name)
474 strcpy(name, $1._class.name ? $1._class.name : "");
476 strcat(name, $1.string);
480 _DeclClass(0, $1.string);
484 fileInput.Seek(@1.start.pos, start);
485 resetScannerPos(&@1.start);
490 YY_STACK_PRINT (yyss, yyssp);
493 YY_STACK_PRINT (yyss, yyssp);
496 YY_STACK_PRINT (yyss, yyssp);
499 /* $$ = MkSpecifierNameArgs($1.string, $3); $$.loc = @$; FreeIdentifier($1); */
503 class_function_definition_start:
504 guess_declaration_specifiers declarator_function
505 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
506 | declarator_function
507 { $$ = MkClassFunction(null, null, $1, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
510 constructor_function_definition_start:
511 guess_declaration_specifiers '(' ')'
512 { $$ = MkClassFunction(null, null, null, null); $$.isConstructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; FreeList($1, FreeSpecifier); }
515 destructor_function_definition_start:
516 '~' guess_declaration_specifiers '(' ')'
517 { $$ = MkClassFunction(null, null, null, null); $$.isDestructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; FreeList($2, FreeSpecifier) }
520 virtual_class_function_definition_start:
521 VIRTUAL guess_declaration_specifiers declarator_function
522 { $$ = MkClassFunction($2, null, $3, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
523 | VIRTUAL declarator_function
524 { $$ = MkClassFunction(null, null, $2, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
527 class_function_definition_start_error:
528 guess_declaration_specifiers declarator_function_error
529 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
530 | declarator_function_error
531 { $$ = MkClassFunction(null, null, $1, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
534 virtual_class_function_definition_start_error:
535 VIRTUAL guess_declaration_specifiers declarator_function_error
536 { $$ = MkClassFunction($2, null, $3, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
537 | VIRTUAL declarator_function_error
538 { $$ = MkClassFunction(null, null, $2, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
541 class_function_definition:
542 class_function_definition_start compound_statement
543 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
544 | virtual_class_function_definition_start compound_statement
545 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
546 | virtual_class_function_definition_start ';'
547 { ProcessClassFunctionBody($1, null); $$.loc = @$; }
548 | constructor_function_definition_start compound_statement
549 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
550 | destructor_function_definition_start compound_statement
551 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
554 | class_function_definition_start ';'
555 { ProcessClassFunctionBody($1, null); $$.loc = @$; }
558 class_function_definition_error:
559 class_function_definition_start compound_statement_error
560 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
561 | class_function_definition_start_error
562 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
563 | virtual_class_function_definition_start compound_statement_error
564 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
565 | virtual_class_function_definition_start_error
566 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
567 | virtual_class_function_definition_start_error ';'
568 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
571 // In Instances, return type is required to distinguish from calling the function
572 instance_class_function_definition_start:
573 declaration_specifiers declarator_function
574 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
575 | declaration_specifiers declarator_nofunction
576 { $$ = MkClassFunction($1, null, MkDeclaratorFunction($2, null), null); $$.loc = @$; $$.id = ++globalContext.nextID; }
579 instance_class_function_definition_start_error:
580 declaration_specifiers declarator_function_error
581 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
584 instance_class_function_definition:
585 instance_class_function_definition_start compound_statement
586 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
589 instance_class_function_definition_error:
590 instance_class_function_definition_start compound_statement_error
591 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; $$.loc.end.charPos++; $$.loc.end.pos++;}
592 | instance_class_function_definition_start_error
593 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
594 | instance_class_function_definition_start
595 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
598 data_member_initialization:
599 postfix_expression '=' initializer_condition { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end;}
600 | initializer_condition { $$ = MkMemberInit(null, $1); $$.loc = @$; $$.realLoc = @$;}
603 data_member_initialization_error:
604 postfix_expression '=' initializer_condition_error { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end;}
605 | postfix_expression '=' error
607 $$ = MkMemberInitExp($1, MkInitializerAssignment(MkExpDummy()));
608 $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = $$.initializer.loc.end = @2.end;
610 fileInput.Seek(@2.end.pos, start);
612 resetScannerPos(&@2.end);
616 | initializer_condition_error { $$ = MkMemberInit(null, $1); $$.loc = @$; $$.realLoc = @$;}
619 data_member_initialization_list:
620 data_member_initialization { $$ = MkList(); ListAdd($$, $1); }
621 | data_member_initialization_list ',' data_member_initialization
622 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
623 | data_member_initialization_list_error ',' data_member_initialization
624 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
627 data_member_initialization_list_error:
628 data_member_initialization_error { $$ = MkList(); ListAdd($$, $1); }
629 | data_member_initialization_list ',' data_member_initialization_error
630 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
631 | data_member_initialization_list_error ',' data_member_initialization_error
632 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
634 | data_member_initialization_list ',' error
635 { ((MemberInit)$1->last).loc.end = @2.end;
637 Initializer dummy = MkInitializerAssignment(MkExpDummy());
638 MemberInit memberInit = MkMemberInit(null, dummy);
639 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @2.end;
640 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @2.end;
641 ListAdd($1, memberInit);
645 data_member_initialization_list_error ',' error
646 { ((MemberInit)$1->last).loc.end = @2.end;
648 Initializer dummy = MkInitializerAssignment(MkExpDummy());
649 MemberInit memberInit = MkMemberInit(null, dummy);
650 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @2.end;
651 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @2.end;
652 ListAdd($1, memberInit);
657 Initializer dummy = MkInitializerAssignment(MkExpDummy());
658 MemberInit memberInit = MkMemberInit(null, dummy);
659 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @1.start;
660 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @1.start;
663 ListAdd($$, memberInit);
665 dummy = MkInitializerAssignment(MkExpDummy());
666 memberInit = MkMemberInit(null, dummy);
667 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @1.end;
668 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @1.end;
669 ListAdd($$, memberInit);
673 data_member_initialization_list_coloned:
674 data_member_initialization_list ';'
675 { if($1->last) ((MemberInit)$1->last).loc.end = @2.end; }
676 | data_member_initialization_list_error ';'
677 { if($1->last) ((MemberInit)$1->last).loc.end = @2.end; }
680 members_initialization_list_coloned:
681 data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($1); $$ = MkList(); ListAdd($$, members); members.loc = @1; }
682 | instance_class_function_definition { $$ = MkList(); ListAdd($$, MkMembersInitMethod($1)); ((MembersInit)$$->last).loc = @1; }
683 | members_initialization_list_error data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($2); ListAdd($$, members); members.loc = @2; }
684 | members_initialization_list_error instance_class_function_definition { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; }
685 | members_initialization_list_coloned data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($2); ListAdd($$, members); members.loc = @2; }
686 | members_initialization_list_coloned instance_class_function_definition { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; }
687 | ';' { MembersInit members = MkMembersInitList(MkList()); $$ = MkList(); ListAdd($$, members); members.loc = @1; }
688 | members_initialization_list_error ';'
689 | members_initialization_list_coloned ';' { MembersInit members = MkMembersInitList(MkList()); ListAdd($$, members); members.loc = @2; }
692 members_initialization_list:
693 members_initialization_list_coloned
694 | data_member_initialization_list { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @1; }
695 | members_initialization_list_coloned data_member_initialization_list { ListAdd($1, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
696 | members_initialization_list_error data_member_initialization_list { ListAdd($1, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
699 members_initialization_list_error:
700 instance_class_function_definition_error { $$ = MkList(); ListAdd($$, MkMembersInitMethod($1)); ((MembersInit)$$->last).loc = @1; }
701 | members_initialization_list instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; }
702 | members_initialization_list_error instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; }
703 | members_initialization_list_coloned instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; }
704 | members_initialization_list_coloned data_member_initialization_list_error { ListAdd($$, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
705 | data_member_initialization_list_error { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @1; }
706 | data_member_initialization_list error { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @2; }
710 instantiation_named_error '}'
711 { $$.loc = @$; $$.insideLoc.end = @2.start; }
712 | instantiation_named_error error '}'
713 { $$.loc = @$; $$.insideLoc.end = @2.start; }
716 instantiation_named_error:
717 declaration_specifiers identifier '{' members_initialization_list_error
718 { $$ = 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++; }
719 | declaration_specifiers identifier '{' members_initialization_list error
720 { $$ = 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++; }
721 | declaration_specifiers identifier '{' members_initialization_list
722 { $$ = 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++; }
723 | declaration_specifiers identifier '{'
724 { $$ = 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++; }
725 | declaration_specifiers identifier '{' error
726 { $$ = 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++; }
731 declaration_specifiers identifier '{' members_initialization_list '}'
732 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
733 | declaration_specifiers identifier '{' members_initialization_list_error '}'
734 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
735 | declaration_specifiers identifier '{' '}'
736 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
739 instantiation_named_error:
740 declaration_specifiers identifier '{' members_initialization_list_error
741 { $$ = 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++; }
742 | declaration_specifiers identifier '{' members_initialization_list error
743 { $$ = 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++; }
744 | declaration_specifiers identifier '{' members_initialization_list
745 { $$ = 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++; }
746 | declaration_specifiers identifier '{'
747 { $$ = 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++; }
748 | declaration_specifiers identifier '{' error
749 { $$ = 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++; }
754 guess_instantiation_named:
755 guess_instantiation_named_error '}'
756 { $$.loc = @$; $$.insideLoc.end = @2.start; }
757 | guess_instantiation_named_error error '}'
758 { $$.loc = @$; $$.insideLoc.end = @2.start; }
761 guess_instantiation_named_error:
762 guess_declaration_specifiers identifier '{' members_initialization_list_error
763 { $$ = 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++; }
764 | guess_declaration_specifiers identifier '{' members_initialization_list error
765 { $$ = 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++; }
766 | guess_declaration_specifiers identifier '{' members_initialization_list
767 { $$ = 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++; }
768 | guess_declaration_specifiers identifier '{'
769 { $$ = 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++; }
770 | guess_declaration_specifiers identifier '{' error
771 { $$ = 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++; }
775 guess_instantiation_named:
776 guess_declaration_specifiers identifier '{' members_initialization_list '}'
777 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
778 | guess_declaration_specifiers identifier '{' members_initialization_list_error '}'
779 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
780 | guess_declaration_specifiers identifier '{' '}'
781 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
784 guess_instantiation_named_error:
785 guess_declaration_specifiers identifier '{' members_initialization_list_error
786 { $$ = 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++; }
787 | guess_declaration_specifiers identifier '{' members_initialization_list error
788 { $$ = 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++; }
789 | guess_declaration_specifiers identifier '{' members_initialization_list
790 { $$ = 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++; }
791 | guess_declaration_specifiers identifier '{'
792 { $$ = 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++; }
793 | guess_declaration_specifiers identifier '{' error
794 { $$ = 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++; }
798 external_guess_instantiation_named:
799 external_guess_declaration_specifiers identifier '{' members_initialization_list '}'
800 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
801 | external_guess_declaration_specifiers identifier '{' members_initialization_list_error '}'
802 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
803 | external_guess_declaration_specifiers identifier '{' '}'
804 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
807 instantiation_unnamed:
808 instantiation_unnamed_error '}'
809 { $$.loc = @$; $$.insideLoc.end = @2.start; }
810 | instantiation_unnamed_error error '}'
811 { $$.loc = @$; $$.insideLoc.end = @2.start; }
814 instantiation_unnamed_error:
815 strict_type '{' members_initialization_list
816 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
817 | identifier '{' members_initialization_list
818 { Location tmpLoc = yylloc; yylloc = @1;
819 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; FreeIdentifier($1); }
821 | strict_type '{' members_initialization_list_error
822 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
824 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
825 | strict_type '{' members_initialization_list error
826 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
827 | strict_type '{' error
828 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
832 | identifier '{' members_initialization_list_error
833 { Location tmpLoc = yylloc; yylloc = @1;
834 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); }
836 { Location tmpLoc = yylloc; yylloc = @1;
837 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); }
838 | identifier '{' members_initialization_list error
839 { Location tmpLoc = yylloc; yylloc = @1;
840 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); }
841 | identifier '{' error
842 { Location tmpLoc = yylloc; yylloc = @1;
843 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); }
847 instantiation_unnamed:
848 strict_type '{' members_initialization_list '}'
849 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; }
850 | strict_type '{' members_initialization_list error '}'
851 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @5.start; }
852 | strict_type '{' members_initialization_list_error '}'
853 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; }
854 | strict_type '{' '}'
855 { $$ = MkInstantiation($1, null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.start;}
856 | strict_type '{' error '}'
857 { $$ = MkInstantiation($1, null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start;}
860 | identifier '{' members_initialization_list '}'
861 { Location tmpLoc = yylloc; yylloc = @1;
862 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
863 | identifier '{' members_initialization_list_error '}'
864 { Location tmpLoc = yylloc; yylloc = @1;
865 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
866 | identifier '{' members_initialization_list error '}'
868 $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @5.start; FreeIdentifier($1); }
870 { Location tmpLoc = yylloc; yylloc = @1;
871 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.start; FreeIdentifier($1);}
872 | identifier '{' error '}'
873 { Location tmpLoc = yylloc; yylloc = @1;
874 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
878 instantiation_unnamed_error:
879 strict_type '{' members_initialization_list_error
880 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
882 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
883 | strict_type '{' members_initialization_list error
884 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
885 | strict_type '{' error
886 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
890 | identifier '{' members_initialization_list_error
891 { Location tmpLoc = yylloc; yylloc = @1;
892 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); }
894 { Location tmpLoc = yylloc; yylloc = @1;
895 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); }
896 | identifier '{' members_initialization_list error
897 { Location tmpLoc = yylloc; yylloc = @1;
898 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); }
899 | identifier '{' error
900 { Location tmpLoc = yylloc; yylloc = @1;
901 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); }
906 instantiation_anon_error '}'
907 { $$.loc = @$; $$.insideLoc.end = @2.start; }
908 | instantiation_anon_error error '}'
909 { $$.loc = @$; $$.insideLoc.end = @2.start; }
912 instantiation_anon_error:
913 '{' members_initialization_list_error
914 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
915 | '{' members_initialization_list error
916 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
918 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
920 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
921 | '{' members_initialization_list
922 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
927 '{' members_initialization_list '}'
928 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start; }
929 | '{' members_initialization_list error '}'
930 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @4.start; }
931 | '{' members_initialization_list_error '}'
932 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start; }
934 { $$ = MkInstantiation(null, null, MkList()); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.start;}
936 { $$ = MkInstantiation(null, null, MkList()); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start;}
939 instantiation_anon_error:
940 '{' members_initialization_list_error
941 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
943 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
944 | '{' members_initialization_list error
945 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
947 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
952 postfix_expression '=' initializer_condition { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; }
955 default_property_error:
956 postfix_expression '=' initializer_condition_error { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end; }
957 | postfix_expression '=' error { $$ = MkMemberInitExp($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end; $$.initializer.loc.end = @2.end; }
958 | postfix_expression error { $$ = MkMemberInitExp($1, null); $$.loc = @$; $$.realLoc = @$; }
961 default_property_list:
962 default_property { $$ = MkList(); ListAdd($$, $1); ((MemberInit)$$->last).loc = @$; }
963 | default_property_list ',' default_property { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
964 | default_property_list_error ',' default_property { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
967 default_property_list_error:
968 default_property_error { $$ = MkList(); ListAdd($$, $1); ((MemberInit)$$->last).loc = @$; }
969 | default_property_list ',' default_property_error { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
970 | default_property_list_error ',' default_property_error { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); }
971 | default_property_list error
975 PROPERTY property_specifiers identifier '{'
976 { $$ = MkProperty($2, null, $3, null, null); $$.loc = @$; }
978 | PROPERTY property_specifiers abstract_declarator identifier '{'
979 { $$ = MkProperty($2, $3, $4, null, null); $$.loc = @$; }
981 | PROPERTY property_specifiers '{'
982 { $$ = MkProperty($2, null, null, null, null); $$.loc = @$; }
984 | PROPERTY property_specifiers abstract_declarator '{'
985 { $$ = MkProperty($2, $3, null, null, null); $$.loc = @$; }
988 { $$ = MkProperty(null, null, null, null, null); $$.loc = @$; }
993 | property_body SETPROP compound_statement
995 | property_body GETPROP compound_statement
997 | property_body ISPROPSET compound_statement
998 { $1.issetStmt = $3; }
999 | property_body WATCHABLE
1000 { $1.isWatchable = true; }
1001 | property_body PROPERTY_CATEGORY string_literal
1002 { $1.category = $3; }
1006 property_body '}' { $1.loc.end = @2.end; }
1009 class_property_start:
1010 CLASS_PROPERTY property_specifiers identifier '{'
1011 { $$ = MkProperty($2, null, $3, null, null); $$.loc = @$; }
1013 | CLASS_PROPERTY property_specifiers abstract_declarator identifier '{'
1014 { $$ = MkProperty($2, $3, $4, null, null); $$.loc = @$; }
1016 | CLASS_PROPERTY property_specifiers '{'
1017 { $$ = MkProperty($2, null, null, null, null); $$.loc = @$; }
1019 | CLASS_PROPERTY property_specifiers abstract_declarator '{'
1020 { $$ = MkProperty($2, $3, null, null, null); $$.loc = @$; }
1022 | CLASS_PROPERTY error '{'
1023 { $$ = MkProperty(null, null, null, null, null); $$.loc = @$; }
1026 class_property_body:
1027 class_property_start
1028 | class_property_body SETPROP compound_statement
1029 { $1.setStmt = $3; }
1030 | class_property_body GETPROP compound_statement
1031 { $1.getStmt = $3; }
1035 class_property_body '}' { $1.loc.end = @2.end; }
1038 watch_property_list:
1040 { $$ = MkListOne($1); }
1041 | watch_property_list identifier
1042 { ListAdd($1, $2); }
1046 watch_property_list compound_statement
1047 { $$ = MkPropertyWatch($1, $2); }
1048 | DELETE compound_statement
1049 { $$ = MkDeleteWatch($2); }
1052 property_watch_list:
1054 { $$ = MkListOne($1); }
1055 | property_watch_list property_watch
1056 { ListAdd($1, $2); }
1059 self_watch_definition:
1060 WATCH '(' watch_property_list ')' compound_statement
1061 { $$ = MkPropertyWatch($3, $5); }
1065 WATCH '(' assignment_expression ')' '{' property_watch_list '}'
1066 { $$ = MkWatchStmt(null, $3, $6); }
1067 | assignment_expression '.' WATCH '(' assignment_expression ')' '{' property_watch_list '}'
1068 { $$ = MkWatchStmt($1, $5, $8); }
1072 STOPWATCHING '(' assignment_expression ',' watch_property_list ')'
1073 { $$ = MkStopWatchingStmt(null, $3, $5); }
1074 | assignment_expression '.' STOPWATCHING '(' assignment_expression ',' watch_property_list ')'
1075 { $$ = MkStopWatchingStmt($1, $5, $7); }
1076 | STOPWATCHING '(' assignment_expression ')'
1077 { $$ = MkStopWatchingStmt(null, $3, null); }
1078 | assignment_expression '.' STOPWATCHING '(' assignment_expression ')'
1079 { $$ = MkStopWatchingStmt($1, $5, null); }
1084 { $$ = MkFireWatchersStmt(null, null); }
1085 | FIREWATCHERS watch_property_list
1086 { $$ = MkFireWatchersStmt(null, $2); }
1087 | postfix_expression '.' FIREWATCHERS
1088 { $$ = MkFireWatchersStmt($1, null); }
1089 | assignment_expression '.' FIREWATCHERS watch_property_list
1090 { $$ = MkFireWatchersStmt($1, $4); }
1094 guess_declaration_specifiers struct_declarator_list ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($1, $2, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1095 | guess_declaration_specifiers ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($1, null, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1096 | instantiation_unnamed ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1097 | guess_instantiation_named ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1098 | class_function_definition { $$ = MkClassDefFunction($1); $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1099 | property { $$ = MkClassDefProperty($1); $$.loc = @$; globalContext.nextID++; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1101 | member_access guess_declaration_specifiers struct_declarator_list ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($2, $3, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = $1; }
1102 | member_access guess_declaration_specifiers ';' { $$ = MkClassDefDeclaration(MkStructDeclaration($2, null, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = $1; }
1103 | member_access instantiation_unnamed ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = $1; }
1104 | member_access guess_instantiation_named ';' { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = $1; }
1105 | member_access class_function_definition { $$ = MkClassDefFunction($2); $$.loc = @$; $$.memberAccess = $1; }
1106 | member_access property { $$ = MkClassDefProperty($2); $$.loc = @$; globalContext.nextID++; $$.memberAccess = $1; }
1108 | default_property_list ';' { $$ = MkClassDefDefaultProperty($1); if($1->last) ((MemberInit)$1->last).loc.end = @2.start; $$.loc = @$; }
1109 | CLASS_DATA guess_declaration_specifiers struct_declarator_list ';' { $$ = MkClassDefClassData(MkStructDeclaration($2, $3, null)); $$.decl.loc = @$; $$.loc = @$; }
1110 | class_property { $$ = MkClassDefClassProperty($1); $$.loc = @$; globalContext.nextID++; }
1111 | self_watch_definition ';' { $$ = MkClassDefPropertyWatch($1); $$.loc = @$; globalContext.nextID++; }
1112 | WATCHABLE { $$ = null; deleteWatchable = true; }
1113 | CLASS_DESIGNER identifier ';' { $$ = MkClassDefDesigner($2.string); FreeIdentifier($2); }
1114 | CLASS_DESIGNER strict_type ';' { $$ = MkClassDefDesigner($2.name); FreeSpecifier($2); }
1115 | CLASS_NO_EXPANSION { $$ = MkClassDefNoExpansion(); }
1116 | CLASS_FIXED { $$ = MkClassDefFixed(); }
1117 | CLASS_DEFAULT_PROPERTY identifier ';' { $$ = MkClassDefDesignerDefaultProperty($2); }
1118 | CLASS_PROPERTY '(' identifier ')' '=' initializer_condition ';' { $$ = MkClassDefClassPropertyValue($3, $6); $$.loc = @$; }
1120 | ';' { $$ = null; }
1121 | member_access ':' { memberAccessStack[defaultMemberAccess] = $1; if(defaultMemberAccess == 0) { $$ = MkClassDefMemberAccess(); $$.memberAccess = $1; $$.loc = @$; } else $$ = null; }
1123 | member_access '(' identifier ')' { $$ = MkClassDefAccessOverride($1, $3); $$.loc = @$; }
1126 struct_declaration_error:
1127 class_function_definition_error { $$ = MkClassDefFunction($1); $$.loc = $1.loc; $$.loc.end.charPos++; $$.loc.end.pos++; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1128 | guess_instantiation_named_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1129 | instantiation_unnamed_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1130 | guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1131 | instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1133 | member_access class_function_definition_error { $$ = MkClassDefFunction($2); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.memberAccess = $1; }
1134 | member_access guess_instantiation_named_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1135 | member_access instantiation_unnamed_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1136 | member_access guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1137 | member_access instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1139 | default_property_list_error { $$ = MkClassDefDefaultProperty($1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
1142 struct_declaration_list:
1143 struct_declaration { $$ = MkList(); ListAdd($$, $1); }
1144 | struct_declaration_list struct_declaration { ListAdd($1, $2); }
1145 | struct_declaration_list_error struct_declaration { ListAdd($1, $2); }
1148 struct_declaration_list_error:
1149 struct_declaration_error { $$ = MkList(); ListAdd($$, $1); }
1150 | struct_declaration_list error
1151 | struct_declaration_list_error error
1152 | struct_declaration_list struct_declaration_error { ListAdd($$, $2); }
1153 | struct_declaration_list_error struct_declaration_error { ListAdd($$, $2); }
1157 declaration_specifiers { $$ = MkTemplateDatatype($1, null); }
1158 | declaration_specifiers abstract_declarator { $$ = MkTemplateDatatype($1, $2); }
1159 | identifier { $$ = MkTemplateDatatype(MkListOne(MkSpecifierName($1.string)), null); FreeIdentifier($1); }
1162 template_type_argument:
1163 template_datatype { $$ = MkTemplateTypeArgument($1); }
1166 template_type_parameter:
1167 CLASS identifier { $$ = MkTypeTemplateParameter($2, null, null); }
1168 | CLASS identifier '=' template_type_argument { $$ = MkTypeTemplateParameter($2, null, $4); }
1169 | CLASS identifier ':' template_datatype { $$ = MkTypeTemplateParameter($2, $4, null); }
1170 | CLASS identifier ':' template_datatype '=' template_type_argument { $$ = MkTypeTemplateParameter($2, $4, $6); }
1171 | CLASS base_strict_type_name { $$ = MkTypeTemplateParameter(MkIdentifier($2), null, null); delete $2; }
1172 | CLASS base_strict_type_name '=' template_type_argument { $$ = MkTypeTemplateParameter(MkIdentifier($2), null, $4); }
1173 | CLASS base_strict_type_name ':' template_datatype { $$ = MkTypeTemplateParameter(MkIdentifier($2), $4, null); }
1174 | CLASS base_strict_type_name ':' template_datatype '=' template_type_argument { $$ = MkTypeTemplateParameter(MkIdentifier($2), $4, $6); }
1177 template_identifier_argument:
1178 identifier { $$ = MkTemplateIdentifierArgument($1); }
1181 template_identifier_parameter:
1182 identifier { $$ = MkIdentifierTemplateParameter($1, dataMember, null); }
1183 | identifier '=' template_identifier_argument { $$ = MkIdentifierTemplateParameter($1, dataMember, $3); }
1186 template_expression_argument:
1187 constant_expression { $$ = MkTemplateExpressionArgument($1); }
1190 template_expression_parameter:
1191 template_datatype identifier { $$ = MkExpressionTemplateParameter($2, $1, null); }
1192 | template_datatype identifier '=' template_expression_argument { $$ = MkExpressionTemplateParameter($2, $1, $4); }
1196 template_type_parameter
1197 | template_identifier_parameter
1198 | template_expression_parameter
1201 template_parameters_list:
1202 template_parameter { $$ = MkList(); ListAdd($$, $1); }
1203 | template_parameters_list ',' template_parameter { ListAdd($1, $3); }
1207 template_expression_argument
1208 | template_identifier_argument
1209 | template_type_argument
1210 | identifier '=' template_expression_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1211 | identifier '=' template_identifier_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1212 | identifier '=' template_type_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1213 | template_datatype '=' template_expression_argument
1216 if($1.specifiers && $1.specifiers->first)
1218 Specifier spec = $1.specifiers->first;
1219 if(spec.type == nameSpecifier)
1220 $$.name = MkIdentifier(spec.name);
1222 FreeTemplateDataType($1);
1225 | template_datatype '=' template_identifier_argument
1228 if($1.specifiers && $1.specifiers->first)
1230 Specifier spec = $1.specifiers->first;
1231 if(spec.type == nameSpecifier)
1232 $$.name = MkIdentifier(spec.name);
1234 FreeTemplateDataType($1);
1237 | template_datatype '=' template_type_argument
1240 if($1.specifiers && $1.specifiers->first)
1242 Specifier spec = $1.specifiers->first;
1243 if(spec.type == nameSpecifier)
1244 $$.name = MkIdentifier(spec.name);
1246 FreeTemplateDataType($1);
1251 template_arguments_list:
1252 template_argument { $$ = MkList(); ListAdd($$, $1); }
1253 | template_arguments_list ',' template_argument { ListAdd($1, $3); }
1263 class_entry identifier { $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1264 | class_entry base_strict_type
1266 $$ = DeclClass(globalContext.nextID++, $2.name);
1269 ++defaultMemberAccess;
1270 memberAccessStack[defaultMemberAccess] = privateAccess;
1272 | identifier class_entry identifier { $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1273 | identifier class_entry base_strict_type { $$ = DeclClass(globalContext.nextID++, $3.name); FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1275 | class_entry identifier '<' template_parameters_list '>' { $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); $$.templateParams = $4; FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1276 | class_entry base_strict_type '<' template_parameters_list '>'
1278 $$ = DeclClass(globalContext.nextID++, $2.name);
1279 $$.templateParams = $4;
1282 ++defaultMemberAccess;
1283 memberAccessStack[defaultMemberAccess] = privateAccess;
1285 | identifier class_entry identifier '<' template_parameters_list '>' { $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); $$.templateParams = $5; FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1286 | identifier class_entry base_strict_type '<' template_parameters_list '>' { $$ = DeclClass(globalContext.nextID++, $3.name); $$.templateParams = $5; FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1295 // Added this for unit classes...
1298 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1300 PopContext(curContext);
1303 | class_decl '{' '}'
1305 $$ = MkClass($1, null, MkList()); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1307 PopContext(curContext);
1309 | class_head '{' '}'
1311 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1313 PopContext(curContext);
1316 | class_entry identifier ';'
1318 $$ = MkClass(DeclClassAddNameSpace(0, $2.string), null, null); FreeIdentifier($2);
1320 PopContext(curContext);
1322 | class_entry type ';'
1324 $$ = MkClass(DeclClass(0, $2.name), null, null); FreeSpecifier($2);
1326 PopContext(curContext);
1331 class_decl ':' inheritance_specifiers
1333 $$ = MkClass($1, $3, null);
1338 class_decl '{' struct_declaration_list_error
1340 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1342 PopContext(curContext);
1344 | class_head '{' struct_declaration_list_error
1346 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1348 PopContext(curContext);
1350 | class_decl '{' struct_declaration_list
1352 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1354 PopContext(curContext);
1356 | class_head '{' struct_declaration_list
1358 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1360 PopContext(curContext);
1362 | class_decl '{' error
1364 $$ = MkClass($1, null, MkList()); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1366 PopContext(curContext);
1368 | class_head '{' error
1370 $$ = $1; $$.definitions = MkList(); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1372 PopContext(curContext);
1376 /**** EXPRESSIONS ********************************************************************/
1380 { $$ = MkIdentifier(yytext); $$.loc = @1; }
1384 simple_primary_expression
1385 | '(' expression ')'
1386 { $$ = MkExpBrackets($2); $$.loc = @$; }
1389 simple_primary_expression:
1390 identifier { $$ = MkExpIdentifier($1); $$.loc = @$; }
1391 | instantiation_unnamed { $$ = MkExpInstance($1); $$.loc = @$; }
1392 | EXTENSION '(' compound_statement ')' { $$ = MkExpExtensionCompound($3); $$.loc = @$; }
1393 | EXTENSION '(' expression ')' { $$ = MkExpExtensionExpression($3); $$.loc = @$; }
1394 | EXTENSION '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, $5); $$.loc = @$; }
1395 | EXTENSION '(' type_name ')' '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, MkInitializerAssignment(MkExpExtensionInitializer($6, $8))); $$.loc = @$; }
1396 | CONSTANT { $$ = MkExpConstant(yytext); $$.loc = @$; }
1397 | string_literal { $$ = MkExpString($1); delete $1; $$.loc = @$; }
1398 | '$' string_literal { $$ = MkExpIntlString($2, null); delete $2; $$.loc = @$; }
1399 | '$' string_literal '.' string_literal { $$ = MkExpIntlString($4, $2); delete $2; delete $4; $$.loc = @$; }
1400 | '(' ')' { Expression exp = MkExpDummy(); exp.loc.start = @1.end; exp.loc.end = @2.start; $$ = MkExpBrackets(MkListOne(exp)); $$.loc = @$; yyerror(); }
1401 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1402 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1403 | NEWOP new_specifiers '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1404 | NEWOP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1405 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1406 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1407 | NEW0OP new_specifiers '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1408 | NEW0OP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1409 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1410 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1411 | RENEW constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1412 | RENEW constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1413 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1414 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1415 | RENEW0 constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1416 | RENEW0 constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1417 | CLASS '(' declaration_specifiers ')' { $$ = MkExpClass($3, null); $$.loc = @$; }
1418 | CLASS '(' declaration_specifiers abstract_declarator ')' { $$ = MkExpClass($3, $4); $$.loc = @$; }
1419 | CLASS '(' identifier ')' { $$ = MkExpClass(MkListOne(MkSpecifierName($3.string)), null); FreeIdentifier($3); $$.loc = @$; }
1420 | VAARG '(' assignment_expression ',' type_name ')' { $$ = MkExpVaArg($3, $5); $$.loc = @$; }
1422 | CLASS_DATA '(' identifier ')' { $$ = MkExpClassData($3); $$.loc = @$; }
1428 | '[' argument_expression_list /*expression*/ ']' { $$ = MkExpArray($2); $$.loc = @$; }
1431 anon_instantiation_expression:
1432 instantiation_anon { $$ = MkExpInstance($1); $$.loc = @$; }
1435 anon_instantiation_expression_error:
1436 instantiation_anon_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1439 primary_expression_error:
1440 '(' expression { $$ = MkExpBrackets($2); $$.loc = @$; }
1441 | '(' expression_error { $$ = MkExpBrackets($2); $$.loc = @$; }
1447 | postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1448 | postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1449 | postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1450 | postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1451 | 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; }
1452 | postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1453 | postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1454 | postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1455 | postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1457 | postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1458 | postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1459 | postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1460 | postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1461 | postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1462 | postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1463 | postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1464 | postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1467 simple_postfix_expression:
1468 simple_primary_expression
1470 | simple_postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1471 | simple_postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1472 | simple_postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1473 | simple_postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1474 | 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; }
1475 | simple_postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1476 | simple_postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1477 | simple_postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1478 | simple_postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1480 | simple_postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1481 | simple_postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1482 | simple_postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1483 | simple_postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1484 | simple_postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1485 | simple_postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1486 | simple_postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1487 | simple_postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1490 argument_expression_list:
1491 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1492 | anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1493 | argument_expression_list ',' assignment_expression { ListAdd($1, $3); }
1494 | argument_expression_list ',' anon_instantiation_expression { ListAdd($1, $3); }
1497 argument_expression_list_error:
1498 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
1499 | anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
1500 | argument_expression_list ',' assignment_expression_error { ListAdd($1, $3); }
1501 | argument_expression_list ',' anon_instantiation_expression_error { ListAdd($1, $3); }
1502 | argument_expression_list ',' { Expression exp = MkExpDummy(); exp.loc.start = @2.end; exp.loc.end = @2.end; ListAdd($1, exp); }
1505 common_unary_expression:
1506 INC_OP unary_expression { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1507 | DEC_OP unary_expression { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1508 | unary_operator cast_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1509 | unary_operator anon_instantiation_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1510 | SIZEOF '(' unary_expression ')' { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1511 | SIZEOF simple_unary_expression { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1512 | SIZEOF '(' guess_type_name ')' { $$ = MkExpTypeSize($3); $$.loc = @$; }
1513 | SIZEOF '(' CLASS type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1514 | SIZEOF '(' CLASS guess_type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1518 common_unary_expression
1519 | postfix_expression
1522 simple_unary_expression:
1523 common_unary_expression
1524 | simple_postfix_expression
1534 | DELETE { $$ = DELETE; }
1535 | _INCREF { $$ = _INCREF; }
1540 | '(' type_name ')' cast_expression { $$ = MkExpCast($2, $4); $$.loc = @$; }
1543 multiplicative_expression:
1545 | multiplicative_expression '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1546 | multiplicative_expression '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1547 | multiplicative_expression '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1548 | multiplicative_expression_error '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1549 | multiplicative_expression_error '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1550 | multiplicative_expression_error '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1553 additive_expression:
1554 multiplicative_expression
1555 | additive_expression '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1556 | additive_expression '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1557 | additive_expression_error '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1558 | additive_expression_error '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1563 | shift_expression LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1564 | shift_expression RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1565 | shift_expression_error LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1566 | shift_expression_error RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1569 relational_expression_smaller_than:
1570 relational_expression '<'
1577 relational_expression:
1579 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression { skipErrors = false; $$ = MkExpOp($1, '<', $2/*$3*/); $$.loc = @$; }
1580 | relational_expression '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1581 | relational_expression LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1582 | relational_expression GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1583 | relational_expression_error '<' shift_expression { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1584 | relational_expression_error '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1585 | relational_expression_error LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1586 | relational_expression_error GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1590 : relational_expression
1591 | equality_expression EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1592 | equality_expression NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1593 | equality_expression_error EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1594 | equality_expression_error NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1596 | equality_expression EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1597 | equality_expression NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1598 | equality_expression_error EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1599 | equality_expression_error NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1603 : equality_expression
1604 | and_expression '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1605 | and_expression_error '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1607 | and_expression '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1608 | and_expression_error '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1611 exclusive_or_expression
1613 | exclusive_or_expression '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1614 | exclusive_or_expression_error '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1616 | exclusive_or_expression '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1617 | exclusive_or_expression_error '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1620 inclusive_or_expression
1621 : exclusive_or_expression
1622 | inclusive_or_expression '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1623 | inclusive_or_expression_error '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1625 | inclusive_or_expression '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1626 | inclusive_or_expression_error '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1629 logical_and_expression
1630 : inclusive_or_expression
1631 | logical_and_expression AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1632 | logical_and_expression_error AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1635 logical_or_expression
1636 : logical_and_expression
1637 | logical_or_expression OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1638 | logical_or_expression_error OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1641 conditional_expression
1642 : logical_or_expression
1643 | logical_or_expression '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1644 | logical_or_expression '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1645 | logical_or_expression_error '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1646 | logical_or_expression_error '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1648 | logical_or_expression '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1649 | logical_or_expression '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1650 | logical_or_expression_error '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1651 | logical_or_expression_error '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1653 | logical_or_expression '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1654 | logical_or_expression '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1655 | logical_or_expression_error '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1656 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1658 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1659 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1660 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1661 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1664 assignment_expression:
1665 conditional_expression
1666 | unary_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1667 | unary_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1668 | conditional_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; } // TODO: Generate error here:
1669 | conditional_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; } // TODO: Generate error here:
1671 | unary_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1672 | unary_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1673 | conditional_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1674 | conditional_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1677 assignment_operator:
1679 | MUL_ASSIGN { $$ = MUL_ASSIGN; }
1680 | DIV_ASSIGN { $$ = DIV_ASSIGN; }
1681 | MOD_ASSIGN { $$ = MOD_ASSIGN; }
1682 | ADD_ASSIGN { $$ = ADD_ASSIGN; }
1683 | SUB_ASSIGN { $$ = SUB_ASSIGN; }
1684 | LEFT_ASSIGN { $$ = LEFT_ASSIGN; }
1685 | RIGHT_ASSIGN { $$ = RIGHT_ASSIGN; }
1686 | AND_ASSIGN { $$ = AND_ASSIGN; }
1687 | XOR_ASSIGN { $$ = XOR_ASSIGN; }
1688 | OR_ASSIGN { $$ = OR_ASSIGN; }
1692 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1693 | expression ',' assignment_expression { ListAdd($1, $3); }
1694 | expression_error ',' assignment_expression { ListAdd($1, $3); }
1695 | expression_error ')'
1698 expression_anon_inst:
1699 anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1700 | expression ',' anon_instantiation_expression { ListAdd($1, $3); }
1701 | expression_error ',' anon_instantiation_expression { ListAdd($1, $3); }
1704 postfix_expression_error:
1705 primary_expression_error
1706 | error { $$ = MkExpDummy(); $$.loc = @$; /*printf("Sorry, didn't mean that syntax error\n");*/ }
1707 | postfix_expression error
1708 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1710 | postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1711 | postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1713 | postfix_expression '(' argument_expression_list { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1714 | postfix_expression '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1715 | postfix_expression '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; $$.call.argLoc.end.charPos++;}
1716 | postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; /*@2.end; $$.call.argLoc.end.charPos++;*/ }
1717 | postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1719 | 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++;}
1720 | 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++;}
1721 | postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1722 | postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1725 simple_postfix_expression_error:
1726 error { $$ = MkExpDummy(); $$.loc = @$; }
1727 | simple_postfix_expression error
1728 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1730 | simple_postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1731 | simple_postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1733 | simple_postfix_expression '(' argument_expression_list { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1734 | 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++;}
1735 | 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++;}
1736 | simple_postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; /*@2.end; $$.call.argLoc.end.charPos++;*/ }
1737 | simple_postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1739 | 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++;}
1740 | 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++;}
1741 | simple_postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1742 | simple_postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1745 common_unary_expression_error:
1746 INC_OP unary_expression_error { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1747 | DEC_OP unary_expression_error { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1748 | unary_operator cast_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1749 | unary_operator anon_instantiation_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1750 | SIZEOF '(' unary_expression_error { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1751 | SIZEOF simple_unary_expression_error { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1752 | SIZEOF '(' guess_type_name ')' error { $$ = MkExpTypeSize($3); $$.loc = @$; }
1753 | SIZEOF '(' CLASS type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1754 | SIZEOF '(' CLASS guess_type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1757 unary_expression_error:
1758 common_unary_expression_error
1759 | postfix_expression_error
1762 simple_unary_expression_error:
1763 common_unary_expression_error
1764 | simple_postfix_expression_error
1768 cast_expression_error:
1769 unary_expression_error
1770 | '(' type_name ')' cast_expression_error { $$ = MkExpCast($2, $4); $$.loc = @$; }
1773 multiplicative_expression_error:
1774 cast_expression_error
1775 | multiplicative_expression '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1776 | multiplicative_expression '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1777 | multiplicative_expression '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1778 | multiplicative_expression_error '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1779 | multiplicative_expression_error '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1780 | multiplicative_expression_error '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1783 additive_expression_error:
1784 multiplicative_expression_error
1785 | additive_expression '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1786 | additive_expression '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1787 | additive_expression '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1788 | additive_expression '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1789 | additive_expression_error '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1790 | additive_expression_error '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1791 | additive_expression_error '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1792 | additive_expression_error '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1795 shift_expression_error:
1796 additive_expression_error
1797 | shift_expression LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1798 | shift_expression RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1799 | shift_expression_error LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1800 | shift_expression_error RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1803 relational_expression_error:
1804 shift_expression_error
1805 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression_error
1807 if($1.type == identifierExp)
1809 if($1.identifier._class && !$1.identifier._class.name)
1813 strcat(name, $1.identifier.string);
1814 _DeclClass(0, name);
1817 _DeclClass(0, $1.identifier.string);
1819 // printf("Declaring Class %s\n", $1.identifier.string);
1824 fileInput.Seek(@1.start.pos, start);
1825 resetScannerPos(&@1.start);
1830 YY_STACK_PRINT (yyss, yyssp);
1834 YY_STACK_PRINT (yyss, yyssp);
1838 YY_STACK_PRINT (yyss, yyssp);
1842 YY_STACK_PRINT (yyss, yyssp);
1850 $$ = MkExpOp($1, '<', $2);
1855 | relational_expression '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1856 | relational_expression LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1857 | relational_expression GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1858 | relational_expression_error '<' shift_expression_error { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1859 | relational_expression_error '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1860 | relational_expression_error LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1861 | relational_expression_error GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1864 equality_expression_error:
1865 relational_expression_error
1866 | equality_expression EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1867 | equality_expression NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1868 | equality_expression_error EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1869 | equality_expression_error NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1871 | equality_expression EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1872 | equality_expression NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1873 | equality_expression_error EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1874 | equality_expression_error NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1876 | equality_expression EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1877 | equality_expression NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1878 | equality_expression_error EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1879 | equality_expression_error NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1882 and_expression_error:
1883 equality_expression_error
1884 | and_expression '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1885 | and_expression_error '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1887 | and_expression '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1888 | and_expression_error '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1891 exclusive_or_expression_error:
1892 and_expression_error
1893 | exclusive_or_expression '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1894 | exclusive_or_expression_error '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1896 | exclusive_or_expression '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1897 | exclusive_or_expression_error '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1900 inclusive_or_expression_error:
1901 exclusive_or_expression_error
1902 | inclusive_or_expression '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1903 | inclusive_or_expression_error '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1905 | inclusive_or_expression '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1906 | inclusive_or_expression_error '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1909 logical_and_expression_error:
1910 inclusive_or_expression_error
1911 | logical_and_expression AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1912 | logical_and_expression_error AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1915 logical_or_expression_error:
1916 logical_and_expression_error
1917 | logical_or_expression OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1918 | logical_or_expression_error OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1921 conditional_expression_error:
1922 logical_or_expression_error
1923 | logical_or_expression '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1924 | logical_or_expression '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1925 | logical_or_expression_error '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1926 | logical_or_expression_error '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1927 | logical_or_expression '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1928 | logical_or_expression '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1929 | logical_or_expression_error '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1930 | logical_or_expression_error '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1932 | logical_or_expression '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1933 | logical_or_expression '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1934 | logical_or_expression_error '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1935 | logical_or_expression_error '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1936 | logical_or_expression '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1937 | logical_or_expression '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1938 | logical_or_expression_error '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1939 | logical_or_expression_error '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
1941 | logical_or_expression '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1942 | logical_or_expression '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1943 | logical_or_expression_error '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1944 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1946 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1947 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1948 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1949 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1951 | logical_or_expression '?' ':'
1953 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy());
1955 ((Expression)$$.cond.exp->last).loc = @2;
1956 $$.cond.elseExp.loc = @3;
1958 | logical_or_expression_error '?' ':'
1960 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @3;
1962 | logical_or_expression '?'
1964 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
1966 | logical_or_expression_error '?'
1968 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
1972 assignment_expression_error:
1973 conditional_expression_error
1974 | unary_expression assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1975 | unary_expression assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
1976 | unary_expression_error assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1977 | unary_expression_error assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
1979 | unary_expression assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1980 | unary_expression_error assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1984 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
1985 | assignment_expression error { $$ = MkList(); ListAdd($$, $1); }
1986 | expression ',' assignment_expression_error { ListAdd($1, $3); }
1987 | expression_error ',' assignment_expression_error { ListAdd($1, $3); }
1988 | expression ',' error
1989 | expression_error ',' error
1991 | expression expression { FreeList($2, FreeExpression); }
1992 | expression_error expression { FreeList($2, FreeExpression); }
1993 | expression expression_error { FreeList($2, FreeExpression); }
1996 expression_anon_inst_error:
1997 anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
1998 | anon_instantiation_expression error { $$ = MkList(); ListAdd($$, $1); }
1999 | expression ',' anon_instantiation_expression_error { ListAdd($1, $3); }
2000 | expression_error ',' anon_instantiation_expression_error { ListAdd($1, $3); }
2004 constant_expression: conditional_expression;
2006 constant_expression_error: conditional_expression_error;
2008 /**** TYPES **************************************************************************/
2009 storage_class_specifier:
2010 TYPEDEF { $$ = MkSpecifier(TYPEDEF); }
2011 | EXTERN { $$ = MkSpecifier(EXTERN); }
2012 | STATIC { $$ = MkSpecifier(STATIC); }
2013 | AUTO { $$ = MkSpecifier(AUTO); }
2014 | REGISTER { $$ = MkSpecifier(REGISTER); }
2017 external_storage_class_specifier:
2018 TYPEDEF { $$ = MkSpecifier(TYPEDEF); declMode = defaultAccess; }
2019 | EXTERN { $$ = MkSpecifier(EXTERN); }
2020 | STATIC { $$ = MkSpecifier(STATIC); declMode = staticAccess; }
2021 | AUTO { $$ = MkSpecifier(AUTO); }
2022 | REGISTER { $$ = MkSpecifier(REGISTER); }
2026 identifier { $$ = MkEnumerator($1, null); }
2027 | identifier '=' constant_expression { $$ = MkEnumerator($1, $3); }
2028 | identifier '=' constant_expression_error { $$ = MkEnumerator($1, $3); }
2032 enumerator { $$ = MkList(); ListAdd($$, $1); }
2033 | enumerator_list ',' enumerator { ListAdd($1, $3); }
2034 | enumerator_list ','
2038 ENUM { memberAccessStack[++defaultMemberAccess] = publicAccess; }
2041 enum_specifier_nocompound:
2042 enum_specifier identifier { $$ = MkEnum($2, null); POP_DEFAULT_ACCESS }
2043 | enum_specifier strict_type { $$ = MkEnum(MkIdentifier($2.name), null); POP_DEFAULT_ACCESS }
2046 enum_specifier_compound:
2047 enum_specifier_compound_error '}' { $$.loc = @$; POP_DEFAULT_ACCESS }
2048 | enum_specifier identifier '{' '}' { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2049 | enum_specifier strict_type '{' '}' { $$ = MkEnum(MkIdentifier($2.name), null); FreeSpecifier($2); $$.loc = @$; POP_DEFAULT_ACCESS }
2052 enum_specifier_compound_error:
2053 enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2054 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2056 | enum_specifier identifier '{' enumerator_list { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2057 | enum_specifier identifier '{' enumerator_list error { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2058 | enum_specifier identifier '{' error { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2059 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2060 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2062 | enum_specifier strict_type '{' enumerator_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2063 | enum_specifier strict_type '{' enumerator_list error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2064 | enum_specifier strict_type '{' error { $$ = MkEnum(MkIdentifier($2.name), null); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2065 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2066 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2070 enum_specifier identifier { $$ = $2; if(declMode) DeclClassAddNameSpace(globalContext.nextID++, $2.string); }
2071 | enum_specifier strict_type { $$ = MkIdentifier($2.name); if(declMode) DeclClass(globalContext.nextID++, $2.name); FreeSpecifier($2); }
2075 enum_class_error '}' { $$.loc = @$; }
2076 | enum_decl ':' inheritance_specifiers '{' '}' { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2077 | enum_decl '{' '}' { $$ = MkEnum($1, null); POP_DEFAULT_ACCESS }
2081 enum_decl ':' inheritance_specifiers '{' enumerator_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2082 | enum_decl ':' inheritance_specifiers '{' enumerator_list error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2083 | enum_decl ':' inheritance_specifiers '{' error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2084 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2085 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2086 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2087 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2088 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2089 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list_error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2091 | enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2092 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2094 | enum_decl '{' enumerator_list { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2095 | enum_decl '{' enumerator_list error { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2096 | enum_decl '{' error { $$ = MkEnum($1, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2097 | enum_decl '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2098 | enum_decl '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2106 class_specifier_error:
2108 | struct_class_error
2112 EXT_STORAGE { $$ = MkSpecifierExtended(yytext); }
2113 | ext_decl { $$ = MkSpecifierExtended($1); delete $1; }
2117 CONST { $$ = MkSpecifier(CONST); }
2118 | VOLATILE { $$ = MkSpecifier(VOLATILE); }
2119 | ext_storage { $$ = $1; }
2123 type_qualifier_list:
2124 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2125 | type_qualifier_list type_qualifier { ListAdd($1, $2); }
2129 VOID { $$ = MkSpecifier(VOID); }
2130 | CHAR { $$ = MkSpecifier(CHAR); }
2131 | SHORT { $$ = MkSpecifier(SHORT); }
2132 | INT { $$ = MkSpecifier(INT); }
2133 | UINT { $$ = MkSpecifier(UINT); }
2134 | INT64 { $$ = MkSpecifier(INT64); }
2135 | VALIST { $$ = MkSpecifier(VALIST); }
2136 | LONG { $$ = MkSpecifier(LONG); }
2137 | FLOAT { $$ = MkSpecifier(FLOAT); }
2138 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2139 | SIGNED { $$ = MkSpecifier(SIGNED); }
2140 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2141 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2142 | struct_or_union_specifier_nocompound
2143 | enum_specifier_nocompound
2145 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2146 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2147 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2148 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2149 | TYPED_OBJECT { $$ = MkSpecifier(TYPED_OBJECT); }
2150 | ANY_OBJECT { $$ = MkSpecifier(ANY_OBJECT); }
2153 strict_type_specifier:
2154 VOID { $$ = MkSpecifier(VOID); }
2155 | CHAR { $$ = MkSpecifier(CHAR); }
2156 | SHORT { $$ = MkSpecifier(SHORT); }
2157 | INT { $$ = MkSpecifier(INT); }
2158 | UINT { $$ = MkSpecifier(UINT); }
2159 | INT64 { $$ = MkSpecifier(INT64); }
2160 | VALIST { $$ = MkSpecifier(VALIST); }
2161 | LONG { $$ = MkSpecifier(LONG); }
2162 | FLOAT { $$ = MkSpecifier(FLOAT); }
2163 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2164 | SIGNED { $$ = MkSpecifier(SIGNED); }
2165 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2166 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2167 | struct_or_union_specifier_nocompound
2168 | enum_specifier_nocompound
2170 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2171 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2172 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2173 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2176 // TESTING declarator_nofunction here... For function declarations
2179 declarator_nofunction
2180 { $$ = MkStructDeclarator($1, null); $$.loc = @$; }
2181 | declarator_nofunction ext_attrib
2182 { $$ = MkStructDeclarator($1, null); $$.structDecl.attrib = $2; $$.loc = @$; }
2183 | ':' constant_expression
2184 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2185 | declarator_nofunction ':' constant_expression
2186 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2187 | declarator_nofunction ':' constant_expression ':' constant_expression
2188 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2189 | ':' constant_expression_error
2190 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2191 | declarator_nofunction ':' constant_expression_error
2192 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2193 | declarator_nofunction ':' constant_expression ':' constant_expression_error
2194 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2195 | declarator_nofunction ':' constant_expression_error ':' constant_expression_error
2196 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2197 | declarator_nofunction ':' constant_expression_error ':' constant_expression
2198 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2201 struct_declarator_list:
2202 struct_declarator { $$ = MkList(); ListAdd($$, $1); }
2203 | struct_declarator_list ',' struct_declarator { ListAdd($1, $3); }
2207 struct_or_union identifier
2209 $$ = MkStructOrUnion($1, $2, null);
2210 $$.addNameSpace = true;
2211 $$.ctx = PushContext();
2213 | struct_or_union base_strict_type
2215 $$ = MkStructOrUnion($1, MkIdentifier($2.name), null);
2216 $$.ctx = PushContext();
2221 struct_or_union_specifier_compound:
2222 struct_or_union_specifier_compound_error '}' { $$.loc = @$; }
2223 | struct_entry '{' '}' { $$ = $1; $$.loc = @$; POP_DEFAULT_ACCESS PopContext(curContext); }
2224 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2227 struct_or_union_specifier_compound_error:
2228 struct_entry '{' struct_declaration_list { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2229 | struct_entry '{' struct_declaration_list_error { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2230 | struct_entry '{' error { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2232 | struct_or_union '{' struct_declaration_list { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2233 | struct_or_union '{' struct_declaration_list_error { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2234 | struct_or_union '{' error { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2237 struct_or_union_specifier_nocompound:
2238 struct_entry { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2247 ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2250 | struct_entry '<' template_parameters_list '>'
2252 Symbol symbol = ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2254 symbol.templateParams = $3;
2259 struct_decl ':' inheritance_specifiers
2263 SetupBaseSpecs(null, $3);
2268 struct_class_error '}' { $$.loc = @$; }
2269 | struct_head '{' '}'
2270 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2271 | struct_decl '{' '}' { POP_DEFAULT_ACCESS PopContext(curContext); }
2272 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2276 struct_head '{' struct_declaration_list
2279 $$.definitions = $3;
2281 PopContext(curContext);
2283 | struct_head '{' struct_declaration_list_error
2286 $$.definitions = $3;
2288 PopContext(curContext);
2290 | struct_head '{' error
2291 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext);}
2293 | struct_decl '{' struct_declaration_list
2295 PopContext(curContext);
2298 $$ = MkStructOrUnion($1.type, $1.id, $3);
2303 $$.definitions = $3;
2306 | struct_decl '{' struct_declaration_list_error
2308 PopContext(curContext);
2312 $$ = MkStructOrUnion($1.type, $1.id, $3);
2317 $$.definitions = $3;
2320 | struct_decl '{' error
2321 { POP_DEFAULT_ACCESS PopContext(curContext); }
2323 | struct_or_union '{' struct_declaration_list
2324 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2325 | struct_or_union '{' struct_declaration_list_error
2326 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2327 | struct_or_union '{' error
2328 { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2332 STRUCT { $$ = structSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2333 | UNION { $$ = unionSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2336 specifier_qualifier_list:
2337 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2338 | specifier_qualifier_list type_qualifier { ListAdd($1, $2); }
2339 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2340 | specifier_qualifier_list type_specifier { ListAdd($1, $2); }
2341 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2342 | specifier_qualifier_list enum_specifier_compound { ListAdd($1, $2); }
2343 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2344 | specifier_qualifier_list struct_or_union_specifier_compound { ListAdd($1, $2); }
2347 guess_specifier_qualifier_list:
2348 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2349 | guess_specifier_qualifier_list type_qualifier { ListAdd($1, $2); }
2350 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2351 | guess_specifier_qualifier_list type_specifier { ListAdd($1, $2); }
2352 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2353 | guess_specifier_qualifier_list guess_type { ListAdd($1, $2); }
2354 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2355 | guess_specifier_qualifier_list enum_specifier_compound { ListAdd($1, $2); }
2356 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2357 | guess_specifier_qualifier_list struct_or_union_specifier_compound { ListAdd($1, $2); }
2360 declaration_specifiers:
2361 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2362 | declaration_specifiers storage_class_specifier { ListAdd($1, $2); }
2363 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2364 | declaration_specifiers type_qualifier { ListAdd($1, $2); }
2365 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2366 | declaration_specifiers strict_type_specifier { ListAdd($1, $2); }
2367 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2368 | declaration_specifiers enum_specifier_compound { ListAdd($1, $2); }
2369 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2370 | declaration_specifiers struct_or_union_specifier_compound { ListAdd($1, $2); }
2373 guess_declaration_specifiers:
2374 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2375 | guess_declaration_specifiers storage_class_specifier { ListAdd($1, $2); }
2376 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2377 | guess_declaration_specifiers type_qualifier { ListAdd($1, $2); }
2378 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2379 | guess_declaration_specifiers type_specifier { ListAdd($1, $2); }
2380 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2381 | guess_declaration_specifiers guess_type { ListAdd($1, $2); }
2382 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2383 | guess_declaration_specifiers struct_or_union_specifier_compound { ListAdd($1, $2); }
2384 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2385 | guess_declaration_specifiers enum_specifier_compound { ListAdd($1, $2); }
2388 external_guess_declaration_specifiers:
2389 external_storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2390 | external_guess_declaration_specifiers external_storage_class_specifier { ListAdd($1, $2); }
2391 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2392 | external_guess_declaration_specifiers type_qualifier { ListAdd($1, $2); }
2393 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2394 | external_guess_declaration_specifiers type_specifier { ListAdd($1, $2); }
2395 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2396 | external_guess_declaration_specifiers guess_type { ListAdd($1, $2); }
2397 | class_specifier { $$ = MkList(); ListAdd($$, $1); }
2398 | external_guess_declaration_specifiers class_specifier { ListAdd($1, $2); }
2401 external_guess_declaration_specifiers_error:
2402 class_specifier_error { $$ = MkList(); ListAdd($$, $1); }
2403 | external_guess_declaration_specifiers class_specifier_error { ListAdd($1, $2); }
2406 _inheritance_specifiers:
2407 PRIVATE { $$ = MkList(); ListAdd($$, MkSpecifier(PRIVATE)); }
2408 | PUBLIC { $$ = MkList(); ListAdd($$, MkSpecifier(PUBLIC)); }
2409 | storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2410 | _inheritance_specifiers storage_class_specifier { ListAdd($1, $2); }
2411 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2412 | _inheritance_specifiers type_qualifier { ListAdd($1, $2); }
2413 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2414 | _inheritance_specifiers strict_type_specifier { ListAdd($1, $2); }
2416 { _DeclClass(0, $1.string); $$ = MkListOne(MkSpecifierName($1.string)); FreeIdentifier($1); }
2417 | _inheritance_specifiers identifier { _DeclClass(0, $2.string); ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2); }
2419 | identifier '<' template_arguments_list '>'
2421 // if($1._class && !$1._class.name)
2425 strcpy(name, $1._class.name ? $1._class.name : "");
2427 strcat(name, $1.string);
2428 _DeclClass(0, name);
2431 _DeclClass(0, $1.string);
2434 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2437 | _inheritance_specifiers identifier '<' template_arguments_list '>'
2439 if($2._class && !$2._class.name)
2443 strcat(name, $2.string);
2444 _DeclClass(0, name);
2447 _DeclClass(0, $2.string);
2448 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2453 inheritance_specifiers:
2454 _inheritance_specifiers
2455 | struct_or_union { $$ = MkListOne(MkStructOrUnion($1, null, null)); POP_DEFAULT_ACCESS }
2458 property_specifiers:
2459 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2460 | property_specifiers storage_class_specifier { ListAdd($1, $2); }
2461 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2462 | property_specifiers type_qualifier { ListAdd($1, $2); }
2463 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2464 | property_specifiers strict_type_specifier { ListAdd($1, $2); }
2465 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2466 | property_specifiers identifier { ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2467 | identifier '<' template_arguments_list '>'
2469 // if($1._class && !$1._class.name)
2473 strcpy(name, $1._class.name ? $1._class.name : "");
2475 strcat(name, $1.string);
2476 _DeclClass(0, name);
2479 _DeclClass(0, $1.string);
2482 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2485 | property_specifiers identifier '<' template_arguments_list '>'
2487 if($2._class && !$2._class.name)
2491 strcat(name, $2.string);
2492 _DeclClass(0, name);
2495 _DeclClass(0, $2.string);
2496 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2502 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2503 | renew_specifiers storage_class_specifier { ListAdd($1, $2); }
2504 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2505 | renew_specifiers type_qualifier { ListAdd($1, $2); }
2506 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2507 | renew_specifiers strict_type_specifier { ListAdd($1, $2); }
2508 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2509 | renew_specifiers struct_or_union_specifier_compound { ListAdd($1, $2); }
2510 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2511 | renew_specifiers enum_specifier_compound { ListAdd($1, $2); }
2512 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2513 | renew_specifiers identifier { ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2514 | identifier '<' template_arguments_list '>'
2516 // if($1._class && !$1._class.name)
2520 strcpy(name, $1._class.name ? $1._class.name : "");
2522 strcat(name, $1.string);
2523 _DeclClass(0, name);
2526 _DeclClass(0, $1.string);
2529 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2532 | renew_specifiers identifier '<' template_arguments_list '>'
2534 if($2._class && !$2._class.name)
2538 strcat(name, $2.string);
2539 _DeclClass(0, name);
2542 _DeclClass(0, $2.string);
2543 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2549 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2550 | new_specifiers storage_class_specifier { ListAdd($1, $2); }
2551 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2552 | new_specifiers type_qualifier { ListAdd($1, $2); }
2553 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2554 | new_specifiers strict_type_specifier { ListAdd($1, $2); }
2555 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2556 | new_specifiers struct_or_union_specifier_compound { ListAdd($1, $2); }
2557 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2558 | new_specifiers enum_specifier_compound { ListAdd($1, $2); }
2559 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2560 | new_specifiers identifier { ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2561 | identifier '<' template_arguments_list '>'
2563 // if($1._class && !$1._class.name)
2567 strcpy(name, $1._class.name ? $1._class.name : "");
2569 strcat(name, $1.string);
2570 _DeclClass(0, name);
2573 _DeclClass(0, $1.string);
2576 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2579 | new_specifiers identifier '<' template_arguments_list '>'
2581 if($2._class && !$2._class.name)
2585 strcat(name, $2.string);
2586 _DeclClass(0, name);
2589 _DeclClass(0, $2.string);
2590 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2595 identifier_list_error:
2596 identifier_list ',' error { ListAdd($1, null); }
2597 | identifier_list_error ',' error { ListAdd($1, null); }
2601 identifier { $$ = MkList(); ListAdd($$, MkTypeName(null, MkDeclaratorIdentifier($1))); }
2602 | identifier_list ',' identifier { ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2603 | identifier_list_error ',' identifier { ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2604 | parameter_list ',' identifier { ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2605 | parameter_list_error ',' identifier { ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2608 direct_declarator_nofunction:
2609 identifier { $$ = MkDeclaratorIdentifier($1); }
2610 | '(' declarator ')' { $$ = MkDeclaratorBrackets($2); }
2611 | direct_declarator_nofunction '[' constant_expression ']' { $$ = MkDeclaratorArray($1, $3); }
2612 | direct_declarator_nofunction '[' constant_expression_error ']' { $$ = MkDeclaratorArray($1, $3); }
2613 | direct_declarator_nofunction '[' type ']' { $$ = MkDeclaratorEnumArray($1, $3); }
2614 | direct_declarator_nofunction '[' ']' { $$ = MkDeclaratorArray($1, null); }
2617 direct_declarator_function_start:
2618 direct_declarator_nofunction '('
2621 direct_declarator_function:
2622 direct_declarator_function_start parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2623 | direct_declarator_function_start parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2624 | direct_declarator_function_start identifier_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2625 | direct_declarator_function_start identifier_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2626 | direct_declarator_function_start ')' { $$ = MkDeclaratorFunction($1, null); }
2629 // Tricky stuff here for overriding...
2630 direct_declarator_function_error:
2631 direct_declarator_function_start identifier_list_error
2633 $$ = MkDeclaratorFunction($1, null);
2634 fileInput.Seek(@1.end.pos, start);
2636 resetScannerPos(&@1.end);
2637 @$.start = @1.start;
2640 | direct_declarator_function_start error
2642 $$ = MkDeclaratorFunction($1, null);
2643 fileInput.Seek(@1.end.pos, start);
2645 resetScannerPos(&@1.end);
2646 @$.start = @1.start;
2649 | direct_declarator_function_start parameter_list '('
2651 $$ = MkDeclaratorFunction($1, null);
2652 fileInput.Seek(@1.end.pos, start);
2654 resetScannerPos(&@1.end);
2655 @$.start = @1.start;
2658 | direct_declarator_function_start guess_declaration_specifiers identifier '('
2660 $$ = MkDeclaratorFunction($1, null);
2661 fileInput.Seek(@1.end.pos, start);
2663 resetScannerPos(&@1.end);
2664 @$.start = @1.start;
2671 direct_declarator_function
2672 | direct_declarator_nofunction
2673 | ext_decl direct_declarator_function
2674 { $$ = MkDeclaratorExtended($1, $2); }
2675 | ext_decl direct_declarator_nofunction
2676 { $$ = MkDeclaratorExtended($1, $2); }
2681 ASM '(' STRING_LITERAL { $<string>$ = CopyString(yytext); } STRING_LITERAL { $<string>$ = CopyString(yytext); }
2684 strcpy(temp, "__asm__(");
2685 strcat(temp, $<string>4);
2687 strcat(temp, $<string>6);
2690 $<string>$ = CopyString(temp);
2695 EXT_DECL { $$ = CopyString(yytext); }
2700 strcpy(temp, $<string>1);
2703 $$ = CopyString(temp);
2705 | asm_start STRING_LITERAL { $$ = CopyString(yytext); } ')'
2708 strcpy(temp, $<string>1);
2710 strcat(temp, $<string>3);
2714 $$ = CopyString(temp);
2720 EXT_DECL { $$ = CopyString(yytext); }
2722 | ASM '(' string_literal ')'
2725 strcpy(temp, "__asm__(");
2728 $$ = CopyString(temp);
2734 EXT_ATTRIB { $$ = CopyString(yytext); }
2738 direct_abstract_declarator:
2739 '(' abstract_declarator ')'
2740 { $$ = MkDeclaratorBrackets($2); }
2742 { $$ = MkDeclaratorArray(null, null); }
2743 | '[' constant_expression ']'
2744 { $$ = MkDeclaratorArray(null, $2); }
2745 | '[' constant_expression_error ']'
2746 { $$ = MkDeclaratorArray(null, $2); }
2748 { $$ = MkDeclaratorEnumArray(null, $2); }
2749 | direct_abstract_declarator '[' ']'
2750 { $$ = MkDeclaratorArray($1, null); }
2751 | direct_abstract_declarator '[' constant_expression ']'
2752 { $$ = MkDeclaratorArray($1, $3); }
2753 | direct_abstract_declarator '[' type']'
2754 { $$ = MkDeclaratorEnumArray($1, $3); }
2755 | direct_abstract_declarator '[' constant_expression_error ']'
2756 { $$ = MkDeclaratorArray($1, $3); }
2758 { $$ = MkDeclaratorFunction(null, null); }
2759 | '(' parameter_type_list ')'
2760 { $$ = MkDeclaratorFunction(null, $2); }
2761 | '(' parameter_type_list_error ')'
2762 { $$ = MkDeclaratorFunction(null, $2); }
2763 | direct_abstract_declarator '(' ')'
2764 { $$ = MkDeclaratorFunction($1, null); }
2765 | direct_abstract_declarator '(' parameter_type_list ')'
2766 { $$ = MkDeclaratorFunction($1, $3); }
2767 | direct_abstract_declarator '(' parameter_type_list_error ')'
2768 { $$ = MkDeclaratorFunction($1, $3); }
2771 direct_abstract_declarator_noarray:
2772 '(' abstract_declarator_noarray ')'
2773 { $$ = MkDeclaratorBrackets($2); }
2775 { $$ = MkDeclaratorFunction(null, null); }
2776 | '(' parameter_type_list ')'
2777 { $$ = MkDeclaratorFunction(null, $2); }
2778 | '(' parameter_type_list_error ')'
2779 { $$ = MkDeclaratorFunction(null, $2); }
2780 | direct_abstract_declarator_noarray '(' ')'
2781 { $$ = MkDeclaratorFunction($1, null); }
2782 | direct_abstract_declarator_noarray '(' parameter_type_list ')'
2783 { $$ = MkDeclaratorFunction($1, $3); }
2784 | direct_abstract_declarator_noarray '(' parameter_type_list_error ')'
2785 { $$ = MkDeclaratorFunction($1, $3); }
2789 '*' { $$ = MkPointer(null, null); }
2790 | '*' type_qualifier_list { $$ = MkPointer($2, null); }
2791 | '*' pointer { $$ = MkPointer(null, $2); }
2792 | '*' type_qualifier_list pointer { $$ = MkPointer($2, $3); }
2795 abstract_declarator:
2796 pointer { $$ = MkDeclaratorPointer($1, null); }
2797 | direct_abstract_declarator
2798 | pointer direct_abstract_declarator { $$ = MkDeclaratorPointer($1, $2); }
2799 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
2800 | ext_decl direct_abstract_declarator { $$ = MkDeclaratorExtended($1, $2); }
2801 | ext_decl pointer direct_abstract_declarator { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2804 abstract_declarator_noarray:
2805 pointer { $$ = MkDeclaratorPointer($1, null); }
2806 | direct_abstract_declarator_noarray
2807 | pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorPointer($1, $2); }
2808 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
2809 | ext_decl direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, $2); }
2810 | ext_decl pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2815 | pointer direct_declarator
2816 { $$ = MkDeclaratorPointer($1, $2); }
2817 | ext_decl pointer direct_declarator
2818 { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2819 | declarator ext_decl
2820 { $$ = MkDeclaratorExtendedEnd($2, $1); }
2823 declarator_function:
2824 direct_declarator_function
2825 | pointer direct_declarator_function { $$ = MkDeclaratorPointer($1, $2); }
2826 | ext_decl direct_declarator_function { $$ = MkDeclaratorExtended($1, $2); }
2827 | ext_decl pointer direct_declarator_function { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2828 | pointer ext_decl direct_declarator_function { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2831 declarator_function_error:
2832 direct_declarator_function_error
2833 | pointer direct_declarator_function_error { $$ = MkDeclaratorPointer($1, $2); }
2834 | ext_decl direct_declarator_function_error { $$ = MkDeclaratorExtended($1, $2); }
2835 | ext_decl pointer direct_declarator_function_error { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2836 | pointer ext_decl direct_declarator_function_error { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2839 declarator_nofunction:
2840 direct_declarator_nofunction
2841 | pointer direct_declarator_nofunction { $$ = MkDeclaratorPointer($1, $2); }
2842 | ext_decl direct_declarator_nofunction { $$ = MkDeclaratorExtended($1, $2); }
2843 | ext_decl pointer direct_declarator_nofunction { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
2844 | pointer ext_decl direct_declarator_nofunction { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
2848 assignment_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2849 | '{' initializer_list '}' { $$ = MkInitializerList($2); $$.loc = @$; }
2850 | '{' initializer_list ',' '}'
2852 $$ = MkInitializerList($2);
2856 Expression exp = MkExpDummy();
2857 Initializer init = MkInitializerAssignment(exp);
2866 assignment_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2867 | '{' initializer_list '}' error { $$ = MkInitializerList($2); $$.loc = @$; }
2868 | '{' initializer_list { $$ = MkInitializerList($2); $$.loc = @$; }
2869 | '{' initializer_list ',' '}' error
2871 $$ = MkInitializerList($2);
2875 Expression exp = MkExpDummy();
2876 Initializer init = MkInitializerAssignment(exp);
2882 | '{' initializer_list ','
2884 $$ = MkInitializerList($2);
2888 Expression exp = MkExpDummy();
2889 Initializer init = MkInitializerAssignment(exp);
2897 initializer_condition:
2898 conditional_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2899 | anon_instantiation_expression
2900 { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2903 initializer_condition_error:
2904 conditional_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2905 | anon_instantiation_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
2909 initializer { $$ = MkList(); ListAdd($$, $1); }
2910 | initializer_error { $$ = MkList(); ListAdd($$, $1); }
2911 | initializer_list ',' initializer { ListAdd($1, $3); }
2912 | initializer_list ',' initializer_error { ListAdd($1, $3); }
2915 | initializer_list initializer { ListAdd($1, $2); }
2916 | initializer_list initializer_error { ListAdd($1, $2); }
2920 declarator { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
2921 | declarator '=' initializer { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
2924 init_declarator_error:
2925 declarator error { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
2926 | declarator '=' error { $$ = MkInitDeclarator($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.initializer.loc = @2; $$.initializer.exp.loc = @2; }
2927 | declarator '=' initializer_error { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
2930 init_declarator_list:
2931 init_declarator { $$ = MkList(); ListAdd($$, $1); }
2932 | init_declarator_list ',' init_declarator { ListAdd($1, $3); }
2933 | init_declarator_list_error ',' init_declarator { ListAdd($1, $3); }
2936 init_declarator_list_error:
2937 init_declarator_error { $$ = MkList(); ListAdd($$, $1); }
2938 | init_declarator error { $$ = MkList(); ListAdd($$, $1); }
2939 | init_declarator_list ',' init_declarator_error { ListAdd($1, $3); }
2940 | init_declarator_list_error ',' init_declarator_error { ListAdd($1, $3); }
2944 specifier_qualifier_list { $$ = MkTypeName($1, null); }
2945 | specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
2949 guess_specifier_qualifier_list { $$ = MkTypeName($1, null); }
2950 | guess_specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
2953 /*** PARAMETERS **********************************************************************/
2954 parameter_declaration:
2955 guess_declaration_specifiers declarator { $$ = MkTypeName($1, $2); }
2956 | guess_declaration_specifiers abstract_declarator { $$ = MkTypeName($1, $2); }
2957 | guess_declaration_specifiers '&' { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), null)); }
2958 | guess_declaration_specifiers '&' declarator { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), $3)); }
2959 | guess_declaration_specifiers { $$ = MkTypeName($1, null); }
2961 { $$ = MkTypeName(MkListOne(MkSpecifier(CLASS)), null); }
2964 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), null); }
2966 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), null)); }
2967 | TYPED_OBJECT declarator
2968 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), $2); }
2969 | TYPED_OBJECT '&' declarator
2970 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), $3)); }
2972 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), null); }
2973 | ANY_OBJECT declarator
2974 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), $2); }
2978 parameter_declaration_error:
2979 guess_declaration_specifiers declarator error { $$ = MkTypeName($1, $2); }
2980 | guess_declaration_specifiers abstract_declarator error { $$ = MkTypeName($1, $2); }
2984 parameter_declaration { $$ = MkList(); ListAdd($$, $1); }
2985 | parameter_list ',' parameter_declaration { ListAdd($1, $3); }
2986 | parameter_list error ',' parameter_declaration { ListAdd($1, $4); }
2987 | parameter_list_error ',' parameter_declaration { ListAdd($1, $3); }
2988 | parameter_list_error error ',' parameter_declaration { ListAdd($1, $4); }
2989 | error ',' parameter_declaration { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
2991 | identifier_list ',' parameter_declaration { ListAdd($1, $3); }
2992 | identifier_list error ',' parameter_declaration { ListAdd($1, $4); }
2993 | identifier_list_error ',' parameter_declaration { ListAdd($1, $3); }
2994 | identifier_list_error error ',' parameter_declaration { ListAdd($1, $4); }
2997 parameter_list_error:
2998 parameter_declaration_error { $$ = MkList(); ListAdd($$, $1); }
2999 | parameter_list ',' parameter_declaration_error { ListAdd($1, $3); }
3000 | parameter_list_error ',' parameter_declaration_error { ListAdd($1, $3); }
3001 | parameter_list_error error ',' parameter_declaration_error { ListAdd($1, $4); }
3002 | error ',' parameter_declaration_error { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3004 | identifier_list ',' parameter_declaration_error { ListAdd($1, $3); }
3005 | identifier_list_error ',' parameter_declaration_error { ListAdd($1, $3); }
3006 | identifier_list_error error ',' parameter_declaration_error { ListAdd($1, $4); }
3009 parameter_type_list:
3011 | parameter_list ',' ELLIPSIS { ListAdd($1, MkTypeName(null, null)); }
3012 | parameter_list_error ',' ELLIPSIS { ListAdd($1, MkTypeName(null, null)); }
3013 | identifier_list ',' ELLIPSIS { ListAdd($1, MkTypeName(null, null)); }
3014 | identifier_list_error ',' ELLIPSIS { ListAdd($1, MkTypeName(null, null)); }
3015 | error ',' ELLIPSIS { $$ = MkList(); ListAdd($$, MkTypeName(null, null)); }
3018 parameter_type_list_error:
3019 parameter_list_error
3020 | parameter_list ',' error { ListAdd($1, null); }
3021 | parameter_list_error error
3024 /****** STATEMENTS *******************************************************************/
3027 | EXT_ATTRIB { $$ = MkExpressionStmt(null); } // Ignoring this for now... ( For __attribute__ ((__unused__)) )
3028 | compound_statement
3029 | ';' { $$ = MkExpressionStmt(null); }
3030 | ':' { $$ = MkExpressionStmt(null); }
3031 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3032 | selection_statement
3033 | iteration_statement
3039 | watch_definition ';'
3043 labeled_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3044 | iteration_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3045 | compound_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3046 | selection_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3047 | jump_statement_error { $$ = $1; Compiler_Error("syntax error\n"); }
3048 | jump_statement error { $$ = $1; Compiler_Error("syntax error\n"); }
3049 | expression_error { $$ = MkExpressionStmt($1); Compiler_Error("syntax error\n"); $$.loc = @1; }
3053 string_literal { $$ = MkAsmField($1, null); $$.loc = @1; }
3054 | string_literal '(' assignment_expression ')' { $$ = MkAsmField($1, $3); $$.loc = @$; }
3058 asm_field { $$ = MkListOne($1); }
3059 | asm_field_list ',' asm_field { ListAdd($$, $3); }
3064 ASM type_qualifier '(' string_literal ')' ';' { $$ = MkAsmStmt($2, $4, null, null, null); $$.loc = @$; }
3065 | ASM type_qualifier '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, null); $$.loc = @$; }
3066 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, null); $$.loc = @$; }
3067 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, $10); $$.loc = @$; }
3069 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, null); $$.loc = @$; }
3070 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, $8); $$.loc = @$; }
3071 | ASM type_qualifier '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, $8); $$.loc = @$; }
3073 | ASM '(' string_literal ')' ';' { $$ = MkAsmStmt(null, $3, null, null, null); $$.loc = @$; }
3074 | ASM '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, null); $$.loc = @$; }
3075 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, null); $$.loc = @$; }
3076 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, $9); $$.loc = @$; }
3078 | ASM '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, null); $$.loc = @$; }
3079 | ASM '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, $7); $$.loc = @$; }
3080 | ASM '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, $7); $$.loc = @$; }
3084 identifier ':' statement { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3085 | CASE constant_expression ':' statement { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3086 | CASE constant_expression_error ':' statement { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3087 | CASE ':' statement { $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3088 | DEFAULT ':' statement { $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3091 labeled_statement_error
3092 : identifier ':' statement_error { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3093 | CASE constant_expression ':' statement_error { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3094 | CASE constant_expression_error ':' statement_error { $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3095 | CASE ':' statement_error { $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3096 | CASE ':' { $$ = MkCaseStmt(MkExpDummy(), null); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3097 | DEFAULT ':' statement_error { $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3098 | DEFAULT ':' { $$ = MkCaseStmt(null, null); $$.loc = @$; }
3102 PUBLIC { $$ = declMode = publicAccess; }
3103 | PRIVATE { $$ = declMode = privateAccess; }
3104 | DEFAULT { $$ = declMode = defaultAccess; }
3108 PUBLIC { $$ = publicAccess; }
3109 | PRIVATE { $$ = privateAccess; }
3113 declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3114 | declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3115 | instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3116 | declaration_error ';' {}
3119 external_guess_declaration:
3120 external_guess_declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3121 | external_guess_declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3122 | external_guess_declaration_specifiers_error init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3124 | external_guess_instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3125 | DEFINE identifier '=' conditional_expression ';' { $$ = MkDeclarationDefine($2, $4); $$.loc = @$; }
3126 | STATIC DEFINE identifier '=' conditional_expression ';' { declMode = staticAccess; $$ = MkDeclarationDefine($3, $5); $$.loc = @$; }
3129 external_guess_declaration_error:
3130 external_guess_declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; yyerrok; }
3134 declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; }
3135 | declaration_error error {}
3137 | instantiation_named_error error { $$ = MkDeclarationInst($1); $$.loc = @$; }
3138 | instantiation_named error { $$ = MkDeclarationInst($1); $$.loc = @$; }
3139 | declaration_specifiers init_declarator_list_error { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3143 declaration { $$ = MkList(); ListAdd($$, $1); /*declMode = defaultDeclMode;*/ }
3144 | declaration_list declaration { ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3145 | declaration_list_error declaration { ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3146 | declaration_list error ';' { }
3149 declaration_list_error:
3150 declaration_error { $$ = MkList(); ListAdd($$, $1); }
3151 | declaration_list declaration_error { ListAdd($1, $2); }
3155 statement { $$ = MkList(); ListAdd($$, $1); }
3156 | statement_list statement { ListAdd($1, $2); }
3157 | statement_list_error statement { ListAdd($1, $2); }
3160 statement_list_error:
3161 statement_error { $$ = MkList(); ListAdd($$, $1); }
3162 | statement_list statement_error { ListAdd($1, $2); }
3163 | statement_list_error statement_error { ListAdd($1, $2); }
3164 | statement_list declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3165 | statement_list_error declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3166 | statement_list declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3167 | statement_list_error declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; yyerror(); ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3171 statement_list { $$ = MkCompoundStmt(null, $1); }
3172 | declaration_list { $$ = MkCompoundStmt($1, null); }
3173 | declaration_list statement_list { $$ = MkCompoundStmt($1, $2); }
3174 | declaration_list_error statement_list { $$ = MkCompoundStmt($1, $2); }
3177 compound_inside_error:
3178 statement_list_error { $$ = MkCompoundStmt(null, $1); }
3179 | declaration_list_error { $$ = MkCompoundStmt($1, null); }
3180 | declaration_list statement_list_error { $$ = MkCompoundStmt($1, $2); }
3181 | declaration_list_error statement_list_error { $$ = MkCompoundStmt($1, $2); }
3185 '{' { $<context>$ = PushContext(); }
3189 compound_statement_error '}' { $$.loc = @$; }
3192 compound_statement_error:
3193 compound_start compound_inside_error
3194 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3196 { $$ = MkCompoundStmt(null, null); $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3198 | compound_start compound_inside
3199 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3203 expression_statement:
3204 ';' { $$ = MkExpressionStmt(null); $$.loc = @$; }
3205 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3206 | expression_error ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3209 selection_statement:
3210 IF '(' expression ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3211 | IF '(' expression_error ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3212 | IF '(' expression ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3213 | IF '(' expression_error ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3214 | SWITCH '(' expression ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3215 | SWITCH '(' expression_error ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3218 selection_statement_error:
3219 IF '(' expression_error { $$ = MkIfStmt($3, null, null); $$.loc = @$; }
3220 | selection_statement error
3223 iteration_statement:
3224 WHILE '(' expression ')' statement { $$ = MkWhileStmt($3, $5); $$.loc = @$; }
3225 | WHILE '(' expression_error statement { $$ = MkWhileStmt($3, $4); $$.loc = @$; }
3226 | WHILE '(' ')' statement { $$ = MkWhileStmt(null, $4); $$.loc = @$; }
3228 | DO statement WHILE '(' expression ')' ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3229 | DO statement WHILE '(' expression_error ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3231 | FOR '(' expression_statement expression_statement ')' statement { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; }
3232 | FOR '(' expression_statement ')' statement { $$ = MkForStmt($3, null, null, $5); $$.loc = @$; }
3233 | FOR '(' expression_statement expression_statement expression ')' statement { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; }
3234 | FOR '(' expression_statement expression_statement expression_error statement { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; }
3235 | FOR '(' ')' statement { $$ = MkForStmt(null, null, null, $4); $$.loc = @$; }
3237 | FOR '(' identifier ':' expression ')' statement { $$ = MkForEachStmt($3, $5, null, $7); $$.loc = @$; }
3238 | FOR '(' identifier ':' expression ';' expression ')' statement { $$ = MkForEachStmt($3, $5, $7, $9); $$.loc = @$; }
3241 iteration_statement_error:
3242 FOR '(' error { $$ = MkForStmt(null, null, null, null); $$.loc = @$; } |
3243 FOR '(' expression_error error { $$ = MkForStmt(MkExpressionStmt($3), null, null, null); $$.forStmt.init.loc = @3; $$.loc = @$; } |
3244 FOR '(' expression_statement error { $$ = MkForStmt($3, null, null, null); $$.loc = @$; } |
3245 FOR '(' expression_statement expression_error error { $$ = MkForStmt($3, MkExpressionStmt($4), null, null); $$.loc = @$; $$.forStmt.check.loc = @4; } |
3246 FOR '(' expression_statement expression_statement error { $$ = MkForStmt($3, $4, null, null); $$.loc = @$; } |
3247 FOR '(' expression_statement expression_statement expression_error { $$ = MkForStmt($3, $4, $5, null); $$.loc = @$; } |
3248 FOR '(' expression_statement expression_statement ')' statement_error { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; } |
3249 FOR '(' expression_statement expression_statement expression ')' statement_error { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; } |
3250 FOR '(' expression_statement expression_statement expression_error statement_error { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; } |
3252 DO statement WHILE '(' expression ')' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3253 DO statement WHILE '(' expression { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3254 DO statement WHILE '(' expression_error { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3255 DO statement WHILE '(' { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3256 DO statement WHILE { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3257 DO statement { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3258 DO { $$ = MkDoWhileStmt(null, null); $$.loc = @$; } |
3261 WHILE error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3262 WHILE '(' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3263 WHILE '(' ')' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3264 WHILE '(' expression_error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3265 WHILE '(' expression_error error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3266 WHILE '(' expression ')' statement_error { $$ = MkWhileStmt($3, $5); $$.loc = @$; } |
3267 WHILE '(' expression_error statement_error { $$ = MkWhileStmt($3, $4 ); $$.loc = @$; }
3271 GOTO identifier ';' { $$ = MkGotoStmt($2); $$.loc = @$; }
3272 | CONTINUE ';' { $$ = MkContinueStmt(); $$.loc = @$; }
3273 | BREAK ';' { $$ = MkBreakStmt(); $$.loc = @$; }
3274 | RETURN ';' { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc = @2; }
3275 | RETURN expression ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3276 | RETURN expression_error ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3277 | RETURN anon_instantiation_expression ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3278 | RETURN anon_instantiation_expression_error ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3281 jump_statement_error:
3282 RETURN expression_error { $$ = MkReturnStmt($2); $$.loc = @$; } |
3283 RETURN anon_instantiation_expression_error { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; } |
3284 RETURN { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc.start = exp.loc.end = @1.end; } |
3285 GOTO { $$ = MkGotoStmt(null); $$.loc = @$; }
3288 /*************************************************************************************/
3290 function_definition:
3291 external_guess_declaration_specifiers declarator_function declaration_list compound_statement { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; }
3292 | external_guess_declaration_specifiers declarator_function compound_statement
3293 { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; }
3295 | declarator_function declaration_list compound_statement { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; }
3296 | declarator_function compound_statement { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$;}
3298 function_definition_error:
3299 external_guess_declaration_specifiers declarator_function declaration_list compound_statement_error { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; $$.loc.end = $4.loc.end; }
3300 | external_guess_declaration_specifiers declarator_function compound_statement_error { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3301 | declarator_function declaration_list compound_statement_error { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3302 | declarator_function compound_statement_error { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
3306 STRING_LITERAL { $$ = CopyString(yytext); }
3307 | string_literal STRING_LITERAL
3309 int len1 = strlen($1);
3310 int len2 = strlen(yytext);
3311 $$ = new byte[len1-1 + len2-1 + 1];
3312 memcpy($$, $1, len1-1);
3313 memcpy($$ + len1-1, yytext+1, len2);
3318 external_declaration:
3319 function_definition { $$ = MkExternalFunction($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3321 { $$ = MkExternalClass($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3323 | external_guess_declaration_specifiers class
3324 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; FreeList($1, FreeSpecifier); }
3326 | external_guess_declaration
3327 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3328 | IMPORT string_literal { $$ = MkExternalImport($2, normalImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3329 | IMPORT STATIC string_literal { $$ = MkExternalImport($3, staticImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3330 | IMPORT identifier string_literal { if(!strcmp($2.string, "remote")) { $$ = MkExternalImport($3, remoteImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; } else yyerror(); FreeIdentifier($2); }
3332 | ';' { $$ = null; }
3334 | declaration_mode function_definition { $$ = MkExternalFunction($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3335 | declaration_mode class
3336 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; declMode = defaultDeclMode; }
3337 | declaration_mode external_guess_declaration { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3338 | declaration_mode IMPORT string_literal { $$ = MkExternalImport($3, normalImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; declMode = defaultDeclMode; }
3339 | declaration_mode IMPORT STATIC string_literal { $$ = MkExternalImport($4, staticImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; declMode = defaultDeclMode; }
3340 | declaration_mode IMPORT identifier string_literal { if(!strcmp($3.string, "remote")) { $$ = MkExternalImport($4, remoteImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; FreeIdentifier($3); } else yyerror(); declMode = defaultDeclMode; }
3341 | declaration_mode ':' { defaultDeclMode = $1; $$ = null; }
3342 | STATIC ':' { defaultDeclMode = staticAccess; $$ = null; }
3343 | NAMESPACE identifier { $$ = MkExternalNameSpace($2); $$.loc = @$; }
3344 | NAMESPACE strict_type { $$ = MkExternalNameSpace(MkIdentifier($2.name)); FreeSpecifier($2); $$.loc = @$; }
3345 | dbtable_definition { $$ = MkExternalDBTable($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3346 | declaration_mode dbtable_definition { $$ = MkExternalDBTable($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3349 external_declaration_error:
3350 class_error { $$ = MkExternalClass($1); $$.loc = $1.loc; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3351 | external_guess_declaration_specifiers class_error { $$ = MkExternalClass($2); $$.loc = $2.loc; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3352 | function_definition_error { $$ = MkExternalFunction($1); $$.loc = $1.loc; $1.declMode = declMode; declMode = defaultDeclMode; }
3354 | declaration_mode class_error { $$ = MkExternalClass($2); $$.loc = $2.loc; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; declMode = defaultDeclMode; }
3355 | declaration_mode function_definition_error { $$ = MkExternalFunction($2); $$.loc = $2.loc; $2.declMode = $1; declMode = defaultDeclMode; }
3357 | external_guess_declaration_error
3358 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; declMode = defaultDeclMode; }
3359 | declaration_mode external_guess_declaration_error { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; declMode = defaultDeclMode; }
3362 translation_unit_error:
3363 external_declaration_error { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3364 | translation_unit external_declaration_error { ListAdd($1, $2); }
3365 | translation_unit_error external_declaration_error { ListAdd($1, $2); }
3366 | translation_unit error
3367 | translation_unit_error error
3371 external_declaration { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3372 | translation_unit external_declaration { ListAdd($1, $2); }
3373 | translation_unit_error class
3374 { External _class = MkExternalClass($2); ListAdd($1, _class); _class.loc = @2; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; declMode = defaultDeclMode; }
3375 | translation_unit_error declaration_mode class
3376 { External _class = MkExternalClass($3); ListAdd($1, _class); _class.loc = @3; $3.declMode = ($2 != defaultAccess) ? $2 : privateAccess; declMode = defaultDeclMode; }
3381 | translation_unit_error
3382 | { ast = MkList(); }
3386 DBTABLE string_literal identifier '{' dbfield_definition_list '}' { Symbol symbol = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3387 | DBTABLE string_literal strict_type '{' dbfield_definition_list '}' { Symbol symbol = DeclClass(globalContext.nextID++, $3.name); FreeSpecifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3388 | DBTABLE string_literal '{' dbfield_definition_list '}' { $$ = MkDBTableDef($2, null, $4); }
3392 guess_declaration_specifiers identifier string_literal ';' { $$ = MkDBFieldEntry(MkTypeName($1, null), $2, $3); }
3396 identifier { $$ = MkDBIndexItem($1, ascending); }
3397 | '>' identifier { $$ = MkDBIndexItem($2, descending); }
3398 | '<' identifier { $$ = MkDBIndexItem($2, ascending); }
3402 dbindex_item { $$ = MkList(); ListAdd($$, $1); }
3403 | dbindex_item_list ',' dbindex_item { ListAdd($1, $3); }
3407 DBINDEX dbindex_item_list ';' { $$ = MkDBIndexEntry($2, null); }
3408 | DBINDEX dbindex_item_list identifier ';' { $$ = MkDBIndexEntry($2, $3); }
3411 dbfield_definition_list:
3412 dbfield_entry { $$ = MkList(); ListAdd($$, $1); }
3413 | dbindex_entry { $$ = MkList(); ListAdd($$, $1); }
3414 | dbfield_definition_list dbfield_entry { ListAdd($1, $2); }
3415 | dbfield_definition_list dbindex_entry { ListAdd($1, $2); }
3419 DATABASE_OPEN '(' assignment_expression ',' assignment_expression ')' { $$ = MkExpDBOpen($3, $5); }
3423 DBFIELD '(' string_literal ',' identifier ')' { $$ = MkExpDBField($3, $5); }
3427 DBINDEX '(' string_literal ',' identifier ')' { $$ = MkExpDBIndex($3, $5); }
3431 DBTABLE '(' string_literal ')' { $$ = MkExpDBTable($3); }