Changeset a32b204 for translator/SynTree/Expression.cc
- Timestamp:
- May 17, 2015, 1:19:35 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:
- 0dd3a2f
- Parents:
- b87a5ed
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/Expression.cc
rb87a5ed ra32b204 32 32 Expression::add_result( Type *t ) 33 33 { 34 if ( TupleType *tuple = dynamic_cast< TupleType* >( t ) ) {34 if ( TupleType *tuple = dynamic_cast< TupleType* >( t ) ) { 35 35 std::copy( tuple->get_types().begin(), tuple->get_types().end(), back_inserter( results ) ); 36 36 } else { … … 40 40 41 41 void Expression::print(std::ostream &os, int indent) const { 42 if ( env ) {42 if ( env ) { 43 43 os << std::string(indent, ' ') << "with environment:" << std::endl; 44 44 env->print( os, indent+2 ); 45 45 } 46 46 47 if ( argName ) {47 if ( argName ) { 48 48 os << std::string(indent, ' ') << "with designator:"; 49 49 argName->print( os, indent+2 ); … … 75 75 { 76 76 add_result( var->get_type()->clone() ); 77 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {77 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) { 78 78 (*i)->set_isLvalue( true ); 79 79 } … … 94 94 95 95 Declaration *decl = get_var(); 96 // if ( decl != 0) decl->print(os, indent + 2);97 if ( decl != 0) decl->printShort(os, indent + 2);96 // if ( decl != 0) decl->print(os, indent + 2); 97 if ( decl != 0) decl->printShort(os, indent + 2); 98 98 os << std::endl; 99 99 Expression::print( os, indent ); … … 126 126 os << std::string(indent, ' ') << "Sizeof Expression on: "; 127 127 128 if (isType)128 if (isType) 129 129 type->print(os, indent + 2); 130 130 else … … 160 160 os << std::string(indent, ' ') << "Attr "; 161 161 attr->print( os, indent + 2 ); 162 if ( isType || expr ) {162 if ( isType || expr ) { 163 163 os << "applied to: "; 164 164 165 if (isType)165 if (isType) 166 166 type->print(os, indent + 2); 167 167 else … … 197 197 arg->print(os, indent+2); 198 198 os << std::endl << std::string(indent, ' ') << "to:" << std::endl; 199 if ( results.empty() ) {199 if ( results.empty() ) { 200 200 os << std::string(indent+2, ' ') << "nothing" << std::endl; 201 201 } else { … … 233 233 { 234 234 add_result( member->get_type()->clone() ); 235 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {235 for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) { 236 236 (*i)->set_isLvalue( true ); 237 237 } … … 287 287 void UntypedExpr::printArgs(std::ostream &os, int indent ) const { 288 288 std::list<Expression *>::const_iterator i; 289 for (i = args.begin(); i != args.end(); i++)289 for (i = args.begin(); i != args.end(); i++) 290 290 (*i)->print(os, indent); 291 291 } … … 362 362 { 363 363 os << std::string(indent, ' ') << "Valof Expression: " << std::endl; 364 if ( get_body() != 0 )364 if ( get_body() != 0 ) 365 365 get_body()->print( os, indent + 2 ); 366 366 }
Note: See TracChangeset
for help on using the changeset viewer.