From f8a928d18371e0b67741f5d75b8154d1c105327b Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Sat, 18 Feb 2023 16:22:54 +1300 Subject: Introduce procs --- DSL/Types.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'DSL/Types.hs') diff --git a/DSL/Types.hs b/DSL/Types.hs index bb1f862..0a4de3f 100644 --- a/DSL/Types.hs +++ b/DSL/Types.hs @@ -42,9 +42,12 @@ data Intrinsic | I_GREATERTHAN deriving (Show, Eq) +type ProcName = String + data Operation = OpPushData StackData | OpIntrinsic Intrinsic + | OpCall ProcName deriving (Show) data StackModifier = StackModifier { smName :: String @@ -59,14 +62,18 @@ data Block | BWhile [Block] [Block] deriving (Show) +type ProcSpec = (ProcName, [Block]) + type Program = [Block] data Machine = Machine { ok :: Bool , stack :: Stack + , pTable :: [(ProcName, [Block])] } data TokenTag = T_WHITESPACE + | T_PROC | T_IF | T_ELSE | T_WHILE @@ -76,6 +83,7 @@ data TokenTag | T_BOOL_LITERAL | T_STRING_LITERAL | T_INTRINSIC Intrinsic + | T_IDENTIFIER deriving (Show, Eq) data Token = Token { tStr :: String -- original text -- cgit v1.2.1