Changes in src/Parser/parser.yy [9e7236f4:374cb117]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r9e7236f4 r374cb117 2303 2303 ; 2304 2304 2305 enum_type: 2305 enum_type: // static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body, bool typed ); // enum 2306 2306 ENUM attribute_list_opt '{' enumerator_list comma_opt '}' 2307 2307 { $$ = DeclarationNode::newEnum( nullptr, $4, true )->addQualifiers( $2 ); } … … 2318 2318 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2319 2319 2320 $$ = DeclarationNode::newEnum( nullptr, $7, true , $3 ) ->addQualifiers( $5);2321 } 2322 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt 2320 $$ = DeclarationNode::newEnum( nullptr, $7, true ) ->addQualifiers( $5 ) -> addEnumBase( $3 ); 2321 } 2322 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt // Question: why attributes/qualifier after identifier 2323 2323 { 2324 2324 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } … … 2327 2327 '{' enumerator_list comma_opt '}' 2328 2328 { 2329 $$ = DeclarationNode::newEnum( $6, $10, true , $3 ) -> addQualifiers( $5 ) -> addQualifiers( $7);2329 $$ = DeclarationNode::newEnum( $6, $10, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ) -> addEnumBase( $3 ); 2330 2330 } 2331 2331 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}' … … 2333 2333 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2334 2334 typedefTable.makeTypedef( *$6->name ); 2335 $$ = DeclarationNode::newEnum( $6->name, $9, true , $3 ) -> addQualifiers( $5 ) -> addQualifiers( $7);2335 $$ = DeclarationNode::newEnum( $6->name, $9, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ) -> addEnumBase( $3 ); 2336 2336 } 2337 2337 | enum_type_nobody
Note:
See TracChangeset
for help on using the changeset viewer.