Changes in src/Parser/parser.yy [0a6d8204:60a8062]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r0a6d8204 r60a8062 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 27 12:25:42202013 // Update Count : 44 8312 // Last Modified On : Sun Feb 16 08:22:14 2020 13 // Update Count : 4461 14 14 // 15 15 … … 278 278 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA 279 279 %token SIZEOF OFFSETOF 280 // %token RESUME // CFA 281 %token SUSPEND // CFA 280 // %token SUSPEND RESUME // CFA 282 281 %token ATTRIBUTE EXTENSION // GCC 283 282 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN … … 919 918 conditional_expression 920 919 | unary_expression assignment_operator assignment_expression 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 } 920 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 928 921 | unary_expression '=' '{' initializer_list_opt comma_opt '}' 929 922 { SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } … … 966 959 967 960 tuple_expression_list: 968 assignment_expression 969 | '@' // CFA 970 { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; } 971 | tuple_expression_list ',' assignment_expression 961 assignment_expression_opt 962 | tuple_expression_list ',' assignment_expression_opt 972 963 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 973 | tuple_expression_list ',' '@'974 { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }975 964 ; 976 965 … … 1270 1259 | RETURN '{' initializer_list_opt comma_opt '}' ';' 1271 1260 { SemanticError( yylloc, "Initializer return 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 ) ); } 1261 // | SUSPEND ';' 1262 // { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; } 1263 // | SUSPEND compound_statement ';' 1264 // { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; } 1284 1265 | THROW assignment_expression_opt ';' // handles rethrow 1285 1266 { $$ = new StatementNode( build_throw( $2 ) ); } … … 1608 1589 // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be 1609 1590 // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name. 1610 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' attribute_list_opt1591 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1611 1592 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 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_opt1614 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ) ->addQualifiers( $8 ); }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 ); } 1615 1596 ; 1616 1597 … … 2096 2077 aggregate_control: // CFA 2097 2078 GENERATOR 2098 { yyy = true; $$ = AggregateDecl::Generator; } 2099 | MONITOR GENERATOR 2100 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2079 { yyy = true; $$ = AggregateDecl::Coroutine; } 2101 2080 | COROUTINE 2102 2081 { yyy = true; $$ = AggregateDecl::Coroutine; } 2103 2082 | MONITOR 2104 2083 { yyy = true; $$ = AggregateDecl::Monitor; } 2105 | MONITOR COROUTINE2106 { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }2107 2084 | THREAD 2108 2085 { yyy = true; $$ = AggregateDecl::Thread; } 2109 | MONITOR THREAD2110 { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }2111 2086 ; 2112 2087
Note:
See TracChangeset
for help on using the changeset viewer.