-- Haskell data types for the abstract syntax.
-- Generated by the BNF converter.

{-# LANGUAGE PatternSynonyms #-}

-- | The abstract syntax of language BNFC.

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
/= :: Grammar -> Grammar -> Bool
$c/= :: Grammar -> Grammar -> Bool
== :: Grammar -> Grammar -> Bool
$c== :: 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
min :: Grammar -> Grammar -> Grammar
$cmin :: Grammar -> Grammar -> Grammar
max :: Grammar -> Grammar -> Grammar
$cmax :: Grammar -> Grammar -> Grammar
>= :: Grammar -> Grammar -> Bool
$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
compare :: Grammar -> Grammar -> Ordering
$ccompare :: Grammar -> Grammar -> Ordering
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
showList :: [Grammar] -> ShowS
$cshowList :: [Grammar] -> ShowS
show :: Grammar -> String
$cshow :: Grammar -> String
showsPrec :: Int -> Grammar -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Grammar]
$creadListPrec :: ReadPrec [Grammar]
readPrec :: ReadPrec Grammar
$creadPrec :: ReadPrec Grammar
readList :: ReadS [Grammar]
$creadList :: ReadS [Grammar]
readsPrec :: Int -> ReadS Grammar
$creadsPrec :: Int -> ReadS Grammar
C.Read)

data Def
    = Rule Label Cat [Item]
    | Comment String
    | Comments 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
