2 ( module Symantic.Parser.Grammar
3 , module Symantic.Parser.Machine
4 , module Symantic.Parser
7 import Data.Either (Either)
8 import Data.Function (($))
9 import Language.Haskell.TH (CodeQ)
10 import qualified Language.Haskell.TH.Syntax as TH
12 import Symantic.Parser.Grammar
13 import Symantic.Parser.Machine
16 type Parser inp a = Machine Gen inp a
18 runParser :: forall inp a.
20 Machinable (InputToken inp) Gen =>
22 CodeQ (inp -> Either (ParsingError inp) a)
23 runParser p = TH.Code $ do
24 mach <- TH.runIO $ machine p
25 TH.examineCode $ generateCode mach