Changes in src/SynTree/Expression.cc [5f2f2d7:843054c2]
- File:
-
- 1 edited
-
src/SynTree/Expression.cc (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r5f2f2d7 r843054c2 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 08:40:46201513 // Update Count : 1612 // Last Modified On : Mon May 18 08:27:07 2015 13 // Update Count : 2 14 14 // 15 15 … … 50 50 } 51 51 52 void Expression::print( std::ostream &os, int indent) const {52 void Expression::print(std::ostream &os, int indent) const { 53 53 if ( env ) { 54 os << std::string( indent, ' ') << "with environment:" << std::endl;54 os << std::string(indent, ' ') << "with environment:" << std::endl; 55 55 env->print( os, indent+2 ); 56 56 } // if 57 57 58 58 if ( argName ) { 59 os << std::string( indent, ' ') << "with designator:";59 os << std::string(indent, ' ') << "with designator:"; 60 60 argName->print( os, indent+2 ); 61 61 } // if … … 72 72 73 73 void ConstantExpr::print( std::ostream &os, int indent ) const { 74 os << "constant expression " ; 75 constant.print( os ); 74 os << std::string(indent, ' ') << "Constant Expression: " ; 75 constant.print(os); 76 os << std::endl; 76 77 Expression::print( os, indent ); 77 78 } … … 92 93 93 94 void VariableExpr::print( std::ostream &os, int indent ) const { 94 os << std::string( indent, ' ') << "Variable Expression: ";95 os << std::string(indent, ' ') << "Variable Expression: "; 95 96 96 97 Declaration *decl = get_var(); … … 121 122 122 123 void SizeofExpr::print( std::ostream &os, int indent) const { 123 os << std::string( indent, ' ') << "Sizeof Expression on: ";124 os << std::string(indent, ' ') << "Sizeof Expression on: "; 124 125 125 126 if (isType) … … 151 152 152 153 void AttrExpr::print( std::ostream &os, int indent) const { 153 os << std::string( indent, ' ') << "Attr ";154 os << std::string(indent, ' ') << "Attr "; 154 155 attr->print( os, indent + 2 ); 155 156 if ( isType || expr ) { … … 183 184 184 185 void CastExpr::print( std::ostream &os, int indent ) const { 185 os << std::string( indent, ' ') << "Cast of:" << std::endl;186 os << std::string(indent, ' ') << "Cast of:" << std::endl; 186 187 arg->print(os, indent+2); 187 os << std::endl << std::string( indent, ' ') << "to:" << std::endl;188 os << std::endl << std::string(indent, ' ') << "to:" << std::endl; 188 189 if ( results.empty() ) { 189 os << std::string( indent+2, ' ') << "nothing" << std::endl;190 os << std::string(indent+2, ' ') << "nothing" << std::endl; 190 191 } else { 191 192 printAll(results, os, indent+2); … … 206 207 207 208 void UntypedMemberExpr::print( std::ostream &os, int indent ) const { 208 os << std::string( indent, ' ') << "Member Expression, with field: " << get_member();209 os << std::string(indent, ' ') << "Member Expression, with field: " << get_member(); 209 210 210 211 Expression *agg = get_aggregate(); 211 os << std::string( indent, ' ') << "from aggregate: ";212 os << std::string(indent, ' ') << "from aggregate: "; 212 213 if (agg != 0) agg->print(os, indent + 2); 213 214 Expression::print( os, indent ); … … 233 234 234 235 void MemberExpr::print( std::ostream &os, int indent ) const { 235 os << std::string( indent, ' ') << "Member Expression, with field: " << std::endl;236 os << std::string(indent, ' ') << "Member Expression, with field: " << std::endl; 236 237 237 238 assert( member ); 238 os << std::string( indent + 2, ' ');239 os << std::string(indent + 2, ' '); 239 240 member->print( os, indent + 2 ); 240 241 os << std::endl; 241 242 242 243 Expression *agg = get_aggregate(); 243 os << std::string( indent, ' ') << "from aggregate: " << std::endl;244 os << std::string(indent, ' ') << "from aggregate: " << std::endl; 244 245 if (agg != 0) agg->print(os, indent + 2); 245 246 Expression::print( os, indent ); … … 260 261 261 262 void UntypedExpr::print( std::ostream &os, int indent ) const { 262 os << std::string( indent, ' ') << "Applying untyped: " << std::endl;263 os << std::string(indent, ' ') << "Applying untyped: " << std::endl; 263 264 function->print(os, indent + 4); 264 os << std::string( indent, ' ') << "...to: " << std::endl;265 os << "\r" << std::string(indent, ' ') << "...to: " << std::endl; 265 266 printArgs(os, indent + 4); 266 267 Expression::print( os, indent ); … … 281 282 282 283 void NameExpr::print( std::ostream &os, int indent ) const { 283 os << std::string( indent, ' ') << "Name: " << get_name() << std::endl;284 os << std::string(indent, ' ') << "Name: " << get_name() << std::endl; 284 285 Expression::print( os, indent ); 285 286 } … … 300 301 301 302 void LogicalExpr::print( std::ostream &os, int indent )const { 302 os << std::string( indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";303 os << std::string(indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: "; 303 304 arg1->print(os); 304 305 os << " and "; … … 322 323 323 324 void ConditionalExpr::print( std::ostream &os, int indent ) const { 324 os << std::string( indent, ' ') << "Conditional expression on: " << std::endl;325 os << std::string(indent, ' ') << "Conditional expression on: " << std::endl; 325 326 arg1->print( os, indent+2 ); 326 os << std::string( indent, ' ') << "First alternative:" << std::endl;327 os << std::string(indent, ' ') << "First alternative:" << std::endl; 327 328 arg2->print( os, indent+2 ); 328 os << std::string( indent, ' ') << "Second alternative:" << std::endl;329 os << std::string(indent, ' ') << "Second alternative:" << std::endl; 329 330 arg3->print( os, indent+2 ); 330 331 os << std::endl; … … 333 334 334 335 void UntypedValofExpr::print( std::ostream &os, int indent ) const { 335 os << std::string( indent, ' ') << "Valof Expression: " << std::endl;336 os << std::string(indent, ' ') << "Valof Expression: " << std::endl; 336 337 if ( get_body() != 0 ) 337 338 get_body()->print( os, indent + 2 );
Note:
See TracChangeset
for help on using the changeset viewer.