Changeset 6a490b2 for src/Parser/parser.yy
- Timestamp:
- May 11, 2020, 1:53:29 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 504a7dc
- Parents:
- b7d6a36 (diff), a7b486b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rb7d6a36 r6a490b2 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 08:22:14202013 // Update Count : 44 6112 // Last Modified On : Mon Apr 27 12:25:42 2020 13 // Update Count : 4483 14 14 // 15 15 … … 278 278 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA 279 279 %token SIZEOF OFFSETOF 280 // %token SUSPEND RESUME // CFA 280 // %token RESUME // CFA 281 %token SUSPEND // CFA 281 282 %token ATTRIBUTE EXTENSION // GCC 282 283 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN … … 918 919 conditional_expression 919 920 | unary_expression assignment_operator assignment_expression 920 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 921 { 922 if ( $2 == OperKinds::AtAssn ) { 923 SemanticError( yylloc, "C @= assignment is currently unimplemented." ); $$ = nullptr; 924 } else { 925 $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); 926 } // if 927 } 921 928 | unary_expression '=' '{' initializer_list_opt comma_opt '}' 922 929 { SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } … … 959 966 960 967 tuple_expression_list: 961 assignment_expression_opt 962 | tuple_expression_list ',' assignment_expression_opt 968 assignment_expression 969 | '@' // CFA 970 { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; } 971 | tuple_expression_list ',' assignment_expression 963 972 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 973 | tuple_expression_list ',' '@' 974 { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; } 964 975 ; 965 976 … … 1259 1270 | RETURN '{' initializer_list_opt comma_opt '}' ';' 1260 1271 { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } 1261 // | SUSPEND ';' 1262 // { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; } 1263 // | SUSPEND compound_statement ';' 1264 // { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; } 1272 | SUSPEND ';' 1273 { $$ = new StatementNode( build_suspend( nullptr ) ); } 1274 | SUSPEND compound_statement 1275 { $$ = new StatementNode( build_suspend( $2 ) ); } 1276 | SUSPEND COROUTINE ';' 1277 { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Coroutine ) ); } 1278 | SUSPEND COROUTINE compound_statement 1279 { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Coroutine ) ); } 1280 | SUSPEND GENERATOR ';' 1281 { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Generator ) ); } 1282 | SUSPEND GENERATOR compound_statement 1283 { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Generator ) ); } 1265 1284 | THROW assignment_expression_opt ';' // handles rethrow 1266 1285 { $$ = new StatementNode( build_throw( $2 ) ); } … … 1589 1608 // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be 1590 1609 // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name. 1591 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1610 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt 1592 1611 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 1593 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ) ; }1594 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1595 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ) ; }1612 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); } 1613 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt 1614 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 )->addQualifiers( $8 ); } 1596 1615 ; 1597 1616 … … 2077 2096 aggregate_control: // CFA 2078 2097 GENERATOR 2079 { yyy = true; $$ = AggregateDecl::Coroutine; } 2098 { yyy = true; $$ = AggregateDecl::Generator; } 2099 | MONITOR GENERATOR 2100 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2080 2101 | COROUTINE 2081 2102 { yyy = true; $$ = AggregateDecl::Coroutine; } 2082 2103 | MONITOR 2083 2104 { yyy = true; $$ = AggregateDecl::Monitor; } 2105 | MONITOR COROUTINE 2106 { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2084 2107 | THREAD 2085 2108 { yyy = true; $$ = AggregateDecl::Thread; } 2109 | MONITOR THREAD 2110 { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2086 2111 ; 2087 2112
Note:
See TracChangeset
for help on using the changeset viewer.