diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-02-17 23:45:26 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-02-17 23:45:26 +1300 |
| commit | c8e97a9e6ebfefec0db5bc51bd095b3d10dfd078 (patch) | |
| tree | b89d2f152e765dc23724a046915d41e0379f0a5d /DSL/Types.hs | |
| parent | 342ba2c6d5e738f4ad5eb03a297a561ce43d6b5f (diff) | |
Lexing and parsing overhaul
Diffstat (limited to 'DSL/Types.hs')
| -rw-r--r-- | DSL/Types.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/DSL/Types.hs b/DSL/Types.hs index 2c33aad..8d59a06 100644 --- a/DSL/Types.hs +++ b/DSL/Types.hs @@ -63,22 +63,22 @@ data Machine = Machine { ok :: Bool , stack :: Stack } -data TokenData +data TokenTag = T_WHITESPACE | T_IF | T_ELSE | T_WHILE | T_DO | T_END - | T_BOOL_LITERAL Bool - | T_INT_LITERAL Integer + | T_BOOL_LITERAL + | T_INT_LITERAL | T_INTRINSIC Intrinsic deriving (Show, Eq) -data DSLToken = DSLToken { tStr :: String -- original text - , tData :: TokenData -- actual data - } deriving (Show) +data Token = Token { tStr :: String -- original text + , tTag :: TokenTag -- actual data + } deriving (Show) -type DSLLexer = Parser Char DSLToken -type DSLParser = Parser DSLToken +type DSLLexer = Parser Char Token +type DSLParser = Parser Token |
