Changes in src/Parser/parser.yy [a1c9ddd:401e61f]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
ra1c9ddd r401e61f 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 7 10:07:12201813 // Update Count : 3 52712 // Last Modified On : Mon Jun 4 22:22:04 2018 13 // Update Count : 3492 14 14 // 15 15 … … 503 503 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); } 504 504 | 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; } 507 506 | 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; } 510 508 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 511 509 { … … 1302 1300 ; 1303 1301 1304 KR_parameter_list_opt: // used to declare parameter types in K&R style functions1302 KR_parameter_list_opt: // used to declare parameter types in K&R style functions 1305 1303 // empty 1306 1304 { $$ = nullptr; } … … 1792 1790 { $$ = DeclarationNode::newFromTypedef( $1 ); } 1793 1791 | '.' TYPEDEFname 1794 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }1792 { $$ = DeclarationNode::newFromTypedef( $2 ); } // FIX ME 1795 1793 | type_name '.' TYPEDEFname 1796 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }1794 { $$ = DeclarationNode::newFromTypedef( $3 ); } // FIX ME 1797 1795 | typegen_name 1798 1796 | '.' typegen_name 1799 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }1797 { $$ = $2; } // FIX ME 1800 1798 | type_name '.' typegen_name 1801 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }1799 { $$ = $3; } // FIX ME 1802 1800 ; 1803 1801 … … 1824 1822 aggregate_key attribute_list_opt '{' field_declaration_list_opt '}' 1825 1823 { $$ = 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 typedef1829 //if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update1824 | 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 1830 1828 forall = false; // reset 1831 1829 } 1832 1830 '{' field_declaration_list_opt '}' 1833 1831 { $$ = DeclarationNode::newAggregate( $1, $3, nullptr, $6, true )->addQualifiers( $2 ); } 1834 | aggregate_key attribute_list_opt type_name1835 {1836 typedefTable.makeTypedef( *$3->type->symbolic.name, forall ? TYPEGENname : TYPEDEFname ); // create typedef1837 //if ( forall ) typedefTable.changeKind( *$3->type->symbolic.name, TYPEGENname ); // possibly update1838 forall = false; // reset1839 }1840 '{' field_declaration_list_opt '}'1841 { $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, nullptr, $6, true )->addQualifiers( $2 ); }1842 1832 | aggregate_key attribute_list_opt '(' type_list ')' '{' field_declaration_list_opt '}' // CFA 1843 1833 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), $4, $7, false )->addQualifiers( $2 ); } … … 1848 1838 aggregate_key attribute_list_opt no_attr_identifier 1849 1839 { 1850 typedefTable.makeTypedef( *$3 , forall ? TYPEGENname : TYPEDEFname);1851 //if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update1840 typedefTable.makeTypedef( *$3 ); 1841 if ( forall ) typedefTable.changeKind( *$3, TYPEGENname ); // possibly update 1852 1842 forall = false; // reset 1853 1843 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1854 1844 } 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 1856 1851 { 1857 1852 // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is … … 1948 1943 ENUM attribute_list_opt '{' enumerator_list comma_opt '}' 1949 1944 { $$ = 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 1951 1946 { typedefTable.makeTypedef( *$3 ); } 1952 1947 '{' enumerator_list comma_opt '}' 1953 1948 { $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); } 1954 | ENUM attribute_list_opt type_name1955 '{' enumerator_list comma_opt '}'1956 { $$ = DeclarationNode::newEnum( $3->type->symbolic.name, $5, true )->addQualifiers( $2 ); }1957 1949 | enum_type_nobody 1958 1950 ; 1959 1951 1960 1952 enum_type_nobody: // enum - {...} 1961 ENUM attribute_list_opt no_attr_identifier 1953 ENUM attribute_list_opt no_attr_identifier_or_type_name 1962 1954 { 1963 1955 typedefTable.makeTypedef( *$3 ); 1964 1956 $$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 ); 1965 }1966 | ENUM attribute_list_opt type_name1967 {1968 typedefTable.makeTypedef( *$3->type->symbolic.name );1969 $$ = DeclarationNode::newEnum( $3->type->symbolic.name, 0, false )->addQualifiers( $2 );1970 1957 } 1971 1958 ; … … 3264 3251 3265 3252 %% 3266 3267 3253 // ----end of grammar---- 3268 3254
Note:
See TracChangeset
for help on using the changeset viewer.