{-# LANGUAGE PatternSynonyms #-}
module BNFC.Abs where
import Prelude (Char, Double, Integer, String)
import qualified Prelude as C
( Eq, Ord, Show, Read
, Int, Maybe(..)
)
data Grammar = Grammar [Def]
deriving (Grammar -> Grammar -> Bool
(Grammar -> Grammar -> Bool)
-> (Grammar -> Grammar -> Bool) -> Eq Grammar
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Grammar -> Grammar -> Bool
== :: Grammar -> Grammar -> Bool
$c/= :: Grammar -> Grammar -> Bool
/= :: Grammar -> Grammar -> Bool
C.Eq, Eq Grammar
Eq Grammar =>
(Grammar -> Grammar -> Ordering)
-> (Grammar -> Grammar -> Bool)
-> (Grammar -> Grammar -> Bool)
-> (Grammar -> Grammar -> Bool)
-> (Grammar -> Grammar -> Bool)
-> (Grammar -> Grammar -> Grammar)
-> (Grammar -> Grammar -> Grammar)
-> Ord Grammar
Grammar -> Grammar -> Bool
Grammar -> Grammar -> Ordering
Grammar -> Grammar -> Grammar
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
$ccompare :: Grammar -> Grammar -> Ordering
compare :: Grammar -> Grammar -> Ordering
$c< :: Grammar -> Grammar -> Bool
< :: Grammar -> Grammar -> Bool
$c<= :: Grammar -> Grammar -> Bool
<= :: Grammar -> Grammar -> Bool
$c> :: Grammar -> Grammar -> Bool
> :: Grammar -> Grammar -> Bool
$c>= :: Grammar -> Grammar -> Bool
>= :: Grammar -> Grammar -> Bool
$cmax :: Grammar -> Grammar -> Grammar
max :: Grammar -> Grammar -> Grammar
$cmin :: Grammar -> Grammar -> Grammar
min :: Grammar -> Grammar -> Grammar
C.Ord, Int -> Grammar -> ShowS
[Grammar] -> ShowS
Grammar -> String
(Int -> Grammar -> ShowS)
-> (Grammar -> String) -> ([Grammar] -> ShowS) -> Show Grammar
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Grammar -> ShowS
showsPrec :: Int -> Grammar -> ShowS
$cshow :: Grammar -> String
show :: Grammar -> String
$cshowList :: [Grammar] -> ShowS
showList :: [Grammar] -> ShowS
C.Show, ReadPrec [Grammar]
ReadPrec Grammar
Int -> ReadS Grammar
ReadS [Grammar]
(Int -> ReadS Grammar)
-> ReadS [Grammar]
-> ReadPrec Grammar
-> ReadPrec [Grammar]
-> Read Grammar
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Grammar
readsPrec :: Int -> ReadS Grammar
$creadList :: ReadS [Grammar]
readList :: ReadS [Grammar]
$creadPrec :: ReadPrec Grammar
readPrec :: ReadPrec Grammar
$creadListPrec :: ReadPrec [Grammar]
readListPrec :: ReadPrec [Grammar]
C.Read)
data Def
= Rule Label Cat [Item]
| String
| String String
| Internal Label Cat [Item]
| Token Identifier Reg
| PosToken Identifier Reg
| Entryp [Cat]
| Separator MinimumSize Cat String
| Terminator MinimumSize Cat String
| Delimiters Cat String String Separation MinimumSize
| Coercions Identifier Integer
| Rules Identifier [RHS]
| Function Identifier [Arg] Exp
| Layout [String]
| LayoutStop [String]
| LayoutTop
deriving (Def -> Def -> Bool
(Def -> Def -> Bool) -> (Def -> Def -> Bool) -> Eq Def
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Def -> Def -> Bool
== :: Def -> Def -> Bool
$c/= :: Def -> Def -> Bool
/= :: Def -> Def -> Bool
C.Eq, Eq Def
Eq Def =>
(Def -> Def -> Ordering)
-> (Def -> Def -> Bool)
-> (Def -> Def -> Bool)
-> (Def -> Def -> Bool)
-> (Def -> Def -> Bool)
-> (Def -> Def -> Def)
-> (Def -> Def -> Def)
-> Ord Def
Def -> Def -> Bool
Def -> Def -> Ordering
Def -> Def -> Def
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
$ccompare :: Def -> Def -> Ordering
compare :: Def -> Def -> Ordering
$c< :: Def -> Def -> Bool
< :: Def -> Def -> Bool
$c<= :: Def -> Def -> Bool
<= :: Def -> Def -> Bool
$c> :: Def -> Def -> Bool
> :: Def -> Def -> Bool
$c>= :: Def -> Def -> Bool
>= :: Def -> Def -> Bool
$cmax :: Def -> Def -> Def
max :: Def -> Def -> Def
$cmin :: Def -> Def -> Def
min :: Def -> Def -> Def
C.Ord, Int -> Def -> ShowS
[Def] -> ShowS
Def -> String
(Int -> Def -> ShowS)
-> (Def -> String) -> ([Def] -> ShowS) -> Show Def
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Def -> ShowS
showsPrec :: Int -> Def -> ShowS
$cshow :: Def -> String
show :: Def -> String
$cshowList :: [Def] -> ShowS
showList :: [Def] -> ShowS
C.Show, ReadPrec [Def]
ReadPrec Def
Int -> ReadS Def
ReadS [Def]
(Int -> ReadS Def)
-> ReadS [Def] -> ReadPrec Def -> ReadPrec [Def] -> Read Def
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Def
readsPrec :: Int -> ReadS Def
$creadList :: ReadS [Def]
readList :: ReadS [Def]
$creadPrec :: ReadPrec Def
readPrec :: ReadPrec Def
$creadListPrec :: ReadPrec [Def]
readListPrec :: ReadPrec [Def]
C.Read)
data Item = Terminal String | NTerminal Cat
deriving (Item -> Item -> Bool
(Item -> Item -> Bool) -> (Item -> Item -> Bool) -> Eq Item
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Item -> Item -> Bool
== :: Item -> Item -> Bool
$c/= :: Item -> Item -> Bool
/= :: Item -> Item -> Bool
C.Eq, Eq Item
Eq Item =>
(Item -> Item -> Ordering)
-> (Item -> Item -> Bool)
-> (Item -> Item -> Bool)
-> (Item -> Item -> Bool)
-> (Item -> Item -> Bool)
-> (Item -> Item -> Item)
-> (Item -> Item -> Item)
-> Ord Item
Item -> Item -> Bool
Item -> Item -> Ordering
Item -> Item -> Item
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
$ccompare :: Item -> Item -> Ordering
compare :: Item -> Item -> Ordering
$c< :: Item -> Item -> Bool
< :: Item -> Item -> Bool
$c<= :: Item -> Item -> Bool
<= :: Item -> Item -> Bool
$c> :: Item -> Item -> Bool
> :: Item -> Item -> Bool
$c>= :: Item -> Item -> Bool
>= :: Item -> Item -> Bool
$cmax :: Item -> Item -> Item
max :: Item -> Item -> Item
$cmin :: Item -> Item -> Item
min :: Item -> Item -> Item
C.Ord, Int -> Item -> ShowS
[Item] -> ShowS
Item -> String
(Int -> Item -> ShowS)
-> (Item -> String) -> ([Item] -> ShowS) -> Show Item
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Item -> ShowS
showsPrec :: Int -> Item -> ShowS
$cshow :: Item -> String
show :: Item -> String
$cshowList :: [Item] -> ShowS
showList :: [Item] -> ShowS
C.Show, ReadPrec [Item]
ReadPrec Item
Int -> ReadS Item
ReadS [Item]
(Int -> ReadS Item)
-> ReadS [Item] -> ReadPrec Item -> ReadPrec [Item] -> Read Item
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Item
readsPrec :: Int -> ReadS Item
$creadList :: ReadS [Item]
readList :: ReadS [Item]
$creadPrec :: ReadPrec Item
readPrec :: ReadPrec Item
$creadListPrec :: ReadPrec [Item]
readListPrec :: ReadPrec [Item]
C.Read)
data Cat = ListCat Cat | IdCat Identifier
deriving (Cat -> Cat -> Bool
(Cat -> Cat -> Bool) -> (Cat -> Cat -> Bool) -> Eq Cat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cat -> Cat -> Bool
== :: Cat -> Cat -> Bool
$c/= :: Cat -> Cat -> Bool
/= :: Cat -> Cat -> Bool
C.Eq, Eq Cat
Eq Cat =>
(Cat -> Cat -> Ordering)
-> (Cat -> Cat -> Bool)
-> (Cat -> Cat -> Bool)
-> (Cat -> Cat -> Bool)
-> (Cat -> Cat -> Bool)
-> (Cat -> Cat -> Cat)
-> (Cat -> Cat -> Cat)
-> Ord Cat
Cat -> Cat -> Bool
Cat -> Cat -> Ordering
Cat -> Cat -> Cat
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
$ccompare :: Cat -> Cat -> Ordering
compare :: Cat -> Cat -> Ordering
$c< :: Cat -> Cat -> Bool
< :: Cat -> Cat -> Bool
$c<= :: Cat -> Cat -> Bool
<= :: Cat -> Cat -> Bool
$c> :: Cat -> Cat -> Bool
> :: Cat -> Cat -> Bool
$c>= :: Cat -> Cat -> Bool
>= :: Cat -> Cat -> Bool
$cmax :: Cat -> Cat -> Cat
max :: Cat -> Cat -> Cat
$cmin :: Cat -> Cat -> Cat
min :: Cat -> Cat -> Cat
C.Ord, Int -> Cat -> ShowS
[Cat] -> ShowS
Cat -> String
(Int -> Cat -> ShowS)
-> (Cat -> String) -> ([Cat] -> ShowS) -> Show Cat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Cat -> ShowS
showsPrec :: Int -> Cat -> ShowS
$cshow :: Cat -> String
show :: Cat -> String
$cshowList :: [Cat] -> ShowS
showList :: [Cat] -> ShowS
C.Show, ReadPrec [Cat]
ReadPrec Cat
Int -> ReadS Cat
ReadS [Cat]
(Int -> ReadS Cat)
-> ReadS [Cat] -> ReadPrec Cat -> ReadPrec [Cat] -> Read Cat
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Cat
readsPrec :: Int -> ReadS Cat
$creadList :: ReadS [Cat]
readList :: ReadS [Cat]
$creadPrec :: ReadPrec Cat
readPrec :: ReadPrec Cat
$creadListPrec :: ReadPrec [Cat]
readListPrec :: ReadPrec [Cat]
C.Read)
data Label = Id Identifier | Wild | ListE | ListCons | ListOne
deriving (Label -> Label -> Bool
(Label -> Label -> Bool) -> (Label -> Label -> Bool) -> Eq Label
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Label -> Label -> Bool
== :: Label -> Label -> Bool
$c/= :: Label -> Label -> Bool
/= :: Label -> Label -> Bool
C.Eq, Eq Label
Eq Label =>
(Label -> Label -> Ordering)
-> (Label -> Label -> Bool)
-> (Label -> Label -> Bool)
-> (Label -> Label -> Bool)
-> (Label -> Label -> Bool)
-> (Label -> Label -> Label)
-> (Label -> Label -> Label)
-> Ord Label
Label -> Label -> Bool
Label -> Label -> Ordering
Label -> Label -> Label
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
$ccompare :: Label -> Label -> Ordering
compare :: Label -> Label -> Ordering
$c< :: Label -> Label -> Bool
< :: Label -> Label -> Bool
$c<= :: Label -> Label -> Bool
<= :: Label -> Label -> Bool
$c> :: Label -> Label -> Bool
> :: Label -> Label -> Bool
$c>= :: Label -> Label -> Bool
>= :: Label -> Label -> Bool
$cmax :: Label -> Label -> Label
max :: Label -> Label -> Label
$cmin :: Label -> Label -> Label
min :: Label -> Label -> Label
C.Ord, Int -> Label -> ShowS
[Label] -> ShowS
Label -> String
(Int -> Label -> ShowS)
-> (Label -> String) -> ([Label] -> ShowS) -> Show Label
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Label -> ShowS
showsPrec :: Int -> Label -> ShowS
$cshow :: Label -> String
show :: Label -> String
$cshowList :: [Label] -> ShowS
showList :: [Label] -> ShowS
C.Show, ReadPrec [Label]
ReadPrec Label
Int -> ReadS Label
ReadS [Label]
(Int -> ReadS Label)
-> ReadS [Label]
-> ReadPrec Label
-> ReadPrec [Label]
-> Read Label
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Label
readsPrec :: Int -> ReadS Label
$creadList :: ReadS [Label]
readList :: ReadS [Label]
$creadPrec :: ReadPrec Label
readPrec :: ReadPrec Label
$creadListPrec :: ReadPrec [Label]
readListPrec :: ReadPrec [Label]
C.Read)
data Arg = Arg Identifier
deriving (Arg -> Arg -> Bool
(Arg -> Arg -> Bool) -> (Arg -> Arg -> Bool) -> Eq Arg
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Arg -> Arg -> Bool
== :: Arg -> Arg -> Bool
$c/= :: Arg -> Arg -> Bool
/= :: Arg -> Arg -> Bool
C.Eq, Eq Arg
Eq Arg =>
(Arg -> Arg -> Ordering)
-> (Arg -> Arg -> Bool)
-> (Arg -> Arg -> Bool)
-> (Arg -> Arg -> Bool)
-> (Arg -> Arg -> Bool)
-> (Arg -> Arg -> Arg)
-> (Arg -> Arg -> Arg)
-> Ord Arg
Arg -> Arg -> Bool
Arg -> Arg -> Ordering
Arg -> Arg -> Arg
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
$ccompare :: Arg -> Arg -> Ordering
compare :: Arg -> Arg -> Ordering
$c< :: Arg -> Arg -> Bool
< :: Arg -> Arg -> Bool
$c<= :: Arg -> Arg -> Bool
<= :: Arg -> Arg -> Bool
$c> :: Arg -> Arg -> Bool
> :: Arg -> Arg -> Bool
$c>= :: Arg -> Arg -> Bool
>= :: Arg -> Arg -> Bool
$cmax :: Arg -> Arg -> Arg
max :: Arg -> Arg -> Arg
$cmin :: Arg -> Arg -> Arg
min :: Arg -> Arg -> Arg
C.Ord, Int -> Arg -> ShowS
[Arg] -> ShowS
Arg -> String
(Int -> Arg -> ShowS)
-> (Arg -> String) -> ([Arg] -> ShowS) -> Show Arg
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Arg -> ShowS
showsPrec :: Int -> Arg -> ShowS
$cshow :: Arg -> String
show :: Arg -> String
$cshowList :: [Arg] -> ShowS
showList :: [Arg] -> ShowS
C.Show, ReadPrec [Arg]
ReadPrec Arg
Int -> ReadS Arg
ReadS [Arg]
(Int -> ReadS Arg)
-> ReadS [Arg] -> ReadPrec Arg -> ReadPrec [Arg] -> Read Arg
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Arg
readsPrec :: Int -> ReadS Arg
$creadList :: ReadS [Arg]
readList :: ReadS [Arg]
$creadPrec :: ReadPrec Arg
readPrec :: ReadPrec Arg
$creadListPrec :: ReadPrec [Arg]
readListPrec :: ReadPrec [Arg]
C.Read)
data Separation = SepNone | SepTerm String | SepSepar String
deriving (Separation -> Separation -> Bool
(Separation -> Separation -> Bool)
-> (Separation -> Separation -> Bool) -> Eq Separation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Separation -> Separation -> Bool
== :: Separation -> Separation -> Bool
$c/= :: Separation -> Separation -> Bool
/= :: Separation -> Separation -> Bool
C.Eq, Eq Separation
Eq Separation =>
(Separation -> Separation -> Ordering)
-> (Separation -> Separation -> Bool)
-> (Separation -> Separation -> Bool)
-> (Separation -> Separation -> Bool)
-> (Separation -> Separation -> Bool)
-> (Separation -> Separation -> Separation)
-> (Separation -> Separation -> Separation)
-> Ord Separation
Separation -> Separation -> Bool
Separation -> Separation -> Ordering
Separation -> Separation -> Separation
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
$ccompare :: Separation -> Separation -> Ordering
compare :: Separation -> Separation -> Ordering
$c< :: Separation -> Separation -> Bool
< :: Separation -> Separation -> Bool
$c<= :: Separation -> Separation -> Bool
<= :: Separation -> Separation -> Bool
$c> :: Separation -> Separation -> Bool
> :: Separation -> Separation -> Bool
$c>= :: Separation -> Separation -> Bool
>= :: Separation -> Separation -> Bool
$cmax :: Separation -> Separation -> Separation
max :: Separation -> Separation -> Separation
$cmin :: Separation -> Separation -> Separation
min :: Separation -> Separation -> Separation
C.Ord, Int -> Separation -> ShowS
[Separation] -> ShowS
Separation -> String
(Int -> Separation -> ShowS)
-> (Separation -> String)
-> ([Separation] -> ShowS)
-> Show Separation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Separation -> ShowS
showsPrec :: Int -> Separation -> ShowS
$cshow :: Separation -> String
show :: Separation -> String
$cshowList :: [Separation] -> ShowS
showList :: [Separation] -> ShowS
C.Show, ReadPrec [Separation]
ReadPrec Separation
Int -> ReadS Separation
ReadS [Separation]
(Int -> ReadS Separation)
-> ReadS [Separation]
-> ReadPrec Separation
-> ReadPrec [Separation]
-> Read Separation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Separation
readsPrec :: Int -> ReadS Separation
$creadList :: ReadS [Separation]
readList :: ReadS [Separation]
$creadPrec :: ReadPrec Separation
readPrec :: ReadPrec Separation
$creadListPrec :: ReadPrec [Separation]
readListPrec :: ReadPrec [Separation]
C.Read)
data Exp
= Cons Exp Exp
| App Identifier [Exp]
| Var Identifier
| LitInt Integer
| LitChar Char
| LitString String
| LitDouble Double
| List [Exp]
deriving (Exp -> Exp -> Bool
(Exp -> Exp -> Bool) -> (Exp -> Exp -> Bool) -> Eq Exp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Exp -> Exp -> Bool
== :: Exp -> Exp -> Bool
$c/= :: Exp -> Exp -> Bool
/= :: Exp -> Exp -> Bool
C.Eq, Eq Exp
Eq Exp =>
(Exp -> Exp -> Ordering)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Exp)
-> (Exp -> Exp -> Exp)
-> Ord Exp
Exp -> Exp -> Bool
Exp -> Exp -> Ordering
Exp -> Exp -> Exp
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
$ccompare :: Exp -> Exp -> Ordering
compare :: Exp -> Exp -> Ordering
$c< :: Exp -> Exp -> Bool
< :: Exp -> Exp -> Bool
$c<= :: Exp -> Exp -> Bool
<= :: Exp -> Exp -> Bool
$c> :: Exp -> Exp -> Bool
> :: Exp -> Exp -> Bool
$c>= :: Exp -> Exp -> Bool
>= :: Exp -> Exp -> Bool
$cmax :: Exp -> Exp -> Exp
max :: Exp -> Exp -> Exp
$cmin :: Exp -> Exp -> Exp
min :: Exp -> Exp -> Exp
C.Ord, Int -> Exp -> ShowS
[Exp] -> ShowS
Exp -> String
(Int -> Exp -> ShowS)
-> (Exp -> String) -> ([Exp] -> ShowS) -> Show Exp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Exp -> ShowS
showsPrec :: Int -> Exp -> ShowS
$cshow :: Exp -> String
show :: Exp -> String
$cshowList :: [Exp] -> ShowS
showList :: [Exp] -> ShowS
C.Show, ReadPrec [Exp]
ReadPrec Exp
Int -> ReadS Exp
ReadS [Exp]
(Int -> ReadS Exp)
-> ReadS [Exp] -> ReadPrec Exp -> ReadPrec [Exp] -> Read Exp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Exp
readsPrec :: Int -> ReadS Exp
$creadList :: ReadS [Exp]
readList :: ReadS [Exp]
$creadPrec :: ReadPrec Exp
readPrec :: ReadPrec Exp
$creadListPrec :: ReadPrec [Exp]
readListPrec :: ReadPrec [Exp]
C.Read)
data RHS = RHS [Item]
deriving (RHS -> RHS -> Bool
(RHS -> RHS -> Bool) -> (RHS -> RHS -> Bool) -> Eq RHS
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RHS -> RHS -> Bool
== :: RHS -> RHS -> Bool
$c/= :: RHS -> RHS -> Bool
/= :: RHS -> RHS -> Bool
C.Eq, Eq RHS
Eq RHS =>
(RHS -> RHS -> Ordering)
-> (RHS -> RHS -> Bool)
-> (RHS -> RHS -> Bool)
-> (RHS -> RHS -> Bool)
-> (RHS -> RHS -> Bool)
-> (RHS -> RHS -> RHS)
-> (RHS -> RHS -> RHS)
-> Ord RHS
RHS -> RHS -> Bool
RHS -> RHS -> Ordering
RHS -> RHS -> RHS
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
$ccompare :: RHS -> RHS -> Ordering
compare :: RHS -> RHS -> Ordering
$c< :: RHS -> RHS -> Bool
< :: RHS -> RHS -> Bool
$c<= :: RHS -> RHS -> Bool
<= :: RHS -> RHS -> Bool
$c> :: RHS -> RHS -> Bool
> :: RHS -> RHS -> Bool
$c>= :: RHS -> RHS -> Bool
>= :: RHS -> RHS -> Bool
$cmax :: RHS -> RHS -> RHS
max :: RHS -> RHS -> RHS
$cmin :: RHS -> RHS -> RHS
min :: RHS -> RHS -> RHS
C.Ord, Int -> RHS -> ShowS
[RHS] -> ShowS
RHS -> String
(Int -> RHS -> ShowS)
-> (RHS -> String) -> ([RHS] -> ShowS) -> Show RHS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RHS -> ShowS
showsPrec :: Int -> RHS -> ShowS
$cshow :: RHS -> String
show :: RHS -> String
$cshowList :: [RHS] -> ShowS
showList :: [RHS] -> ShowS
C.Show, ReadPrec [RHS]
ReadPrec RHS
Int -> ReadS RHS
ReadS [RHS]
(Int -> ReadS RHS)
-> ReadS [RHS] -> ReadPrec RHS -> ReadPrec [RHS] -> Read RHS
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS RHS
readsPrec :: Int -> ReadS RHS
$creadList :: ReadS [RHS]
readList :: ReadS [RHS]
$creadPrec :: ReadPrec RHS
readPrec :: ReadPrec RHS
$creadListPrec :: ReadPrec [RHS]
readListPrec :: ReadPrec [RHS]
C.Read)
data MinimumSize = MNonempty | MEmpty
deriving (MinimumSize -> MinimumSize -> Bool
(MinimumSize -> MinimumSize -> Bool)
-> (MinimumSize -> MinimumSize -> Bool) -> Eq MinimumSize
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MinimumSize -> MinimumSize -> Bool
== :: MinimumSize -> MinimumSize -> Bool
$c/= :: MinimumSize -> MinimumSize -> Bool
/= :: MinimumSize -> MinimumSize -> Bool
C.Eq, Eq MinimumSize
Eq MinimumSize =>
(MinimumSize -> MinimumSize -> Ordering)
-> (MinimumSize -> MinimumSize -> Bool)
-> (MinimumSize -> MinimumSize -> Bool)
-> (MinimumSize -> MinimumSize -> Bool)
-> (MinimumSize -> MinimumSize -> Bool)
-> (MinimumSize -> MinimumSize -> MinimumSize)
-> (MinimumSize -> MinimumSize -> MinimumSize)
-> Ord MinimumSize
MinimumSize -> MinimumSize -> Bool
MinimumSize -> MinimumSize -> Ordering
MinimumSize -> MinimumSize -> MinimumSize
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
$ccompare :: MinimumSize -> MinimumSize -> Ordering
compare :: MinimumSize -> MinimumSize -> Ordering
$c< :: MinimumSize -> MinimumSize -> Bool
< :: MinimumSize -> MinimumSize -> Bool
$c<= :: MinimumSize -> MinimumSize -> Bool
<= :: MinimumSize -> MinimumSize -> Bool
$c> :: MinimumSize -> MinimumSize -> Bool
> :: MinimumSize -> MinimumSize -> Bool
$c>= :: MinimumSize -> MinimumSize -> Bool
>= :: MinimumSize -> MinimumSize -> Bool
$cmax :: MinimumSize -> MinimumSize -> MinimumSize
max :: MinimumSize -> MinimumSize -> MinimumSize
$cmin :: MinimumSize -> MinimumSize -> MinimumSize
min :: MinimumSize -> MinimumSize -> MinimumSize
C.Ord, Int -> MinimumSize -> ShowS
[MinimumSize] -> ShowS
MinimumSize -> String
(Int -> MinimumSize -> ShowS)
-> (MinimumSize -> String)
-> ([MinimumSize] -> ShowS)
-> Show MinimumSize
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MinimumSize -> ShowS
showsPrec :: Int -> MinimumSize -> ShowS
$cshow :: MinimumSize -> String
show :: MinimumSize -> String
$cshowList :: [MinimumSize] -> ShowS
showList :: [MinimumSize] -> ShowS
C.Show, ReadPrec [MinimumSize]
ReadPrec MinimumSize
Int -> ReadS MinimumSize
ReadS [MinimumSize]
(Int -> ReadS MinimumSize)
-> ReadS [MinimumSize]
-> ReadPrec MinimumSize
-> ReadPrec [MinimumSize]
-> Read MinimumSize
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS MinimumSize
readsPrec :: Int -> ReadS MinimumSize
$creadList :: ReadS [MinimumSize]
readList :: ReadS [MinimumSize]
$creadPrec :: ReadPrec MinimumSize
readPrec :: ReadPrec MinimumSize
$creadListPrec :: ReadPrec [MinimumSize]
readListPrec :: ReadPrec [MinimumSize]
C.Read)
data Reg
= RAlt Reg Reg
| RMinus Reg Reg
| RSeq Reg Reg
| RStar Reg
| RPlus Reg
| ROpt Reg
| REps
| RChar Char
| RAlts String
| RSeqs String
| RDigit
| RLetter
| RUpper
| RLower
| RAny
deriving (Reg -> Reg -> Bool
(Reg -> Reg -> Bool) -> (Reg -> Reg -> Bool) -> Eq Reg
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Reg -> Reg -> Bool
== :: Reg -> Reg -> Bool
$c/= :: Reg -> Reg -> Bool
/= :: Reg -> Reg -> Bool
C.Eq, Eq Reg
Eq Reg =>
(Reg -> Reg -> Ordering)
-> (Reg -> Reg -> Bool)
-> (Reg -> Reg -> Bool)
-> (Reg -> Reg -> Bool)
-> (Reg -> Reg -> Bool)
-> (Reg -> Reg -> Reg)
-> (Reg -> Reg -> Reg)
-> Ord Reg
Reg -> Reg -> Bool
Reg -> Reg -> Ordering
Reg -> Reg -> Reg
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
$ccompare :: Reg -> Reg -> Ordering
compare :: Reg -> Reg -> Ordering
$c< :: Reg -> Reg -> Bool
< :: Reg -> Reg -> Bool
$c<= :: Reg -> Reg -> Bool
<= :: Reg -> Reg -> Bool
$c> :: Reg -> Reg -> Bool
> :: Reg -> Reg -> Bool
$c>= :: Reg -> Reg -> Bool
>= :: Reg -> Reg -> Bool
$cmax :: Reg -> Reg -> Reg
max :: Reg -> Reg -> Reg
$cmin :: Reg -> Reg -> Reg
min :: Reg -> Reg -> Reg
C.Ord, Int -> Reg -> ShowS
[Reg] -> ShowS
Reg -> String
(Int -> Reg -> ShowS)
-> (Reg -> String) -> ([Reg] -> ShowS) -> Show Reg
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Reg -> ShowS
showsPrec :: Int -> Reg -> ShowS
$cshow :: Reg -> String
show :: Reg -> String
$cshowList :: [Reg] -> ShowS
showList :: [Reg] -> ShowS
C.Show, ReadPrec [Reg]
ReadPrec Reg
Int -> ReadS Reg
ReadS [Reg]
(Int -> ReadS Reg)
-> ReadS [Reg] -> ReadPrec Reg -> ReadPrec [Reg] -> Read Reg
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Reg
readsPrec :: Int -> ReadS Reg
$creadList :: ReadS [Reg]
readList :: ReadS [Reg]
$creadPrec :: ReadPrec Reg
readPrec :: ReadPrec Reg
$creadListPrec :: ReadPrec [Reg]
readListPrec :: ReadPrec [Reg]
C.Read)
newtype Identifier = Identifier ((C.Int, C.Int), String)
deriving (Identifier -> Identifier -> Bool
(Identifier -> Identifier -> Bool)
-> (Identifier -> Identifier -> Bool) -> Eq Identifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Identifier -> Identifier -> Bool
== :: Identifier -> Identifier -> Bool
$c/= :: Identifier -> Identifier -> Bool
/= :: Identifier -> Identifier -> Bool
C.Eq, Eq Identifier
Eq Identifier =>
(Identifier -> Identifier -> Ordering)
-> (Identifier -> Identifier -> Bool)
-> (Identifier -> Identifier -> Bool)
-> (Identifier -> Identifier -> Bool)
-> (Identifier -> Identifier -> Bool)
-> (Identifier -> Identifier -> Identifier)
-> (Identifier -> Identifier -> Identifier)
-> Ord Identifier
Identifier -> Identifier -> Bool
Identifier -> Identifier -> Ordering
Identifier -> Identifier -> Identifier
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
$ccompare :: Identifier -> Identifier -> Ordering
compare :: Identifier -> Identifier -> Ordering
$c< :: Identifier -> Identifier -> Bool
< :: Identifier -> Identifier -> Bool
$c<= :: Identifier -> Identifier -> Bool
<= :: Identifier -> Identifier -> Bool
$c> :: Identifier -> Identifier -> Bool
> :: Identifier -> Identifier -> Bool
$c>= :: Identifier -> Identifier -> Bool
>= :: Identifier -> Identifier -> Bool
$cmax :: Identifier -> Identifier -> Identifier
max :: Identifier -> Identifier -> Identifier
$cmin :: Identifier -> Identifier -> Identifier
min :: Identifier -> Identifier -> Identifier
C.Ord, Int -> Identifier -> ShowS
[Identifier] -> ShowS
Identifier -> String
(Int -> Identifier -> ShowS)
-> (Identifier -> String)
-> ([Identifier] -> ShowS)
-> Show Identifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Identifier -> ShowS
showsPrec :: Int -> Identifier -> ShowS
$cshow :: Identifier -> String
show :: Identifier -> String
$cshowList :: [Identifier] -> ShowS
showList :: [Identifier] -> ShowS
C.Show, ReadPrec [Identifier]
ReadPrec Identifier
Int -> ReadS Identifier
ReadS [Identifier]
(Int -> ReadS Identifier)
-> ReadS [Identifier]
-> ReadPrec Identifier
-> ReadPrec [Identifier]
-> Read Identifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Identifier
readsPrec :: Int -> ReadS Identifier
$creadList :: ReadS [Identifier]
readList :: ReadS [Identifier]
$creadPrec :: ReadPrec Identifier
readPrec :: ReadPrec Identifier
$creadListPrec :: ReadPrec [Identifier]
readListPrec :: ReadPrec [Identifier]
C.Read)
type BNFC'Position = C.Maybe (C.Int, C.Int)
pattern BNFC'NoPosition :: BNFC'Position
pattern $mBNFC'NoPosition :: forall {r}. BNFC'Position -> ((# #) -> r) -> ((# #) -> r) -> r
$bBNFC'NoPosition :: BNFC'Position
BNFC'NoPosition = C.Nothing
pattern BNFC'Position :: C.Int -> C.Int -> BNFC'Position
pattern $mBNFC'Position :: forall {r}. BNFC'Position -> (Int -> Int -> r) -> ((# #) -> r) -> r
$bBNFC'Position :: Int -> Int -> BNFC'Position
BNFC'Position line col = C.Just (line, col)
class HasPosition a where
hasPosition :: a -> BNFC'Position
instance HasPosition Identifier where
hasPosition :: Identifier -> BNFC'Position
hasPosition (Identifier ((Int, Int)
p, String
_)) = (Int, Int) -> BNFC'Position
forall a. a -> Maybe a
C.Just (Int, Int)
p