2 ( module Symantic.Parser.Grammar
3 , module Symantic.Parser.Machine
4 , module Symantic.Parser
7 import Control.Monad.ST (ST, RealWorld)
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
19 type Parsed inp a = ST RealWorld (Result inp a)
21 runParser :: forall inp a.
23 Machinable (InputToken inp) Gen =>
25 CodeQ (inp -> Parsed inp a)
26 runParser p = TH.Code $ do
27 mach <- TH.runIO $ machine p
28 TH.examineCode $ generateCode mach