Changes in src/Parser/parser.yy [a491a3c:0a6d8204]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
ra491a3c r0a6d8204 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu May 28 12:11:45202013 // Update Count : 4 50012 // Last Modified On : Mon Apr 27 12:25:42 2020 13 // Update Count : 4483 14 14 // 15 15 … … 329 329 %type<en> conditional_expression constant_expression assignment_expression assignment_expression_opt 330 330 %type<en> comma_expression comma_expression_opt 331 %type<en> argument_expression_list _optargument_expression default_initialize_opt331 %type<en> argument_expression_list argument_expression default_initialize_opt 332 332 %type<ifctl> if_control_expression 333 333 %type<fctl> for_control_expression for_control_expression_list … … 624 624 // equivalent to the old x[i,j]. 625 625 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); } 626 | postfix_expression '{' argument_expression_list _opt'}' // CFA, constructor call626 | postfix_expression '{' argument_expression_list '}' // CFA, constructor call 627 627 { 628 628 Token fn; … … 630 630 $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) ); 631 631 } 632 | postfix_expression '(' argument_expression_list _opt')'632 | postfix_expression '(' argument_expression_list ')' 633 633 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } 634 634 | postfix_expression '`' identifier // CFA, postfix call … … 662 662 | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal 663 663 { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); } 664 | '^' primary_expression '{' argument_expression_list _opt'}' // CFA, destructor call664 | '^' primary_expression '{' argument_expression_list '}' // CFA, destructor call 665 665 { 666 666 Token fn; … … 670 670 ; 671 671 672 argument_expression_list _opt:672 argument_expression_list: 673 673 // empty 674 674 { $$ = nullptr; } 675 675 | argument_expression 676 | argument_expression_list _opt',' argument_expression676 | argument_expression_list ',' argument_expression 677 677 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 678 678 ; … … 1196 1196 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1197 1197 OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1198 | '=' comma_expression // CFA1198 | '=' comma_expression // CFA 1199 1199 { $$ = forCtrl( $2, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1200 1200 OperKinds::LEThan, $2->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } … … 1203 1203 | comma_expression inclexcl comma_expression '~' comma_expression // CFA 1204 1204 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } 1205 | comma_expression ';' // CFA1206 { $$ = forCtrl( new ExpressionNode( build_constantInteger( *new string( "0u" ) ) ), $1, nullptr, OperKinds::LThan, nullptr, nullptr ); }1207 1205 | comma_expression ';' comma_expression // CFA 1208 1206 { $$ = forCtrl( $3, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1209 1207 OperKinds::LThan, $3->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1210 | comma_expression ';' '=' comma_expression // CFA1208 | comma_expression ';' '=' comma_expression // CFA 1211 1209 { $$ = forCtrl( $4, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1212 1210 OperKinds::LEThan, $4->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } … … 1306 1304 // If MUTEX becomes a general qualifier, there are shift/reduce conflicts, so change syntax to "with mutex". 1307 1305 mutex_statement: 1308 MUTEX '(' argument_expression_list _opt')' statement1306 MUTEX '(' argument_expression_list ')' statement 1309 1307 { SemanticError( yylloc, "Mutex statement is currently unimplemented." ); $$ = nullptr; } 1310 1308 ; … … 1323 1321 WAITFOR '(' cast_expression ')' 1324 1322 { $$ = $3; } 1325 // | WAITFOR '(' cast_expression ',' argument_expression_list _opt')'1323 // | WAITFOR '(' cast_expression ',' argument_expression_list ')' 1326 1324 // { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1327 | WAITFOR '(' cast_expression_list ':' argument_expression_list _opt')'1325 | WAITFOR '(' cast_expression_list ':' argument_expression_list ')' 1328 1326 { $$ = (ExpressionNode *)($3->set_last( $5 )); } 1329 1327 ; … … 1332 1330 cast_expression 1333 1331 | cast_expression_list ',' cast_expression 1334 // { $$ = (ExpressionNode *)($1->set_last( $3 )); } 1335 { SemanticError( yylloc, "List of mutex member is currently unimplemented." ); $$ = nullptr; } 1332 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 1336 1333 ; 1337 1334 … … 2098 2095 2099 2096 aggregate_control: // CFA 2100 MONITOR 2101 { yyy = true; $$ = AggregateDecl::Monitor; } 2102 | MUTEX STRUCT 2103 { yyy = true; $$ = AggregateDecl::Monitor; } 2104 | GENERATOR 2097 GENERATOR 2105 2098 { yyy = true; $$ = AggregateDecl::Generator; } 2106 | M UTEXGENERATOR2099 | MONITOR GENERATOR 2107 2100 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2108 2101 | COROUTINE 2109 2102 { yyy = true; $$ = AggregateDecl::Coroutine; } 2110 | MUTEX COROUTINE 2103 | MONITOR 2104 { yyy = true; $$ = AggregateDecl::Monitor; } 2105 | MONITOR COROUTINE 2111 2106 { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2112 2107 | THREAD 2113 2108 { yyy = true; $$ = AggregateDecl::Thread; } 2114 | M UTEXTHREAD2109 | MONITOR THREAD 2115 2110 { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; } 2116 2111 ; … … 2779 2774 | attr_name 2780 2775 { $$ = DeclarationNode::newAttribute( $1 ); } 2781 | attr_name '(' argument_expression_list _opt')'2776 | attr_name '(' argument_expression_list ')' 2782 2777 { $$ = DeclarationNode::newAttribute( $1, $3 ); } 2783 2778 ;
Note:
See TracChangeset
for help on using the changeset viewer.