Changeset 264e691
- Timestamp:
- May 15, 2019, 2:59:30 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 9e1d485
- Parents:
- 9b81fed3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
r9b81fed3 r264e691 23 23 #include "Fwd.hpp" // for UniqueId 24 24 #include "ParseNode.hpp" 25 #include " Type.hpp" // for ptr<Type>25 #include "Visitor.hpp" 26 26 27 27 namespace ast { … … 117 117 bool extension = false; 118 118 119 Expr(const CodeLocation & loc ) : ParseNode( loc ), result(), env(), inferred() {}119 Expr(const CodeLocation & loc ) : ParseNode( loc ), result(), env(), inferred() {} 120 120 121 121 Expr* set_extension( bool ex ) { extension = ex; return this; } 122 122 123 virtual Expr * accept( Visitor& v ) override = 0;123 virtual Expr * accept( Visitor & v ) override = 0; 124 124 private: 125 virtual Expr* clone() const override = 0; 125 virtual Expr * clone() const override = 0; 126 }; 127 128 /// A type used as an expression (e.g. a type generator parameter) 129 class TypeExpr final : public Expr { 130 public: 131 ptr<Type> type; 132 133 TypeExpr( const CodeLocation & loc, const Type * t ) : Expr(loc), type(t) {} 134 135 Expr* accept( Visitor & v ) override { return v.visit( this ); } 136 private: 137 TypeExpr * clone() const override { return new TypeExpr{ *this }; } 126 138 }; 127 139
Note: See TracChangeset
for help on using the changeset viewer.