Changeset 7f5566b for src/Parser/ExpressionNode.cc
- Timestamp:
- Jul 30, 2015, 3:56:18 PM (9 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:
- 093f1a0
- Parents:
- 51b986f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
r51b986f r7f5566b 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:17:07 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Wed Jun 24 16:20:00201513 // Update Count : 1 5811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 30 14:53:23 2015 13 // Update Count : 188 14 14 // 15 15 … … 42 42 } 43 43 44 ExpressionNode * ExpressionNode::set_a sArgName( const std::string *aName ) {44 ExpressionNode * ExpressionNode::set_argName( const std::string *aName ) { 45 45 argName = new VarRefNode( aName ); 46 46 return this; 47 47 } 48 48 49 ExpressionNode * ExpressionNode::set_a sArgName( ExpressionNode *aDesignator ) {49 ExpressionNode * ExpressionNode::set_argName( ExpressionNode *aDesignator ) { 50 50 argName = aDesignator; 51 51 return this; … … 210 210 assert( type == String ); 211 211 212 // "abc" "def" "ghi" => "abcdefghi", soremove new text from quotes and insert before last quote in old string.212 // "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string. 213 213 value.insert( value.length() - 1, newValue->substr( 1, newValue->length() - 2 ) ); 214 214 … … 330 330 //############################################################################## 331 331 332 CompositeExprNode::CompositeExprNode( void) : ExpressionNode(), function( 0 ), arguments( 0 ) {332 CompositeExprNode::CompositeExprNode() : ExpressionNode(), function( 0 ), arguments( 0 ) { 333 333 } 334 334 … … 541 541 { 542 542 assert( args.size() == 3); 543 std::list< Expression * >::const_iterator i = args.begin();543 std::list< Expression * >::const_iterator i = args.begin(); 544 544 Expression *arg1 = notZeroExpr( *i++ ); 545 545 Expression *arg2 = *i++; … … 552 552 { 553 553 assert( args.size() == 2); 554 std::list< Expression * >::const_iterator i = args.begin();554 std::list< Expression * >::const_iterator i = args.begin(); 555 555 Expression *ret = *i++; 556 556 while ( i != args.end() ) { … … 617 617 set_args( arg ); 618 618 } 619 620 //############################################################################## 621 622 Expression *AsmExprNode::build() const { 623 return new AsmExpr( maybeBuild< Expression >( inout ), (ConstantExpr *)constraint->build(), operand->build() ); 624 } 625 626 void AsmExprNode::print( std::ostream &os, int indent ) const { 627 os << string( indent, ' ' ) << "Assembler Expression:" << endl; 628 if ( inout ) { 629 os << string( indent, ' ' ) << "inout: " << std::endl; 630 inout->print( os, indent + 2 ); 631 } // if 632 if ( constraint ) { 633 os << string( indent, ' ' ) << "constraint: " << std::endl; 634 constraint->print( os, indent + 2 ); 635 } // if 636 if ( operand ) { 637 os << string( indent, ' ' ) << "operand: " << std::endl; 638 operand->print( os, indent + 2 ); 639 } // if 640 } 641 642 void AsmExprNode::printOneLine( std::ostream &os, int indent ) const { 643 printDesignation( os ); 644 os << "( "; 645 if ( inout ) inout->printOneLine( os, indent + 2 ); 646 os << ", "; 647 if ( constraint ) constraint->printOneLine( os, indent + 2 ); 648 os << ", "; 649 if ( operand ) operand->printOneLine( os, indent + 2 ); 650 os << ") "; 651 } 652 653 //############################################################################## 654 655 void LabelNode::print( std::ostream &os, int indent ) const {} 656 657 void LabelNode::printOneLine( std::ostream &os, int indent ) const {} 619 658 620 659 //##############################################################################
Note: See TracChangeset
for help on using the changeset viewer.