module GLL.Flags where
data Flags = Flags { Flags -> Bool
symbol_nodes :: Bool
, Flags -> Bool
intermediate_nodes :: Bool
, Flags -> Bool
edges :: Bool
, Flags -> Bool
flexible_binarisation :: Bool
, Flags -> Int
max_errors :: Int
, Flags -> Bool
do_select_test :: Bool
}
defaultFlags :: Flags
defaultFlags = Bool -> Bool -> Bool -> Bool -> Int -> Bool -> Flags
Flags Bool
False Bool
False Bool
False Bool
True Int
3 Bool
True
runOptions :: ParseOptions -> Flags
runOptions :: ParseOptions -> Flags
runOptions = (ParseOption -> ParseOption) -> Flags -> ParseOptions -> Flags
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr ParseOption -> ParseOption
forall a b. (a -> b) -> a -> b
($) Flags
defaultFlags
type ParseOption = Flags -> Flags
type ParseOptions = [ParseOption]
fullSPPF :: ParseOption
fullSPPF :: ParseOption
fullSPPF Flags
flags = Flags
flags{symbol_nodes = True, intermediate_nodes = True, edges = True}
allNodes :: ParseOption
allNodes :: ParseOption
allNodes Flags
flags = Flags
flags{symbol_nodes = True, intermediate_nodes = True}
packedNodesOnly :: ParseOption
packedNodesOnly :: ParseOption
packedNodesOnly Flags
flags = Flags
flags{symbol_nodes = False, intermediate_nodes = False, edges = False}
strictBinarisation :: ParseOption
strictBinarisation :: ParseOption
strictBinarisation Flags
flags = Flags
flags{flexible_binarisation = False}
maximumErrors :: Int -> ParseOption
maximumErrors :: Int -> ParseOption
maximumErrors Int
n Flags
flags = Flags
flags {max_errors = n}
noSelectTest :: ParseOption
noSelectTest :: ParseOption
noSelectTest Flags
flags = Flags
flags{do_select_test = False}