Changeset db70fe4 for src/Parser/parser.yy
- Timestamp:
- Sep 15, 2017, 9:03:38 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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, resolv-new, with_gc
- Children:
- 3e3d923
- Parents:
- ba54f7d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
rba54f7d rdb70fe4 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 13 11:01:20201713 // Update Count : 28 0312 // Last Modified On : Thu Sep 14 23:07:12 2017 13 // Update Count : 2815 14 14 // 15 15 … … 563 563 switch ( $1 ) { 564 564 case OperKinds::AddressOf: 565 $$ = new ExpressionNode( build_addressOf( $2) );565 $$ = new ExpressionNode( new AddressExpr( maybeMoveBuild< Expression >( $2 ) ) ); 566 566 break; 567 567 case OperKinds::PointTo: … … 569 569 break; 570 570 case OperKinds::And: 571 $$ = new ExpressionNode( new AddressExpr( build_addressOf( $2) ) );571 $$ = new ExpressionNode( new AddressExpr( new AddressExpr( maybeMoveBuild< Expression >( $2 ) ) ) ); 572 572 break; 573 573 default: … … 582 582 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::Decr, $2 ) ); } 583 583 | SIZEOF unary_expression 584 { $$ = new ExpressionNode( build_sizeOfexpr( $2) ); }584 { $$ = new ExpressionNode( new SizeofExpr( maybeMoveBuild< Expression >( $2 ) ) ); } 585 585 | SIZEOF '(' type_no_function ')' 586 { $$ = new ExpressionNode( build_sizeOftype( $3) ); }586 { $$ = new ExpressionNode( new SizeofExpr( maybeMoveBuildType( $3 ) ) ); } 587 587 | ALIGNOF unary_expression // GCC, variable alignment 588 { $$ = new ExpressionNode( build_alignOfexpr( $2) ); }588 { $$ = new ExpressionNode( new AlignofExpr( maybeMoveBuild< Expression >( $2 ) ) ); } 589 589 | ALIGNOF '(' type_no_function ')' // GCC, type alignment 590 { $$ = new ExpressionNode( build_alignOftype( $3) ); }590 { $$ = new ExpressionNode( new AlignofExpr( maybeMoveBuildType( $3 ) ) ); } 591 591 | OFFSETOF '(' type_no_function ',' no_attr_identifier ')' 592 592 { $$ = new ExpressionNode( build_offsetOf( $3, build_varref( $5 ) ) ); } 593 593 | ATTR_IDENTIFIER 594 { $$ = new ExpressionNode( build_attrexpr( build_varref( $1 ), nullptr) ); }594 { $$ = new ExpressionNode( new AttrExpr( build_varref( $1 ), maybeMoveBuild< Expression >( (ExpressionNode *)nullptr ) ) ); } 595 595 | ATTR_IDENTIFIER '(' argument_expression ')' 596 { $$ = new ExpressionNode( build_attrexpr( build_varref( $1 ), $3) ); }596 { $$ = new ExpressionNode( new AttrExpr( build_varref( $1 ), maybeMoveBuild< Expression >( $3 ) ) ); } 597 597 | ATTR_IDENTIFIER '(' type ')' 598 { $$ = new ExpressionNode( build_attrtype( build_varref( $1 ), $3) ); }598 { $$ = new ExpressionNode( new AttrExpr( build_varref( $1 ), maybeMoveBuildType( $3 ) ) ); } 599 599 ; 600 600 … … 895 895 constant_expression { $$ = $1; } 896 896 | constant_expression ELLIPSIS constant_expression // GCC, subrange 897 { $$ = new ExpressionNode( build_range( $1, $3) ); }897 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $1 ), maybeMoveBuild< Expression >( $3 ) ) ); } 898 898 | subrange // CFA, subrange 899 899 ; … … 2089 2089 { $$ = $3; } 2090 2090 | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements 2091 { $$ = new ExpressionNode( build_range( $3, $5) ); }2091 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $3 ), maybeMoveBuild< Expression >( $5 ) ) ); } 2092 2092 | '.' '[' push field_list pop ']' // CFA, tuple field selector 2093 2093 { $$ = $4; } … … 2407 2407 subrange: 2408 2408 constant_expression '~' constant_expression // CFA, integer subrange 2409 { $$ = new ExpressionNode( build_range( $1, $3) ); }2409 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $1 ), maybeMoveBuild< Expression >( $3 ) ) ); } 2410 2410 ; 2411 2411
Note: See TracChangeset
for help on using the changeset viewer.