Changes in src/Parser/parser.yy [513e165:ea0c5e3]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r513e165 rea0c5e3 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:20 201713 // Update Count : 2 80312 // Last Modified On : Mon Sep 11 18:12:00 2017 13 // Update Count : 2787 14 14 // 15 15 … … 56 56 #include "LinkageSpec.h" 57 57 #include "Common/SemanticError.h" // error_str 58 #include "Common/utility.h" // for maybeMoveBuild, maybeBuild, CodeLo...59 58 60 59 extern DeclarationNode * parseTree; … … 439 438 { $$ = $2; } 440 439 | '(' compound_statement ')' // GCC, lambda expression 441 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) )) ); }440 { $$ = new ExpressionNode( build_valexpr( $2 ) ); } 442 441 | primary_expression '{' argument_expression_list '}' // CFA, constructor call 443 442 { … … 619 618 // VIRTUAL cannot be opt because of look ahead issues 620 619 | '(' VIRTUAL ')' cast_expression 621 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $4 ), maybeMoveBuildType( nullptr )) ); }620 { $$ = new ExpressionNode( build_virtual_cast( nullptr, $4 ) ); } 622 621 | '(' VIRTUAL type_no_function ')' cast_expression 623 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $5 ), maybeMoveBuildType( $3 )) ); }622 { $$ = new ExpressionNode( build_virtual_cast( $3, $5 ) ); } 624 623 // | '(' type_no_function ')' tuple 625 624 // { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } … … 772 771 assignment_expression 773 772 | comma_expression ',' assignment_expression 774 { $$ = new ExpressionNode( new CommaExpr( maybeMoveBuild< Expression >( $1 ), maybeMoveBuild< Expression >( $3 )) ); }773 { $$ = new ExpressionNode( build_comma( $1, $3 ) ); } 775 774 ; 776 775 … … 1155 1154 asm_operand: // GCC 1156 1155 string_literal '(' constant_expression ')' 1157 { $$ = new ExpressionNode( new AsmExpr( maybeMoveBuild< Expression >( (ExpressionNode *)nullptr ), $1, maybeMoveBuild< Expression >( $3 )) ); }1156 { $$ = new ExpressionNode( build_asmexpr( 0, $1, $3 ) ); } 1158 1157 | '[' constant_expression ']' string_literal '(' constant_expression ')' 1159 { $$ = new ExpressionNode( new AsmExpr( maybeMoveBuild< Expression >( $2 ), $4, maybeMoveBuild< Expression >( $6 )) ); }1158 { $$ = new ExpressionNode( build_asmexpr( $2, $4, $6 ) ); } 1160 1159 ; 1161 1160 … … 1166 1165 { $$ = new ExpressionNode( $1 ); } 1167 1166 | asm_clobbers_list_opt ',' string_literal 1168 // set_last return sParseNode *1167 // set_last return ParseNode * 1169 1168 { $$ = (ExpressionNode *)$1->set_last( new ExpressionNode( $3 ) ); } 1170 1169 ; … … 2166 2165 type_list: // CFA 2167 2166 type 2168 { $$ = new ExpressionNode( new TypeExpr( maybeMoveBuildType( $1 )) ); }2167 { $$ = new ExpressionNode( build_typevalue( $1 ) ); } 2169 2168 | assignment_expression 2170 2169 | type_list ',' type 2171 { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 )) ) ) ); }2170 { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( build_typevalue( $3 ) ) ) ); } 2172 2171 | type_list ',' assignment_expression 2173 2172 { $$ = (ExpressionNode *)( $1->set_last( $3 )); }
Note:
See TracChangeset
for help on using the changeset viewer.