Changeset 44b5ca0 for src/SynTree/Expression.cc
- Timestamp:
- Jun 5, 2015, 8:12:32 AM (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:
- a65d92e
- Parents:
- cf0941d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
rcf0941d r44b5ca0 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 4 21:42:55201513 // Update Count : 1 012 // Last Modified On : Fri Jun 5 07:51:09 2015 13 // Update Count : 11 14 14 // 15 15 … … 93 93 94 94 void VariableExpr::print( std::ostream &os, int indent ) const { 95 os << std::string( indent, ' ') << "Variable Expression: ";95 os << std::string( indent, ' ' ) << "Variable Expression: "; 96 96 97 97 Declaration *decl = get_var(); … … 122 122 123 123 void SizeofExpr::print( std::ostream &os, int indent) const { 124 os << std::string( indent, ' ') << "Sizeof Expression on: ";124 os << std::string( indent, ' ' ) << "Sizeof Expression on: "; 125 125 126 126 if (isType) … … 152 152 153 153 void AttrExpr::print( std::ostream &os, int indent) const { 154 os << std::string( indent, ' ') << "Attr ";154 os << std::string( indent, ' ' ) << "Attr "; 155 155 attr->print( os, indent + 2 ); 156 156 if ( isType || expr ) { … … 184 184 185 185 void CastExpr::print( std::ostream &os, int indent ) const { 186 os << std::string( indent, ' ') << "Cast of:" << std::endl;186 os << std::string( indent, ' ' ) << "Cast of:" << std::endl; 187 187 arg->print(os, indent+2); 188 os << std::endl << std::string( indent, ' ') << "to:" << std::endl;188 os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl; 189 189 if ( results.empty() ) { 190 os << std::string( indent+2, ' ') << "nothing" << std::endl;190 os << std::string( indent+2, ' ' ) << "nothing" << std::endl; 191 191 } else { 192 192 printAll(results, os, indent+2); … … 207 207 208 208 void UntypedMemberExpr::print( std::ostream &os, int indent ) const { 209 os << std::string( indent, ' ') << "Member Expression, with field: " << get_member();209 os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member(); 210 210 211 211 Expression *agg = get_aggregate(); 212 os << std::string( indent, ' ') << "from aggregate: ";212 os << std::string( indent, ' ' ) << "from aggregate: "; 213 213 if (agg != 0) agg->print(os, indent + 2); 214 214 Expression::print( os, indent ); … … 234 234 235 235 void MemberExpr::print( std::ostream &os, int indent ) const { 236 os << std::string( indent, ' ') << "Member Expression, with field: " << std::endl;236 os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl; 237 237 238 238 assert( member ); 239 os << std::string( indent + 2, ' ');239 os << std::string( indent + 2, ' ' ); 240 240 member->print( os, indent + 2 ); 241 241 os << std::endl; 242 242 243 243 Expression *agg = get_aggregate(); 244 os << std::string( indent, ' ') << "from aggregate: " << std::endl;244 os << std::string( indent, ' ' ) << "from aggregate: " << std::endl; 245 245 if (agg != 0) agg->print(os, indent + 2); 246 246 Expression::print( os, indent ); … … 261 261 262 262 void UntypedExpr::print( std::ostream &os, int indent ) const { 263 os << std::string( indent, ' ') << "Applying untyped: " << std::endl;263 os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl; 264 264 function->print(os, indent + 4); 265 os << "\r" << std::string(indent, ' ') << "...to: " << std::endl;265 os << std::string( indent, ' ' ) << "...to: " << std::endl; 266 266 printArgs(os, indent + 4); 267 267 Expression::print( os, indent ); … … 282 282 283 283 void NameExpr::print( std::ostream &os, int indent ) const { 284 os << std::string( indent, ' ') << "Name: " << get_name() << std::endl;284 os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl; 285 285 Expression::print( os, indent ); 286 286 } … … 301 301 302 302 void LogicalExpr::print( std::ostream &os, int indent )const { 303 os << std::string( indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";303 os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: "; 304 304 arg1->print(os); 305 305 os << " and "; … … 323 323 324 324 void ConditionalExpr::print( std::ostream &os, int indent ) const { 325 os << std::string( indent, ' ') << "Conditional expression on: " << std::endl;325 os << std::string( indent, ' ' ) << "Conditional expression on: " << std::endl; 326 326 arg1->print( os, indent+2 ); 327 os << std::string( indent, ' ') << "First alternative:" << std::endl;327 os << std::string( indent, ' ' ) << "First alternative:" << std::endl; 328 328 arg2->print( os, indent+2 ); 329 os << std::string( indent, ' ') << "Second alternative:" << std::endl;329 os << std::string( indent, ' ' ) << "Second alternative:" << std::endl; 330 330 arg3->print( os, indent+2 ); 331 331 os << std::endl; … … 334 334 335 335 void UntypedValofExpr::print( std::ostream &os, int indent ) const { 336 os << std::string( indent, ' ') << "Valof Expression: " << std::endl;336 os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl; 337 337 if ( get_body() != 0 ) 338 338 get_body()->print( os, indent + 2 );
Note: See TracChangeset
for help on using the changeset viewer.