Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    ra1c9ddd r401e61f  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  7 10:07:12 2018
    13 // Update Count     : 3527
     12// Last Modified On : Mon Jun  4 22:22:04 2018
     13// Update Count     : 3492
    1414//
    1515
     
    503503                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); }
    504504        | type_name '.' no_attr_identifier                                      // CFA, nested type
    505                 // { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    506                 { $$ = nullptr; }
     505                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    507506        | type_name '.' '[' field_list ']'                                      // CFA, nested type / tuple field selector
    508                 // { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    509                 { $$ = nullptr; }
     507                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    510508        | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11
    511509                {
     
    13021300        ;
    13031301
    1304 KR_parameter_list_opt:                                                                  // used to declare parameter types in K&R style functions
     1302KR_parameter_list_opt:                                                          // used to declare parameter types in K&R style functions
    13051303        // empty
    13061304                { $$ = nullptr; }
     
    17921790                { $$ = DeclarationNode::newFromTypedef( $1 ); }
    17931791        | '.' TYPEDEFname
    1794                 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     1792                { $$ = DeclarationNode::newFromTypedef( $2 ); } // FIX ME
    17951793        | type_name '.' TYPEDEFname
    1796                 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     1794                { $$ = DeclarationNode::newFromTypedef( $3 ); } // FIX ME
    17971795        | typegen_name
    17981796        | '.' typegen_name
    1799                 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     1797                { $$ = $2; }                                                                    // FIX ME
    18001798        | type_name '.' typegen_name
    1801                 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     1799                { $$ = $3; }                                                                    // FIX ME
    18021800        ;
    18031801
     
    18241822        aggregate_key attribute_list_opt '{' field_declaration_list_opt '}'
    18251823                { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), nullptr, $4, true )->addQualifiers( $2 ); }
    1826         | aggregate_key attribute_list_opt no_attr_identifier
    1827                 {
    1828                         typedefTable.makeTypedef( *$3, forall ? TYPEGENname : TYPEDEFname ); // create typedef
    1829                         //if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update
     1824        | aggregate_key attribute_list_opt no_attr_identifier_or_type_name
     1825                {
     1826                        typedefTable.makeTypedef( *$3 );                        // create typedef
     1827                        if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update
    18301828                        forall = false;                                                         // reset
    18311829                }
    18321830          '{' field_declaration_list_opt '}'
    18331831                { $$ = DeclarationNode::newAggregate( $1, $3, nullptr, $6, true )->addQualifiers( $2 ); }
    1834         | aggregate_key attribute_list_opt type_name
    1835                 {
    1836                         typedefTable.makeTypedef( *$3->type->symbolic.name, forall ? TYPEGENname : TYPEDEFname ); // create typedef
    1837                         //if ( forall ) typedefTable.changeKind( *$3->type->symbolic.name, TYPEGENname ); // possibly update
    1838                         forall = false;                                                         // reset
    1839                 }
    1840           '{' field_declaration_list_opt '}'
    1841                 { $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, nullptr, $6, true )->addQualifiers( $2 ); }
    18421832        | aggregate_key attribute_list_opt '(' type_list ')' '{' field_declaration_list_opt '}' // CFA
    18431833                { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), $4, $7, false )->addQualifiers( $2 ); }
     
    18481838        aggregate_key attribute_list_opt no_attr_identifier
    18491839                {
    1850                         typedefTable.makeTypedef( *$3, forall ? TYPEGENname : TYPEDEFname );
    1851                         //if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update
     1840                        typedefTable.makeTypedef( *$3 );
     1841                        if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update
    18521842                        forall = false;                                                         // reset
    18531843                        $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 );
    18541844                }
    1855         | aggregate_key attribute_list_opt type_name
     1845        | aggregate_key attribute_list_opt TYPEDEFname
     1846                {
     1847                        typedefTable.makeTypedef( *$3 );
     1848                        $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 );
     1849                }
     1850        | aggregate_key attribute_list_opt typegen_name         // CFA
    18561851                {
    18571852                        // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is
     
    19481943        ENUM attribute_list_opt '{' enumerator_list comma_opt '}'
    19491944                { $$ = DeclarationNode::newEnum( new string( DeclarationNode::anonymous.newName() ), $4, true )->addQualifiers( $2 ); }
    1950         | ENUM attribute_list_opt no_attr_identifier
     1945        | ENUM attribute_list_opt no_attr_identifier_or_type_name
    19511946                { typedefTable.makeTypedef( *$3 ); }
    19521947          '{' enumerator_list comma_opt '}'
    19531948                { $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); }
    1954         | ENUM attribute_list_opt type_name
    1955           '{' enumerator_list comma_opt '}'
    1956                 { $$ = DeclarationNode::newEnum( $3->type->symbolic.name, $5, true )->addQualifiers( $2 ); }
    19571949        | enum_type_nobody
    19581950        ;
    19591951
    19601952enum_type_nobody:                                                                               // enum - {...}
    1961         ENUM attribute_list_opt no_attr_identifier
     1953        ENUM attribute_list_opt no_attr_identifier_or_type_name
    19621954                {
    19631955                        typedefTable.makeTypedef( *$3 );
    19641956                        $$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 );
    1965                 }
    1966         | ENUM attribute_list_opt type_name
    1967                 {
    1968                         typedefTable.makeTypedef( *$3->type->symbolic.name );
    1969                         $$ = DeclarationNode::newEnum( $3->type->symbolic.name, 0, false )->addQualifiers( $2 );
    19701957                }
    19711958        ;
     
    32643251
    32653252%%
    3266 
    32673253// ----end of grammar----
    32683254
Note: See TracChangeset for help on using the changeset viewer.