4 #define YYLTYPE Location
8 # define YYLLOC_DEFAULT(Current, Rhs, N) \
9 (Current).start = (Rhs)[1].start; \
10 (Current).end = (Rhs)[N].end;
14 extern File fileInput;
20 bool deleteWatchable = false;
22 #define MAX_STRUCT_LEVELS 256
23 AccessMode memberAccessStack[MAX_STRUCT_LEVELS];
24 int defaultMemberAccess = -1;
26 #define POP_DEFAULT_ACCESS if(defaultMemberAccess > -1) defaultMemberAccess--;
28 #define C89_DECL_WARNING $"eC expects all declarations to precede statements in the block (C89 style)\n"
29 #define CASE_LABELED_STMT_WARNING $"labeled statement directly within a case statement\n"
39 SpecifierType specifierType;
46 Enumerator enumerator;
47 Declarator declarator;
49 Initializer initializer;
50 InitDeclarator initDeclarator;
52 Declaration declaration;
54 FunctionDefinition function;
62 Instantiation instance;
63 MembersInit membersInit;
64 MemberInit memberInit;
65 ClassFunction classFunction;
66 ClassDefinition _class;
71 PropertyWatch propertyWatch;
72 TemplateParameter templateParameter;
73 TemplateArgument templateArgument;
74 TemplateDatatype templateDatatype;
76 DBTableEntry dbtableEntry;
77 DBIndexItem dbindexItem;
78 DBTableDef dbtableDef;
83 %type <symbol> class_decl
84 %type <specifierType> struct_or_union
85 %type <i> unary_operator assignment_operator
86 %type <declMode> member_access declaration_mode
87 %type <id> identifier enum_decl
88 %type <exp> primary_expression primary_expression_error postfix_expression unary_expression cast_expression
89 multiplicative_expression additive_expression shift_expression
90 relational_expression relational_expression_smaller_than equality_expression and_expression
91 exclusive_or_expression inclusive_or_expression logical_and_expression
92 logical_or_expression conditional_expression assignment_expression
93 constant_expression constant_expression_error
94 anon_instantiation_expression anon_instantiation_expression_error i18n_string
95 postfix_expression_error unary_expression_error cast_expression_error
96 multiplicative_expression_error additive_expression_error shift_expression_error
97 relational_expression_error equality_expression_error and_expression_error
98 exclusive_or_expression_error inclusive_or_expression_error logical_and_expression_error
99 logical_or_expression_error conditional_expression_error assignment_expression_error
100 simple_primary_expression constant
101 common_unary_expression common_unary_expression_error
102 database_open dbfield dbindex dbtable
104 //simple_unary_expression simple_unary_expression_error
105 // simple_postfix_expression simple_postfix_expression_error
107 %type <list> argument_expression_list expression expression_anon_inst expression_anon_inst_error enumerator_list type_qualifier_list
108 struct_declarator_list struct_declaration_list
109 declaration_specifiers identifier_list identifier_list_error initializer_list init_declarator_list
110 parameter_list parameter_list_error parameter_type_list parameter_type_list_error declaration_list declaration_list_error statement_list statement_list_error
111 translation_unit members_initialization_list members_initialization_list_coloned members_initialization_list_error data_member_initialization_list data_member_initialization_list_coloned
112 default_property_list data_member_initialization_list_error
113 expression_error init_declarator_list_error argument_expression_list_error default_property_list_error struct_declaration_list_error
114 translation_unit_error
115 guess_declaration_specifiers
116 external_guess_declaration_specifiers external_guess_declaration_specifiers_error
117 specifier_qualifier_list guess_specifier_qualifier_list
118 _inheritance_specifiers inheritance_specifiers property_specifiers
119 new_specifiers renew_specifiers asm_field_list
120 property_watch_list watch_property_list
121 dbindex_item_list dbfield_definition_list
122 template_arguments_list template_parameters_list attribs_list
124 %type <asmField> asm_field
125 %type <specifier> storage_class_specifier enum_specifier_compound enum_specifier_nocompound type_qualifier type_specifier class_specifier class_specifier_error
126 struct_or_union_specifier_compound struct_or_union_specifier_nocompound ext_storage type strict_type guess_type enum_class strict_type_specifier struct_class
127 struct_or_union_specifier_compound_error struct_class_error struct_decl
128 enum_specifier_compound_error enum_class_error external_storage_class_specifier
129 base_strict_type struct_head struct_entry
130 %type <enumerator> enumerator
131 %type <declarator> declarator direct_declarator direct_abstract_declarator abstract_declarator
132 direct_abstract_declarator_noarray abstract_declarator_noarray
133 struct_declarator direct_declarator_function direct_declarator_function_start declarator_function_error direct_declarator_function_error declarator_function direct_declarator_nofunction
134 direct_declarator_function_type_ok declarator_nofunction_type_ok direct_declarator_nofunction_type_ok declarator_function_type_ok direct_declarator_function_error_type_ok
135 direct_declarator_function_start_type_ok direct_declarator_type_ok declarator_type_ok declarator_function_error_type_ok
136 %type <pointer> pointer
137 %type <initializer> initializer initializer_error initializer_condition initializer_condition_error
138 %type <initDeclarator> init_declarator init_declarator_error
139 %type <typeName> type_name guess_type_name parameter_declaration parameter_declaration_error
140 %type <stmt> statement labeled_statement labeled_statement_error compound_statement compound_statement_error expression_statement
141 selection_statement selection_statement_error iteration_statement jump_statement jump_statement_error compound_inside compound_inside_error
142 iteration_statement_error statement_error asm_statement
143 stopwatching watch_definition firewatchers
145 %type <declaration> declaration declaration_error external_guess_declaration external_guess_declaration_error
146 %type <function> function_definition function_definition_error
147 %type <external> external_declaration external_declaration_error
149 %type <instance> instantiation_named instantiation_named_error instantiation_unnamed instantiation_unnamed_error guess_instantiation_named guess_instantiation_named_error external_guess_instantiation_named
150 instantiation_anon instantiation_anon_error
151 %type <memberInit> data_member_initialization data_member_initialization_error default_property default_property_error
152 %type <classFunction> class_function_definition class_function_definition_error class_function_definition_start
153 class_function_definition_start_error virtual_class_function_definition_start virtual_class_function_definition_start_error
154 constructor_function_definition_start destructor_function_definition_start
155 %type <classFunction> instance_class_function_definition instance_class_function_definition_error instance_class_function_definition_start instance_class_function_definition_start_error
156 %type <_class> class class_error class_head
157 %type <classDef> struct_declaration struct_declaration_error
158 %type <string> string_literal base_strict_type_name attribute_word
159 %type <extDecl> ext_decl
160 %type <attrib> attrib
161 %type <attribute> attribute
162 %type <prop> property property_start property_body class_property class_property_start class_property_body
163 %type <propertyWatch> property_watch self_watch_definition
165 %type <templateParameter> template_parameter template_type_parameter template_identifier_parameter template_expression_parameter
166 %type <templateArgument> template_argument template_type_argument template_identifier_argument template_expression_argument
167 %type <templateDatatype> template_datatype
169 %type <dbtableEntry> dbindex_entry dbfield_entry
170 %type <dbindexItem> dbindex_item
171 %type <dbtableDef> dbtable_definition
172 %type <context> compound_start class_entry
174 %token IDENTIFIER CONSTANT STRING_LITERAL SIZEOF
175 %token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP
176 %token AND_OP OR_OP MUL_ASSIGN DIV_ASSIGN MOD_ASSIGN ADD_ASSIGN
177 %token SUB_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN
178 %token XOR_ASSIGN OR_ASSIGN TYPE_NAME
180 %token TYPEDEF EXTERN STATIC AUTO REGISTER
181 %token CHAR SHORT INT UINT INT64 LONG SIGNED UNSIGNED FLOAT DOUBLE CONST VOLATILE VOID VALIST
182 %token STRUCT UNION ENUM ELLIPSIS
184 %token CASE DEFAULT IF SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN
188 %token CLASS THISCLASS CLASS_NAME
189 %token PROPERTY SETPROP GETPROP NEWOP RENEW DELETE EXT_DECL EXT_STORAGE IMPORT DEFINE VIRTUAL ATTRIB
190 %token PUBLIC PRIVATE
191 %token TYPED_OBJECT ANY_OBJECT _INCREF EXTENSION ASM TYPEOF
192 %token WATCH STOPWATCHING FIREWATCHERS WATCHABLE CLASS_DESIGNER CLASS_NO_EXPANSION CLASS_FIXED ISPROPSET
193 %token CLASS_DEFAULT_PROPERTY PROPERTY_CATEGORY CLASS_DATA CLASS_PROPERTY SUBCLASS NAMESPACE
194 %token NEW0OP RENEW0 VAARG
195 %token DBTABLE DBFIELD DBINDEX DATABASE_OPEN
196 %token ALIGNOF ATTRIB_DEP __ATTRIB
197 %token BOOL _BOOL _COMPLEX _IMAGINARY RESTRICT THREAD
199 %destructor { FreeIdentifier($$); } identifier
200 %destructor { FreePointer($$); } pointer
201 %destructor { FreeExpression($$); } primary_expression primary_expression_error postfix_expression unary_expression cast_expression
202 multiplicative_expression additive_expression shift_expression
203 relational_expression equality_expression and_expression
204 exclusive_or_expression inclusive_or_expression logical_and_expression
205 logical_or_expression conditional_expression assignment_expression
206 constant_expression constant_expression_error
207 postfix_expression_error unary_expression_error cast_expression_error
208 multiplicative_expression_error additive_expression_error shift_expression_error
209 relational_expression_error equality_expression_error and_expression_error
210 exclusive_or_expression_error inclusive_or_expression_error logical_and_expression_error
211 logical_or_expression_error conditional_expression_error assignment_expression_error i18n_string
212 %destructor { FreeSpecifier($$); } storage_class_specifier enum_specifier_compound enum_specifier_nocompound type_qualifier type_specifier class_specifier class_specifier_error
213 struct_or_union_specifier_compound struct_or_union_specifier_nocompound ext_storage type strict_type guess_type enum_class strict_type_specifier struct_class
214 struct_or_union_specifier_compound_error struct_class_error struct_decl
215 enum_specifier_compound_error enum_class_error external_storage_class_specifier
216 base_strict_type struct_head struct_entry
217 %destructor { FreeEnumerator($$); } enumerator
218 %destructor { FreeDeclarator($$); } declarator direct_declarator direct_abstract_declarator abstract_declarator
219 direct_abstract_declarator_noarray abstract_declarator_noarray
220 struct_declarator direct_declarator_function direct_declarator_function_start declarator_function_error direct_declarator_function_error declarator_function direct_declarator_nofunction
221 direct_declarator_function_type_ok declarator_nofunction_type_ok direct_declarator_nofunction_type_ok declarator_function_type_ok direct_declarator_function_error_type_ok
222 direct_declarator_function_start_type_ok direct_declarator_type_ok declarator_type_ok declarator_function_error_type_ok
224 %destructor { FreeInitializer($$); } initializer initializer_error initializer_condition initializer_condition_error
225 %destructor { FreeInitDeclarator($$); } init_declarator init_declarator_error
226 %destructor { FreeTypeName($$); } type_name guess_type_name parameter_declaration parameter_declaration_error
227 %destructor { FreeStatement($$); } statement labeled_statement labeled_statement_error compound_statement compound_statement_error expression_statement
228 selection_statement selection_statement_error iteration_statement jump_statement jump_statement_error compound_inside compound_inside_error
229 iteration_statement_error statement_error
231 %destructor { FreeDeclaration($$); } declaration
232 %destructor { FreeFunction($$); } function_definition function_definition_error
233 %destructor { FreeExternal($$); } external_declaration external_declaration_error
235 %destructor { FreeInstance($$); } instantiation_named instantiation_named_error instantiation_unnamed instantiation_unnamed_error
237 %destructor { FreeMemberInit($$); } data_member_initialization data_member_initialization_error default_property default_property_error
239 %destructor { FreeClassFunction($$); } class_function_definition class_function_definition_error class_function_definition_start
240 class_function_definition_start_error virtual_class_function_definition_start virtual_class_function_definition_start_error
241 constructor_function_definition_start destructor_function_definition_start
242 instance_class_function_definition instance_class_function_definition_error instance_class_function_definition_start instance_class_function_definition_start_error
243 %destructor { Context ctx = curContext; PopContext(ctx); FreeContext(ctx); delete ctx; } class_entry
244 %destructor { Context ctx = curContext; PopContext(ctx); FreeContext(ctx); delete ctx; } class_decl
245 %destructor { FreeClass($$); } class class_error class_head
246 %destructor { FreeClassDef($$); } struct_declaration struct_declaration_error
247 %destructor { delete $$; } string_literal attribute_word base_strict_type_name
248 %destructor { FreeProperty($$); } property
250 %destructor { FreeList($$, FreeExpression); } argument_expression_list expression expression_error argument_expression_list_error
251 %destructor { FreeList($$, FreeEnumerator); } enumerator_list
252 %destructor { FreeList($$, FreeSpecifier); } type_qualifier_list specifier_qualifier_list declaration_specifiers inheritance_specifiers _inheritance_specifiers external_guess_declaration_specifiers external_guess_declaration_specifiers_error
253 guess_declaration_specifiers guess_specifier_qualifier_list
254 %destructor { FreeList($$, FreeDeclarator); } struct_declarator_list
255 %destructor { FreeList($$, FreeDeclaration); } declaration_list declaration_list_error
256 %destructor { FreeList($$, FreeInitializer); } initializer_list
257 %destructor { FreeList($$, FreeInitDeclarator); } init_declarator_list init_declarator_list_error
258 %destructor { FreeList($$, FreeTypeName); } parameter_list parameter_list_error parameter_type_list parameter_type_list_error identifier_list identifier_list_error
259 %destructor { FreeList($$, FreeStatement); } statement_list statement_list_error
260 %destructor { if($$ != ast) FreeList($$, FreeExternal); } translation_unit translation_unit_error
261 %destructor { FreeList($$, FreeClassDef); } struct_declaration_list struct_declaration_list_error
262 %destructor { FreeList($$, FreeMemberInit); } default_property_list default_property_list_error data_member_initialization_list data_member_initialization_list_coloned data_member_initialization_list_error
263 %destructor { FreeList($$, FreeMembersInit); } members_initialization_list members_initialization_list_coloned members_initialization_list_error
264 %destructor { PopContext($$); FreeContext($$); delete $$; } compound_start
265 %destructor { FreeTemplateParameter($$); } template_parameter template_type_parameter template_identifier_parameter template_expression_parameter
266 %destructor { FreeTemplateArgument($$); } template_argument template_type_argument template_identifier_argument template_expression_argument
267 %destructor { FreeTemplateDataType($$); } template_datatype
268 %destructor { FreeList($$, FreeTemplateParameter); } template_parameters_list
269 %destructor { FreeList($$, FreeTemplateArgument); } template_arguments_list
270 %destructor { } declaration_mode
271 %destructor { FreeAttrib($$); } attrib
272 %destructor { FreeExtDecl($$); } ext_decl
273 %destructor { FreeAttribute($$); } attribute
274 %destructor { FreeList($$, FreeAttribute); } attribs_list
284 // if($1._class && !$1._class.name)
288 strcpy(name, $1._class.name ? $1._class.name : "");
290 strcat(name, $1.string);
294 _DeclClass(0, $1.string);
298 fileInput.Seek(@1.start.pos, start);
299 resetScannerPos(&@1.start);
304 YY_STACK_PRINT (yyss, yyssp);
307 YY_STACK_PRINT (yyss, yyssp);
314 // if($1._class && !$1._class.name)
318 strcpy(name, $1._class.name ? $1._class.name : "");
320 strcat(name, $1.string);
324 _DeclClass(0, $1.string);
328 fileInput.Seek(@1.start.pos, start);
329 resetScannerPos(&@1.start);
334 YY_STACK_PRINT (yyss, yyssp);
337 YY_STACK_PRINT (yyss, yyssp);
341 /* | identifier '*' '<' template_arguments_list '>'
343 //if($1._class && !$1._class.name)
347 strcpy(name, $1._class.name ? $1._class.name : "");
349 strcat(name, $1.string);
353 _DeclClass(0, $1.string);
354 fileInput.Seek(@1.start.pos, start);
355 resetScannerPos(&@1.start);
360 YY_STACK_PRINT (yyss, yyssp);
363 YY_STACK_PRINT (yyss, yyssp);
369 strict_type { $$ = $1; }
370 | identifier identifier
375 $$ = MkSpecifierName($1.string);
381 // if($1._class && !$1._class.name)
385 strcpy(name, $1._class.name ? $1._class.name : "");
387 strcat(name, $1.string);
391 _DeclClass(0, $1.string);
396 fileInput.Seek(@1.start.pos, start);
397 resetScannerPos(&@1.start);
402 YY_STACK_PRINT (yyss, yyssp);
405 YY_STACK_PRINT (yyss, yyssp);
408 Location tmpLoc = yylloc; $$ = $2; yylloc = @1;
409 Compiler_Error($"Not a type: %s\n", $1.string);
410 yylloc = tmpLoc; $2.badID = $1;
418 //if($1._class && !$1._class.name)
422 strcpy(name, $1._class.name ? $1._class.name : "");
424 strcat(name, $1.string);
428 _DeclClass(0, $1.string);
429 fileInput.Seek(@1.start.pos, start);
430 resetScannerPos(&@1.start);
435 YY_STACK_PRINT (yyss, yyssp);
438 YY_STACK_PRINT (yyss, yyssp);
442 /* | strict_type '<' template_arguments_list '>' { $$ = $1; }
443 | identifier identifier '<' template_arguments_list '>'
446 // if($1._class && !$1._class.name)
450 strcpy(name, $1._class.name ? $1._class.name : "");
452 strcat(name, $1.string);
456 _DeclClass(0, $1.string);
460 fileInput.Seek(@1.start.pos, start);
461 resetScannerPos(&@1.start);
466 YY_STACK_PRINT (yyss, yyssp);
469 YY_STACK_PRINT (yyss, yyssp);
472 Location tmpLoc = yylloc; $$ = $2; yylloc = @1;
473 Compiler_Error($"Not a type: %s\n", $1.string);
474 yylloc = tmpLoc; $2.badID = $1;
480 TYPE_NAME { $$ = MkSpecifierName(yytext); }
483 base_strict_type_name:
484 TYPE_NAME { $$ = CopyString(yytext); }
488 | base_strict_type '<' template_arguments_list '>' { $$ = $1; SetClassTemplateArgs($$, $3); $$.loc = @$; }
489 | base_strict_type '<' template_arguments_list RIGHT_OP
492 SetClassTemplateArgs($$, $3);
496 fileInput.Seek(@4.end.pos, start);
497 resetScannerPos(&@4.end);
501 /* | identifier '<' template_arguments_list '>' */
502 /*| identifier '<' error
504 // if($1._class && !$1._class.name)
508 strcpy(name, $1._class.name ? $1._class.name : "");
510 strcat(name, $1.string);
514 _DeclClass(0, $1.string);
518 fileInput.Seek(@1.start.pos, start);
519 resetScannerPos(&@1.start);
524 YY_STACK_PRINT (yyss, yyssp);
527 YY_STACK_PRINT (yyss, yyssp);
530 YY_STACK_PRINT (yyss, yyssp);
533 /* $$ = MkSpecifierNameArgs($1.string, $3); $$.loc = @$; FreeIdentifier($1); */
537 class_function_definition_start:
538 guess_declaration_specifiers declarator_function_type_ok
539 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
540 | declarator_function
541 { $$ = MkClassFunction(null, null, $1, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
544 constructor_function_definition_start:
545 guess_declaration_specifiers '(' ')'
546 { $$ = MkClassFunction($1, null, null, null); $$.isConstructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
549 destructor_function_definition_start:
550 '~' guess_declaration_specifiers '(' ')'
551 { $$ = MkClassFunction($2, null, null, null); $$.isDestructor = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
554 virtual_class_function_definition_start:
555 VIRTUAL guess_declaration_specifiers declarator_function_type_ok
556 { $$ = MkClassFunction($2, null, $3, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
557 | VIRTUAL declarator_function
558 { $$ = MkClassFunction(null, null, $2, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
561 class_function_definition_start_error:
562 guess_declaration_specifiers declarator_function_error_type_ok
563 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
564 | declarator_function_error
565 { $$ = MkClassFunction(null, null, $1, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
568 virtual_class_function_definition_start_error:
569 VIRTUAL guess_declaration_specifiers declarator_function_error_type_ok
570 { $$ = MkClassFunction($2, null, $3, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
571 | VIRTUAL declarator_function_error
572 { $$ = MkClassFunction(null, null, $2, null); $$.isVirtual = true; $$.loc = @$; $$.id = ++globalContext.nextID; }
575 class_function_definition:
576 class_function_definition_start compound_statement
577 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
578 | virtual_class_function_definition_start compound_statement
579 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
580 | virtual_class_function_definition_start ';'
581 { ProcessClassFunctionBody($1, null); $$.loc = @$; }
582 | constructor_function_definition_start compound_statement
583 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
584 | destructor_function_definition_start compound_statement
585 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
588 | class_function_definition_start ';'
589 { ProcessClassFunctionBody($1, null); $$.loc = @$; }
591 // Added this to fix attrib not working after function pointer declarations
592 | class_function_definition_start attrib ';'
596 $1.declarator = MkStructDeclarator($1.declarator, null);
597 $1.declarator.structDecl.attrib = $2;
599 ProcessClassFunctionBody($1, null);
604 class_function_definition_error:
605 class_function_definition_start compound_statement_error
606 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
607 | class_function_definition_start_error
608 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
609 | virtual_class_function_definition_start compound_statement_error
610 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
611 | virtual_class_function_definition_start_error
612 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
613 | virtual_class_function_definition_start_error ';'
614 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
617 // In Instances, return type is required to distinguish from calling the function
618 instance_class_function_definition_start:
619 declaration_specifiers declarator_function_type_ok
620 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
621 | declaration_specifiers declarator_nofunction_type_ok
622 { $$ = MkClassFunction($1, null, MkDeclaratorFunction($2, null), null); $$.loc = @$; $$.id = ++globalContext.nextID; }
625 instance_class_function_definition_start_error:
626 declaration_specifiers declarator_function_error_type_ok
627 { $$ = MkClassFunction($1, null, $2, null); $$.loc = @$; $$.id = ++globalContext.nextID; }
630 instance_class_function_definition:
631 instance_class_function_definition_start compound_statement
632 { ProcessClassFunctionBody($1, $2); $$.loc = @$; }
635 instance_class_function_definition_error:
636 instance_class_function_definition_start compound_statement_error
637 { ProcessClassFunctionBody($1, $2); $$.loc = @$; $$.loc.end = $2.loc.end; $$.loc.end.charPos++; $$.loc.end.pos++;}
638 | instance_class_function_definition_start_error
639 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
640 | instance_class_function_definition_start
641 { ProcessClassFunctionBody($1, null); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++;}
644 data_member_initialization:
645 postfix_expression '=' initializer_condition { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end;}
646 | initializer_condition { $$ = MkMemberInit(null, $1); $$.loc = @$; $$.realLoc = @$;}
649 data_member_initialization_error:
650 postfix_expression '=' initializer_condition_error { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end;}
651 | postfix_expression '=' error
653 $$ = MkMemberInitExp($1, MkInitializerAssignment(MkExpDummy()));
654 $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = $$.initializer.loc.end = @2.end;
656 fileInput.Seek(@2.end.pos, start);
658 resetScannerPos(&@2.end);
662 | initializer_condition_error { $$ = MkMemberInit(null, $1); $$.loc = @$; $$.realLoc = @$;}
665 data_member_initialization_list:
666 data_member_initialization { $$ = MkList(); ListAdd($$, $1); }
667 | data_member_initialization_list ',' data_member_initialization
668 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
669 | data_member_initialization_list_error ',' data_member_initialization
670 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
673 data_member_initialization_list_error:
674 data_member_initialization_error { $$ = MkList(); ListAdd($$, $1); }
675 | data_member_initialization_list ',' data_member_initialization_error
676 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
677 | data_member_initialization_list_error ',' data_member_initialization_error
678 { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
680 | data_member_initialization_list ',' error
681 { ((MemberInit)$1->last).loc.end = @2.end;
683 Initializer dummy = MkInitializerAssignment(MkExpDummy());
684 MemberInit memberInit = MkMemberInit(null, dummy);
685 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @2.end;
686 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @2.end;
687 ListAdd($1, memberInit);
692 data_member_initialization_list_error ',' error
693 { ((MemberInit)$1->last).loc.end = @2.end;
695 Initializer dummy = MkInitializerAssignment(MkExpDummy());
696 MemberInit memberInit = MkMemberInit(null, dummy);
697 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @2.end;
698 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @2.end;
699 ListAdd($1, memberInit);
705 Initializer dummy = MkInitializerAssignment(MkExpDummy());
706 MemberInit memberInit = MkMemberInit(null, dummy);
707 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @1.start;
708 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @1.start;
711 ListAdd($$, memberInit);
713 dummy = MkInitializerAssignment(MkExpDummy());
714 memberInit = MkMemberInit(null, dummy);
715 memberInit.realLoc.start = memberInit.loc.start = dummy.loc.start = @1.end;
716 memberInit.realLoc.end = memberInit.loc.end = dummy.loc.end = @1.end;
717 ListAdd($$, memberInit);
721 data_member_initialization_list_coloned:
722 data_member_initialization_list ';'
723 { if($1->last) ((MemberInit)$1->last).loc.end = @2.end; $$ = $1; }
724 | data_member_initialization_list_error ';'
725 { if($1->last) ((MemberInit)$1->last).loc.end = @2.end; $$ = $1; }
728 members_initialization_list_coloned:
729 data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($1); $$ = MkList(); ListAdd($$, members); members.loc = @1; }
730 | instance_class_function_definition { $$ = MkList(); ListAdd($$, MkMembersInitMethod($1)); ((MembersInit)$$->last).loc = @1; }
731 | members_initialization_list_error data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($2); ListAdd($$, members); members.loc = @2; $$ = $1; }
732 | members_initialization_list_error instance_class_function_definition { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
733 | members_initialization_list_coloned data_member_initialization_list_coloned { MembersInit members = MkMembersInitList($2); ListAdd($$, members); members.loc = @2; $$ = $1; }
734 | members_initialization_list_coloned instance_class_function_definition { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
735 | members_initialization_list_error ';'
736 | members_initialization_list_coloned ';'
738 MembersInit members = (MembersInit)$$->last;
739 if(members.type == dataMembersInit)
740 members.loc.end = @$.end;
743 MembersInit members = MkMembersInitList(MkList());
744 ListAdd($$, members);
749 | ';' { MembersInit members = MkMembersInitList(MkList()); $$ = MkList(); ListAdd($$, members); members.loc = @1; }
752 members_initialization_list:
753 members_initialization_list_coloned
754 | data_member_initialization_list { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @1; }
755 | members_initialization_list_coloned data_member_initialization_list { ListAdd($1, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
756 | members_initialization_list_error data_member_initialization_list { ListAdd($1, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; }
759 members_initialization_list_error:
760 instance_class_function_definition_error { $$ = MkList(); ListAdd($$, MkMembersInitMethod($1)); ((MembersInit)$$->last).loc = @1; }
761 | members_initialization_list instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
762 | members_initialization_list_error instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
763 | members_initialization_list_coloned instance_class_function_definition_error { ListAdd($$, MkMembersInitMethod($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
764 | members_initialization_list_coloned data_member_initialization_list_error { ListAdd($$, MkMembersInitList($2)); ((MembersInit)$$->last).loc = @2; $$ = $1; }
765 | data_member_initialization_list_error { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @1; }
766 | data_member_initialization_list error { $$ = MkList(); ListAdd($$, MkMembersInitList($1)); ((MembersInit)$$->last).loc = @2; }
770 instantiation_named_error '}'
771 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
772 | instantiation_named_error error '}'
773 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
776 instantiation_named_error:
777 declaration_specifiers identifier '{' members_initialization_list_error
778 { $$ = 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++; }
779 | declaration_specifiers identifier '{' members_initialization_list error
780 { $$ = 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++; }
781 | declaration_specifiers identifier '{' members_initialization_list
782 { $$ = 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++; }
783 | declaration_specifiers identifier '{'
784 { $$ = 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++; }
785 | declaration_specifiers identifier '{' error
786 { $$ = 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++; }
791 declaration_specifiers identifier '{' members_initialization_list '}'
792 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
793 | declaration_specifiers identifier '{' members_initialization_list_error '}'
794 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
795 | declaration_specifiers identifier '{' '}'
796 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
799 instantiation_named_error:
800 declaration_specifiers identifier '{' members_initialization_list_error
801 { $$ = 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++; }
802 | declaration_specifiers identifier '{' members_initialization_list error
803 { $$ = 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++; }
804 | declaration_specifiers identifier '{' members_initialization_list
805 { $$ = 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++; }
806 | declaration_specifiers identifier '{'
807 { $$ = 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++; }
808 | declaration_specifiers identifier '{' error
809 { $$ = 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++; }
814 guess_instantiation_named:
815 guess_instantiation_named_error '}'
816 { $$.loc = @$; $$.insideLoc.end = @2.start; }
817 | guess_instantiation_named_error error '}'
818 { $$.loc = @$; $$.insideLoc.end = @2.start; }
821 guess_instantiation_named_error:
822 guess_declaration_specifiers identifier '{' members_initialization_list_error
823 { $$ = 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++; }
824 | guess_declaration_specifiers identifier '{' members_initialization_list error
825 { $$ = 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++; }
826 | guess_declaration_specifiers identifier '{' members_initialization_list
827 { $$ = 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++; }
828 | guess_declaration_specifiers identifier '{'
829 { $$ = 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++; }
830 | guess_declaration_specifiers identifier '{' error
831 { $$ = 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++; }
835 guess_instantiation_named:
836 guess_declaration_specifiers identifier '{' members_initialization_list '}'
837 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4);$$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
838 | guess_declaration_specifiers identifier '{' members_initialization_list_error '}'
839 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
840 | guess_declaration_specifiers identifier '{' '}'
841 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
844 guess_instantiation_named_error:
845 guess_declaration_specifiers identifier '{' members_initialization_list_error
846 { $$ = 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++; }
847 | guess_declaration_specifiers identifier '{' members_initialization_list error
848 { $$ = 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++; }
849 | guess_declaration_specifiers identifier '{' members_initialization_list
850 { $$ = 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++; }
851 | guess_declaration_specifiers identifier '{'
852 { $$ = 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++; }
853 | guess_declaration_specifiers identifier '{' error
854 { $$ = 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++; }
858 external_guess_instantiation_named:
859 external_guess_declaration_specifiers identifier '{' members_initialization_list '}'
860 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
861 | external_guess_declaration_specifiers identifier '{' members_initialization_list_error '}'
862 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), $4); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @5.start;}
863 | external_guess_declaration_specifiers identifier '{' '}'
864 { $$ = MkInstantiationNamed($1, MkExpIdentifier($2), MkList()); $$.exp.loc = @2; $$.loc = @$; $$.nameLoc = @2; $$.insideLoc.start = @3.end; $$.insideLoc.end = @4.start;}
867 instantiation_unnamed:
868 instantiation_unnamed_error '}'
869 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
870 | instantiation_unnamed_error error '}'
871 { $$.loc = @$; $$.insideLoc.end = @2.start; $$ = $1; }
874 instantiation_unnamed_error:
875 strict_type '{' members_initialization_list
876 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
877 | identifier '{' members_initialization_list
878 { Location tmpLoc = yylloc; yylloc = @1;
879 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; FreeIdentifier($1); }
881 | strict_type '{' members_initialization_list_error
882 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
884 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
885 | strict_type '{' members_initialization_list error
886 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
887 | strict_type '{' error
888 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
892 | identifier '{' members_initialization_list_error
893 { Location tmpLoc = yylloc; yylloc = @1;
894 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); }
896 { Location tmpLoc = yylloc; yylloc = @1;
897 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); }
898 | identifier '{' members_initialization_list error
899 { Location tmpLoc = yylloc; yylloc = @1;
900 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
901 | identifier '{' error
902 { Location tmpLoc = yylloc; yylloc = @1;
903 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; FreeIdentifier($1); }
907 instantiation_unnamed:
908 strict_type '{' members_initialization_list '}'
909 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; }
910 | strict_type '{' members_initialization_list error '}'
911 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @5.start; }
912 | strict_type '{' members_initialization_list_error '}'
913 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; }
914 | strict_type '{' '}'
915 { $$ = MkInstantiation($1, null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.start;}
916 | strict_type '{' error '}'
917 { $$ = MkInstantiation($1, null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start;}
920 | identifier '{' members_initialization_list '}'
921 { Location tmpLoc = yylloc; yylloc = @1;
922 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
923 | identifier '{' members_initialization_list_error '}'
924 { Location tmpLoc = yylloc; yylloc = @1;
925 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
926 | identifier '{' members_initialization_list error '}'
928 $$ = MkInstantiation(MkSpecifierName($1.string), null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @5.start; FreeIdentifier($1); }
930 { Location tmpLoc = yylloc; yylloc = @1;
931 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.start; FreeIdentifier($1);}
932 | identifier '{' error '}'
933 { Location tmpLoc = yylloc; yylloc = @1;
934 yylloc = tmpLoc; $$ = MkInstantiation(MkSpecifierName($1.string), null, MkList()); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @4.start; FreeIdentifier($1); }
938 instantiation_unnamed_error:
939 strict_type '{' members_initialization_list_error
940 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
942 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
943 | strict_type '{' members_initialization_list error
944 { $$ = MkInstantiation($1, null, $3); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @3.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
945 | strict_type '{' error
946 { $$ = MkInstantiation($1, null, null); $$.loc = @$; $$.insideLoc.start = @2.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
950 | identifier '{' members_initialization_list_error
951 { Location tmpLoc = yylloc; yylloc = @1;
952 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); }
954 { Location tmpLoc = yylloc; yylloc = @1;
955 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); }
956 | identifier '{' members_initialization_list error
957 { Location tmpLoc = yylloc; yylloc = @1;
958 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); }
959 | identifier '{' error
960 { Location tmpLoc = yylloc; yylloc = @1;
961 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); }
966 instantiation_anon_error '}'
967 { $$.loc = @$; $$.insideLoc.end = @2.start; }
968 | instantiation_anon_error error '}'
969 { $$.loc = @$; $$.insideLoc.end = @2.start; }
972 instantiation_anon_error:
973 '{' members_initialization_list_error
974 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
975 | '{' members_initialization_list error
976 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
978 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
980 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
981 | '{' members_initialization_list
982 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
987 '{' members_initialization_list '}'
988 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start; }
989 | '{' members_initialization_list error '}'
990 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @4.start; }
991 | '{' members_initialization_list_error '}'
992 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start; }
994 { $$ = MkInstantiation(null, null, MkList()); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.start;}
996 { $$ = MkInstantiation(null, null, MkList()); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @3.start;}
999 instantiation_anon_error:
1000 '{' members_initialization_list_error
1001 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
1003 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
1004 | '{' members_initialization_list error
1005 { $$ = MkInstantiation(null, null, $2); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @2.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
1007 { $$ = MkInstantiation(null, null, null); $$.loc = @$; $$.insideLoc.start = @1.end; $$.insideLoc.end = @1.end; $$.loc.end.charPos++; $$.loc.end.pos++; }
1012 postfix_expression '=' initializer_condition { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; }
1015 default_property_error:
1016 postfix_expression '=' initializer_condition_error { $$ = MkMemberInitExp($1, $3); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end; }
1017 | postfix_expression '=' error { $$ = MkMemberInitExp($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.realLoc = @$; $$.initializer.loc.start = @2.end; $$.initializer.loc.end = @2.end; }
1018 | postfix_expression error { $$ = MkMemberInitExp($1, null); $$.loc = @$; $$.realLoc = @$; }
1021 default_property_list:
1022 default_property { $$ = MkList(); ListAdd($$, $1); ((MemberInit)$$->last).loc = @$; }
1023 | default_property_list ',' default_property { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
1024 | default_property_list_error ',' default_property { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
1027 default_property_list_error:
1028 default_property_error { $$ = MkList(); ListAdd($$, $1); ((MemberInit)$$->last).loc = @$; }
1029 | default_property_list ',' default_property_error { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
1030 | default_property_list_error ',' default_property_error { ((MemberInit)$1->last).loc.end = @3.start; ListAdd($1, $3); $$ = $1; }
1031 | default_property_list error
1035 PROPERTY property_specifiers identifier '{'
1036 { $$ = MkProperty($2, null, $3, null, null); $$.loc = @$; }
1038 | PROPERTY property_specifiers abstract_declarator identifier '{'
1039 { $$ = MkProperty($2, $3, $4, null, null); $$.loc = @$; }
1041 | PROPERTY property_specifiers '{'
1042 { $$ = MkProperty($2, null, null, null, null); $$.loc = @$; }
1044 | PROPERTY property_specifiers abstract_declarator '{'
1045 { $$ = MkProperty($2, $3, null, null, null); $$.loc = @$; }
1047 | PROPERTY error '{'
1048 { $$ = MkProperty(null, null, null, null, null); $$.loc = @$; }
1053 | property_body SETPROP compound_statement
1054 { $1.setStmt = $3; }
1055 | property_body GETPROP compound_statement
1056 { $1.getStmt = $3; }
1057 | property_body ISPROPSET compound_statement
1058 { $1.issetStmt = $3; }
1059 | property_body WATCHABLE
1060 { $1.isWatchable = true; }
1061 | property_body PROPERTY_CATEGORY i18n_string
1062 { $1.category = $3; }
1066 property_body '}' { $1.loc.end = @2.end; $$ = $1; }
1069 class_property_start:
1070 CLASS_PROPERTY property_specifiers identifier '{'
1071 { $$ = MkProperty($2, null, $3, null, null); $$.loc = @$; }
1073 | CLASS_PROPERTY property_specifiers abstract_declarator identifier '{'
1074 { $$ = MkProperty($2, $3, $4, null, null); $$.loc = @$; }
1076 | CLASS_PROPERTY property_specifiers '{'
1077 { $$ = MkProperty($2, null, null, null, null); $$.loc = @$; }
1079 | CLASS_PROPERTY property_specifiers abstract_declarator '{'
1080 { $$ = MkProperty($2, $3, null, null, null); $$.loc = @$; }
1082 | CLASS_PROPERTY error '{'
1083 { $$ = MkProperty(null, null, null, null, null); $$.loc = @$; }
1086 class_property_body:
1087 class_property_start
1088 | class_property_body SETPROP compound_statement
1089 { $1.setStmt = $3; }
1090 | class_property_body GETPROP compound_statement
1091 { $1.getStmt = $3; }
1095 class_property_body '}' { $1.loc.end = @2.end; }
1098 watch_property_list:
1100 { $$ = MkListOne($1); }
1101 | watch_property_list identifier
1102 { ListAdd($1, $2); }
1106 watch_property_list compound_statement
1107 { $$ = MkPropertyWatch($1, $2); }
1108 | DELETE compound_statement
1109 { $$ = MkDeleteWatch($2); }
1112 property_watch_list:
1114 { $$ = MkListOne($1); }
1115 | property_watch_list property_watch
1116 { ListAdd($1, $2); }
1119 self_watch_definition:
1120 WATCH '(' watch_property_list ')' compound_statement
1121 { $$ = MkPropertyWatch($3, $5); }
1125 WATCH '(' assignment_expression ')' '{' property_watch_list '}'
1126 { $$ = MkWatchStmt(null, $3, $6); }
1127 | assignment_expression '.' WATCH '(' assignment_expression ')' '{' property_watch_list '}'
1128 { $$ = MkWatchStmt($1, $5, $8); }
1132 STOPWATCHING '(' assignment_expression ',' watch_property_list ')'
1133 { $$ = MkStopWatchingStmt(null, $3, $5); }
1134 | assignment_expression '.' STOPWATCHING '(' assignment_expression ',' watch_property_list ')'
1135 { $$ = MkStopWatchingStmt($1, $5, $7); }
1136 | STOPWATCHING '(' assignment_expression ')'
1137 { $$ = MkStopWatchingStmt(null, $3, null); }
1138 | assignment_expression '.' STOPWATCHING '(' assignment_expression ')'
1139 { $$ = MkStopWatchingStmt($1, $5, null); }
1144 { $$ = MkFireWatchersStmt(null, null); }
1145 | FIREWATCHERS watch_property_list
1146 { $$ = MkFireWatchersStmt(null, $2); }
1147 | postfix_expression '.' FIREWATCHERS
1148 { $$ = MkFireWatchersStmt($1, null); }
1149 | assignment_expression '.' FIREWATCHERS watch_property_list
1150 { $$ = MkFireWatchersStmt($1, $4); }
1154 struct_declaration_error ';' { $$ = $1; $$.loc.end = @2.end; }
1155 | default_property_list ';' { $$ = MkClassDefDefaultProperty($1); if($1->last) ((MemberInit)$1->last).loc.end = @2.start; $$.loc = @$; }
1156 | class_function_definition { $$ = MkClassDefFunction($1); $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1157 | property { $$ = MkClassDefProperty($1); $$.loc = @$; globalContext.nextID++; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1158 | member_access class_function_definition { $$ = MkClassDefFunction($2); $$.loc = @$; $$.memberAccess = $1; }
1159 | member_access property { $$ = MkClassDefProperty($2); $$.loc = @$; globalContext.nextID++; $$.memberAccess = $1; }
1160 | class_property { $$ = MkClassDefClassProperty($1); $$.loc = @$; globalContext.nextID++; }
1161 | WATCHABLE { $$ = null; deleteWatchable = true; }
1162 | CLASS_NO_EXPANSION { $$ = MkClassDefNoExpansion(); }
1163 | CLASS_FIXED { $$ = MkClassDefFixed(); }
1164 | CLASS_PROPERTY '(' identifier ')' '=' initializer_condition ';' { $$ = MkClassDefClassPropertyValue($3, $6); $$.loc = @$; }
1166 | ';' { $$ = null; }
1167 | member_access ':' { memberAccessStack[defaultMemberAccess] = $1; if(defaultMemberAccess == 0) { $$ = MkClassDefMemberAccess(); $$.memberAccess = $1; $$.loc = @$; } else $$ = null; }
1169 | member_access '(' identifier ')' { $$ = MkClassDefAccessOverride($1, $3); $$.loc = @$; }
1172 struct_declaration_error:
1173 class_function_definition_error { $$ = MkClassDefFunction($1); $$.loc = $1.loc; $$.loc.end.charPos++; $$.loc.end.pos++; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1175 // Moved all these in here without the ';'
1176 | guess_declaration_specifiers { $$ = MkClassDefDeclaration(MkStructDeclaration($1, null, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1177 | guess_declaration_specifiers struct_declarator_list { $$ = MkClassDefDeclaration(MkStructDeclaration($1, $2, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1178 | member_access guess_declaration_specifiers struct_declarator_list { $$ = MkClassDefDeclaration(MkStructDeclaration($2, $3, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = $1; }
1179 | member_access guess_declaration_specifiers { $$ = MkClassDefDeclaration(MkStructDeclaration($2, null, null)); $$.decl.loc = @$; $$.loc = @$; $$.memberAccess = $1; }
1180 | member_access instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = $1; }
1181 | member_access guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = $1; }
1182 | CLASS_DATA guess_declaration_specifiers struct_declarator_list { $$ = MkClassDefClassData(MkStructDeclaration($2, $3, null)); $$.decl.loc = @$; $$.loc = @$; }
1183 | self_watch_definition { $$ = MkClassDefPropertyWatch($1); $$.loc = @$; globalContext.nextID++; }
1184 | CLASS_DESIGNER identifier { $$ = MkClassDefDesigner($2.string); FreeIdentifier($2); }
1185 | CLASS_DESIGNER strict_type { $$ = MkClassDefDesigner($2.name); FreeSpecifier($2); }
1186 | CLASS_DEFAULT_PROPERTY identifier { $$ = MkClassDefDesignerDefaultProperty($2); }
1187 | instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1188 | guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = @$; $$.decl.loc = @$; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1189 | default_property_list { $$ = MkClassDefDefaultProperty($1); if($1->last) ((MemberInit)$1->last).loc.end = @1.end; $$.loc = @$; }
1191 | guess_instantiation_named_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1192 | instantiation_unnamed_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1193 // | guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1194 // | instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($1)); $$.loc = $1.loc; $$.decl.loc = $$.loc; $$.memberAccess = memberAccessStack[defaultMemberAccess]; }
1196 | member_access class_function_definition_error { $$ = MkClassDefFunction($2); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.memberAccess = $1; }
1197 | member_access guess_instantiation_named_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1198 | member_access instantiation_unnamed_error error { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1199 // | member_access guess_instantiation_named { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1200 // | member_access instantiation_unnamed { $$ = MkClassDefDeclaration(MkDeclarationClassInst($2)); $$.loc = @$; $$.decl.loc = $$.loc; $$.memberAccess = $1; }
1202 | default_property_list_error { $$ = MkClassDefDefaultProperty($1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
1205 struct_declaration_list:
1206 struct_declaration { $$ = MkList(); ListAdd($$, $1); }
1207 | struct_declaration_list struct_declaration { $$ = $1; ListAdd($1, $2); }
1208 | struct_declaration_list_error struct_declaration { $$ = $1; ListAdd($1, $2); }
1211 struct_declaration_list_error:
1212 struct_declaration_error { yyerror(); $$ = MkList(); ListAdd($$, $1); }
1213 | struct_declaration_list error
1214 | struct_declaration_list_error error
1215 | struct_declaration_list struct_declaration_error { yyerror(); $$ = $1; ListAdd($$, $2); }
1216 | struct_declaration_list_error struct_declaration_error { $$ = $1; ListAdd($$, $2); }
1220 guess_declaration_specifiers { $$ = MkTemplateDatatype($1, null); }
1221 | guess_declaration_specifiers abstract_declarator { $$ = MkTemplateDatatype($1, $2); }
1222 // | identifier { $$ = MkTemplateDatatype(MkListOne(MkSpecifierName($1.string)), null); FreeIdentifier($1); }
1225 template_type_argument:
1226 // template_datatype { $$ = MkTemplateTypeArgument($1); }
1228 // Explicitly copied the rules here to handle:
1229 // ast.ec: Map<List<Location>> intlStrings { };
1231 // LinkList.ec: class LinkList<bool circ = false>
1233 guess_declaration_specifiers { $$ = MkTemplateTypeArgument(MkTemplateDatatype($1, null)); }
1234 | guess_declaration_specifiers abstract_declarator { $$ = MkTemplateTypeArgument(MkTemplateDatatype($1, $2)); }
1237 template_type_parameter:
1238 CLASS identifier { $$ = MkTypeTemplateParameter($2, null, null); }
1239 | CLASS identifier '=' template_type_argument { $$ = MkTypeTemplateParameter($2, null, $4); }
1240 | CLASS identifier ':' template_datatype { $$ = MkTypeTemplateParameter($2, $4, null); }
1241 | CLASS identifier ':' template_datatype '=' template_type_argument { $$ = MkTypeTemplateParameter($2, $4, $6); }
1242 | CLASS base_strict_type_name { $$ = MkTypeTemplateParameter(MkIdentifier($2), null, null); delete $2; }
1243 | CLASS base_strict_type_name '=' template_type_argument { $$ = MkTypeTemplateParameter(MkIdentifier($2), null, $4); }
1244 | CLASS base_strict_type_name ':' template_datatype { $$ = MkTypeTemplateParameter(MkIdentifier($2), $4, null); }
1245 | CLASS base_strict_type_name ':' template_datatype '=' template_type_argument { $$ = MkTypeTemplateParameter(MkIdentifier($2), $4, $6); }
1248 template_identifier_argument:
1249 identifier { $$ = MkTemplateIdentifierArgument($1); }
1252 template_identifier_parameter:
1253 identifier { $$ = MkIdentifierTemplateParameter($1, dataMember, null); }
1254 | identifier '=' template_identifier_argument { $$ = MkIdentifierTemplateParameter($1, dataMember, $3); }
1257 template_expression_argument:
1258 shift_expression /*constant_expression*/ { $$ = MkTemplateExpressionArgument($1); }
1261 template_expression_parameter:
1263 template_datatype identifier { $$ = MkExpressionTemplateParameter($2, $1, null); }
1264 | template_datatype identifier '=' template_expression_argument { $$ = MkExpressionTemplateParameter($2, $1, $4); }
1266 guess_declaration_specifiers identifier '=' template_expression_argument { $$ = MkExpressionTemplateParameter($2, MkTemplateDatatype($1, null), $4); }
1267 | guess_declaration_specifiers abstract_declarator identifier '=' template_expression_argument { $$ = MkExpressionTemplateParameter($3, MkTemplateDatatype($1, $2), $5); }
1271 template_type_parameter
1272 | template_identifier_parameter
1273 | template_expression_parameter
1276 template_parameters_list:
1277 template_parameter { $$ = MkList(); ListAdd($$, $1); }
1278 | template_parameters_list ',' template_parameter { $$ = $1; ListAdd($1, $3); }
1282 template_expression_argument
1283 | template_identifier_argument
1284 | template_type_argument
1285 | identifier '=' template_expression_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1286 | identifier '=' template_identifier_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1287 | identifier '=' template_type_argument { $$ = $3; $$.name = $1; $$.loc = @$; }
1288 /*| template_datatype '=' template_expression_argument
1291 if($1.specifiers && $1.specifiers->first)
1293 Specifier spec = $1.specifiers->first;
1294 if(spec.type == nameSpecifier)
1295 $$.name = MkIdentifier(spec.name);
1297 FreeTemplateDataType($1);
1300 | template_datatype '=' template_identifier_argument
1303 if($1.specifiers && $1.specifiers->first)
1305 Specifier spec = $1.specifiers->first;
1306 if(spec.type == nameSpecifier)
1307 $$.name = MkIdentifier(spec.name);
1309 FreeTemplateDataType($1);
1312 | template_datatype '=' template_type_argument
1315 if($1.specifiers && $1.specifiers->first)
1317 Specifier spec = $1.specifiers->first;
1318 if(spec.type == nameSpecifier)
1319 $$.name = MkIdentifier(spec.name);
1321 FreeTemplateDataType($1);
1326 template_arguments_list:
1327 template_argument { $$ = MkList(); ListAdd($$, $1); }
1328 | template_arguments_list ',' template_argument { $$ = $1; ListAdd($1, $3); }
1334 if(curContext != globalContext)
1335 PopContext(curContext);
1340 class_entry identifier { (void)$1; $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1341 | class_entry base_strict_type
1343 (void)$1; $$ = DeclClass(globalContext.nextID++, $2.name);
1346 ++defaultMemberAccess;
1347 memberAccessStack[defaultMemberAccess] = privateAccess;
1349 | identifier class_entry identifier { (void)$2; $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1350 | identifier class_entry base_strict_type { (void)$2; $$ = DeclClass(globalContext.nextID++, $3.name); FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1352 | class_entry identifier '<' template_parameters_list '>' { (void)$1; $$ = DeclClassAddNameSpace(globalContext.nextID++, $2.string); $$.templateParams = $4; FreeIdentifier($2); $$.nameLoc = @2; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1353 | class_entry base_strict_type '<' template_parameters_list '>'
1355 (void)$1; $$ = DeclClass(globalContext.nextID++, $2.name);
1356 $$.templateParams = $4;
1359 ++defaultMemberAccess;
1360 memberAccessStack[defaultMemberAccess] = privateAccess;
1362 | identifier class_entry identifier '<' template_parameters_list '>' { (void)$2; $$ = DeclClassAddNameSpace(globalContext.nextID++, $3.string); $$.templateParams = $5; FreeIdentifier($1); FreeIdentifier($3); $$.nameLoc = @3; $$.isRemote = true; memberAccessStack[++defaultMemberAccess] = privateAccess; }
1363 | identifier class_entry base_strict_type '<' template_parameters_list '>' { (void)$2; $$ = DeclClass(globalContext.nextID++, $3.name); $$.templateParams = $5; FreeIdentifier($1); $$.nameLoc = @3; $$.isRemote = true; FreeSpecifier($3); memberAccessStack[++defaultMemberAccess] = privateAccess; }
1373 // Added this for unit classes...
1376 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1378 PopContext(curContext);
1381 | class_decl '{' '}'
1383 $$ = MkClass($1, null, MkList()); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1385 PopContext(curContext);
1387 | class_head '{' '}'
1389 $$ = $1; $$.definitions = MkList(); $$.blockStart = @2; $$.loc = @$; $$.endid = globalContext.nextID++;
1391 PopContext(curContext);
1394 | class_entry identifier ';'
1396 (void)$1; $$ = MkClass(DeclClassAddNameSpace(0, $2.string), null, null); FreeIdentifier($2);
1398 PopContext(curContext);
1400 | class_entry type ';'
1402 (void)$1; $$ = MkClass(DeclClass(0, $2.name), null, null); FreeSpecifier($2);
1404 PopContext(curContext);
1409 class_decl ':' inheritance_specifiers
1411 $$ = MkClass($1, $3, null);
1416 class_decl '{' struct_declaration_list_error
1418 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1420 PopContext(curContext);
1422 | class_head '{' struct_declaration_list_error
1424 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1426 PopContext(curContext);
1428 | class_decl '{' struct_declaration_list
1430 $$ = MkClass($1, null, $3); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1432 PopContext(curContext);
1434 | class_head '{' struct_declaration_list
1436 $$ = $1; $$.definitions = $3; $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1438 PopContext(curContext);
1440 | class_decl '{' error
1442 $$ = MkClass($1, null, MkList()); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1444 PopContext(curContext);
1446 | class_head '{' error
1448 $$ = $1; $$.definitions = MkList(); $$.deleteWatchable = deleteWatchable; deleteWatchable = false; $$.blockStart = @2; $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; $$.endid = globalContext.nextID++;
1450 PopContext(curContext);
1454 /**** EXPRESSIONS ********************************************************************/
1458 { $$ = MkIdentifier(yytext); $$.loc = @1; }
1462 simple_primary_expression
1463 | '(' expression ')'
1464 { $$ = MkExpBrackets($2); $$.loc = @$; }
1468 string_literal { $$ = MkExpString($1); delete $1; $$.loc = @$; }
1469 | '$' string_literal { $$ = MkExpIntlString($2, null); delete $2; $$.loc = @$; }
1470 | '$' string_literal '.' string_literal { $$ = MkExpIntlString($4, $2); delete $2; delete $4; $$.loc = @$; }
1474 CONSTANT { $$ = MkExpConstant(yytext); $$.loc = @$; }
1477 simple_primary_expression:
1478 identifier { $$ = MkExpIdentifier($1); $$.loc = @$; }
1479 | instantiation_unnamed { $$ = MkExpInstance($1); $$.loc = @$; }
1480 | EXTENSION '(' compound_statement ')' { $$ = MkExpExtensionCompound($3); $$.loc = @$; }
1481 | EXTENSION '(' expression ')' { $$ = MkExpExtensionExpression($3); $$.loc = @$; }
1482 | EXTENSION '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, $5); $$.loc = @$; }
1483 | EXTENSION '(' type_name ')' '(' type_name ')' initializer { $$ = MkExpExtensionInitializer($3, MkInitializerAssignment(MkExpExtensionInitializer($6, $8))); $$.loc = @$; }
1484 | constant identifier
1486 char * constant = $1.constant;
1487 int len = strlen(constant);
1488 if(constant[len-1] == '.')
1490 constant[len-1] = 0;
1491 $$ = MkExpMember($1, $2);
1497 | constant { $$ = $1; }
1499 | '(' ')' { Expression exp = MkExpDummy(); exp.loc.start = @1.end; exp.loc.end = @2.start; $$ = MkExpBrackets(MkListOne(exp)); $$.loc = @$; yyerror(); }
1500 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1501 | NEWOP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,$3), $5); $$.loc = @$; }
1502 | NEWOP new_specifiers '[' constant_expression ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1503 | NEWOP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew(MkTypeName($2,null), $4); $$.loc = @$; }
1504 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1505 | NEW0OP new_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,$3), $5); $$.loc = @$; }
1506 | NEW0OP new_specifiers '[' constant_expression ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1507 | NEW0OP new_specifiers '[' constant_expression_error ']' { $$ = MkExpNew0(MkTypeName($2,null), $4); $$.loc = @$; }
1508 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1509 | RENEW constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1510 | RENEW constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1511 | RENEW constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew($2, MkTypeName($3,null), $5); $$.loc = @$; }
1512 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1513 | RENEW0 constant_expression renew_specifiers abstract_declarator_noarray '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,$4), $6); $$.loc = @$; }
1514 | RENEW0 constant_expression renew_specifiers '[' constant_expression ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1515 | RENEW0 constant_expression renew_specifiers '[' constant_expression_error ']' { $$ = MkExpRenew0($2, MkTypeName($3,null), $5); $$.loc = @$; }
1516 | CLASS '(' declaration_specifiers ')' { $$ = MkExpClass($3, null); $$.loc = @$; }
1517 | CLASS '(' declaration_specifiers abstract_declarator ')' { $$ = MkExpClass($3, $4); $$.loc = @$; }
1518 | CLASS '(' identifier ')' { $$ = MkExpClass(MkListOne(MkSpecifierName($3.string)), null); FreeIdentifier($3); $$.loc = @$; }
1519 | VAARG '(' assignment_expression ',' type_name ')' { $$ = MkExpVaArg($3, $5); $$.loc = @$; }
1521 | CLASS_DATA '(' identifier ')' { $$ = MkExpClassData($3); $$.loc = @$; }
1527 | '[' argument_expression_list /*expression*/ ']' { $$ = MkExpArray($2); $$.loc = @$; }
1528 | '[' ']' { $$ = MkExpArray(null); $$.loc = @$; }
1531 anon_instantiation_expression:
1532 instantiation_anon { $$ = MkExpInstance($1); $$.loc = @$; }
1535 anon_instantiation_expression_error:
1536 instantiation_anon_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1539 primary_expression_error:
1540 '(' expression { yyerror(); $$ = MkExpBrackets($2); $$.loc = @$; }
1541 | '(' expression_error { $$ = MkExpBrackets($2); $$.loc = @$; }
1547 | postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1548 | postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1549 | postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1550 | postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1551 | 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; }
1552 | postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1553 | postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1554 | postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1555 | postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1557 | postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1558 | postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1559 | postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1560 | postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1561 | postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1562 | postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1563 | postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1564 | postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1567 /*simple_postfix_expression:
1568 simple_primary_expression
1570 | simple_postfix_expression '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1571 | simple_postfix_expression '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1572 | simple_postfix_expression '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1573 | simple_postfix_expression '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end; $$.loc = @$; }
1574 | 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; }
1575 | simple_postfix_expression '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1576 | simple_postfix_expression PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1577 | simple_postfix_expression INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1578 | simple_postfix_expression DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1580 | simple_postfix_expression_error '[' expression ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1581 | simple_postfix_expression_error '[' expression_error ']' { $$ = MkExpIndex($1, $3); $$.loc = @$; }
1582 | simple_postfix_expression_error '(' ')' { $$ = MkExpCall($1, MkList()); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; }
1583 | simple_postfix_expression_error '(' argument_expression_list ')' { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; }
1584 | simple_postfix_expression_error '.' identifier { $$ = MkExpMember($1, $3); $$.loc = @$; }
1585 | simple_postfix_expression_error PTR_OP identifier { $$ = MkExpPointer($1, $3); $$.loc = @$; }
1586 | simple_postfix_expression_error INC_OP { $$ = MkExpOp($1, INC_OP, null); $$.loc = @$; }
1587 | simple_postfix_expression_error DEC_OP { $$ = MkExpOp($1, DEC_OP, null); $$.loc = @$; }
1590 argument_expression_list:
1591 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1592 | anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1593 | argument_expression_list ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1594 | argument_expression_list ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1597 argument_expression_list_error:
1598 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
1599 | anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
1600 | argument_expression_list ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
1601 | argument_expression_list ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
1602 | argument_expression_list ',' { Expression exp = MkExpDummy(); yyerror(); exp.loc.start = @2.end; exp.loc.end = @2.end; $$ = $1; ListAdd($1, exp); }
1605 common_unary_expression:
1606 INC_OP unary_expression { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1607 | DEC_OP unary_expression { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1608 | unary_operator cast_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1609 | unary_operator anon_instantiation_expression { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1610 //| SIZEOF '(' unary_expression ')' { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1611 | SIZEOF unary_expression { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1612 | SIZEOF '(' guess_type_name ')' { $$ = MkExpTypeSize($3); $$.loc = @$; }
1613 | SIZEOF '(' CLASS type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1614 | SIZEOF '(' CLASS guess_type ')' { $$ = MkExpClassSize($4); $$.loc = @$; }
1616 //| ALIGNOF '(' unary_expression ')' { $$ = MkExpOp(null, ALIGNOF, $3); $$.loc = @$; }
1617 | ALIGNOF unary_expression { $$ = MkExpOp(null, ALIGNOF, $2); $$.loc = @$; }
1618 | ALIGNOF '(' guess_type_name ')' { $$ = MkExpTypeAlign($3); $$.loc = @$; }
1622 common_unary_expression
1623 | postfix_expression
1627 common_unary_expression
1628 | simple_postfix_expression
1638 | DELETE { $$ = DELETE; }
1639 | _INCREF { $$ = _INCREF; }
1644 | '(' type_name ')' cast_expression { $$ = MkExpCast($2, $4); $$.loc = @$; }
1647 multiplicative_expression:
1649 | multiplicative_expression '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1650 | multiplicative_expression '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1651 | multiplicative_expression '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1652 | multiplicative_expression_error '*' cast_expression { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1653 | multiplicative_expression_error '/' cast_expression { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1654 | multiplicative_expression_error '%' cast_expression { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1657 additive_expression:
1658 multiplicative_expression
1659 | additive_expression '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1660 | additive_expression '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1661 | additive_expression_error '+' multiplicative_expression { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1662 | additive_expression_error '-' multiplicative_expression { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1667 | shift_expression LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1668 | shift_expression RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1669 | shift_expression_error LEFT_OP additive_expression { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1670 | shift_expression_error RIGHT_OP additive_expression { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1673 relational_expression_smaller_than:
1674 relational_expression '<'
1681 relational_expression:
1683 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression { skipErrors = false; $$ = MkExpOp($1, '<', $2/*$3*/); $$.loc = @$; }
1684 | relational_expression '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1685 | relational_expression LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1686 | relational_expression GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1687 | relational_expression_error '<' shift_expression { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1688 | relational_expression_error '>' shift_expression { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1689 | relational_expression_error LE_OP shift_expression { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1690 | relational_expression_error GE_OP shift_expression { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1694 : relational_expression
1695 | equality_expression EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1696 | equality_expression NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1697 | equality_expression_error EQ_OP relational_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1698 | equality_expression_error NE_OP relational_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1700 | equality_expression EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1701 | equality_expression NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1702 | equality_expression_error EQ_OP anon_instantiation_expression { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1703 | equality_expression_error NE_OP anon_instantiation_expression { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1707 : equality_expression
1708 | and_expression '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1709 | and_expression_error '&' equality_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1711 | and_expression '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1712 | and_expression_error '&' anon_instantiation_expression { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
1715 exclusive_or_expression
1717 | exclusive_or_expression '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1718 | exclusive_or_expression_error '^' and_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1720 | exclusive_or_expression '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1721 | exclusive_or_expression_error '^' anon_instantiation_expression { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
1724 inclusive_or_expression
1725 : exclusive_or_expression
1726 | inclusive_or_expression '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1727 | inclusive_or_expression_error '|' exclusive_or_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1729 | inclusive_or_expression '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1730 | inclusive_or_expression_error '|' anon_instantiation_expression { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
1733 logical_and_expression
1734 : inclusive_or_expression
1735 | logical_and_expression AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1736 | logical_and_expression_error AND_OP inclusive_or_expression { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
1739 logical_or_expression
1740 : logical_and_expression
1741 | logical_or_expression OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1742 | logical_or_expression_error OR_OP logical_and_expression { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
1745 conditional_expression
1746 : logical_or_expression
1747 | logical_or_expression '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1748 | logical_or_expression '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1749 | logical_or_expression_error '?' expression ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1750 | logical_or_expression_error '?' expression_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1752 | logical_or_expression '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1753 | logical_or_expression '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1754 | logical_or_expression_error '?' expression_anon_inst ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1755 | logical_or_expression_error '?' expression_anon_inst_error ':' conditional_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1757 | logical_or_expression '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1758 | logical_or_expression '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1759 | logical_or_expression_error '?' expression ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1760 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1762 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1763 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1764 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1765 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
1768 assignment_expression:
1769 conditional_expression
1770 | unary_expression assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1771 | unary_expression_error assignment_operator assignment_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1772 | conditional_expression assignment_operator assignment_expression { Compiler_Error($"l-value expected\n"); $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1773 | conditional_expression_error assignment_operator assignment_expression { Compiler_Error($"l-value expected\n"); $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1775 | unary_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1776 | unary_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1777 | conditional_expression assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1778 | conditional_expression_error assignment_operator anon_instantiation_expression { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
1781 assignment_operator:
1783 | MUL_ASSIGN { $$ = MUL_ASSIGN; }
1784 | DIV_ASSIGN { $$ = DIV_ASSIGN; }
1785 | MOD_ASSIGN { $$ = MOD_ASSIGN; }
1786 | ADD_ASSIGN { $$ = ADD_ASSIGN; }
1787 | SUB_ASSIGN { $$ = SUB_ASSIGN; }
1788 | LEFT_ASSIGN { $$ = LEFT_ASSIGN; }
1789 | RIGHT_ASSIGN { $$ = RIGHT_ASSIGN; }
1790 | AND_ASSIGN { $$ = AND_ASSIGN; }
1791 | XOR_ASSIGN { $$ = XOR_ASSIGN; }
1792 | OR_ASSIGN { $$ = OR_ASSIGN; }
1796 assignment_expression { $$ = MkList(); ListAdd($$, $1); }
1797 | expression ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1798 | expression_error ',' assignment_expression { $$ = $1; ListAdd($1, $3); }
1799 | expression_error ')'
1802 expression_anon_inst:
1803 anon_instantiation_expression { $$ = MkList(); ListAdd($$, $1); }
1804 | expression ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1805 | expression_error ',' anon_instantiation_expression { $$ = $1; ListAdd($1, $3); }
1808 postfix_expression_error:
1809 primary_expression_error
1810 | error { $$ = MkExpDummy(); $$.loc = @$; /*printf("Sorry, didn't mean that syntax error\n");*/ }
1811 | postfix_expression error
1812 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1814 | postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1815 | postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1817 | postfix_expression '(' argument_expression_list { yyerror(); $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1818 | postfix_expression '(' argument_expression_list_error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1819 /* Useless rules due to conflicts
1820 | postfix_expression '(' argument_expression_list ',' error { $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @4.end;$$.loc = @$; $$.call.argLoc.end.charPos++;}
1821 | postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; }
1823 | postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1825 | 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++;}
1826 /* Useless rules due to conflicts
1827 | 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++;}
1828 | postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1830 | postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1833 /*simple_postfix_expression_error:
1834 error { $$ = MkExpDummy(); $$.loc = @$; }
1835 | simple_postfix_expression error
1836 | instantiation_unnamed_error error { $$ = MkExpInstance($1); $$.loc = @$; }
1838 | simple_postfix_expression PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1839 | simple_postfix_expression_error PTR_OP error { $$ = MkExpPointer($1, null); $$.loc = @$; }
1841 | simple_postfix_expression '(' argument_expression_list { yyerror(); $$ = MkExpCall($1, $3); $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @3.end; $$.loc = @$; $$.call.argLoc.end.charPos++;}
1842 | 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++;}
1843 // Useless rules due to conflicts
1844 //| 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++;}
1845 //| simple_postfix_expression '(' error { $$ = MkExpCall($1, MkList() ); @$.end = yylloc.start; $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = yylloc.start; }
1847 | simple_postfix_expression '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1849 | 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++;}
1850 // Useless rules due to conflicts
1851 //| 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++;}
1852 //| simple_postfix_expression_error '(' error { $$ = MkExpCall($1, MkList() ); $$.loc = @$; $$.call.argLoc.start = @2.start; $$.call.argLoc.end = @2.end; $$.call.argLoc.end.charPos++;}
1853 | simple_postfix_expression_error '.' error { $$ = MkExpMember($1, null); $$.loc = @$; }
1857 common_unary_expression_error:
1858 INC_OP unary_expression_error { $$ = MkExpOp(null, INC_OP, $2); $$.loc = @$; }
1859 | DEC_OP unary_expression_error { $$ = MkExpOp(null, DEC_OP, $2); $$.loc = @$; }
1860 | unary_operator cast_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1861 | unary_operator anon_instantiation_expression_error { $$ = MkExpOp(null, $1, $2); $$.loc = @$; }
1862 //| SIZEOF '(' unary_expression_error { $$ = MkExpOp(null, SIZEOF, $3); $$.loc = @$; }
1863 | SIZEOF unary_expression_error { $$ = MkExpOp(null, SIZEOF, $2); $$.loc = @$; }
1864 | SIZEOF '(' guess_type_name ')' error { $$ = MkExpTypeSize($3); $$.loc = @$; }
1865 | SIZEOF '(' CLASS type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1866 | SIZEOF '(' CLASS guess_type ')' error { $$ = MkExpClassSize($4); $$.loc = @$; }
1867 //| ALIGNOF '(' unary_expression_error { $$ = MkExpOp(null, ALIGNOF, $3); $$.loc = @$; }
1868 | ALIGNOF unary_expression_error { $$ = MkExpOp(null, ALIGNOF, $2); $$.loc = @$; }
1869 | ALIGNOF '(' guess_type_name ')' error { $$ = MkExpTypeAlign($3); $$.loc = @$; }
1872 unary_expression_error:
1873 common_unary_expression_error
1874 | postfix_expression_error
1877 /*simple_unary_expression_error:
1878 common_unary_expression_error
1879 | simple_postfix_expression_error
1882 cast_expression_error:
1883 unary_expression_error
1884 | '(' type_name ')' cast_expression_error { $$ = MkExpCast($2, $4); $$.loc = @$; }
1887 multiplicative_expression_error:
1888 cast_expression_error
1889 | multiplicative_expression '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1890 | multiplicative_expression '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1891 | multiplicative_expression '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1892 | multiplicative_expression_error '*' cast_expression_error { $$ = MkExpOp($1, '*', $3); $$.loc = @$; }
1893 | multiplicative_expression_error '/' cast_expression_error { $$ = MkExpOp($1, '/', $3); $$.loc = @$; }
1894 | multiplicative_expression_error '%' cast_expression_error { $$ = MkExpOp($1, '%', $3); $$.loc = @$; }
1897 additive_expression_error:
1898 multiplicative_expression_error
1899 | additive_expression '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1900 /* Useless rules due to conflicts
1901 | additive_expression '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1903 | additive_expression '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1904 /* Useless rules due to conflicts
1905 | additive_expression '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1907 | additive_expression_error '+' multiplicative_expression_error { $$ = MkExpOp($1, '+', $3); $$.loc = @$; }
1908 /* Useless rules due to conflicts
1909 | additive_expression_error '+' error { $$ = MkExpOp($1, '+', null); $$.loc = @$; }
1911 | additive_expression_error '-' multiplicative_expression_error { $$ = MkExpOp($1, '-', $3); $$.loc = @$; }
1912 /* Useless rules due to conflicts
1913 | additive_expression_error '-' error { $$ = MkExpOp($1, '-', null); $$.loc = @$; }
1917 shift_expression_error:
1918 additive_expression_error
1919 | shift_expression LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1920 | shift_expression RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1921 | shift_expression_error LEFT_OP additive_expression_error { $$ = MkExpOp($1, LEFT_OP, $3); $$.loc = @$; }
1922 | shift_expression_error RIGHT_OP additive_expression_error { $$ = MkExpOp($1, RIGHT_OP, $3); $$.loc = @$; }
1925 relational_expression_error:
1926 shift_expression_error
1927 | relational_expression_smaller_than /*relational_expression '<' */ shift_expression_error
1929 if($1.type == identifierExp)
1931 if($1.identifier._class && !$1.identifier._class.name)
1935 strcat(name, $1.identifier.string);
1936 _DeclClass(0, name);
1939 _DeclClass(0, $1.identifier.string);
1941 // printf("Declaring Class %s\n", $1.identifier.string);
1947 fileInput.Seek(@1.start.pos, start);
1948 resetScannerPos(&@1.start);
1953 YY_STACK_PRINT (yyss, yyssp);
1957 YY_STACK_PRINT (yyss, yyssp);
1961 YY_STACK_PRINT (yyss, yyssp);
1965 YY_STACK_PRINT (yyss, yyssp);
1973 $$ = MkExpOp($1, '<', $2);
1978 | relational_expression '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1979 | relational_expression LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1980 | relational_expression GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1981 | relational_expression_error '<' shift_expression_error { $$ = MkExpOp($1, '<', $3); $$.loc = @$; }
1982 | relational_expression_error '>' shift_expression_error { $$ = MkExpOp($1, '>', $3); $$.loc = @$; }
1983 | relational_expression_error LE_OP shift_expression_error { $$ = MkExpOp($1, LE_OP, $3); $$.loc = @$; }
1984 | relational_expression_error GE_OP shift_expression_error { $$ = MkExpOp($1, GE_OP, $3); $$.loc = @$; }
1987 equality_expression_error:
1988 relational_expression_error
1989 | equality_expression EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1990 | equality_expression NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1991 | equality_expression_error EQ_OP relational_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
1992 | equality_expression_error NE_OP relational_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
1993 /* Useless rules due to conflicts
1994 | equality_expression EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1995 | equality_expression NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1996 | equality_expression_error EQ_OP error { $$ = MkExpOp($1, EQ_OP, MkExpDummy()); $$.loc = @$; }
1997 | equality_expression_error NE_OP error { $$ = MkExpOp($1, NE_OP, MkExpDummy()); $$.loc = @$; }
1999 | equality_expression EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
2000 | equality_expression NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
2001 | equality_expression_error EQ_OP anon_instantiation_expression_error { $$ = MkExpOp($1, EQ_OP, $3); $$.loc = @$; }
2002 | equality_expression_error NE_OP anon_instantiation_expression_error { $$ = MkExpOp($1, NE_OP, $3); $$.loc = @$; }
2005 and_expression_error:
2006 equality_expression_error
2007 | and_expression '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
2008 | and_expression_error '&' equality_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
2010 | and_expression '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
2011 | and_expression_error '&' anon_instantiation_expression_error { $$ = MkExpOp($1, '&', $3); $$.loc = @$; }
2014 exclusive_or_expression_error:
2015 and_expression_error
2016 | exclusive_or_expression '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
2017 | exclusive_or_expression_error '^' and_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
2019 | exclusive_or_expression '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
2020 | exclusive_or_expression_error '^' anon_instantiation_expression_error { $$ = MkExpOp($1, '^', $3); $$.loc = @$; }
2023 inclusive_or_expression_error:
2024 exclusive_or_expression_error
2025 | inclusive_or_expression '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
2026 | inclusive_or_expression_error '|' exclusive_or_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
2028 | inclusive_or_expression '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
2029 | inclusive_or_expression_error '|' anon_instantiation_expression_error { $$ = MkExpOp($1, '|', $3); $$.loc = @$; }
2032 logical_and_expression_error:
2033 inclusive_or_expression_error
2034 | logical_and_expression AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
2035 | logical_and_expression_error AND_OP inclusive_or_expression_error { $$ = MkExpOp($1, AND_OP, $3); $$.loc = @$; }
2038 logical_or_expression_error:
2039 logical_and_expression_error
2040 | logical_or_expression OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
2041 | logical_or_expression_error OR_OP logical_and_expression_error { $$ = MkExpOp($1, OR_OP, $3); $$.loc = @$; }
2044 conditional_expression_error:
2045 logical_or_expression_error
2046 | logical_or_expression '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2047 | logical_or_expression '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2048 | logical_or_expression_error '?' expression ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2049 | logical_or_expression_error '?' expression_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2050 | logical_or_expression '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2051 | logical_or_expression '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2052 | logical_or_expression_error '?' expression ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2053 | logical_or_expression_error '?' expression_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2055 | logical_or_expression '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2056 | logical_or_expression '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2057 | logical_or_expression_error '?' expression_anon_inst ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2058 | logical_or_expression_error '?' expression_anon_inst_error ':' logical_or_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2059 | logical_or_expression '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2060 | logical_or_expression '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2061 | logical_or_expression_error '?' expression_anon_inst ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2062 | logical_or_expression_error '?' expression_anon_inst_error ':' { $$ = MkExpCondition($1, $3, MkExpDummy()); $$.loc = @$; $$.cond.elseExp.loc = @3; }
2064 | logical_or_expression '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2065 | logical_or_expression '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2066 | logical_or_expression_error '?' expression ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2067 | logical_or_expression_error '?' expression_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2069 | logical_or_expression '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2070 | logical_or_expression '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2071 | logical_or_expression_error '?' expression_anon_inst ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2072 | logical_or_expression_error '?' expression_anon_inst_error ':' anon_instantiation_expression_error { $$ = MkExpCondition($1, $3, $5); $$.loc = @$; }
2074 | logical_or_expression '?' ':'
2077 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy());
2079 ((Expression)$$.cond.exp->last).loc = @2;
2080 $$.cond.elseExp.loc = @3;
2082 | logical_or_expression_error '?' ':'
2084 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @3;
2086 | logical_or_expression '?'
2089 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
2091 | logical_or_expression_error '?'
2093 $$ = MkExpCondition($1, MkListOne(MkExpDummy()), MkExpDummy()); $$.loc = @$; ((Expression)$$.cond.exp->last).loc = @2; $$.cond.elseExp.loc = @2;
2097 assignment_expression_error:
2098 conditional_expression_error
2099 | unary_expression assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2100 /* Useless rules due to conflicts
2101 | unary_expression assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
2103 | unary_expression_error assignment_operator assignment_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2104 /* Useless rules due to conflicts
2105 | unary_expression_error assignment_operator error { $$ = MkExpOp($1, $2, MkExpDummy()); $$.loc = @$; $$.op.exp2.loc = @2; }
2108 | unary_expression assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2109 | unary_expression_error assignment_operator anon_instantiation_expression_error { $$ = MkExpOp($1, $2, $3); $$.loc = @$; }
2113 assignment_expression_error { $$ = MkList(); ListAdd($$, $1); }
2114 | assignment_expression error { $$ = MkList(); ListAdd($$, $1); }
2115 | expression ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
2116 | expression_error ',' assignment_expression_error { $$ = $1; ListAdd($1, $3); }
2117 /* Useless rules due to conflicts
2118 | expression ',' error
2119 | expression_error ',' error
2122 | expression expression { yyerror(); $$ = $1; FreeList($2, FreeExpression); }
2123 | expression_error expression { $$ = $1; FreeList($2, FreeExpression); }
2124 | expression expression_error { $$ = $1; FreeList($2, FreeExpression); }
2127 expression_anon_inst_error:
2128 anon_instantiation_expression_error { $$ = MkList(); ListAdd($$, $1); }
2129 | anon_instantiation_expression error { $$ = MkList(); ListAdd($$, $1); }
2130 | expression ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
2131 | expression_error ',' anon_instantiation_expression_error { $$ = $1; ListAdd($1, $3); }
2135 constant_expression: conditional_expression;
2137 constant_expression_error: conditional_expression_error;
2139 /**** TYPES **************************************************************************/
2140 storage_class_specifier:
2141 TYPEDEF { $$ = MkSpecifier(TYPEDEF); }
2142 | EXTERN { $$ = MkSpecifier(EXTERN); }
2143 | STATIC { $$ = MkSpecifier(STATIC); }
2144 | THREAD { $$ = MkSpecifier(THREAD); }
2145 | AUTO { $$ = MkSpecifier(AUTO); }
2146 | REGISTER { $$ = MkSpecifier(REGISTER); }
2147 | RESTRICT { $$ = MkSpecifier(RESTRICT); }
2150 external_storage_class_specifier:
2151 TYPEDEF { $$ = MkSpecifier(TYPEDEF); structDeclMode = declMode = defaultAccess; }
2152 | EXTERN { $$ = MkSpecifier(EXTERN); }
2153 | STATIC { $$ = MkSpecifier(STATIC); structDeclMode = declMode = staticAccess; }
2154 | THREAD { $$ = MkSpecifier(THREAD); }
2155 | AUTO { $$ = MkSpecifier(AUTO); }
2156 | REGISTER { $$ = MkSpecifier(REGISTER); }
2157 | RESTRICT { $$ = MkSpecifier(RESTRICT); }
2161 identifier { $$ = MkEnumerator($1, null); }
2162 | identifier '=' constant_expression { $$ = MkEnumerator($1, $3); }
2163 | identifier '=' constant_expression_error { $$ = MkEnumerator($1, $3); }
2167 enumerator { $$ = MkList(); ListAdd($$, $1); }
2168 | enumerator_list ',' enumerator { $$ = $1; ListAdd($1, $3); }
2169 | enumerator_list ','
2173 ENUM { memberAccessStack[++defaultMemberAccess] = publicAccess; }
2176 enum_specifier_nocompound:
2177 enum_specifier identifier { $$ = MkEnum($2, null); POP_DEFAULT_ACCESS }
2178 | enum_specifier strict_type { $$ = MkEnum(MkIdentifier($2.name), null); POP_DEFAULT_ACCESS }
2181 enum_specifier_compound:
2182 enum_specifier_compound_error '}' { $$.loc = @$; POP_DEFAULT_ACCESS $$ = $1; }
2183 | enum_specifier identifier '{' '}' { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2184 | enum_specifier strict_type '{' '}' { $$ = MkEnum(MkIdentifier($2.name), null); FreeSpecifier($2); $$.loc = @$; POP_DEFAULT_ACCESS }
2187 enum_specifier_compound_error:
2188 enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2189 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2191 | enum_specifier identifier '{' enumerator_list { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2192 | enum_specifier identifier '{' enumerator_list error { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2193 | enum_specifier identifier '{' error { $$ = MkEnum($2, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2194 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2195 | enum_specifier identifier '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($2, $4); $$.loc = @$; $$.definitions = $6; POP_DEFAULT_ACCESS }
2197 | enum_specifier strict_type '{' enumerator_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2198 | enum_specifier strict_type '{' enumerator_list error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2199 | enum_specifier strict_type '{' error { $$ = MkEnum(MkIdentifier($2.name), null); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2200 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2201 | enum_specifier strict_type '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; $$.definitions = $6; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2203 | enum_specifier identifier '{' enumerator_list ';' { $$ = MkEnum($2, $4); $$.loc = @$; POP_DEFAULT_ACCESS }
2204 | enum_specifier strict_type '{' enumerator_list ';' { $$ = MkEnum(MkIdentifier($2.name), $4); $$.loc = @$; FreeSpecifier($2); POP_DEFAULT_ACCESS }
2208 enum_specifier identifier { $$ = $2; if(declMode) DeclClassAddNameSpace(globalContext.nextID++, $2.string); }
2209 | enum_specifier strict_type { $$ = MkIdentifier($2.name); if(declMode) DeclClass(globalContext.nextID++, $2.name); FreeSpecifier($2); }
2213 enum_class_error '}' { $$ = $1; $$.loc = @$; }
2214 | enum_decl ':' inheritance_specifiers '{' '}' { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2215 | enum_decl '{' '}' { $$ = MkEnum($1, null); POP_DEFAULT_ACCESS }
2219 enum_decl ':' inheritance_specifiers '{' enumerator_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2220 | enum_decl ':' inheritance_specifiers '{' enumerator_list error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2221 | enum_decl ':' inheritance_specifiers '{' error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2222 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2223 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2224 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2225 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' struct_declaration_list_error { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.definitions = $8; $$.loc = @$; POP_DEFAULT_ACCESS }
2226 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2227 | enum_decl ':' inheritance_specifiers '{' error ';' struct_declaration_list_error { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.definitions = $7; $$.loc = @$; POP_DEFAULT_ACCESS }
2229 | enum_specifier '{' enumerator_list { $$ = MkEnum(null, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2230 | enum_specifier '{' error { $$ = MkEnum(null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2232 | enum_decl '{' enumerator_list { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2233 | enum_decl '{' enumerator_list error { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2234 | enum_decl '{' error { $$ = MkEnum($1, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2235 | enum_decl '{' enumerator_list ';' struct_declaration_list { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2236 | enum_decl '{' enumerator_list ';' struct_declaration_list_error { $$ = MkEnum($1, $3); $$.definitions = $5; $$.loc = @$; POP_DEFAULT_ACCESS }
2238 | enum_decl ':' inheritance_specifiers '{' enumerator_list ';' { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2239 | enum_decl ':' inheritance_specifiers '{' enumerator_list error ';' { $$ = MkEnum($1, $5); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2240 | enum_decl ':' inheritance_specifiers '{' error ';' { $$ = MkEnum($1, null); $$.baseSpecs = $3; $$.loc = @$; POP_DEFAULT_ACCESS }
2241 | enum_decl '{' enumerator_list ';' { $$ = MkEnum($1, $3); $$.loc = @$; POP_DEFAULT_ACCESS }
2249 class_specifier_error:
2251 | struct_class_error
2255 ext_decl { $$ = MkSpecifierExtended($1); }
2259 CONST { $$ = MkSpecifier(CONST); }
2260 | VOLATILE { $$ = MkSpecifier(VOLATILE); }
2261 | ext_storage { $$ = $1; }
2265 type_qualifier_list:
2266 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2267 | type_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2271 VOID { $$ = MkSpecifier(VOID); }
2272 | CHAR { $$ = MkSpecifier(CHAR); }
2273 | SHORT { $$ = MkSpecifier(SHORT); }
2274 | INT { $$ = MkSpecifier(INT); }
2275 | UINT { $$ = MkSpecifier(UINT); }
2276 | INT64 { $$ = MkSpecifier(INT64); }
2277 | VALIST { $$ = MkSpecifier(VALIST); }
2278 | LONG { $$ = MkSpecifier(LONG); }
2279 | FLOAT { $$ = MkSpecifier(FLOAT); }
2280 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2281 | SIGNED { $$ = MkSpecifier(SIGNED); }
2282 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2283 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2284 | struct_or_union_specifier_nocompound
2285 | enum_specifier_nocompound
2287 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2288 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2289 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2290 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2291 | TYPED_OBJECT { $$ = MkSpecifier(TYPED_OBJECT); }
2292 | ANY_OBJECT { $$ = MkSpecifier(ANY_OBJECT); }
2293 | _BOOL { $$ = MkSpecifier(_BOOL); }
2294 | BOOL { $$ = MkSpecifier(BOOL); }
2295 | _COMPLEX { $$ = MkSpecifier(_COMPLEX); }
2296 | _IMAGINARY { $$ = MkSpecifier(_IMAGINARY); }
2299 strict_type_specifier:
2300 VOID { $$ = MkSpecifier(VOID); }
2301 | CHAR { $$ = MkSpecifier(CHAR); }
2302 | SHORT { $$ = MkSpecifier(SHORT); }
2303 | INT { $$ = MkSpecifier(INT); }
2304 | UINT { $$ = MkSpecifier(UINT); }
2305 | INT64 { $$ = MkSpecifier(INT64); }
2306 | VALIST { $$ = MkSpecifier(VALIST); }
2307 | LONG { $$ = MkSpecifier(LONG); }
2308 | FLOAT { $$ = MkSpecifier(FLOAT); }
2309 | DOUBLE { $$ = MkSpecifier(DOUBLE); }
2310 | SIGNED { $$ = MkSpecifier(SIGNED); }
2311 | UNSIGNED { $$ = MkSpecifier(UNSIGNED); }
2312 | EXTENSION { $$ = MkSpecifier(EXTENSION); }
2313 | struct_or_union_specifier_nocompound
2314 | enum_specifier_nocompound
2316 | _BOOL { $$ = MkSpecifier(_BOOL); }
2317 | BOOL { $$ = MkSpecifier(BOOL); }
2318 | _COMPLEX { $$ = MkSpecifier(_COMPLEX); }
2319 | _IMAGINARY { $$ = MkSpecifier(_IMAGINARY); }
2320 | TYPEOF '(' assignment_expression ')' { $$ = MkSpecifierTypeOf($3); }
2321 | SUBCLASS '(' type ')' { $$ = MkSpecifierSubClass($3); }
2322 | SUBCLASS '(' identifier ')' { _DeclClass(0, $3.string); $$ = MkSpecifierSubClass(MkSpecifierName($3.string)); FreeIdentifier($3); }
2323 | THISCLASS { $$ = MkSpecifier(THISCLASS); }
2326 // TESTING declarator_nofunction here... For function declarations
2329 declarator_nofunction_type_ok
2330 { $$ = MkStructDeclarator($1, null); $$.loc = @$; }
2331 | declarator_nofunction_type_ok attrib
2332 { $$ = MkStructDeclarator($1, null); $$.structDecl.attrib = $2; $$.loc = @$; }
2333 | ':' constant_expression
2334 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2335 | declarator_nofunction_type_ok ':' constant_expression
2336 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2337 | declarator_nofunction_type_ok ':' constant_expression ':' constant_expression
2338 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2339 | ':' constant_expression_error
2340 { $$ = MkStructDeclarator(null, $2); $$.loc = @$; }
2341 | declarator_nofunction_type_ok ':' constant_expression_error
2342 { $$ = MkStructDeclarator($1, $3); $$.loc = @$; }
2343 | declarator_nofunction_type_ok ':' constant_expression ':' constant_expression_error
2344 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2345 | declarator_nofunction_type_ok ':' constant_expression_error ':' constant_expression_error
2346 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2347 | declarator_nofunction_type_ok ':' constant_expression_error ':' constant_expression
2348 { $$ = MkStructDeclarator($1, $3); $$.structDecl.posExp = $5; $$.loc = @$; }
2351 struct_declarator_list:
2352 struct_declarator { $$ = MkList(); ListAdd($$, $1); }
2353 | struct_declarator_list ',' struct_declarator { $$ = $1; ListAdd($1, $3); }
2357 struct_or_union identifier
2359 $$ = MkStructOrUnion($1, $2, null);
2360 $$.addNameSpace = true;
2361 $$.ctx = PushContext();
2363 | struct_or_union base_strict_type
2365 $$ = MkStructOrUnion($1, MkIdentifier($2.name), null);
2366 $$.ctx = PushContext();
2369 | struct_or_union ext_decl identifier
2371 $$ = MkStructOrUnion($1, $3, null);
2372 $$.extDeclStruct = $2;
2373 $$.addNameSpace = true;
2374 $$.ctx = PushContext();
2376 | struct_or_union ext_decl base_strict_type
2378 $$ = MkStructOrUnion($1, MkIdentifier($3.name), null);
2379 $$.extDeclStruct = $2;
2380 $$.ctx = PushContext();
2385 struct_or_union_specifier_compound:
2386 struct_or_union_specifier_compound_error '}' { $$ = $1; $$.loc = @$; }
2387 | struct_entry '{' '}' { $$ = $1; $$.loc = @$; POP_DEFAULT_ACCESS PopContext(curContext); }
2388 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); $$.loc = @$; POP_DEFAULT_ACCESS }
2389 | struct_or_union ext_decl '{' '}' { $$ = MkStructOrUnion($1, null, null); $$.extDeclStruct = $2; $$.loc = @$; POP_DEFAULT_ACCESS }
2392 struct_or_union_specifier_compound_error:
2393 struct_entry '{' struct_declaration_list { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2394 | struct_entry '{' struct_declaration_list_error { $$ = $1; AddStructDefinitions($1, $3); POP_DEFAULT_ACCESS PopContext(curContext); }
2395 | struct_entry '{' error { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2397 | struct_or_union '{' struct_declaration_list { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2398 | struct_or_union '{' struct_declaration_list_error { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2399 | struct_or_union '{' error { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2401 | struct_or_union ext_decl '{' struct_declaration_list { $$ = MkStructOrUnion($1, null, $4); $$.extDeclStruct = $2; POP_DEFAULT_ACCESS }
2402 | struct_or_union ext_decl '{' struct_declaration_list_error { $$ = MkStructOrUnion($1, null, $4); $$.extDeclStruct = $2; POP_DEFAULT_ACCESS }
2403 | struct_or_union ext_decl '{' error { $$ = MkStructOrUnion($1, null, null); $$.extDeclStruct = $2; POP_DEFAULT_ACCESS }
2406 struct_or_union_specifier_nocompound:
2407 struct_entry { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2416 ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2419 | struct_entry '<' template_parameters_list '>'
2421 Symbol symbol = ($1.addNameSpace ? DeclClassAddNameSpace : DeclClass)(globalContext.nextID++, $1.id.string);
2423 symbol.templateParams = $3;
2428 struct_decl ':' inheritance_specifiers
2432 SetupBaseSpecs(null, $3);
2437 struct_class_error '}' { $$ = $1; $$.loc = @$; }
2438 | struct_head '{' '}'
2439 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2440 | struct_decl '{' '}' { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2441 | struct_or_union '{' '}' { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2445 struct_head '{' struct_declaration_list
2448 $$.definitions = $3;
2450 PopContext(curContext);
2452 | struct_head '{' struct_declaration_list_error
2455 $$.definitions = $3;
2457 PopContext(curContext);
2459 | struct_head '{' error
2460 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext);}
2462 | struct_decl '{' struct_declaration_list
2464 PopContext(curContext);
2467 $$ = MkStructOrUnion($1.type, $1.id, $3);
2472 $$.definitions = $3;
2475 | struct_decl '{' struct_declaration_list_error
2477 PopContext(curContext);
2481 $$ = MkStructOrUnion($1.type, $1.id, $3);
2486 $$.definitions = $3;
2489 | struct_decl '{' error
2490 { $$ = $1; POP_DEFAULT_ACCESS PopContext(curContext); }
2492 | struct_or_union '{' struct_declaration_list
2493 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2494 | struct_or_union '{' struct_declaration_list_error
2495 { $$ = MkStructOrUnion($1, null, $3); POP_DEFAULT_ACCESS }
2496 | struct_or_union '{' error
2497 { $$ = MkStructOrUnion($1, null, null); POP_DEFAULT_ACCESS }
2501 STRUCT { $$ = structSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2502 | UNION { $$ = unionSpecifier; memberAccessStack[++defaultMemberAccess] = publicAccess; }
2505 specifier_qualifier_list:
2506 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2507 | specifier_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2508 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2509 | specifier_qualifier_list type_specifier { $$ = $1; ListAdd($1, $2); }
2510 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2511 | specifier_qualifier_list enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2512 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2513 | specifier_qualifier_list struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2516 guess_specifier_qualifier_list:
2517 type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2518 | guess_specifier_qualifier_list type_qualifier { $$ = $1; ListAdd($1, $2); }
2519 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2520 | guess_specifier_qualifier_list type_specifier { $$ = $1; ListAdd($1, $2); }
2521 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2522 | guess_specifier_qualifier_list guess_type { $$ = $1; ListAdd($1, $2); }
2523 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2524 | guess_specifier_qualifier_list enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2525 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2526 | guess_specifier_qualifier_list struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2529 declaration_specifiers:
2530 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2531 | declaration_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2532 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2533 | declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2534 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2535 | declaration_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2536 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2537 | declaration_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2538 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2539 | declaration_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2542 guess_declaration_specifiers:
2543 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2544 | guess_declaration_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2545 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2546 | guess_declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2547 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2548 | guess_declaration_specifiers type_specifier { $$ = $1; ListAdd($1, $2); }
2549 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2550 | guess_declaration_specifiers guess_type { $$ = $1; ListAdd($1, $2); }
2551 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2552 | guess_declaration_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2553 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2554 | guess_declaration_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2557 external_guess_declaration_specifiers:
2558 external_storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2559 | external_guess_declaration_specifiers external_storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2560 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2561 | external_guess_declaration_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2562 | type_specifier { $$ = MkList(); ListAdd($$, $1); }
2563 | external_guess_declaration_specifiers type_specifier { $$ = $1; ListAdd($1, $2); }
2564 | guess_type { $$ = MkList(); ListAdd($$, $1); }
2565 | external_guess_declaration_specifiers guess_type { $$ = $1; ListAdd($1, $2); }
2566 | class_specifier { $$ = MkList(); ListAdd($$, $1); }
2567 | external_guess_declaration_specifiers class_specifier { $$ = $1; ListAdd($1, $2); }
2570 external_guess_declaration_specifiers_error:
2571 class_specifier_error { $$ = MkList(); ListAdd($$, $1); }
2572 | external_guess_declaration_specifiers class_specifier_error { $$ = $1; ListAdd($1, $2); }
2575 _inheritance_specifiers:
2576 PRIVATE { $$ = MkList(); ListAdd($$, MkSpecifier(PRIVATE)); }
2577 | PUBLIC { $$ = MkList(); ListAdd($$, MkSpecifier(PUBLIC)); }
2578 | storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2579 | _inheritance_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2580 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2581 | _inheritance_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2582 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2583 | _inheritance_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2585 { _DeclClass(0, $1.string); $$ = MkListOne(MkSpecifierName($1.string)); FreeIdentifier($1); }
2586 | _inheritance_specifiers identifier { $$ = $1; _DeclClass(0, $2.string); ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2); }
2588 | identifier '<' template_arguments_list '>'
2590 // if($1._class && !$1._class.name)
2594 strcpy(name, $1._class.name ? $1._class.name : "");
2596 strcat(name, $1.string);
2597 _DeclClass(0, name);
2600 _DeclClass(0, $1.string);
2603 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2606 | _inheritance_specifiers identifier '<' template_arguments_list '>'
2609 if($2._class && !$2._class.name)
2613 strcat(name, $2.string);
2614 _DeclClass(0, name);
2617 _DeclClass(0, $2.string);
2618 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2623 inheritance_specifiers:
2624 _inheritance_specifiers
2625 | struct_or_union { $$ = MkListOne(MkStructOrUnion($1, null, null)); POP_DEFAULT_ACCESS }
2628 property_specifiers:
2629 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2630 | property_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2631 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2632 | property_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2633 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2634 | property_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2635 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2636 | property_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2637 | identifier '<' template_arguments_list '>'
2639 // if($1._class && !$1._class.name)
2643 strcpy(name, $1._class.name ? $1._class.name : "");
2645 strcat(name, $1.string);
2646 _DeclClass(0, name);
2649 _DeclClass(0, $1.string);
2652 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2655 | property_specifiers identifier '<' template_arguments_list '>'
2657 if($2._class && !$2._class.name)
2661 strcat(name, $2.string);
2662 _DeclClass(0, name);
2665 _DeclClass(0, $2.string);
2666 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2672 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2673 | renew_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2674 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2675 | renew_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2676 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2677 | renew_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2678 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2679 | renew_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2680 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2681 | renew_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2682 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2683 | renew_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2684 | identifier '<' template_arguments_list '>'
2686 // if($1._class && !$1._class.name)
2690 strcpy(name, $1._class.name ? $1._class.name : "");
2692 strcat(name, $1.string);
2693 _DeclClass(0, name);
2696 _DeclClass(0, $1.string);
2699 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2702 | renew_specifiers identifier '<' template_arguments_list '>'
2704 if($2._class && !$2._class.name)
2708 strcat(name, $2.string);
2709 _DeclClass(0, name);
2712 _DeclClass(0, $2.string);
2713 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2719 storage_class_specifier { $$ = MkList(); ListAdd($$, $1); }
2720 | new_specifiers storage_class_specifier { $$ = $1; ListAdd($1, $2); }
2721 | type_qualifier { $$ = MkList(); ListAdd($$, $1); }
2722 | new_specifiers type_qualifier { $$ = $1; ListAdd($1, $2); }
2723 | strict_type_specifier { $$ = MkList(); ListAdd($$, $1); }
2724 | new_specifiers strict_type_specifier { $$ = $1; ListAdd($1, $2); }
2725 | struct_or_union_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2726 | new_specifiers struct_or_union_specifier_compound { $$ = $1; ListAdd($1, $2); }
2727 | enum_specifier_compound { $$ = MkList(); ListAdd($$, $1); }
2728 | new_specifiers enum_specifier_compound { $$ = $1; ListAdd($1, $2); }
2729 | identifier { $$ = MkList(); ListAdd($$, MkSpecifierName($1.string)); FreeIdentifier($1)}
2730 | new_specifiers identifier { $$ = $1; ListAdd($1, MkSpecifierName($2.string)); FreeIdentifier($2)}
2731 | identifier '<' template_arguments_list '>'
2733 // if($1._class && !$1._class.name)
2737 strcpy(name, $1._class.name ? $1._class.name : "");
2739 strcat(name, $1.string);
2740 _DeclClass(0, name);
2743 _DeclClass(0, $1.string);
2746 ListAdd($$, MkSpecifierNameArgs($1.string, $3));
2749 | new_specifiers identifier '<' template_arguments_list '>'
2751 if($2._class && !$2._class.name)
2755 strcat(name, $2.string);
2756 _DeclClass(0, name);
2759 _DeclClass(0, $2.string);
2760 ListAdd($1, MkSpecifierNameArgs($2.string, $4));
2765 identifier_list_error:
2766 identifier_list ',' error { $$ = $1; ListAdd($1, null); }
2767 | identifier_list_error ',' error { $$ = $1; ListAdd($1, null); }
2771 identifier { $$ = MkList(); ListAdd($$, MkTypeName(null, MkDeclaratorIdentifier($1))); }
2772 | identifier_list ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2773 | identifier_list_error ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2774 | parameter_list ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2775 | parameter_list_error ',' identifier { $$ = $1; ListAdd($1, MkTypeName(null, MkDeclaratorIdentifier($3))); }
2778 direct_declarator_nofunction_type_ok:
2779 direct_declarator_nofunction
2782 char * colon = RSearchString($1.name, "::", strlen($1.name), true, false);
2783 String s = colon ? colon + 2 : $1.name;
2784 $$ = MkDeclaratorIdentifier(MkIdentifier(s));
2787 | UINT { $$ = MkDeclaratorIdentifier(MkIdentifier("uint")); }
2788 // These rules need to be reviewed in lights of prototypes with types only...
2789 | base_strict_type '[' constant_expression ']'
2792 char * colon = RSearchString($1.name, "::", strlen($1.name), true, false);
2793 String s = colon ? colon + 2 : $1.name;
2794 decl = MkDeclaratorIdentifier(MkIdentifier(s));
2796 $$ = MkDeclaratorArray(decl, $3);
2798 | base_strict_type '[' constant_expression_error ']'
2801 char * colon = RSearchString($1.name, "::", strlen($1.name), true, false);
2802 String s = colon ? colon + 2 : $1.name;
2803 decl = MkDeclaratorIdentifier(MkIdentifier(s));
2805 $$ = MkDeclaratorArray(decl, $3);
2807 | base_strict_type '[' type ']'
2810 char * colon = RSearchString($1.name, "::", strlen($1.name), true, false);
2811 String s = colon ? colon + 2 : $1.name;
2812 decl = MkDeclaratorIdentifier(MkIdentifier(s));
2814 $$ = MkDeclaratorEnumArray(decl, $3);
2816 | base_strict_type '[' ']'
2819 char * colon = RSearchString($1.name, "::", strlen($1.name), true, false);
2820 String s = colon ? colon + 2 : $1.name;
2821 decl = MkDeclaratorIdentifier(MkIdentifier(s));
2823 $$ = MkDeclaratorEnumArray(decl, null);
2825 | direct_declarator_nofunction_type_ok '[' constant_expression ']' { $$ = MkDeclaratorArray($1, $3); }
2826 | direct_declarator_nofunction_type_ok '[' constant_expression_error ']' { $$ = MkDeclaratorArray($1, $3); }
2827 | direct_declarator_nofunction_type_ok '[' type ']' { $$ = MkDeclaratorEnumArray($1, $3); }
2828 | direct_declarator_nofunction_type_ok '[' ']' { $$ = MkDeclaratorArray($1, null); }
2831 direct_declarator_nofunction:
2832 identifier { $$ = MkDeclaratorIdentifier($1); }
2833 | '(' declarator ')' { $$ = MkDeclaratorBrackets($2); }
2834 | '(' ext_decl declarator ')' { $$ = MkDeclaratorBrackets(MkDeclaratorExtended($2, $3)); }
2835 | '(' declarator_type_ok ')' { $$ = MkDeclaratorBrackets($2); }
2836 | '(' ext_decl declarator_type_ok ')' { $$ = MkDeclaratorBrackets(MkDeclaratorExtended($2, $3)); }
2837 | direct_declarator_nofunction '[' constant_expression ']' { $$ = MkDeclaratorArray($1, $3); }
2838 | direct_declarator_nofunction '[' constant_expression_error ']' { $$ = MkDeclaratorArray($1, $3); }
2839 | direct_declarator_nofunction '[' type ']' { $$ = MkDeclaratorEnumArray($1, $3); }
2840 | direct_declarator_nofunction '[' ']' { $$ = MkDeclaratorArray($1, null); }
2843 direct_declarator_function_start:
2844 direct_declarator_nofunction '('
2847 direct_declarator_function:
2848 direct_declarator_function_start parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2849 | direct_declarator_function_start parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2850 | direct_declarator_function_start identifier_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2851 | direct_declarator_function_start identifier_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2852 | direct_declarator_function_start ')' { $$ = MkDeclaratorFunction($1, null); }
2855 // Tricky stuff here for overriding...
2856 direct_declarator_function_error:
2857 direct_declarator_function_start identifier_list_error
2859 $$ = MkDeclaratorFunction($1, $2);
2860 fileInput.Seek(@1.end.pos, start);
2862 resetScannerPos(&@1.end);
2863 @$.start = @1.start;
2866 | direct_declarator_function_start error
2868 $$ = MkDeclaratorFunction($1, null);
2869 fileInput.Seek(@1.end.pos, start);
2871 resetScannerPos(&@1.end);
2872 @$.start = @1.start;
2875 | direct_declarator_function_start parameter_list '('
2877 $$ = MkDeclaratorFunction($1, $2);
2878 fileInput.Seek(@1.end.pos, start);
2880 resetScannerPos(&@1.end);
2881 @$.start = @1.start;
2884 | direct_declarator_function_start guess_declaration_specifiers identifier '('
2886 $$ = MkDeclaratorFunction($1, null);
2887 fileInput.Seek(@1.end.pos, start);
2889 resetScannerPos(&@1.end);
2890 @$.start = @1.start;
2892 FreeList($2, FreeSpecifier);
2898 direct_declarator_function
2899 | direct_declarator_nofunction
2903 direct_declarator_function_start_type_ok:
2904 direct_declarator_nofunction_type_ok '('
2907 direct_declarator_function_type_ok:
2908 direct_declarator_function_start_type_ok parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2909 | direct_declarator_function_start_type_ok parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2910 | direct_declarator_function_start_type_ok identifier_list ')' { $$ = MkDeclaratorFunction($1, $2); }
2911 | direct_declarator_function_start_type_ok identifier_list_error ')' { $$ = MkDeclaratorFunction($1, $2); }
2912 | direct_declarator_function_start_type_ok ')' { $$ = MkDeclaratorFunction($1, null); }
2915 // Tricky stuff here for overriding...
2916 direct_declarator_function_error_type_ok:
2917 direct_declarator_function_start_type_ok identifier_list_error
2919 $$ = MkDeclaratorFunction($1, $2);
2920 fileInput.Seek(@1.end.pos, start);
2922 resetScannerPos(&@1.end);
2923 @$.start = @1.start;
2926 | direct_declarator_function_start_type_ok error
2928 $$ = MkDeclaratorFunction($1, null);
2929 fileInput.Seek(@1.end.pos, start);
2931 resetScannerPos(&@1.end);
2932 @$.start = @1.start;
2935 | direct_declarator_function_start_type_ok parameter_list '('
2937 $$ = MkDeclaratorFunction($1, $2);
2938 fileInput.Seek(@1.end.pos, start);
2940 resetScannerPos(&@1.end);
2941 @$.start = @1.start;
2944 | direct_declarator_function_start_type_ok guess_declaration_specifiers identifier '('
2946 $$ = MkDeclaratorFunction($1, null);
2947 fileInput.Seek(@1.end.pos, start);
2949 resetScannerPos(&@1.end);
2950 @$.start = @1.start;
2952 FreeList($2, FreeSpecifier);
2957 direct_declarator_type_ok:
2958 direct_declarator_function_type_ok
2959 | direct_declarator_nofunction_type_ok
2961 | ext_decl direct_declarator_function_type_ok
2962 { $$ = MkDeclaratorExtended($1, $2); }
2963 | ext_decl direct_declarator_nofunction_type_ok
2964 { $$ = MkDeclaratorExtended($1, $2); }
2969 ASM '(' STRING_LITERAL { $<string>$ = CopyString(yytext); } STRING_LITERAL { $<string>$ = CopyString(yytext); }
2972 strcpy(temp, "__asm__(");
2973 strcat(temp, $<string>4);
2975 strcat(temp, $<string>6);
2978 $<string>$ = CopyString(temp);
2983 EXT_DECL { $$ = MkExtDeclString(CopyString(yytext)); }
2984 | attrib { $$ = MkExtDeclAttrib($1);
2988 strcpy(temp, $<string>1);
2991 $$ = MkExtDeclString(CopyString(temp));
2993 | asm_start STRING_LITERAL { $$ = CopyString(yytext); } ')'
2996 strcpy(temp, $<string>1);
2998 strcat(temp, $<string>3);
3002 $$ = MkExtDeclString(CopyString(temp));
3008 EXT_DECL { $$ = MkExtDeclString(CopyString(yytext)); }
3009 | EXT_STORAGE { $$ = MkExtDeclString(CopyString(yytext)); }
3010 | attrib { $$ = MkExtDeclAttrib($1); }
3011 | ASM '(' string_literal ')'
3014 strcpy(temp, "__asm__(");
3017 $$ = MkExtDeclString(CopyString(temp));
3023 ATTRIB { $<i>$ = ATTRIB; }
3024 | ATTRIB_DEP { $<i>$ = ATTRIB_DEP; }
3025 | __ATTRIB { $<i>$ = __ATTRIB; }
3030 IDENTIFIER { $$ = CopyString(yytext); }
3031 | TYPE_NAME { $$ = CopyString(yytext); }
3032 | EXT_STORAGE { $$ = CopyString(yytext); }
3033 | EXT_DECL { $$ = CopyString(yytext); }
3034 | CONST { $$ = CopyString(yytext); }
3038 attribute_word { $$ = MkAttribute($1, null); $$.loc = @$; }
3039 | attribute_word '(' expression ')' { $$ = MkAttribute($1, MkExpBrackets($3)); $$.loc = @$; }
3043 attribute { $$ = MkListOne($1); }
3044 | attribs_list attribute { ListAdd($1, $2); $$ = $1; }
3045 | attribs_list ',' attribute { ListAdd($1, $3); $$ = $1; }
3049 _attrib '(' '(' attribs_list ')' ')' { $$ = MkAttrib($<i>1, $4); $$.loc = @$; }
3050 | _attrib '(' '(' ')' ')' { $$ = MkAttrib($<i>1, null); $$.loc = @$; }
3053 direct_abstract_declarator:
3054 '(' abstract_declarator ')' { $$ = MkDeclaratorBrackets($2); }
3055 | '(' ext_decl abstract_declarator ')' { $$ = MkDeclaratorBrackets(MkDeclaratorExtended($2, $3)); }
3056 | '[' ']' { $$ = MkDeclaratorArray(null, null); }
3057 | '[' constant_expression ']' { $$ = MkDeclaratorArray(null, $2); }
3058 | '[' constant_expression_error ']' { $$ = MkDeclaratorArray(null, $2); }
3059 | '[' type ']' { $$ = MkDeclaratorEnumArray(null, $2); }
3060 | direct_abstract_declarator '[' ']' { $$ = MkDeclaratorArray($1, null); }
3061 | direct_abstract_declarator '[' constant_expression ']' { $$ = MkDeclaratorArray($1, $3); }
3062 | direct_abstract_declarator '[' type']' { $$ = MkDeclaratorEnumArray($1, $3); }
3063 | direct_abstract_declarator '[' constant_expression_error ']' { $$ = MkDeclaratorArray($1, $3); }
3064 | '(' ')' { $$ = MkDeclaratorFunction(null, null); }
3065 | '(' parameter_type_list ')' { $$ = MkDeclaratorFunction(null, $2); }
3066 | '(' parameter_type_list_error ')' { $$ = MkDeclaratorFunction(null, $2); }
3067 | direct_abstract_declarator '(' ')' { $$ = MkDeclaratorFunction($1, null); }
3068 | direct_abstract_declarator '(' parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $3); }
3069 | direct_abstract_declarator '(' parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $3); }
3072 direct_abstract_declarator_noarray:
3073 '(' abstract_declarator_noarray ')' { $$ = MkDeclaratorBrackets($2); }
3074 | '(' ext_decl abstract_declarator_noarray ')' { $$ = MkDeclaratorBrackets(MkDeclaratorExtended($2, $3)); }
3075 | '(' ')' { $$ = MkDeclaratorFunction(null, null); }
3076 | '(' parameter_type_list ')' { $$ = MkDeclaratorFunction(null, $2); }
3077 | '(' parameter_type_list_error ')' { $$ = MkDeclaratorFunction(null, $2); }
3078 | direct_abstract_declarator_noarray '(' ')' { $$ = MkDeclaratorFunction($1, null); }
3079 | direct_abstract_declarator_noarray '(' parameter_type_list ')' { $$ = MkDeclaratorFunction($1, $3); }
3080 | direct_abstract_declarator_noarray '(' parameter_type_list_error ')' { $$ = MkDeclaratorFunction($1, $3); }
3084 '*' { $$ = MkPointer(null, null); }
3085 | '*' type_qualifier_list { $$ = MkPointer($2, null); }
3086 | '*' pointer { $$ = MkPointer(null, $2); }
3087 | '*' type_qualifier_list pointer { $$ = MkPointer($2, $3); }
3090 abstract_declarator:
3091 pointer { $$ = MkDeclaratorPointer($1, null); }
3092 | direct_abstract_declarator
3093 | pointer direct_abstract_declarator { $$ = MkDeclaratorPointer($1, $2); }
3094 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
3095 | ext_decl pointer direct_abstract_declarator { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3098 abstract_declarator_noarray:
3099 pointer { $$ = MkDeclaratorPointer($1, null); }
3100 | direct_abstract_declarator_noarray
3101 | pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorPointer($1, $2); }
3102 | ext_decl pointer { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, null)); }
3103 | ext_decl pointer direct_abstract_declarator_noarray { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3108 | pointer direct_declarator
3109 { $$ = MkDeclaratorPointer($1, $2); }
3110 | ext_decl pointer direct_declarator
3111 { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3112 | declarator ext_decl
3113 { $$ = MkDeclaratorExtendedEnd($2, $1); }
3114 | declarator_nofunction_type_ok ext_decl
3115 { $$ = MkDeclaratorExtendedEnd($2, $1); }
3119 direct_declarator_type_ok
3120 | pointer direct_declarator_type_ok
3121 { $$ = MkDeclaratorPointer($1, $2); }
3122 | ext_decl pointer direct_declarator_type_ok
3123 { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3124 | declarator_type_ok ext_decl
3125 { $$ = MkDeclaratorExtendedEnd($2, $1); }
3128 declarator_function:
3129 direct_declarator_function
3130 | pointer direct_declarator_function { $$ = MkDeclaratorPointer($1, $2); }
3131 | ext_decl pointer direct_declarator_function { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3132 | pointer ext_decl direct_declarator_function { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
3135 declarator_function_error:
3136 direct_declarator_function_error
3137 | pointer direct_declarator_function_error { $$ = MkDeclaratorPointer($1, $2); }
3138 | ext_decl pointer direct_declarator_function_error { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3139 | pointer ext_decl direct_declarator_function_error { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
3142 declarator_function_type_ok:
3143 direct_declarator_function_type_ok
3144 | pointer direct_declarator_function_type_ok { $$ = MkDeclaratorPointer($1, $2); }
3145 | ext_decl pointer direct_declarator_function_type_ok { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3146 | pointer ext_decl direct_declarator_function_type_ok { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
3149 declarator_function_error_type_ok:
3150 direct_declarator_function_error_type_ok
3151 | pointer direct_declarator_function_error_type_ok { $$ = MkDeclaratorPointer($1, $2); }
3152 | ext_decl pointer direct_declarator_function_error_type_ok { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3153 | pointer ext_decl direct_declarator_function_error_type_ok { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
3156 declarator_nofunction_type_ok:
3157 direct_declarator_nofunction_type_ok
3158 | pointer direct_declarator_nofunction_type_ok { $$ = MkDeclaratorPointer($1, $2); }
3159 | ext_decl pointer direct_declarator_nofunction_type_ok { $$ = MkDeclaratorExtended($1, MkDeclaratorPointer($2, $3)); }
3160 | pointer ext_decl direct_declarator_nofunction_type_ok { $$ = MkDeclaratorPointer($1, MkDeclaratorExtended($2, $3)); }
3164 assignment_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
3165 | '{' initializer_list '}' { $$ = MkInitializerList($2); $$.loc = @$; }
3166 | '{' initializer_list ',' '}'
3168 Compiler_Warning($"extra comma\n");
3169 $$ = MkInitializerList($2);
3173 Expression exp = MkExpDummy();
3174 Initializer init = MkInitializerAssignment(exp);
3183 assignment_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
3184 | '{' initializer_list '}' error { $$ = MkInitializerList($2); $$.loc = @$; }
3185 | '{' initializer_list { yyerror(); $$ = MkInitializerList($2); $$.loc = @$; }
3186 | '{' initializer_list ',' '}' error
3188 $$ = MkInitializerList($2);
3192 Expression exp = MkExpDummy();
3193 Initializer init = MkInitializerAssignment(exp);
3199 | '{' initializer_list ','
3202 $$ = MkInitializerList($2);
3206 Expression exp = MkExpDummy();
3207 Initializer init = MkInitializerAssignment(exp);
3215 initializer_condition:
3216 conditional_expression { $$ = MkInitializerAssignment($1); $$.loc = @$; }
3217 | anon_instantiation_expression
3218 { $$ = MkInitializerAssignment($1); $$.loc = @$; }
3221 initializer_condition_error:
3222 conditional_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
3223 | anon_instantiation_expression_error { $$ = MkInitializerAssignment($1); $$.loc = @$; }
3227 initializer { $$ = MkList(); ListAdd($$, $1); }
3228 | initializer_error { $$ = MkList(); ListAdd($$, $1); }
3229 | initializer_list ',' initializer { $$ = $1; ListAdd($1, $3); }
3230 | initializer_list ',' initializer_error { $$ = $1; ListAdd($1, $3); }
3233 | initializer_list initializer { yyerror(); $$ = $1; ListAdd($1, $2); }
3234 | initializer_list initializer_error { $$ = $1; ListAdd($1, $2); }
3238 declarator { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
3239 | declarator_type_ok { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
3240 | declarator '=' initializer { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
3243 init_declarator_error:
3244 declarator error { $$ = MkInitDeclarator($1, null); $$.loc = @$; }
3245 /* Useless rules due to conflicts
3246 | declarator '=' error { $$ = MkInitDeclarator($1, MkInitializerAssignment(MkExpDummy())); $$.loc = @$; $$.initializer.loc = @2; $$.initializer.exp.loc = @2; }
3248 | declarator '=' initializer_error { $$ = MkInitDeclarator($1, $3); $$.loc = @$; $$.initializer.loc.start = @2.end; }
3251 init_declarator_list:
3252 init_declarator { $$ = MkList(); ListAdd($$, $1); }
3253 | init_declarator_list ',' init_declarator { $$ = $1; ListAdd($1, $3); }
3254 | UINT ',' init_declarator { $$ = MkList(); ListAdd($$, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("uint")), null)); ListAdd($$, $3); }
3255 | INT64 ',' init_declarator { $$ = MkList(); ListAdd($$, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("int64")), null)); ListAdd($$, $3); }
3256 | base_strict_type ',' init_declarator
3258 char * colon = RSearchString($1.name, "::", strlen($1.name), true, false);
3259 String s = colon ? colon + 2 : $1.name;
3261 ListAdd($$, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(s)), null));
3265 | init_declarator_list_error ',' init_declarator { $$ = $1; ListAdd($1, $3); }
3266 /*| base_strict_type ',' init_declarator
3273 init_declarator_list_error:
3274 init_declarator_error { $$ = MkList(); ListAdd($$, $1); }
3275 | init_declarator error { $$ = MkList(); ListAdd($$, $1); }
3276 | init_declarator_list ',' init_declarator_error { $$ = $1; ListAdd($1, $3); }
3277 | init_declarator_list_error ',' init_declarator_error { $$ = $1; ListAdd($1, $3); }
3281 specifier_qualifier_list { $$ = MkTypeName($1, null); }
3282 | specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
3286 guess_specifier_qualifier_list { $$ = MkTypeName($1, null); }
3287 | guess_specifier_qualifier_list abstract_declarator { $$ = MkTypeName($1, $2); }
3290 /*** PARAMETERS **********************************************************************/
3291 parameter_declaration:
3292 guess_declaration_specifiers declarator_type_ok { $$ = MkTypeName($1, $2); }
3293 | guess_declaration_specifiers abstract_declarator { $$ = MkTypeName($1, $2); }
3294 | guess_declaration_specifiers '&' { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), null)); }
3295 | guess_declaration_specifiers '&' declarator_type_ok { $$ = MkTypeName($1, MkDeclaratorPointer(MkPointer(null,null), $3)); }
3296 | guess_declaration_specifiers { $$ = MkTypeNameGuessDecl($1, null); }
3298 { $$ = MkTypeName(MkListOne(MkSpecifier(CLASS)), null); }
3301 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), null); }
3303 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), null)); }
3304 | TYPED_OBJECT declarator
3305 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), $2); }
3306 | TYPED_OBJECT '&' declarator
3307 { $$ = MkTypeName(MkListOne(MkSpecifier(TYPED_OBJECT)), MkDeclaratorPointer(MkPointer(null,null), $3)); }
3309 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), null); }
3310 | ANY_OBJECT declarator
3311 { $$ = MkTypeName(MkListOne(MkSpecifier(ANY_OBJECT)), $2); }
3315 parameter_declaration_error:
3316 guess_declaration_specifiers declarator_type_ok error { $$ = MkTypeName($1, $2); }
3317 | guess_declaration_specifiers abstract_declarator error { $$ = MkTypeName($1, $2); }
3321 parameter_declaration { $$ = MkList(); ListAdd($$, $1); }
3322 | parameter_list ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3323 | parameter_list error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3324 | parameter_list_error ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3325 | parameter_list_error error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3326 | error ',' parameter_declaration { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3328 | identifier_list ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3329 | identifier_list error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3330 | identifier_list_error ',' parameter_declaration { $$ = $1; ListAdd($1, $3); }
3331 | identifier_list_error error ',' parameter_declaration { $$ = $1; ListAdd($1, $4); }
3334 parameter_list_error:
3335 parameter_declaration_error { $$ = MkList(); ListAdd($$, $1); }
3336 | parameter_list ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3337 | parameter_list_error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3338 | parameter_list_error error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $4); }
3339 | error ',' parameter_declaration_error { $$ = MkList(); ListAdd($$, MkTypeName(MkList(), null)); ListAdd($$, $3); }
3341 | identifier_list ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3342 | identifier_list_error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $3); }
3343 | identifier_list_error error ',' parameter_declaration_error { $$ = $1; ListAdd($1, $4); }
3346 parameter_type_list:
3348 | parameter_list ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3349 | parameter_list_error ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3350 | identifier_list ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3351 | identifier_list_error ',' ELLIPSIS { $$ = $1; ListAdd($1, MkTypeName(null, null)); }
3352 | error ',' ELLIPSIS { $$ = MkList(); ListAdd($$, MkTypeName(null, null)); }
3355 parameter_type_list_error:
3356 parameter_list_error
3357 | parameter_list ',' error { $$ = $1; ListAdd($1, null); }
3358 | parameter_list_error error
3361 /****** STATEMENTS *******************************************************************/
3364 | attrib { $$ = MkExpressionStmt(null); FreeAttrib($1); } // Ignoring this for now... ( For __attribute__ ((__unused__)) )
3365 | compound_statement
3366 | ';' { $$ = MkExpressionStmt(null); }
3367 | ':' { $$ = MkExpressionStmt(null); }
3368 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3369 | selection_statement
3370 | iteration_statement
3375 | watch_definition ';'
3379 labeled_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3380 | iteration_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3381 | compound_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3382 | selection_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3383 | jump_statement_error { $$ = $1; Compiler_Error($"syntax error\n"); }
3384 | jump_statement error { $$ = $1; Compiler_Error($"syntax error\n"); }
3385 | expression_error { $$ = MkExpressionStmt($1); Compiler_Error($"syntax error\n"); $$.loc = @1; }
3389 string_literal { $$ = MkAsmField($1, null, null); $$.loc = @1; }
3390 | string_literal '(' assignment_expression ')' { $$ = MkAsmField($1, $3, null); $$.loc = @$; }
3391 | '[' identifier ']' string_literal '(' assignment_expression ')' { $$ = MkAsmField($4, $6, $2); $$.loc = @$; }
3395 asm_field { $$ = MkListOne($1); }
3396 | asm_field_list ',' asm_field { ListAdd($$, $3); }
3401 ASM type_qualifier '(' string_literal ')' ';' { $$ = MkAsmStmt($2, $4, null, null, null); $$.loc = @$; }
3402 | ASM type_qualifier '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, null); $$.loc = @$; }
3403 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, null); $$.loc = @$; }
3404 | ASM type_qualifier '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, $8, $10); $$.loc = @$; }
3406 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, null); $$.loc = @$; }
3407 | ASM type_qualifier '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, null, $6, $8); $$.loc = @$; }
3408 | ASM type_qualifier '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt($2, $4, $6, null, $8); $$.loc = @$; }
3410 | ASM '(' string_literal ')' ';' { $$ = MkAsmStmt(null, $3, null, null, null); $$.loc = @$; }
3411 | ASM '(' string_literal ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, null); $$.loc = @$; }
3412 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, null); $$.loc = @$; }
3413 | ASM '(' string_literal ':' asm_field_list ':' asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, $7, $9); $$.loc = @$; }
3415 | ASM '(' string_literal IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, null); $$.loc = @$; }
3416 | ASM '(' string_literal IDENTIFIER asm_field_list ':' asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, null, $5, $7); $$.loc = @$; }
3417 | ASM '(' string_literal ':' asm_field_list IDENTIFIER asm_field_list ')' ';' { $$ = MkAsmStmt(null, $3, $5, null, $7); $$.loc = @$; }
3421 identifier ':' statement { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3422 | CASE constant_expression ':' statement { if($4.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3423 | CASE constant_expression_error ':' statement { if($4.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3424 | CASE ':' statement { if($3.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3425 | DEFAULT ':' statement { if($3.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3427 | identifier ':' declaration { Statement stmt = MkBadDeclStmt($3); stmt.loc = @3; Compiler_Warning(C89_DECL_WARNING); $$ = MkLabeledStmt($1, stmt); $$.loc = @$; }
3428 | CASE constant_expression ':' declaration { Statement stmt = MkBadDeclStmt($4); stmt.loc = @4; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt($2, stmt); $$.loc = @$; $2.loc.start = @1.end; }
3429 | CASE constant_expression_error ':' declaration { Statement stmt = MkBadDeclStmt($4); stmt.loc = @4; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt($2, stmt); $$.loc = @$; $2.loc.start = @1.end; }
3430 | CASE ':' declaration { Statement stmt = MkBadDeclStmt($3); stmt.loc = @3; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt(MkExpDummy(), stmt); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3431 | DEFAULT ':' declaration { Statement stmt = MkBadDeclStmt($3); stmt.loc = @3; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt(null, stmt); $$.loc = @$; }
3434 labeled_statement_error:
3435 identifier ':' statement_error { $$ = MkLabeledStmt($1, $3); $$.loc = @$; }
3436 | CASE constant_expression ':' statement_error { if($4.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3437 | CASE constant_expression_error ':' statement_error { if($4.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt($2, $4); $$.loc = @$; $2.loc.start = @1.end; }
3438 | CASE ':' statement_error { if($3.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt(MkExpDummy(), $3); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3439 | CASE ':' { $$ = MkCaseStmt(MkExpDummy(), null); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3440 | DEFAULT ':' statement_error { if($3.type == labeledStmt) Compiler_Warning(CASE_LABELED_STMT_WARNING); $$ = MkCaseStmt(null, $3); $$.loc = @$; }
3441 | DEFAULT ':' { $$ = MkCaseStmt(null, null); $$.loc = @$; }
3443 | identifier ':' declaration_error { Statement stmt = MkBadDeclStmt($3); stmt.loc = @3; Compiler_Warning(C89_DECL_WARNING); $$ = MkLabeledStmt($1, stmt); $$.loc = @$; }
3444 | CASE constant_expression ':' declaration_error { Statement stmt = MkBadDeclStmt($4); stmt.loc = @4; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt($2, stmt); $$.loc = @$; $2.loc.start = @1.end; }
3445 | CASE constant_expression_error ':' declaration_error { Statement stmt = MkBadDeclStmt($4); stmt.loc = @4; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt($2, stmt); $$.loc = @$; $2.loc.start = @1.end; }
3446 | CASE ':' declaration_error { Statement stmt = MkBadDeclStmt($3); stmt.loc = @3; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt(MkExpDummy(), stmt); $$.caseStmt.exp.loc = @2; $$.loc = @$; $$.caseStmt.exp.loc.start = @1.end; }
3447 | DEFAULT ':' declaration_error { Statement stmt = MkBadDeclStmt($3); stmt.loc = @3; Compiler_Warning(C89_DECL_WARNING); $$ = MkCaseStmt(null, stmt); $$.loc = @$; }
3451 PUBLIC { $$ = structDeclMode = declMode = publicAccess; }
3452 | PRIVATE { $$ = structDeclMode = declMode = privateAccess; }
3453 | DEFAULT { $$ = structDeclMode = declMode = defaultAccess; }
3457 PUBLIC { $$ = publicAccess; }
3458 | PRIVATE { $$ = privateAccess; }
3462 declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; structDeclMode = defaultDeclMode; }
3463 | declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; structDeclMode = defaultDeclMode; }
3464 | instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; structDeclMode = defaultDeclMode; }
3465 | declaration_error ';' { $$ = $1; structDeclMode = defaultDeclMode; }
3468 external_guess_declaration:
3469 external_guess_declaration_specifiers ';' { $$ = MkDeclaration($1, null); $$.loc = @$; }
3470 | external_guess_declaration_specifiers init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3471 | external_guess_declaration_specifiers_error init_declarator_list ';' { $$ = MkDeclaration($1, $2); $$.loc = @$; }
3473 | external_guess_instantiation_named ';' { $$ = MkDeclarationInst($1); $$.loc = @$; }
3474 | DEFINE identifier '=' conditional_expression ';' { $$ = MkDeclarationDefine($2, $4); $$.loc = @$; }
3475 | STATIC DEFINE identifier '=' conditional_expression ';' { structDeclMode = declMode = staticAccess; $$ = MkDeclarationDefine($3, $5); $$.loc = @$; }
3478 external_guess_declaration_error:
3479 external_guess_declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; yyerrok; }
3483 declaration_specifiers error { $$ = MkDeclaration($1, null); $$.loc = @$; structDeclMode = defaultDeclMode; }
3484 | declaration_error error { structDeclMode = defaultDeclMode; }
3486 | instantiation_named_error error { $$ = MkDeclarationInst($1); $$.loc = @$; structDeclMode = defaultDeclMode; }
3487 | instantiation_named error { $$ = MkDeclarationInst($1); $$.loc = @$; structDeclMode = defaultDeclMode; }
3488 | declaration_specifiers init_declarator_list_error { $$ = MkDeclaration($1, $2); $$.loc = @$; structDeclMode = defaultDeclMode; }
3492 declaration { $$ = MkList(); ListAdd($$, $1); /*declMode = defaultDeclMode;*/ }
3493 | declaration_list declaration { $$ = $1; ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3494 | declaration_list_error declaration { $$ = $1; ListAdd($1, $2); /*declMode = defaultDeclMode; */}
3495 | declaration_list error ';' { $$ = $1; }
3498 declaration_list_error:
3499 declaration_error { $$ = MkList(); ListAdd($$, $1); }
3500 | declaration_list declaration_error { $$ = $1; ListAdd($1, $2); }
3504 statement { $$ = MkList(); ListAdd($$, $1); }
3505 | statement_list statement { $$ = $1; ListAdd($1, $2); }
3506 | statement_list_error statement { $$ = $1; ListAdd($1, $2); }
3509 statement_list_error:
3510 statement_error { $$ = MkList(); ListAdd($$, $1); }
3511 | statement_list statement_error { $$ = $1; ListAdd($1, $2); }
3512 | statement_list_error statement_error { $$ = $1; ListAdd($1, $2); }
3513 | statement_list declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; Compiler_Warning(C89_DECL_WARNING); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3514 | statement_list_error declaration { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; Compiler_Warning(C89_DECL_WARNING); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3515 | statement_list declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; Compiler_Warning(C89_DECL_WARNING); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3516 | statement_list_error declaration_error { Statement stmt = MkBadDeclStmt($2); stmt.loc = @2; Compiler_Warning(C89_DECL_WARNING); $$ = $1; ListAdd($1, stmt); /*declMode = defaultDeclMode;*/ }
3520 statement_list { $$ = MkCompoundStmt(null, $1); }
3521 | declaration_list { $$ = MkCompoundStmt($1, null); }
3522 | declaration_list statement_list { $$ = MkCompoundStmt($1, $2); }
3523 | declaration_list_error statement_list { $$ = MkCompoundStmt($1, $2); }
3526 compound_inside_error:
3527 statement_list_error { $$ = MkCompoundStmt(null, $1); }
3528 | declaration_list_error { $$ = MkCompoundStmt($1, null); }
3529 | declaration_list statement_list_error { $$ = MkCompoundStmt($1, $2); }
3530 | declaration_list_error statement_list_error { $$ = MkCompoundStmt($1, $2); }
3534 '{' { $<context>$ = PushContext(); }
3538 compound_statement_error '}' { $$ = $1; $$.loc = @$; }
3541 compound_statement_error:
3542 compound_start compound_inside_error
3543 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3545 { $$ = MkCompoundStmt(null, null); $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3547 | compound_start compound_inside
3548 { $$ = $2; $$.compound.context = $<context>1; PopContext($<context>1); $$.loc = @$; $$.loc.end.charPos++; $$.loc.end.pos++; }
3552 expression_statement:
3553 ';' { $$ = MkExpressionStmt(null); $$.loc = @$; }
3554 | expression ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3555 | expression_error ';' { $$ = MkExpressionStmt($1); $$.loc = @$; }
3558 selection_statement:
3559 IF '(' expression ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3560 | IF '(' expression_error ')' statement %prec IFX { $$ = MkIfStmt($3, $5, null); $$.loc = @$; }
3561 | IF '(' expression ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3562 | IF '(' expression_error ')' statement ELSE statement { $$ = MkIfStmt($3, $5, $7); $$.loc = @$; }
3563 | SWITCH '(' expression ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3564 | SWITCH '(' expression_error ')' statement { $$ = MkSwitchStmt($3, $5); $$.loc = @$; }
3567 selection_statement_error:
3568 IF '(' expression_error { $$ = MkIfStmt($3, null, null); $$.loc = @$; }
3569 | selection_statement error
3572 iteration_statement:
3573 WHILE '(' expression ')' statement { $$ = MkWhileStmt($3, $5); $$.loc = @$; }
3574 | WHILE '(' expression_error statement { $$ = MkWhileStmt($3, $4); $$.loc = @$; }
3575 | WHILE '(' ')' statement { yyerror(); $$ = MkWhileStmt(null, $4); $$.loc = @$; }
3577 | DO statement WHILE '(' expression ')' ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3578 | DO statement WHILE '(' expression_error ';' { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; }
3580 | FOR '(' expression_statement expression_statement ')' statement { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; }
3581 | FOR '(' expression_statement ')' statement { yyerror(); $$ = MkForStmt($3, null, null, $5); $$.loc = @$; }
3582 | FOR '(' expression_statement expression_statement expression ')' statement { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; }
3583 | FOR '(' expression_statement expression_statement expression_error statement { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; }
3584 | FOR '(' ')' statement { yyerror(); $$ = MkForStmt(null, null, null, $4); $$.loc = @$; }
3586 | FOR '(' identifier ':' expression ')' statement { $$ = MkForEachStmt($3, $5, null, $7); $$.loc = @$; }
3587 | FOR '(' identifier ':' expression ';' expression ')' statement { $$ = MkForEachStmt($3, $5, $7, $9); $$.loc = @$; }
3590 iteration_statement_error:
3591 FOR '(' error { $$ = MkForStmt(null, null, null, null); $$.loc = @$; } |
3592 FOR '(' expression_error error { $$ = MkForStmt(MkExpressionStmt($3), null, null, null); $$.forStmt.init.loc = @3; $$.loc = @$; } |
3593 FOR '(' expression_statement error { $$ = MkForStmt($3, null, null, null); $$.loc = @$; } |
3594 FOR '(' expression_statement expression_error error { $$ = MkForStmt($3, MkExpressionStmt($4), null, null); $$.loc = @$; $$.forStmt.check.loc = @4; } |
3595 /* Useless rules due to conflicts
3596 FOR '(' expression_statement expression_statement error { $$ = MkForStmt($3, $4, null, null); $$.loc = @$; } |
3598 FOR '(' expression_statement expression_statement expression_error { $$ = MkForStmt($3, $4, $5, null); $$.loc = @$; } |
3599 FOR '(' expression_statement expression_statement ')' statement_error { $$ = MkForStmt($3, $4, null, $6); $$.loc = @$; } |
3600 FOR '(' expression_statement expression_statement expression ')' statement_error { $$ = MkForStmt($3, $4, $5, $7); $$.loc = @$; } |
3601 FOR '(' expression_statement expression_statement expression_error statement_error { $$ = MkForStmt($3, $4, $5, $6 ); $$.loc = @$; } |
3603 DO statement WHILE '(' expression ')' { yyerror(); $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3604 DO statement WHILE '(' expression { yyerror(); $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3605 DO statement WHILE '(' expression_error { $$ = MkDoWhileStmt($2, $5); $$.loc = @$; } |
3606 DO statement WHILE '(' { $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3607 DO statement WHILE { yyerror(); $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3608 DO statement { yyerror(); $$ = MkDoWhileStmt($2, null); $$.loc = @$; } |
3609 DO { yyerror(); $$ = MkDoWhileStmt(null, null); $$.loc = @$; } |
3612 WHILE error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3613 /* Useless rules due to conflicts
3614 WHILE '(' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3616 WHILE '(' ')' error { $$ = MkWhileStmt(null, null); $$.loc = @$; } |
3617 WHILE '(' expression_error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3618 /* Useless rules due to conflicts
3619 WHILE '(' expression_error error { $$ = MkWhileStmt($3, null); $$.loc = @$; } |
3621 WHILE '(' expression ')' statement_error { $$ = MkWhileStmt($3, $5); $$.loc = @$; } |
3622 WHILE '(' expression_error statement_error { $$ = MkWhileStmt($3, $4 ); $$.loc = @$; }
3626 GOTO identifier ';' { $$ = MkGotoStmt($2); $$.loc = @$; }
3627 | CONTINUE ';' { $$ = MkContinueStmt(); $$.loc = @$; }
3628 | BREAK ';' { $$ = MkBreakStmt(); $$.loc = @$; }
3629 | RETURN ';' { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc = @2; }
3630 | RETURN expression ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3631 | RETURN expression_error ';' { $$ = MkReturnStmt($2); $$.loc = @$; }
3632 | RETURN anon_instantiation_expression ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3633 | RETURN anon_instantiation_expression_error ';' { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; }
3636 jump_statement_error:
3637 RETURN expression_error { $$ = MkReturnStmt($2); $$.loc = @$; } |
3638 RETURN anon_instantiation_expression_error { $$ = MkReturnStmt(MkListOne($2)); $$.loc = @$; } |
3639 RETURN { Expression exp = MkExpDummy(); $$ = MkReturnStmt(MkListOne(exp)); $$.loc = @$; exp.loc.start = exp.loc.end = @1.end; } |
3640 GOTO { $$ = MkGotoStmt(null); $$.loc = @$; }
3643 /*************************************************************************************/
3645 function_definition:
3646 external_guess_declaration_specifiers declarator_function declaration_list compound_statement { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; }
3647 | external_guess_declaration_specifiers declarator_function compound_statement
3648 { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; }
3649 | external_guess_declaration_specifiers declarator_function_type_ok declaration_list compound_statement { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; }
3650 | external_guess_declaration_specifiers declarator_function_type_ok compound_statement
3651 { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; }
3653 | declarator_function declaration_list compound_statement { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; }
3654 | declarator_function compound_statement { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$;}
3656 function_definition_error:
3657 external_guess_declaration_specifiers declarator_function declaration_list compound_statement_error { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; $$.loc.end = $4.loc.end; }
3658 | external_guess_declaration_specifiers declarator_function compound_statement_error { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3659 | external_guess_declaration_specifiers declarator_function_type_ok declaration_list compound_statement_error { $$ = MkFunction($1, $2, $3); ProcessFunctionBody($$, $4); $$.loc = @$; $$.loc.end = $4.loc.end; }
3660 | external_guess_declaration_specifiers declarator_function_type_ok compound_statement_error { $$ = MkFunction($1, $2, null); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3661 | declarator_function declaration_list compound_statement_error { $$ = MkFunction(null, $1, $2); ProcessFunctionBody($$, $3); $$.loc = @$; $$.loc.end = $3.loc.end; }
3662 | declarator_function compound_statement_error { $$ = MkFunction(null, $1, null); ProcessFunctionBody($$, $2); $$.loc = @$; $$.loc.end = $2.loc.end; }
3666 STRING_LITERAL { $$ = CopyString(yytext); }
3667 | string_literal STRING_LITERAL
3669 int len1 = strlen($1);
3670 int len2 = strlen(yytext);
3671 $$ = new byte[len1-1 + len2-1 + 1];
3672 memcpy($$, $1, len1-1);
3673 memcpy($$ + len1-1, yytext+1, len2);
3678 external_declaration:
3679 function_definition { $$ = MkExternalFunction($1); $$.loc = @$; $1.declMode = declMode; structDeclMode = declMode = defaultDeclMode; }
3681 { $$ = MkExternalClass($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3683 | external_guess_declaration_specifiers class
3684 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; structDeclMode = declMode = defaultDeclMode; FreeList($1, FreeSpecifier); }
3686 | external_guess_declaration
3687 { $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; structDeclMode = declMode = defaultDeclMode; }
3688 | IMPORT string_literal { $$ = MkExternalImport($2, normalImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3689 | IMPORT STATIC string_literal { $$ = MkExternalImport($3, staticImport, (declMode != defaultAccess) ? declMode : privateAccess); $$.loc = @$; }
3690 | IMPORT identifier string_literal
3692 bool isRemote = !strcmp($2.string, "remote");
3693 $$ = MkExternalImport($3, isRemote ? remoteImport : normalImport, (declMode != defaultAccess) ? declMode : privateAccess);
3700 | ';' { $$ = null; }
3702 | declaration_mode function_definition { $$ = MkExternalFunction($2); $$.loc = @$; $2.declMode = $1; structDeclMode = declMode = defaultDeclMode; }
3703 | declaration_mode class
3704 { $$ = MkExternalClass($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3705 | declaration_mode external_guess_declaration { $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; structDeclMode = declMode = defaultDeclMode; }
3706 | declaration_mode IMPORT string_literal { $$ = MkExternalImport($3, normalImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; structDeclMode = declMode = defaultDeclMode; }
3707 | declaration_mode IMPORT STATIC string_literal { $$ = MkExternalImport($4, staticImport, ($1 != defaultAccess) ? $1 : privateAccess); $$.loc = @$; structDeclMode = declMode = defaultDeclMode; }
3708 | declaration_mode IMPORT identifier string_literal
3710 bool isRemote = !strcmp($3.string, "remote");
3711 $$ = MkExternalImport($4, isRemote ? remoteImport : normalImport, ($1 != defaultAccess) ? $1 : privateAccess);
3714 structDeclMode = declMode = defaultDeclMode;
3718 | declaration_mode ':' { defaultDeclMode = $1; $$ = null; }
3719 | STATIC ':' { defaultDeclMode = staticAccess; $$ = null; }
3720 | NAMESPACE identifier { $$ = MkExternalNameSpace($2); $$.loc = @$; }
3721 | NAMESPACE strict_type { $$ = MkExternalNameSpace(MkIdentifier($2.name)); FreeSpecifier($2); $$.loc = @$; }
3722 | dbtable_definition { $$ = MkExternalDBTable($1); $$.loc = @$; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3723 | declaration_mode dbtable_definition { $$ = MkExternalDBTable($2); $$.loc = @$; $2.declMode = ($1 != defaultAccess) ? declMode : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3726 external_declaration_error:
3727 class_error { yyerror(); $$ = MkExternalClass($1); $$.loc = $1.loc; $1.declMode = (declMode != defaultAccess) ? declMode : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3728 | external_guess_declaration_specifiers class_error
3731 FreeList($1, FreeSpecifier);
3732 $$ = MkExternalClass($2);
3734 $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess;
3735 structDeclMode = declMode = defaultDeclMode;
3737 | function_definition_error { yyerror(); $$ = MkExternalFunction($1); $$.loc = $1.loc; $1.declMode = declMode; structDeclMode = declMode = defaultDeclMode; }
3739 | declaration_mode class_error { yyerror(); $$ = MkExternalClass($2); $$.loc = $2.loc; $2.declMode = ($1 != defaultAccess) ? $1 : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3740 | declaration_mode function_definition_error { yyerror(); $$ = MkExternalFunction($2); $$.loc = $2.loc; $2.declMode = $1; structDeclMode = declMode = defaultDeclMode; }
3742 | external_guess_declaration_error
3743 { yyerror(); $$ = MkExternalDeclaration($1); $$.loc = @$; $1.declMode = declMode; structDeclMode = declMode = defaultDeclMode; }
3744 | declaration_mode external_guess_declaration_error { yyerror(); $$ = MkExternalDeclaration($2); $$.loc = @$; $2.declMode = $1; structDeclMode = declMode = defaultDeclMode; }
3747 translation_unit_error:
3748 external_declaration_error { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3749 | translation_unit external_declaration_error { $$ = $1; ListAdd($1, $2); }
3750 | translation_unit_error external_declaration_error { $$ = $1; ListAdd($1, $2); }
3751 | translation_unit error
3752 | translation_unit_error error
3756 external_declaration { $$ = MkList(); ListAdd($$, $1); ast = $$; }
3757 | translation_unit external_declaration { $$ = $1; ListAdd($1, $2); }
3758 | translation_unit_error class
3759 { External _class = MkExternalClass($2); $$ = $1; ListAdd($1, _class); _class.loc = @2; $2.declMode = (declMode != defaultAccess) ? declMode : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3760 | translation_unit_error declaration_mode class
3761 { External _class = MkExternalClass($3); $$ = $1; ListAdd($1, _class); _class.loc = @3; $3.declMode = ($2 != defaultAccess) ? $2 : privateAccess; structDeclMode = declMode = defaultDeclMode; }
3766 | translation_unit_error
3767 | { ast = MkList(); }
3771 DBTABLE string_literal identifier '{' dbfield_definition_list '}' { Symbol symbol = DeclClassAddNameSpace(globalContext.nextID++, $3.string); FreeIdentifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3772 | DBTABLE string_literal strict_type '{' dbfield_definition_list '}' { Symbol symbol = DeclClass(globalContext.nextID++, $3.name); FreeSpecifier($3); $$ = MkDBTableDef($2, symbol, $5); }
3773 | DBTABLE string_literal '{' dbfield_definition_list '}' { $$ = MkDBTableDef($2, null, $4); }
3777 guess_declaration_specifiers identifier string_literal ';' { $$ = MkDBFieldEntry(MkTypeName($1, null), $2, $3); }
3781 identifier { $$ = MkDBIndexItem($1, ascending); }
3782 | '>' identifier { $$ = MkDBIndexItem($2, descending); }
3783 | '<' identifier { $$ = MkDBIndexItem($2, ascending); }
3787 dbindex_item { $$ = MkList(); ListAdd($$, $1); }
3788 | dbindex_item_list ',' dbindex_item { ListAdd($1, $3); }
3792 DBINDEX dbindex_item_list ';' { $$ = MkDBIndexEntry($2, null); }
3793 | DBINDEX dbindex_item_list identifier ';' { $$ = MkDBIndexEntry($2, $3); }
3796 dbfield_definition_list:
3797 dbfield_entry { $$ = MkList(); ListAdd($$, $1); }
3798 | dbindex_entry { $$ = MkList(); ListAdd($$, $1); }
3799 | dbfield_definition_list dbfield_entry { ListAdd($1, $2); }
3800 | dbfield_definition_list dbindex_entry { ListAdd($1, $2); }
3804 DATABASE_OPEN '(' assignment_expression ',' assignment_expression ')' { $$ = MkExpDBOpen($3, $5); }
3808 DBFIELD '(' string_literal ',' identifier ')' { $$ = MkExpDBField($3, $5); }
3812 DBINDEX '(' string_literal ',' identifier ')' { $$ = MkExpDBIndex($3, $5); }
3816 DBTABLE '(' string_literal ')' { $$ = MkExpDBTable($3); }