summaryrefslogtreecommitdiff
path: root/DSL.hs
blob: 54efb28776ec95b51ef2fa20a9292fe4469dfa6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module DSL where

import DSL.BaseParsers (parse) -- for testing
import DSL.Parsing
import DSL.Interpretation

interpretFromString :: String -> IO ()
interpretFromString = maybe err interpret . stringToProgram
  where
    err = putStrLn "Unable to parse program"

interpretFromFile :: FilePath -> IO ()
interpretFromFile path = readFile path >>= interpretFromString