/= :: Def -> Def -> Bool
$c/= :: Def -> Def -> Bool
== :: Def -> Def -> Bool
$c== :: 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
min :: Def -> Def -> Def
$cmin :: Def -> Def -> Def
max :: Def -> Def -> Def
$cmax :: Def -> Def -> Def
>= :: Def -> Def -> Bool
$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
compare :: Def -> Def -> Ordering
$ccompare :: Def -> Def -> Ordering
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
showList :: [Def] -> ShowS
$cshowList :: [Def] -> ShowS
show :: Def -> String
$cshow :: Def -> String
showsPrec :: Int -> Def -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Def]
$creadListPrec :: ReadPrec [Def]
readPrec :: ReadPrec Def
$creadPrec :: ReadPrec Def
readList :: ReadS [Def]
$creadList :: ReadS [Def]
readsPrec :: Int -> ReadS Def
$creadsPrec :: Int -> ReadS 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
/= :: Item -> Item -> Bool
$c/= :: Item -> Item -> Bool
== :: Item -> Item -> Bool
$c== :: 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
min :: Item -> Item -> Item
$cmin :: Item -> Item -> Item
max :: Item -> Item -> Item
$cmax :: Item -> Item -> Item
>= :: Item -> Item -> Bool
$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
compare :: Item -> Item -> Ordering
$ccompare :: Item -> Item -> Ordering
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
showList :: [Item] -> ShowS
$cshowList :: [Item] -> ShowS
show :: Item -> String
$cshow :: Item -> String
showsPrec :: Int -> Item -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Item]
$creadListPrec :: ReadPrec [Item]
readPrec :: ReadPrec Item
$creadPrec :: ReadPrec Item
readList :: ReadS [Item]
$creadList :: ReadS [Item]
readsPrec :: Int -> ReadS Item
$creadsPrec :: Int -> ReadS 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
/= :: Cat -> Cat -> Bool
$c/= :: Cat -> Cat -> Bool
== :: Cat -> Cat -> Bool
$c== :: 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
min :: Cat -> Cat -> Cat
$cmin :: Cat -> Cat -> Cat
max :: Cat -> Cat -> Cat
$cmax :: Cat -> Cat -> Cat
>= :: Cat -> Cat -> Bool
$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
compare :: Cat -> Cat -> Ordering
$ccompare :: Cat -> Cat -> Ordering
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
showList :: [Cat] -> ShowS
$cshowList :: [Cat] -> ShowS
show :: Cat -> String
$cshow :: Cat -> String
showsPrec :: Int -> Cat -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Cat]
$creadListPrec :: ReadPrec [Cat]
readPrec :: ReadPrec Cat
$creadPrec :: ReadPrec Cat
readList :: ReadS [Cat]
$creadList :: ReadS [Cat]
readsPrec :: Int -> ReadS Cat
$creadsPrec :: Int -> ReadS 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
/= :: Label -> Label -> Bool
$c/= :: Label -> Label -> Bool
== :: Label -> Label -> Bool
$c== :: 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
min :: Label -> Label -> Label
$cmin :: Label -> Label -> Label
max :: Label -> Label -> Label
$cmax :: Label -> Label -> Label
>= :: Label -> Label -> Bool
$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
compare :: Label -> Label -> Ordering
$ccompare :: Label -> Label -> Ordering
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
showList :: [Label] -> ShowS
$cshowList :: [Label] -> ShowS
show :: Label -> String
$cshow :: Label -> String
showsPrec :: Int -> Label -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Label]
$creadListPrec :: ReadPrec [Label]
readPrec :: ReadPrec Label
$creadPrec :: ReadPrec Label
readList :: ReadS [Label]
$creadList :: ReadS [Label]
readsPrec :: Int -> ReadS Label
$creadsPrec :: Int -> ReadS 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
/= :: Arg -> Arg -> Bool
$c/= :: Arg -> Arg -> Bool
== :: Arg -> Arg -> Bool
$c== :: 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
min :: Arg -> Arg -> Arg
$cmin :: Arg -> Arg -> Arg
max :: Arg -> Arg -> Arg
$cmax :: Arg -> Arg -> Arg
>= :: Arg -> Arg -> Bool
$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
compare :: Arg -> Arg -> Ordering
$ccompare :: Arg -> Arg -> Ordering
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
showList :: [Arg] -> ShowS
$cshowList :: [Arg] -> ShowS
show :: Arg -> String
$cshow :: Arg -> String
showsPrec :: Int -> Arg -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Arg]
$creadListPrec :: ReadPrec [Arg]
readPrec :: ReadPrec Arg
$creadPrec :: ReadPrec Arg
readList :: ReadS [Arg]
$creadList :: ReadS [Arg]
readsPrec :: Int -> ReadS Arg
$creadsPrec :: Int -> ReadS 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
/= :: Separation -> Separation -> Bool
$c/= :: Separation -> Separation -> Bool
== :: Separation -> Separation -> Bool
$c== :: 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
min :: Separation -> Separation -> Separation
$cmin :: Separation -> Separation -> Separation
max :: Separation -> Separation -> Separation
$cmax :: Separation -> Separation -> Separation
>= :: Separation -> Separation -> Bool
$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
compare :: Separation -> Separation -> Ordering
$ccompare :: Separation -> Separation -> Ordering
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
showList :: [Separation] -> ShowS
$cshowList :: [Separation] -> ShowS
show :: Separation -> String
$cshow :: Separation -> String
showsPrec :: Int -> Separation -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Separation]
$creadListPrec :: ReadPrec [Separation]
readPrec :: ReadPrec Separation
$creadPrec :: ReadPrec Separation
readList :: ReadS [Separation]
$creadList :: ReadS [Separation]
readsPrec :: Int -> ReadS Separation
$creadsPrec :: Int -> ReadS 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
/= :: Exp -> Exp -> Bool
$c/= :: Exp -> Exp -> Bool
== :: Exp -> Exp -> Bool
$c== :: 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
min :: Exp -> Exp -> Exp
$cmin :: Exp -> Exp -> Exp
max :: Exp -> Exp -> Exp
$cmax :: Exp -> Exp -> Exp
>= :: Exp -> Exp -> Bool
$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
compare :: Exp -> Exp -> Ordering
$ccompare :: Exp -> Exp -> Ordering
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
showList :: [Exp] -> ShowS
$cshowList :: [Exp] -> ShowS
show :: Exp -> String
$cshow :: Exp -> String
showsPrec :: Int -> Exp -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Exp]
$creadListPrec :: ReadPrec [Exp]
readPrec :: ReadPrec Exp
$creadPrec :: ReadPrec Exp
readList :: ReadS [Exp]
$creadList :: ReadS [Exp]
readsPrec :: Int -> ReadS Exp
$creadsPrec :: Int -> ReadS 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
/= :: RHS -> RHS -> Bool
$c/= :: RHS -> RHS -> Bool
== :: RHS -> RHS -> Bool
$c== :: 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
min :: RHS -> RHS -> RHS
$cmin :: RHS -> RHS -> RHS
max :: RHS -> RHS -> RHS
$cmax :: RHS -> RHS -> RHS
>= :: RHS -> RHS -> Bool
$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
compare :: RHS -> RHS -> Ordering
$ccompare :: RHS -> RHS -> Ordering
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
showList :: [RHS] -> ShowS
$cshowList :: [RHS] -> ShowS
show :: RHS -> String
$cshow :: RHS -> String
showsPrec :: Int -> RHS -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [RHS]
$creadListPrec :: ReadPrec [RHS]
readPrec :: ReadPrec RHS
$creadPrec :: ReadPrec RHS
readList :: ReadS [RHS]
$creadList :: ReadS [RHS]
readsPrec :: Int -> ReadS RHS
$creadsPrec :: Int -> ReadS 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
/= :: MinimumSize -> MinimumSize -> Bool
$c/= :: MinimumSize -> MinimumSize -> Bool
== :: MinimumSize -> MinimumSize -> Bool
$c== :: 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
min :: MinimumSize -> MinimumSize -> MinimumSize
$cmin :: MinimumSize -> MinimumSize -> MinimumSize
max :: MinimumSize -> MinimumSize -> MinimumSize
$cmax :: MinimumSize -> MinimumSize -> MinimumSize
>= :: MinimumSize -> MinimumSize -> Bool
$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
compare :: MinimumSize -> MinimumSize -> Ordering
$ccompare :: MinimumSize -> MinimumSize -> Ordering
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
showList :: [MinimumSize] -> ShowS
$cshowList :: [MinimumSize] -> ShowS
show :: MinimumSize -> String
$cshow :: MinimumSize -> String
showsPrec :: Int -> MinimumSize -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [MinimumSize]
$creadListPrec :: ReadPrec [MinimumSize]
readPrec :: ReadPrec MinimumSize
$creadPrec :: ReadPrec MinimumSize
readList :: ReadS [MinimumSize]
$creadList :: ReadS [MinimumSize]
readsPrec :: Int -> ReadS MinimumSize
$creadsPrec :: Int -> ReadS 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
/= :: Reg -> Reg -> Bool
$c/= :: Reg -> Reg -> Bool
== :: Reg -> Reg -> Bool
$c== :: 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
min :: Reg -> Reg -> Reg
$cmin :: Reg -> Reg -> Reg
max :: Reg -> Reg -> Reg
$cmax :: Reg -> Reg -> Reg
>= :: Reg -> Reg -> Bool
$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
compare :: Reg -> Reg -> Ordering
$ccompare :: Reg -> Reg -> Ordering
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
showList :: [Reg] -> ShowS
$cshowList :: [Reg] -> ShowS
show :: Reg -> String
$cshow :: Reg -> String
showsPrec :: Int -> Reg -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Reg]
$creadListPrec :: ReadPrec [Reg]
readPrec :: ReadPrec Reg
$creadPrec :: ReadPrec Reg
readList :: ReadS [Reg]
$creadList :: ReadS [Reg]
readsPrec :: Int -> ReadS Reg
$creadsPrec :: Int -> ReadS 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
/= :: Identifier -> Identifier -> Bool
$c/= :: Identifier -> Identifier -> Bool
== :: Identifier -> Identifier -> Bool
$c== :: 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
min :: Identifier -> Identifier -> Identifier
$cmin :: Identifier -> Identifier -> Identifier
max :: Identifier -> Identifier -> Identifier
$cmax :: Identifier -> Identifier -> Identifier
>= :: Identifier -> Identifier -> Bool
$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
compare :: Identifier -> Identifier -> Ordering
$ccompare :: Identifier -> Identifier -> Ordering
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
showList :: [Identifier] -> ShowS
$cshowList :: [Identifier] -> ShowS
show :: Identifier -> String
$cshow :: Identifier -> String
showsPrec :: Int -> Identifier -> ShowS
$cshowsPrec :: Int -> 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
readListPrec :: ReadPrec [Identifier]
$creadListPrec :: ReadPrec [Identifier]
readPrec :: ReadPrec Identifier
$creadPrec :: ReadPrec Identifier
readList :: ReadS [Identifier]
$creadList :: ReadS [Identifier]
readsPrec :: Int -> ReadS Identifier
$creadsPrec :: Int -> ReadS Identifier
C.Read)

-- | Start position (line, column) of something.

type BNFC'Position = C.Maybe (C.Int, C.Int)

pattern BNFC'NoPosition :: BNFC'Position
pattern $bBNFC'NoPosition :: BNFC'Position
$mBNFC'NoPosition :: forall {r}. BNFC'Position -> (Void# -> r) -> (Void# -> r) -> r
BNFC'NoPosition = C.Nothing

pattern BNFC'Position :: C.Int -> C.Int -> BNFC'Position
pattern $bBNFC'Position :: Int -> Int -> BNFC'Position
$mBNFC'Position :: forall {r}. BNFC'Position -> (Int -> Int -> r) -> (Void# -> r) -> r
BNFC'Position line col = C.Just (line, col)

-- | Get the start position of something.

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