module Language.Symantic.Grammar.EBNF where
import Control.Applicative (Applicative(..))
-import Control.Monad
-import Data.Semigroup hiding (option)
+import Data.Semigroup
import Data.Text (Text)
-import Prelude hiding (any)
import qualified Data.Text as Text
import Language.Symantic.Grammar.Meta
-- Synthetized attributes are:
--
-- * 'Text' of the 'EBNF' rendition.
-data EBNF a = EBNF { unEBNF :: RuleMode -> (Infix, Side) -> Text }
+newtype EBNF a = EBNF { unEBNF :: RuleMode -> (Infix, Side) -> Text }
instance Gram_Reader st EBNF where
- g_ask_before (EBNF e) = EBNF e
- g_ask_after (EBNF e) = EBNF e
+ askBefore (EBNF e) = EBNF e
+ askAfter (EBNF e) = EBNF e
instance Gram_State st EBNF where
- g_state_before (EBNF e) = EBNF e
- g_state_after (EBNF e) = EBNF e
+ stateBefore (EBNF e) = EBNF e
+ stateAfter (EBNF e) = EBNF e
instance Gram_Error err EBNF where
- g_catch (EBNF e) = EBNF e
+ catch (EBNF e) = EBNF e
-- | Get textual rendition of given 'EBNF'.
runEBNF :: EBNF a -> Text