Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Parser.Ptera.TH.ParserLib
Synopsis
- newtype ActionM ctx = ActionM {
- runActionM :: [ReduceArgument] -> ActionTask ctx ReduceArgument
- data ReduceArgument where
- ReduceArgument :: forall a. a -> ReduceArgument
- data RunnerParser ctx elem altHelp = RunnerParser {
- parserInitial :: StartNum -> Maybe StateNum
- parserGetTokenNum :: elem -> TokenNum
- parserTrans :: StateNum -> TokenNum -> Trans
- parserAltKind :: AltNum -> AltKind
- parserStateHelp :: StateNum -> [(AltNum, Int)]
- parserAltHelp :: AltNum -> (StringLit, Maybe altHelp)
- parserAction :: AltNum -> ActionM ctx
- data Trans = Trans {
- transState :: StateNum
- transOps :: [TransOp]
- data TransOp
- failAction :: ActionTask ctx a
- modifyAction :: (ctx -> ctx) -> ActionTask ctx ()
- getAction :: ActionTask ctx ctx
- data ActionTask ctx a
- class GrammarToken tokens elem where
- tokenToTerminal :: Proxy tokens -> elem -> T (TokensTag tokens)
- data AltKind
- data Proxy (t :: k) = Proxy
- type Parser = T
- pteraTHTokenToTerminal :: GrammarToken tokens elem => Proxy tokens -> elem -> Int
- pteraTHArrayIndex :: Array Int e -> Int -> e
- pteraTHArrayFromList :: Int -> [e] -> Array Int e
- pteraTHLookupTable8 :: Int -> Addr# -> Int -> Int -> Int
- pteraTHLookupTable16 :: Int -> Addr# -> Int -> Int -> Int
- pteraTHLookupTable32 :: Int -> Addr# -> Int -> Int -> Int
- pteraTHUnsafeExtractReduceArgument :: ReduceArgument -> a
- pteraTHUnsafeRunner :: RunnerParser ctx elem () -> Parser ctx rules elem initials
- pteraTHAction :: ([ReduceArgument] -> ActionTask ctx b) -> ActionM ctx
- pteraTHActionTaskPure :: a -> ActionTask ctx a
Documentation
Constructors
ActionM | |
Fields
|
data ReduceArgument where #
Constructors
ReduceArgument :: forall a. a -> ReduceArgument |
data RunnerParser ctx elem altHelp #
Constructors
RunnerParser | |
Fields
|
Constructors
Trans | |
Fields
|
Constructors
TransOpEnter VarNum Bool StateNum | |
TransOpPushBackpoint StateNum | |
TransOpHandleNot AltNum | |
TransOpShift | |
TransOpReduce AltNum |
failAction :: ActionTask ctx a #
modifyAction :: (ctx -> ctx) -> ActionTask ctx () #
getAction :: ActionTask ctx ctx #
data ActionTask ctx a #
Instances
Monad (ActionTask ctx) | |
Defined in Language.Parser.Ptera.Syntax Methods (>>=) :: ActionTask ctx a -> (a -> ActionTask ctx b) -> ActionTask ctx b # (>>) :: ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx b # return :: a -> ActionTask ctx a # | |
Functor (ActionTask ctx) | |
Defined in Language.Parser.Ptera.Syntax Methods fmap :: (a -> b) -> ActionTask ctx a -> ActionTask ctx b # (<$) :: a -> ActionTask ctx b -> ActionTask ctx a # | |
Applicative (ActionTask ctx) | |
Defined in Language.Parser.Ptera.Syntax Methods pure :: a -> ActionTask ctx a # (<*>) :: ActionTask ctx (a -> b) -> ActionTask ctx a -> ActionTask ctx b # liftA2 :: (a -> b -> c) -> ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx c # (*>) :: ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx b # (<*) :: ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx a # |
class GrammarToken tokens elem where #
Methods
tokenToTerminal :: Proxy tokens -> elem -> T (TokensTag tokens) #
Instances
Proxy
is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically,
is a safer alternative to the
Proxy
:: Proxy
a
idiom.undefined
:: a
>>>
Proxy :: Proxy (Void, Int -> Int)
Proxy
Proxy can even hold types of higher kinds,
>>>
Proxy :: Proxy Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy
Constructors
Proxy |
Instances
Generic1 (Proxy :: k -> Type) | Since: base-4.6.0.0 |
Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Foldable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Alternative (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Hashable1 (Proxy :: Type -> Type) | |
Defined in Data.Hashable.Class | |
Bounded (Proxy t) | Since: base-4.7.0.0 |
Enum (Proxy s) | Since: base-4.7.0.0 |
Eq (Proxy s) | Since: base-4.7.0.0 |
Ord (Proxy s) | Since: base-4.7.0.0 |
Read (Proxy t) | Since: base-4.7.0.0 |
Show (Proxy s) | Since: base-4.7.0.0 |
Ix (Proxy s) | Since: base-4.7.0.0 |
Defined in Data.Proxy | |
Generic (Proxy t) | Since: base-4.6.0.0 |
Semigroup (Proxy s) | Since: base-4.9.0.0 |
Monoid (Proxy s) | Since: base-4.7.0.0 |
Hashable (Proxy a) | |
Defined in Data.Hashable.Class | |
type Rep1 (Proxy :: k -> Type) | |
type Rep (Proxy t) | |
pteraTHTokenToTerminal :: GrammarToken tokens elem => Proxy tokens -> elem -> Int Source #
pteraTHUnsafeRunner :: RunnerParser ctx elem () -> Parser ctx rules elem initials Source #
pteraTHAction :: ([ReduceArgument] -> ActionTask ctx b) -> ActionM ctx Source #
pteraTHActionTaskPure :: a -> ActionTask ctx a Source #