Changeset a08ba92 for translator/Parser/ExpressionNode.cc
- Timestamp:
- May 19, 2015, 4:58:14 PM (11 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 843054c2
- Parents:
- 01aeade
- File:
-
- 1 edited
-
translator/Parser/ExpressionNode.cc (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
translator/Parser/ExpressionNode.cc
r01aeade ra08ba92 81 81 } 82 82 83 CommaExprNode *ExpressionNode::add_to_list( ExpressionNode *exp ) {83 CommaExprNode *ExpressionNode::add_to_list( ExpressionNode *exp ) { 84 84 return new CommaExprNode( this, exp ); 85 85 } … … 111 111 } 112 112 113 void ConstantNode::classify( std::string &str ) {114 switch ( type ) {113 void ConstantNode::classify( std::string &str ) { 114 switch ( type ) { 115 115 case Integer: 116 116 case Float: … … 130 130 std::transform( sfx.begin(), sfx.end(), sfx.begin(), tolower_hack ); 131 131 132 if ( sfx.find("ll") != string::npos ) {132 if ( sfx.find("ll") != string::npos ) { 133 133 longs = 2; 134 } else if ( sfx.find("l") != string::npos ) {134 } else if ( sfx.find("l") != string::npos ) { 135 135 longs = 1; 136 136 } // if … … 163 163 ConstantNode *ConstantNode::append( std::string *newValue ) { 164 164 if ( newValue ) { 165 if ( type == String ) {165 if ( type == String ) { 166 166 std::string temp = *newValue; 167 167 value.resize( value.size() - 1 ); … … 209 209 BasicType *bt; 210 210 211 switch ( get_type()) {211 switch ( get_type()) { 212 212 case Integer: 213 213 /* Cfr. standard 6.4.4.1 */ … … 354 354 return new UntypedExpr( function->build(), args, maybeBuild< Expression >( get_argName() )); 355 355 } else { 356 switch ( op->get_type()) {356 switch ( op->get_type()) { 357 357 case OperatorNode::Incr: 358 358 case OperatorNode::Decr: … … 563 563 } 564 564 565 void CompositeExprNode::set_function( ExpressionNode *f ) {565 void CompositeExprNode::set_function( ExpressionNode *f ) { 566 566 function = f; 567 567 } 568 568 569 void CompositeExprNode::set_args( ExpressionNode *args ) {569 void CompositeExprNode::set_args( ExpressionNode *args ) { 570 570 arguments = args; 571 571 } … … 579 579 } 580 580 581 void CompositeExprNode::add_arg( ExpressionNode *arg ) {581 void CompositeExprNode::add_arg( ExpressionNode *arg ) { 582 582 if ( arguments ) 583 583 arguments->set_link( arg ); … … 594 594 } 595 595 596 CommaExprNode *CommaExprNode::add_to_list( ExpressionNode *exp ) {596 CommaExprNode *CommaExprNode::add_to_list( ExpressionNode *exp ) { 597 597 add_arg( exp ); 598 598 … … 646 646 } 647 647 648 ForCtlExprNode::~ForCtlExprNode() {648 ForCtlExprNode::~ForCtlExprNode() { 649 649 delete init; 650 650 delete condition;
Note:
See TracChangeset
for help on using the changeset viewer.