Changeset 8bea701


Ignore:
Timestamp:
Mar 28, 2021, 10:59:56 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
9e234f0b
Parents:
fec3e9a
Message:

add semantic error for typed enumeration is currently unimplemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rfec3e9a r8bea701  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 23 20:56:24 2021
    13 // Update Count     : 4929
     12// Last Modified On : Sun Mar 28 18:53:34 2021
     13// Update Count     : 4940
    1414//
    1515
     
    22262226                { $$ = DeclarationNode::newEnum( $3->name, $5, true )->addQualifiers( $2 ); }
    22272227        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}'
    2228                 // { SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr; }
    2229                 { $$ = nullptr; }
    2230         | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt '{' enumerator_list comma_opt '}'
    2231                 // { SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr; }
    2232                 { typedefTable.makeTypedef( *$6 ); }
     2228                {
     2229                        if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for constants." ); }
     2230                        SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr;
     2231                }
     2232        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt
     2233                {
     2234                        if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for constants." ); }
     2235                        typedefTable.makeTypedef( *$6 );
     2236                }
     2237          '{' enumerator_list comma_opt '}'
     2238                {
     2239                        SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr;
     2240                }
    22332241        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}'
    2234                 // { SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr; }
    2235                 { typedefTable.makeTypedef( *$6->name ); }
     2242                {
     2243                        if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for constants." ); }
     2244                        typedefTable.makeTypedef( *$6->name );
     2245                        SemanticError( yylloc, "Typed enumeration is currently unimplemented." ); $$ = nullptr;
     2246                }
    22362247        | enum_type_nobody
    22372248        ;
Note: See TracChangeset for help on using the changeset viewer.