( module Symantic.Parser.Grammar
, module Symantic.Parser.Grammar.Combinators
, module Symantic.Parser.Grammar.Optimize
- , module Symantic.Parser.Grammar.ObserveSharing
+ , module Symantic.Parser.Grammar.SharingObserver
, module Symantic.Parser.Grammar.Production
, module Symantic.Parser.Grammar.Write
, module Symantic.Parser.Grammar.View
, Letsable(..)
) where
import Symantic.Parser.Grammar.Combinators
-import Symantic.Parser.Grammar.ObserveSharing
+import Symantic.Parser.Grammar.SharingObserver
import Symantic.Parser.Grammar.Optimize
import Symantic.Parser.Grammar.Production
import Symantic.Parser.Grammar.View
import Data.Function ((.))
import Data.String (String)
import Data.Typeable (Typeable)
-import System.IO (IO)
import Text.Show (Show(..))
-import qualified Data.Functor as Functor
+import Language.Haskell.TH.HideName
import qualified Language.Haskell.TH.Syntax as TH
-- * Type 'Grammar'
-type Grammar repr = ObserveSharing TH.Name (OptimizeGrammar repr)
+type Grammar repr = SharingObserver TH.Name (OptimizeGrammar repr)
-- ** Class 'Grammarable'
type Grammarable tok repr =
)
-- | A usual pipeline to interpret 'Comb'inators:
--- 'observeSharing' then 'optimizeGrammar' then a polymorphic @(repr)@.
+-- 'sharingObserver' then 'optimizeGrammar' then a polymorphic @(repr)@.
grammar :: Grammarable tok repr => Grammar repr a -> repr a
-grammar = optimizeGrammar . observeSharing
+grammar = optimizeGrammar . sharingObserver
-- | An usual pipeline to show 'Comb'inators:
--- 'observeSharing' then 'optimizeGrammar' then 'viewGrammar' then 'show'.
+-- 'sharingObserver' then 'optimizeGrammar' then 'viewGrammar' then 'show'.
showGrammar :: forall showName a tok.
- ShowLetName showName TH.Name =>
+ HideableName showName =>
Grammarable tok (Grammar (ViewGrammar showName)) =>
Grammar (ViewGrammar showName) a -> String
showGrammar = show . viewGrammar . grammar @tok