- Timestamp:
- Jan 17, 2020, 2:57:01 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- cca568e
- Parents:
- 768bd556
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r768bd556 r4a063df 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 16 15:32:58 201913 // Update Count : 44 0912 // Last Modified On : Fri Jan 17 14:54:55 2020 13 // Update Count : 4426 14 14 // 15 15 … … 323 323 %type<op> ptrref_operator unary_operator assignment_operator 324 324 %type<en> primary_expression postfix_expression unary_expression 325 %type<en> cast_expression exponential_expression multiplicative_expression additive_expression325 %type<en> cast_expression_list cast_expression exponential_expression multiplicative_expression additive_expression 326 326 %type<en> shift_expression relational_expression equality_expression 327 327 %type<en> AND_expression exclusive_OR_expression inclusive_OR_expression … … 679 679 | argument_expression 680 680 | argument_expression_list ',' argument_expression 681 { $$ = (ExpressionNode *)( 681 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 682 682 ; 683 683 … … 691 691 field_name_list: // CFA, tuple field selector 692 692 field 693 | field_name_list ',' field { $$ = (ExpressionNode *) $1->set_last( $3); }693 | field_name_list ',' field { $$ = (ExpressionNode *)($1->set_last( $3 )); } 694 694 ; 695 695 … … 960 960 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $3 ) ) ); } 961 961 | '[' push assignment_expression pop ',' tuple_expression_list ']' 962 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *) $3->set_last( $6 ) )); }962 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)($3->set_last( $6 ) ) )); } 963 963 ; 964 964 … … 966 966 assignment_expression_opt 967 967 | tuple_expression_list ',' assignment_expression_opt 968 { $$ = (ExpressionNode *) $1->set_last( $3); }968 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 969 969 ; 970 970 … … 1307 1307 WAITFOR '(' cast_expression ')' 1308 1308 { $$ = $3; } 1309 | WAITFOR '(' cast_expression ',' argument_expression_list ')' 1310 { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1309 // | WAITFOR '(' cast_expression ',' argument_expression_list ')' 1310 // { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1311 | WAITFOR '(' cast_expression_list ':' argument_expression_list ')' 1312 { $$ = (ExpressionNode *)($3->set_last( $5 )); } 1313 ; 1314 1315 cast_expression_list: 1316 cast_expression 1317 | cast_expression_list ',' cast_expression 1318 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 1311 1319 ; 1312 1320 … … 1419 1427 asm_operand 1420 1428 | asm_operands_list ',' asm_operand 1421 { $$ = (ExpressionNode *) $1->set_last( $3); }1429 { $$ = (ExpressionNode *)($1->set_last( $3 )); } 1422 1430 ; 1423 1431 … … 1435 1443 { $$ = new ExpressionNode( $1 ); } 1436 1444 | asm_clobbers_list_opt ',' string_literal 1437 // set_last returns ParseNode * 1438 { $$ = (ExpressionNode *)$1->set_last( new ExpressionNode( $3 ) ); } 1445 { $$ = (ExpressionNode *)($1->set_last( new ExpressionNode( $3 ) )); } 1439 1446 ; 1440 1447 … … 2359 2366 | initializer_list_opt ',' initializer { $$ = (InitializerNode *)( $1->set_last( $3 ) ); } 2360 2367 | initializer_list_opt ',' designation initializer 2361 { $$ = (InitializerNode *)( $1->set_last( $4->set_designators( $3 ) )); }2368 { $$ = (InitializerNode *)($1->set_last( $4->set_designators( $3 ) )); } 2362 2369 ; 2363 2370 … … 2381 2388 designator 2382 2389 | designator_list designator 2383 { $$ = (ExpressionNode *)( $1->set_last( $2 )); }2390 { $$ = (ExpressionNode *)($1->set_last( $2 )); } 2384 2391 //| designator_list designator { $$ = new ExpressionNode( $1, $2 ); } 2385 2392 ; … … 2478 2485 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $1->build()) ); $$ = nullptr; } 2479 2486 | type_list ',' type 2480 { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) )); }2487 { $$ = (ExpressionNode *)($1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) )); } 2481 2488 | type_list ',' assignment_expression 2482 2489 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $3->build()) ); $$ = nullptr; }
Note: See TracChangeset
for help on using the changeset viewer.