module CFGEq.CFG where
import Data.Set (Set)
data CFG v t = CFG { CFG v t -> Set (Rule v t)
rules :: Set (Rule v t)
, CFG v t -> v
start :: v
}
deriving Int -> CFG v t -> ShowS
[CFG v t] -> ShowS
CFG v t -> String
(Int -> CFG v t -> ShowS)
-> (CFG v t -> String) -> ([CFG v t] -> ShowS) -> Show (CFG v t)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall v t. (Show v, Show t) => Int -> CFG v t -> ShowS
forall v t. (Show v, Show t) => [CFG v t] -> ShowS
forall v t. (Show v, Show t) => CFG v t -> String
showList :: [CFG v t] -> ShowS
$cshowList :: forall v t. (Show v, Show t) => [CFG v t] -> ShowS
show :: CFG v t -> String
$cshow :: forall v t. (Show v, Show t) => CFG v t -> String
showsPrec :: Int -> CFG v t -> ShowS
$cshowsPrec :: forall v t. (Show v, Show t) => Int -> CFG v t -> ShowS
Show
data Rule v t =
v :-> Production v t
deriving (Int -> Rule v t -> ShowS
[Rule v t] -> ShowS
Rule v t -> String
(Int -> Rule v t -> ShowS)
-> (Rule v t -> String) -> ([Rule v t] -> ShowS) -> Show (Rule v t)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall v t. (Show v, Show t) => Int -> Rule v t -> ShowS
forall v t. (Show v, Show t) => [Rule v t] -> ShowS
forall v t. (Show v, Show t) => Rule v t -> String
showList :: [Rule v t] -> ShowS
$cshowList :: forall v t. (Show v, Show t) => [Rule v t] -> ShowS
show :: Rule v t -> String
$cshow :: forall v t. (Show v, Show t) => Rule v t -> String
showsPrec :: Int -> Rule v t -> ShowS
$cshowsPrec :: forall v t. (Show v, Show t) => Int -> Rule v t -> ShowS
Show, Rule v t -> Rule v t -> Bool
(Rule v t -> Rule v t -> Bool)
-> (Rule v t -> Rule v t -> Bool) -> Eq (Rule v t)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall v t. (Eq v, Eq t) => Rule v t -> Rule v t -> Bool
/= :: Rule v t -> Rule v t -> Bool
$c/= :: forall v t. (Eq v, Eq t) => Rule v t -> Rule v t -> Bool
== :: Rule v t -> Rule v t -> Bool
$c== :: forall v t. (Eq v, Eq t) => Rule v t -> Rule v t -> Bool
Eq, Eq (Rule v t)
Eq (Rule v t)
-> (Rule v t -> Rule v t -> Ordering)
-> (Rule v t -> Rule v t -> Bool)
-> (Rule v t -> Rule v t -> Bool)
-> (Rule v t -> Rule v t -> Bool)
-> (Rule v t -> Rule v t -> Bool)
-> (Rule v t -> Rule v t -> Rule v t)
-> (Rule v t -> Rule v t -> Rule v t)
-> Ord (Rule v t)
Rule v t -> Rule v t -> Bool
Rule v t -> Rule v t -> Ordering
Rule v t -> Rule v t -> Rule v t
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall v t. (Ord v, Ord t) => Eq (Rule v t)
forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Bool
forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Ordering
forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Rule v t
min :: Rule v t -> Rule v t -> Rule v t
$cmin :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Rule v t
max :: Rule v t -> Rule v t -> Rule v t
$cmax :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Rule v t
>= :: Rule v t -> Rule v t -> Bool
$c>= :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Bool
> :: Rule v t -> Rule v t -> Bool
$c> :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Bool
<= :: Rule v t -> Rule v t -> Bool
$c<= :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Bool
< :: Rule v t -> Rule v t -> Bool
$c< :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Bool
compare :: Rule v t -> Rule v t -> Ordering
$ccompare :: forall v t. (Ord v, Ord t) => Rule v t -> Rule v t -> Ordering
$cp1Ord :: forall v t. (Ord v, Ord t) => Eq (Rule v t)
Ord)
type Production v t = [Either v t]