{-# LANGUAGE DeriveFunctor     #-}
{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE StrictData        #-}
module Language.Cimple.AST
    ( AssignOp (..)
    , BinaryOp (..)
    , UnaryOp (..)
    , LiteralType (..)
    , Node (..)
    , Scope (..)
    , CommentStyle (..)
    ) where

import           Data.Aeson   (FromJSON, ToJSON)
import           GHC.Generics (Generic)

data Node a lexeme
    = Attr a
    -- Preprocessor
    | PreprocInclude lexeme
    | PreprocDefine lexeme
    | PreprocDefineConst lexeme (Node a lexeme)
    | PreprocDefineMacro lexeme [Node a lexeme] (Node a lexeme)
    | PreprocIf (Node a lexeme) [Node a lexeme] (Node a lexeme)
    | PreprocIfdef lexeme [Node a lexeme] (Node a lexeme)
    | PreprocIfndef lexeme [Node a lexeme] (Node a lexeme)
    | PreprocElse [Node a lexeme]
    | PreprocElif (Node a lexeme) [Node a lexeme] (Node a lexeme)
    | PreprocUndef lexeme
    | PreprocDefined lexeme
    | PreprocScopedDefine (Node a lexeme) [Node a lexeme] (Node a lexeme)
    | MacroBodyStmt [Node a lexeme]
    | MacroBodyFunCall (Node a lexeme)
    | MacroParam lexeme
    | StaticAssert (Node a lexeme) lexeme
    -- Comments
    | LicenseDecl lexeme [Node a lexeme]
    | CopyrightDecl lexeme (Maybe lexeme) [lexeme]
    | Comment CommentStyle lexeme [Node a lexeme] lexeme
    | CommentBlock lexeme
    | CommentWord lexeme
    | Commented (Node a lexeme) (Node a lexeme)
    -- Namespace-like blocks
    | ExternC [Node a lexeme]
    | Class Scope lexeme [Node a lexeme] [Node a lexeme]
    | Namespace Scope lexeme [Node a lexeme]
    -- Statements
    | CompoundStmt [Node a lexeme]
    | Break
    | Goto lexeme
    | Continue
    | Return (Maybe (Node a lexeme))
    | SwitchStmt (Node a lexeme) [Node a lexeme]
    | IfStmt (Node a lexeme) [Node a lexeme] (Maybe (Node a lexeme))
    | ForStmt (Node a lexeme) (Node a lexeme) (Node a lexeme) [Node a lexeme]
    | WhileStmt (Node a lexeme) [Node a lexeme]
    | DoWhileStmt [Node a lexeme] (Node a lexeme)
    | Case (Node a lexeme) (Node a lexeme)
    | Default (Node a lexeme)
    | Label lexeme (Node a lexeme)
    -- Variable declarations
    | VLA (Node a lexeme) lexeme (Node a lexeme)
    | VarDecl (Node a lexeme) (Node a lexeme)
    | Declarator (Node a lexeme) (Maybe (Node a lexeme))
    | DeclSpecVar lexeme
    | DeclSpecArray (Node a lexeme) (Maybe (Node a lexeme))
    -- Expressions
    | InitialiserList [Node a lexeme]
    | UnaryExpr UnaryOp (Node a lexeme)
    | BinaryExpr (Node a lexeme) BinaryOp (Node a lexeme)
    | TernaryExpr (Node a lexeme) (Node a lexeme) (Node a lexeme)
    | AssignExpr (Node a lexeme) AssignOp (Node a lexeme)
    | ParenExpr (Node a lexeme)
    | CastExpr (Node a lexeme) (Node a lexeme)
    | CompoundExpr (Node a lexeme) (Node a lexeme)
    | SizeofExpr (Node a lexeme)
    | SizeofType (Node a lexeme)
    | LiteralExpr LiteralType lexeme
    | VarExpr lexeme
    | MemberAccess (Node a lexeme) lexeme
    | PointerAccess (Node a lexeme) lexeme
    | ArrayAccess (Node a lexeme) (Node a lexeme)
    | FunctionCall (Node a lexeme) [Node a lexeme]
    | CommentExpr (Node a lexeme) (Node a lexeme)
    -- Type definitions
    | EnumClass lexeme [Node a lexeme]
    | EnumConsts (Maybe lexeme) [Node a lexeme]
    | EnumDecl lexeme [Node a lexeme] lexeme
    | Enumerator lexeme (Maybe (Node a lexeme))
    | ClassForward lexeme [Node a lexeme]
    | Typedef (Node a lexeme) lexeme
    | TypedefFunction (Node a lexeme)
    | Struct lexeme [Node a lexeme]
    | Union lexeme [Node a lexeme]
    | MemberDecl (Node a lexeme) (Node a lexeme) (Maybe lexeme)
    | TyConst (Node a lexeme)
    | TyPointer (Node a lexeme)
    | TyStruct lexeme
    | TyFunc lexeme
    | TyStd lexeme
    | TyVar lexeme
    | TyUserDefined lexeme
    -- Functions
    | FunctionDecl Scope (Node a lexeme) (Maybe (Node a lexeme))
    | FunctionDefn Scope (Node a lexeme) [Node a lexeme]
    | FunctionPrototype (Node a lexeme) lexeme [Node a lexeme]
    | FunctionParam (Node a lexeme) (Node a lexeme)
    | Event lexeme (Node a lexeme)
    | EventParams [Node a lexeme]
    | Property (Node a lexeme) (Node a lexeme) [Node a lexeme]
    | Accessor lexeme [Node a lexeme] (Maybe (Node a lexeme))
    | ErrorDecl lexeme [Node a lexeme]
    | ErrorList [Node a lexeme]
    | ErrorFor lexeme
    | Ellipsis
    -- Constants
    | ConstDecl (Node a lexeme) lexeme
    | ConstDefn Scope (Node a lexeme) lexeme (Node a lexeme)
    deriving (Int -> Node a lexeme -> ShowS
[Node a lexeme] -> ShowS
Node a lexeme -> String
(Int -> Node a lexeme -> ShowS)
-> (Node a lexeme -> String)
-> ([Node a lexeme] -> ShowS)
-> Show (Node a lexeme)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall a lexeme.
(Show a, Show lexeme) =>
Int -> Node a lexeme -> ShowS
forall a lexeme. (Show a, Show lexeme) => [Node a lexeme] -> ShowS
forall a lexeme. (Show a, Show lexeme) => Node a lexeme -> String
showList :: [Node a lexeme] -> ShowS
$cshowList :: forall a lexeme. (Show a, Show lexeme) => [Node a lexeme] -> ShowS
show :: Node a lexeme -> String
$cshow :: forall a lexeme. (Show a, Show lexeme) => Node a lexeme -> String
showsPrec :: Int -> Node a lexeme -> ShowS
$cshowsPrec :: forall a lexeme.
(Show a, Show lexeme) =>
Int -> Node a lexeme -> ShowS
Show, Node a lexeme -> Node a lexeme -> Bool
(Node a lexeme -> Node a lexeme -> Bool)
-> (Node a lexeme -> Node a lexeme -> Bool) -> Eq (Node a lexeme)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall a lexeme.
(Eq a, Eq lexeme) =>
Node a lexeme -> Node a lexeme -> Bool
/= :: Node a lexeme -> Node a lexeme -> Bool
$c/= :: forall a lexeme.
(Eq a, Eq lexeme) =>
Node a lexeme -> Node a lexeme -> Bool
== :: Node a lexeme -> Node a lexeme -> Bool
$c== :: forall a lexeme.
(Eq a, Eq lexeme) =>
Node a lexeme -> Node a lexeme -> Bool
Eq, (forall x. Node a lexeme -> Rep (Node a lexeme) x)
-> (forall x. Rep (Node a lexeme) x -> Node a lexeme)
-> Generic (Node a lexeme)
forall x. Rep (Node a lexeme) x -> Node a lexeme
forall x. Node a lexeme -> Rep (Node a lexeme) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a lexeme x. Rep (Node a lexeme) x -> Node a lexeme
forall a lexeme x. Node a lexeme -> Rep (Node a lexeme) x
$cto :: forall a lexeme x. Rep (Node a lexeme) x -> Node a lexeme
$cfrom :: forall a lexeme x. Node a lexeme -> Rep (Node a lexeme) x
Generic, a -> Node a b -> Node a a
(a -> b) -> Node a a -> Node a b
(forall a b. (a -> b) -> Node a a -> Node a b)
-> (forall a b. a -> Node a b -> Node a a) -> Functor (Node a)
forall a b. a -> Node a b -> Node a a
forall a b. (a -> b) -> Node a a -> Node a b
forall a a b. a -> Node a b -> Node a a
forall a a b. (a -> b) -> Node a a -> Node a b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Node a b -> Node a a
$c<$ :: forall a a b. a -> Node a b -> Node a a
fmap :: (a -> b) -> Node a a -> Node a b
$cfmap :: forall a a b. (a -> b) -> Node a a -> Node a b
Functor, Node a a -> Bool
(a -> m) -> Node a a -> m
(a -> b -> b) -> b -> Node a a -> b
(forall m. Monoid m => Node a m -> m)
-> (forall m a. Monoid m => (a -> m) -> Node a a -> m)
-> (forall m a. Monoid m => (a -> m) -> Node a a -> m)
-> (forall a b. (a -> b -> b) -> b -> Node a a -> b)
-> (forall a b. (a -> b -> b) -> b -> Node a a -> b)
-> (forall b a. (b -> a -> b) -> b -> Node a a -> b)
-> (forall b a. (b -> a -> b) -> b -> Node a a -> b)
-> (forall a. (a -> a -> a) -> Node a a -> a)
-> (forall a. (a -> a -> a) -> Node a a -> a)
-> (forall a. Node a a -> [a])
-> (forall a. Node a a -> Bool)
-> (forall a. Node a a -> Int)
-> (forall a. Eq a => a -> Node a a -> Bool)
-> (forall a. Ord a => Node a a -> a)
-> (forall a. Ord a => Node a a -> a)
-> (forall a. Num a => Node a a -> a)
-> (forall a. Num a => Node a a -> a)
-> Foldable (Node a)
forall a. Eq a => a -> Node a a -> Bool
forall a. Num a => Node a a -> a
forall a. Ord a => Node a a -> a
forall m. Monoid m => Node a m -> m
forall a. Node a a -> Bool
forall a. Node a a -> Int
forall a. Node a a -> [a]
forall a. (a -> a -> a) -> Node a a -> a
forall a a. Eq a => a -> Node a a -> Bool
forall a a. Num a => Node a a -> a
forall a a. Ord a => Node a a -> a
forall m a. Monoid m => (a -> m) -> Node a a -> m
forall a m. Monoid m => Node a m -> m
forall a a. Node a a -> Bool
forall a a. Node a a -> Int
forall a a. Node a a -> [a]
forall b a. (b -> a -> b) -> b -> Node a a -> b
forall a b. (a -> b -> b) -> b -> Node a a -> b
forall a a. (a -> a -> a) -> Node a a -> a
forall a m a. Monoid m => (a -> m) -> Node a a -> m
forall a b a. (b -> a -> b) -> b -> Node a a -> b
forall a a b. (a -> b -> b) -> b -> Node a a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: Node a a -> a
$cproduct :: forall a a. Num a => Node a a -> a
sum :: Node a a -> a
$csum :: forall a a. Num a => Node a a -> a
minimum :: Node a a -> a
$cminimum :: forall a a. Ord a => Node a a -> a
maximum :: Node a a -> a
$cmaximum :: forall a a. Ord a => Node a a -> a
elem :: a -> Node a a -> Bool
$celem :: forall a a. Eq a => a -> Node a a -> Bool
length :: Node a a -> Int
$clength :: forall a a. Node a a -> Int
null :: Node a a -> Bool
$cnull :: forall a a. Node a a -> Bool
toList :: Node a a -> [a]
$ctoList :: forall a a. Node a a -> [a]
foldl1 :: (a -> a -> a) -> Node a a -> a
$cfoldl1 :: forall a a. (a -> a -> a) -> Node a a -> a
foldr1 :: (a -> a -> a) -> Node a a -> a
$cfoldr1 :: forall a a. (a -> a -> a) -> Node a a -> a
foldl' :: (b -> a -> b) -> b -> Node a a -> b
$cfoldl' :: forall a b a. (b -> a -> b) -> b -> Node a a -> b
foldl :: (b -> a -> b) -> b -> Node a a -> b
$cfoldl :: forall a b a. (b -> a -> b) -> b -> Node a a -> b
foldr' :: (a -> b -> b) -> b -> Node a a -> b
$cfoldr' :: forall a a b. (a -> b -> b) -> b -> Node a a -> b
foldr :: (a -> b -> b) -> b -> Node a a -> b
$cfoldr :: forall a a b. (a -> b -> b) -> b -> Node a a -> b
foldMap' :: (a -> m) -> Node a a -> m
$cfoldMap' :: forall a m a. Monoid m => (a -> m) -> Node a a -> m
foldMap :: (a -> m) -> Node a a -> m
$cfoldMap :: forall a m a. Monoid m => (a -> m) -> Node a a -> m
fold :: Node a m -> m
$cfold :: forall a m. Monoid m => Node a m -> m
Foldable, Functor (Node a)
Foldable (Node a)
Functor (Node a)
-> Foldable (Node a)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Node a a -> f (Node a b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Node a (f a) -> f (Node a a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Node a a -> m (Node a b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Node a (m a) -> m (Node a a))
-> Traversable (Node a)
(a -> f b) -> Node a a -> f (Node a b)
forall a. Functor (Node a)
forall a. Foldable (Node a)
forall a (m :: * -> *) a. Monad m => Node a (m a) -> m (Node a a)
forall a (f :: * -> *) a.
Applicative f =>
Node a (f a) -> f (Node a a)
forall a (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Node a a -> m (Node a b)
forall a (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Node a a -> f (Node a b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Node a (m a) -> m (Node a a)
forall (f :: * -> *) a.
Applicative f =>
Node a (f a) -> f (Node a a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Node a a -> m (Node a b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Node a a -> f (Node a b)
sequence :: Node a (m a) -> m (Node a a)
$csequence :: forall a (m :: * -> *) a. Monad m => Node a (m a) -> m (Node a a)
mapM :: (a -> m b) -> Node a a -> m (Node a b)
$cmapM :: forall a (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Node a a -> m (Node a b)
sequenceA :: Node a (f a) -> f (Node a a)
$csequenceA :: forall a (f :: * -> *) a.
Applicative f =>
Node a (f a) -> f (Node a a)
traverse :: (a -> f b) -> Node a a -> f (Node a b)
$ctraverse :: forall a (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Node a a -> f (Node a b)
$cp2Traversable :: forall a. Foldable (Node a)
$cp1Traversable :: forall a. Functor (Node a)
Traversable)

instance (FromJSON a, FromJSON lexeme) => FromJSON (Node a lexeme)
instance (ToJSON a, ToJSON lexeme) => ToJSON (Node a lexeme)

data AssignOp
    = AopEq
    | AopMul
    | AopDiv
    | AopPlus
    | AopMinus
    | AopBitAnd
    | AopBitOr
    | AopBitXor
    | AopMod
    | AopLsh
    | AopRsh
    deriving (Int -> AssignOp -> ShowS
[AssignOp] -> ShowS
AssignOp -> String
(Int -> AssignOp -> ShowS)
-> (AssignOp -> String) -> ([AssignOp] -> ShowS) -> Show AssignOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssignOp] -> ShowS
$cshowList :: [AssignOp] -> ShowS
show :: AssignOp -> String
$cshow :: AssignOp -> String
showsPrec :: Int -> AssignOp -> ShowS
$cshowsPrec :: Int -> AssignOp -> ShowS
Show, AssignOp -> AssignOp -> Bool
(AssignOp -> AssignOp -> Bool)
-> (AssignOp -> AssignOp -> Bool) -> Eq AssignOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssignOp -> AssignOp -> Bool
$c/= :: AssignOp -> AssignOp -> Bool
== :: AssignOp -> AssignOp -> Bool
$c== :: AssignOp -> AssignOp -> Bool
Eq, (forall x. AssignOp -> Rep AssignOp x)
-> (forall x. Rep AssignOp x -> AssignOp) -> Generic AssignOp
forall x. Rep AssignOp x -> AssignOp
forall x. AssignOp -> Rep AssignOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssignOp x -> AssignOp
$cfrom :: forall x. AssignOp -> Rep AssignOp x
Generic)

instance FromJSON AssignOp
instance ToJSON AssignOp

data BinaryOp
    = BopNe
    | BopEq
    | BopOr
    | BopBitXor
    | BopBitOr
    | BopAnd
    | BopBitAnd
    | BopDiv
    | BopMul
    | BopMod
    | BopPlus
    | BopMinus
    | BopLt
    | BopLe
    | BopLsh
    | BopGt
    | BopGe
    | BopRsh
    deriving (Int -> BinaryOp -> ShowS
[BinaryOp] -> ShowS
BinaryOp -> String
(Int -> BinaryOp -> ShowS)
-> (BinaryOp -> String) -> ([BinaryOp] -> ShowS) -> Show BinaryOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BinaryOp] -> ShowS
$cshowList :: [BinaryOp] -> ShowS
show :: BinaryOp -> String
$cshow :: BinaryOp -> String
showsPrec :: Int -> BinaryOp -> ShowS
$cshowsPrec :: Int -> BinaryOp -> ShowS
Show, BinaryOp -> BinaryOp -> Bool
(BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool) -> Eq BinaryOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BinaryOp -> BinaryOp -> Bool
$c/= :: BinaryOp -> BinaryOp -> Bool
== :: BinaryOp -> BinaryOp -> Bool
$c== :: BinaryOp -> BinaryOp -> Bool
Eq, (forall x. BinaryOp -> Rep BinaryOp x)
-> (forall x. Rep BinaryOp x -> BinaryOp) -> Generic BinaryOp
forall x. Rep BinaryOp x -> BinaryOp
forall x. BinaryOp -> Rep BinaryOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BinaryOp x -> BinaryOp
$cfrom :: forall x. BinaryOp -> Rep BinaryOp x
Generic)

instance FromJSON BinaryOp
instance ToJSON BinaryOp

data UnaryOp
    = UopNot
    | UopNeg
    | UopMinus
    | UopAddress
    | UopDeref
    | UopIncr
    | UopDecr
    deriving (Int -> UnaryOp -> ShowS
[UnaryOp] -> ShowS
UnaryOp -> String
(Int -> UnaryOp -> ShowS)
-> (UnaryOp -> String) -> ([UnaryOp] -> ShowS) -> Show UnaryOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnaryOp] -> ShowS
$cshowList :: [UnaryOp] -> ShowS
show :: UnaryOp -> String
$cshow :: UnaryOp -> String
showsPrec :: Int -> UnaryOp -> ShowS
$cshowsPrec :: Int -> UnaryOp -> ShowS
Show, UnaryOp -> UnaryOp -> Bool
(UnaryOp -> UnaryOp -> Bool)
-> (UnaryOp -> UnaryOp -> Bool) -> Eq UnaryOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnaryOp -> UnaryOp -> Bool
$c/= :: UnaryOp -> UnaryOp -> Bool
== :: UnaryOp -> UnaryOp -> Bool
$c== :: UnaryOp -> UnaryOp -> Bool
Eq, (forall x. UnaryOp -> Rep UnaryOp x)
-> (forall x. Rep UnaryOp x -> UnaryOp) -> Generic UnaryOp
forall x. Rep UnaryOp x -> UnaryOp
forall x. UnaryOp -> Rep UnaryOp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnaryOp x -> UnaryOp
$cfrom :: forall x. UnaryOp -> Rep UnaryOp x
Generic)

instance FromJSON UnaryOp
instance ToJSON UnaryOp

data LiteralType
    = Char
    | Int
    | Bool
    | String
    | ConstId
    deriving (Int -> LiteralType -> ShowS
[LiteralType] -> ShowS
LiteralType -> String
(Int -> LiteralType -> ShowS)
-> (LiteralType -> String)
-> ([LiteralType] -> ShowS)
-> Show LiteralType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LiteralType] -> ShowS
$cshowList :: [LiteralType] -> ShowS
show :: LiteralType -> String
$cshow :: LiteralType -> String
showsPrec :: Int -> LiteralType -> ShowS
$cshowsPrec :: Int -> LiteralType -> ShowS
Show, LiteralType -> LiteralType -> Bool
(LiteralType -> LiteralType -> Bool)
-> (LiteralType -> LiteralType -> Bool) -> Eq LiteralType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LiteralType -> LiteralType -> Bool
$c/= :: LiteralType -> LiteralType -> Bool
== :: LiteralType -> LiteralType -> Bool
$c== :: LiteralType -> LiteralType -> Bool
Eq, (forall x. LiteralType -> Rep LiteralType x)
-> (forall x. Rep LiteralType x -> LiteralType)
-> Generic LiteralType
forall x. Rep LiteralType x -> LiteralType
forall x. LiteralType -> Rep LiteralType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LiteralType x -> LiteralType
$cfrom :: forall x. LiteralType -> Rep LiteralType x
Generic)

instance FromJSON LiteralType
instance ToJSON LiteralType

data Scope
    = Global
    | Static
    deriving (Int -> Scope -> ShowS
[Scope] -> ShowS
Scope -> String
(Int -> Scope -> ShowS)
-> (Scope -> String) -> ([Scope] -> ShowS) -> Show Scope
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scope] -> ShowS
$cshowList :: [Scope] -> ShowS
show :: Scope -> String
$cshow :: Scope -> String
showsPrec :: Int -> Scope -> ShowS
$cshowsPrec :: Int -> Scope -> ShowS
Show, Scope -> Scope -> Bool
(Scope -> Scope -> Bool) -> (Scope -> Scope -> Bool) -> Eq Scope
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scope -> Scope -> Bool
$c/= :: Scope -> Scope -> Bool
== :: Scope -> Scope -> Bool
$c== :: Scope -> Scope -> Bool
Eq, (forall x. Scope -> Rep Scope x)
-> (forall x. Rep Scope x -> Scope) -> Generic Scope
forall x. Rep Scope x -> Scope
forall x. Scope -> Rep Scope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Scope x -> Scope
$cfrom :: forall x. Scope -> Rep Scope x
Generic)

instance FromJSON Scope
instance ToJSON Scope

data CommentStyle
    = Regular
    | Doxygen
    | Block
    deriving (Int -> CommentStyle -> ShowS
[CommentStyle] -> ShowS
CommentStyle -> String
(Int -> CommentStyle -> ShowS)
-> (CommentStyle -> String)
-> ([CommentStyle] -> ShowS)
-> Show CommentStyle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommentStyle] -> ShowS
$cshowList :: [CommentStyle] -> ShowS
show :: CommentStyle -> String
$cshow :: CommentStyle -> String
showsPrec :: Int -> CommentStyle -> ShowS
$cshowsPrec :: Int -> CommentStyle -> ShowS
Show, CommentStyle -> CommentStyle -> Bool
(CommentStyle -> CommentStyle -> Bool)
-> (CommentStyle -> CommentStyle -> Bool) -> Eq CommentStyle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommentStyle -> CommentStyle -> Bool
$c/= :: CommentStyle -> CommentStyle -> Bool
== :: CommentStyle -> CommentStyle -> Bool
$c== :: CommentStyle -> CommentStyle -> Bool
Eq, (forall x. CommentStyle -> Rep CommentStyle x)
-> (forall x. Rep CommentStyle x -> CommentStyle)
-> Generic CommentStyle
forall x. Rep CommentStyle x -> CommentStyle
forall x. CommentStyle -> Rep CommentStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommentStyle x -> CommentStyle
$cfrom :: forall x. CommentStyle -> Rep CommentStyle x
Generic)

instance FromJSON CommentStyle
instance ToJSON CommentStyle