aboutsummaryrefslogtreecommitdiffstats
path: root/tuplr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tuplr.hpp')
-rw-r--r--tuplr.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tuplr.hpp b/tuplr.hpp
index c86ff68..29b8463 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -99,13 +99,15 @@ struct CEnv; ///< Compile-Time Environment
struct AST {
AST(Cursor c=Cursor()) : loc(c) {}
virtual ~AST() {}
- virtual string str() const = 0;
- virtual bool operator==(const AST& o) const = 0;
- virtual bool contains(AST* child) const { return false; }
- virtual void constrain(TEnv& tenv) const {}
- virtual void lift(CEnv& cenv) {}
- virtual CValue compile(CEnv& cenv) = 0;
+ virtual string str() const = 0;
+ virtual bool operator==(const AST& o) const = 0;
+ virtual bool contains(const AST* child) const { return false; }
+ virtual void constrain(TEnv& tenv) const {}
+ virtual void lift(CEnv& cenv) {}
Cursor loc;
+private:
+ friend class CEnv;
+ virtual CValue compile(CEnv& cenv) = 0;
};
/// Literal value