diff options
Diffstat (limited to 'src/resp.hpp')
-rw-r--r-- | src/resp.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/resp.hpp b/src/resp.hpp index 593205d..7dc9f16 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -694,6 +694,8 @@ Subst unify(const Constraints& c); * Code Generation * ***************************************************************************/ +typedef void* IfState; + /// Compiler backend struct Engine { virtual ~Engine() {} @@ -719,11 +721,14 @@ struct Engine { virtual CVal compileString(CEnv& cenv, const char* str) = 0; virtual CVal compileCall(CEnv& cenv, CFunc f, const AType* fT, ValVec& args) = 0; virtual CVal compilePrimitive(CEnv& cenv, const ATuple* prim) = 0; - virtual CVal compileIf(CEnv& cenv, const ATuple* aif) = 0; virtual CVal compileMatch(CEnv& cenv, const ATuple* match) = 0; virtual CVal compileGlobal(CEnv& cenv, const AType* t, const string& sym, CVal val) = 0; virtual CVal compileGlobalGet(CEnv& cenv, const string& sym, CVal val) = 0; - + + virtual IfState compileIfStart(CEnv& cenv) = 0; + virtual void compileIfBranch(CEnv& cenv, IfState state, CVal condV, const AST* then) = 0; + virtual CVal compileIfEnd(CEnv& cenv, IfState state, CVal elseV, const AType* type) = 0; + virtual void writeModule(CEnv& cenv, std::ostream& os) = 0; virtual const string call(CEnv& cenv, CFunc f, const AType* retT) = 0; |