]> Git — Sourcephile - haskell/symantic-parser.git/blob - src/Symantic/Parser/Machine.hs
test: unique names changed again
[haskell/symantic-parser.git] / src / Symantic / Parser / Machine.hs
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.View
7 ) where
8 import Data.Function ((.))
9 import Data.Ord (Ord)
10 import Symantic.Parser.Machine.Input
11 import Symantic.Parser.Grammar
12 import Text.Show (Show)
13 import qualified Language.Haskell.TH.Syntax as TH
14
15 import Symantic.Parser.Machine.Generate
16 import Symantic.Parser.Machine.Instructions
17 import Symantic.Parser.Machine.View
18
19 -- * Type 'Parser'
20 type Parser inp =
21 ObserveSharing TH.Name
22 (OptimizeGrammar TH.Name
23 (Machine inp))
24
25 machine :: forall inp repr a.
26 Ord (InputToken inp) =>
27 Show (InputToken inp) =>
28 TH.Lift (InputToken inp) =>
29 Executable repr =>
30 Grammar (Machine inp) =>
31 Readable repr (InputToken inp) =>
32 Parser inp a ->
33 repr inp '[] ('Succ 'Zero) a
34 machine = runMachine . optimizeGrammar . observeSharing