Changeset 407bde5
- Timestamp:
- Jun 6, 2018, 5:24:52 PM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 5c25eee
- Parents:
- 25bca42
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r25bca42 r407bde5 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 4 22:22:04201813 // Update Count : 3 49212 // Last Modified On : Wed Jun 6 14:53:38 2018 13 // Update Count : 3522 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; } 505 // { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 506 { $$ = nullptr; } 506 507 | type_name '.' '[' field_list ']' // CFA, nested type / tuple field selector 507 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 508 // { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 509 { $$ = nullptr; } 508 510 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 509 511 { … … 1300 1302 ; 1301 1303 1302 KR_parameter_list_opt: // used to declare parameter types in K&R style functions1304 KR_parameter_list_opt: // used to declare parameter types in K&R style functions 1303 1305 // empty 1304 1306 { $$ = nullptr; } … … 1790 1792 { $$ = DeclarationNode::newFromTypedef( $1 ); } 1791 1793 | '.' TYPEDEFname 1792 { $$ = DeclarationNode::newFromTypedef( $2 ); } // FIX ME1794 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 1793 1795 | type_name '.' TYPEDEFname 1794 { $$ = DeclarationNode::newFromTypedef( $3 ); } // FIX ME1796 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 1795 1797 | typegen_name 1796 1798 | '.' typegen_name 1797 { $$ = $2; } // FIX ME1799 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 1798 1800 | type_name '.' typegen_name 1799 { $$ = $3; } // FIX ME1801 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 1800 1802 ; 1801 1803 … … 1822 1824 aggregate_key attribute_list_opt '{' field_declaration_list_opt '}' 1823 1825 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), nullptr, $4, true )->addQualifiers( $2 ); } 1824 | aggregate_key attribute_list_opt no_attr_identifier _or_type_name1826 | aggregate_key attribute_list_opt no_attr_identifier 1825 1827 { 1826 1828 typedefTable.makeTypedef( *$3 ); // create typedef … … 1830 1832 '{' field_declaration_list_opt '}' 1831 1833 { $$ = 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 ); // 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 ); } 1832 1842 | aggregate_key attribute_list_opt '(' type_list ')' '{' field_declaration_list_opt '}' // CFA 1833 1843 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), $4, $7, false )->addQualifiers( $2 ); } … … 1843 1853 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1844 1854 } 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 1855 | aggregate_key attribute_list_opt type_name 1851 1856 { 1852 1857 // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is … … 1943 1948 ENUM attribute_list_opt '{' enumerator_list comma_opt '}' 1944 1949 { $$ = DeclarationNode::newEnum( new string( DeclarationNode::anonymous.newName() ), $4, true )->addQualifiers( $2 ); } 1945 | ENUM attribute_list_opt no_attr_identifier _or_type_name1950 | ENUM attribute_list_opt no_attr_identifier 1946 1951 { typedefTable.makeTypedef( *$3 ); } 1947 1952 '{' enumerator_list comma_opt '}' 1948 1953 { $$ = 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 ); } 1949 1957 | enum_type_nobody 1950 1958 ; 1951 1959 1952 1960 enum_type_nobody: // enum - {...} 1953 ENUM attribute_list_opt no_attr_identifier _or_type_name1961 ENUM attribute_list_opt no_attr_identifier 1954 1962 { 1955 1963 typedefTable.makeTypedef( *$3 ); 1956 1964 $$ = 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 ); 1957 1970 } 1958 1971 ;
Note: See TracChangeset
for help on using the changeset viewer.