never executed always true always false
1 module HelVM.HelMA.Automata.WhiteSpace.Evaluator (
2 simpleEval,
3 evalParams,
4 ) where
5
6 import HelVM.HelMA.Automata.WhiteSpace.Lexer
7 import HelVM.HelMA.Automata.WhiteSpace.Parser
8 import qualified HelVM.HelMA.Automata.WhiteSpace.SimpleParams as S
9 import HelVM.HelMA.Automata.WhiteSpace.Token
10
11 import qualified HelVM.HelMA.Automaton.API.AutomatonOptions as Automaton
12 import HelVM.HelMA.Automaton.API.EvalParams
13 import HelVM.HelMA.Automaton.API.IOTypes
14
15 import HelVM.HelMA.Automaton.Automaton
16
17 import HelVM.HelMA.Automaton.IO.BusinessIO
18
19 import HelVM.HelMA.Automaton.Types.FormatType
20 import HelVM.HelMA.Automaton.Types.TokenType
21
22 import HelVM.HelIO.Control.Safe
23
24 import Prelude hiding (swap)
25
26
27 simpleEval :: BIO m => S.SimpleParams -> m ()
28 simpleEval p = eval (S.tokenType p) (S.source p) (S.formatType p) $ S.automatonOptions p
29
30 ----
31
32 evalParams :: BIO m => TokenType -> EvalParams -> m ()
33 evalParams tokenType p = eval tokenType (source p) (formatType p) $ automatonOptions p
34
35 eval :: BIO m => TokenType -> Source -> FormatType -> Automaton.AutomatonOptions -> m ()
36 eval tokenType source = evalTL $ tokenize tokenType source
37
38 evalTL :: BIO m => TokenList -> FormatType -> Automaton.AutomatonOptions -> m ()
39 evalTL tl ascii ao = flip start ao =<< liftSafe (parseFromTL ascii tl)