Changes in src/SynTree/Expression.cc [9a705dc8:9bfc9da]
- File:
-
- 1 edited
-
src/SynTree/Expression.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r9a705dc8 r9bfc9da 271 271 } 272 272 273 CastExpr::CastExpr( Expression *arg , Type *toType, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated) {273 CastExpr::CastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) { 274 274 set_result(toType); 275 275 } 276 276 277 CastExpr::CastExpr( Expression *arg , bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated) {277 CastExpr::CastExpr( Expression *arg_ ) : Expression(), arg(arg_) { 278 278 set_result( new VoidType( Type::Qualifiers() ) ); 279 279 } 280 280 281 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) , isGenerated( other.isGenerated ){281 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) { 282 282 } 283 283 … … 296 296 result->print( os, indent+1 ); 297 297 } // if 298 Expression::print( os, indent );299 }300 301 KeywordCastExpr::KeywordCastExpr( Expression *arg, Target target ) : Expression(), arg(arg), target( target ) {302 }303 304 KeywordCastExpr::KeywordCastExpr( const KeywordCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), target( other.target ) {305 }306 307 KeywordCastExpr::~KeywordCastExpr() {308 delete arg;309 }310 311 const std::string & KeywordCastExpr::targetString() const {312 static const std::string targetStrs[] = {313 "coroutine", "thread", "monitor"314 };315 static_assert(316 (sizeof(targetStrs) / sizeof(targetStrs[0])) == ((unsigned long)NUMBER_OF_TARGETS),317 "Each KeywordCastExpr::Target should have a corresponding string representation"318 );319 return targetStrs[(unsigned long)target];320 }321 322 void KeywordCastExpr::print( std::ostream &os, Indenter indent ) const {323 os << "Keyword Cast of:" << std::endl << indent+1;324 arg->print(os, indent+1);325 os << std::endl << indent << "... to: ";326 os << targetString();327 298 Expression::print( os, indent ); 328 299 }
Note:
See TracChangeset
for help on using the changeset viewer.