From 930f3d68b02bd0089e209eb80328f5db2e6fd821 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 25 Dec 2018 10:39:25 +0100 Subject: Add comparisons; tak example --- Sjit/Compile.dcl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'Sjit/Compile.dcl') diff --git a/Sjit/Compile.dcl b/Sjit/Compile.dcl index d373e42..e630178 100644 --- a/Sjit/Compile.dcl +++ b/Sjit/Compile.dcl @@ -13,17 +13,24 @@ from Sjit.Syntax import :: Function | Call !Int | Jmp !Int - | JmpTrue !Int + | JmpCond !Cond !Int | Ret | Halt - | IAdd - | IMul - | ISub - | IDiv + | Op !Op | PlaceHolder !Int !Int // only used during compilation +:: Op + = OAdd | OMul + | OSub | ODiv + +:: Cond + = CEq | CNe + | CLt | CLe + | CGt | CGe + | CTrue + :: Program :== {!Instr} :: CompileState = -- cgit v1.2.3