Changeset f135b50 for src/Parser/parser.yy
- Timestamp:
- Feb 28, 2022, 3:41:44 AM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 786c438
- Parents:
- a8ef59e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
ra8ef59e rf135b50 2292 2292 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2293 2293 // SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr; 2294 $$ = DeclarationNode::newEnum( nullptr, $7, true, true ) ->addQualifiers( $5 ); 2294 2295 $$ = DeclarationNode::newEnum( nullptr, $7, true, true ) ->addQualifiers( $5 ) -> addEnumBase( $3 ); 2296 // $$ = DeclarationNode::newEnum( nullptr, $7, true, true ) ->addQualifiers( $5 ); 2295 2297 } 2296 2298 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt // Question: why attributes/qualifier after identifier … … 2301 2303 '{' enumerator_list comma_opt '}' 2302 2304 { 2303 $$ = DeclarationNode::newEnum( $6, $10, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ); 2305 $$ = DeclarationNode::newEnum( $6, $10, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ) -> addEnumBase( $3 ); 2306 // $$ = DeclarationNode::newEnum( $6, $10, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ); 2304 2307 } 2305 2308 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}' … … 2307 2310 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." ); } 2308 2311 typedefTable.makeTypedef( *$6->name ); 2309 $$ = DeclarationNode::newEnum( $6->name, $9, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ); 2312 $$ = DeclarationNode::newEnum( $6->name, $9, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ) -> addEnumBase( $3 ); 2313 // $$ = DeclarationNode::newEnum( $6->name, $9, true, true ) -> addQualifiers( $5 ) -> addQualifiers( $7 ); 2310 2314 } 2311 2315 | enum_type_nobody
Note: See TracChangeset
for help on using the changeset viewer.