Changeset 0f79853 for src/SynTree
- Timestamp:
- Jun 7, 2018, 9:55:28 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 61d9b4b
- Parents:
- 2a6c115
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r2a6c115 r0f79853 746 746 os << std::endl << indent+1 << "... deleted by: "; 747 747 deleteStmt->print( os, indent+1 ); 748 } 749 750 751 DefaultArgExpr::DefaultArgExpr( Expression * expr ) : expr( expr ) { 752 assert( expr->result ); 753 result = expr->result->clone(); 754 } 755 DefaultArgExpr::DefaultArgExpr( const DefaultArgExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ) {} 756 DefaultArgExpr::~DefaultArgExpr() { 757 delete expr; 758 } 759 760 void DefaultArgExpr::print( std::ostream & os, Indenter indent ) const { 761 os << "Default Argument Expression" << std::endl << indent+1; 762 expr->print( os, indent+1 ); 748 763 } 749 764 -
src/SynTree/Expression.h
r2a6c115 r0f79853 865 865 }; 866 866 867 /// expression wrapping the use of a default argument - should never make it past the resolver. 868 class DefaultArgExpr : public Expression { 869 public: 870 Expression * expr; 871 872 DefaultArgExpr( Expression * expr ); 873 DefaultArgExpr( const DefaultArgExpr & other ); 874 ~DefaultArgExpr(); 875 876 virtual DefaultArgExpr * clone() const { return new DefaultArgExpr( * this ); } 877 virtual void accept( Visitor & v ) { v.visit( this ); } 878 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 879 virtual void print( std::ostream & os, Indenter indent = {} ) const; 880 }; 881 867 882 /// C11 _Generic expression 868 883 class GenericExpr : public Expression { -
src/SynTree/Mutator.h
r2a6c115 r0f79853 93 93 virtual Expression * mutate( InitExpr * initExpr ) = 0; 94 94 virtual Expression * mutate( DeletedExpr * delExpr ) = 0; 95 virtual Expression * mutate( DefaultArgExpr * argExpr ) = 0; 95 96 virtual Expression * mutate( GenericExpr * genExpr ) = 0; 96 97 -
src/SynTree/SynTree.h
r2a6c115 r0f79853 101 101 class InitExpr; 102 102 class DeletedExpr; 103 class DefaultArgExpr; 103 104 class GenericExpr; 104 105 -
src/SynTree/Visitor.h
r2a6c115 r0f79853 95 95 virtual void visit( InitExpr * initExpr ) = 0; 96 96 virtual void visit( DeletedExpr * delExpr ) = 0; 97 virtual void visit( DefaultArgExpr * argExpr ) = 0; 97 98 virtual void visit( GenericExpr * genExpr ) = 0; 98 99
Note: See TracChangeset
for help on using the changeset viewer.