1 module Symantic.Parser.Machine
2 ( module Symantic.Parser.Machine
3 , module Symantic.Parser.Machine.Generate
4 , module Symantic.Parser.Machine.Input
5 , module Symantic.Parser.Machine.Instructions
6 , module Symantic.Parser.Machine.Optimize
7 , module Symantic.Parser.Machine.Program
8 , module Symantic.Parser.Machine.View
10 import Data.Function ((.))
12 import qualified Language.Haskell.TH.Syntax as TH
14 import Symantic.Parser.Grammar
15 import Symantic.Parser.Machine.Generate
16 import Symantic.Parser.Machine.Input
17 import Symantic.Parser.Machine.Instructions
18 import Symantic.Parser.Machine.Optimize
19 import Symantic.Parser.Machine.Program
20 import Symantic.Parser.Machine.View
23 type Machine repr inp =
24 ObserveSharing TH.Name
25 (OptimizeGrammar (Program repr inp))
27 -- | Build a 'Machine' able to 'generateCode' for the given 'Parser'.
28 machine :: forall inp repr a.
29 Grammarable (InputToken inp) (Program repr inp) =>
30 Machinable (InputToken inp) repr =>
33 machine = optimizeMachine . grammar @(InputToken inp)