Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The abstract ayntax tree ( ast ) aims to be a data structure able to:
- represent multiple ( native ) ast kinds
- from various programming languages
Its main purpose is to serve as the:
As part of the dhscanner framework:
- targets mostly languages used for cloud native applications ☁️
- Python, Ruby 💎, Php, Javascript, Typescript, Java ☕️, C# and Golang.
Typical flow:
a file is parsed with the corresponding native parser of the language it's written in
- see Python's native parser, for example
- native parsers hosted on independent micro services
- the native ast is dumped (as JSON, or plain text)
- dumped content is sent to a Happy + Alex Haskell parser
- the Haskell parser organizes the natively parsed content into an ast
Geared towards static code analysis, the ast design abstracts away details that are normally ignored anyway
- for example, it does not distinguish between
try
andcatch
blocks - it models both of them as plain sequential code blocks.
- for example, it does not distinguish between
- Every file has exactly one ast (
Root
) that represents it Non Haskell parogrammers note:
- The ast is immutable ( like everything else in Haskell ... )
Synopsis
- data Root = Root {}
- data Exp
- data Stmt
- = StmtExp Exp
- | StmtIf StmtIfContent
- | StmtTry StmtTryContent
- | StmtCall ExpCallContent
- | StmtFunc StmtFuncContent
- | StmtDecvar DecVarContent
- | StmtBreak StmtBreakContent
- | StmtClass StmtClassContent
- | StmtWhile StmtWhileContent
- | StmtImport StmtImportContent
- | StmtMethod StmtMethodContent
- | StmtAssign StmtAssignContent
- | StmtReturn StmtReturnContent
- | StmtContinue StmtContinueContent
- data Param = Param {
- paramName :: ParamName
- paramNominalType :: NominalTy
- paramSerialIdx :: Word
- data DataMember = DataMember {}
- data DataMembers = DataMembers {
- actualDataMembers :: Map MembrName DataMember
- data StmtMethodContent = StmtMethodContent {}
- data Methods = Methods {}
- data StmtClassContent = StmtClassContent {}
- data StmtFuncContent = StmtFuncContent {}
- data DecPackageContent = DecPackageContent {}
- data DecVarContent = DecVarContent {
- decVarName :: VarName
- decVarNominalType :: NominalTy
- decVarInitValue :: Maybe Exp
- data ExpIntContent = ExpIntContent {}
- data ExpStrContent = ExpStrContent {}
- data ExpBoolContent = ExpBoolContent {}
- data Operator
- data ExpLambdaContent = ExpLambdaContent {
- expLambdaParams :: [Param]
- expLambdaBody :: [Stmt]
- expLambdaLocation :: Location
- data ExpBinopContent = ExpBinopContent {}
- data ExpVarContent = ExpVarContent {
- actualExpVar :: Var
- data StmtAssignContent = StmtAssignContent {
- stmtAssignLhs :: Var
- stmtAssignRhs :: Exp
- data StmtTryContent = StmtTryContent {
- stmtTryPart :: [Stmt]
- stmtCatchPart :: [Stmt]
- stmtTryLocation :: Location
- data StmtBreakContent = StmtBreakContent {}
- data StmtImportContent = StmtImportContent {
- stmtImportName :: String
- stmtImportAlias :: String
- stmtImportLocation :: Location
- data StmtContinueContent = StmtContinueContent {}
- data StmtIfContent = StmtIfContent {
- stmtIfCond :: Exp
- stmtIfBody :: [Stmt]
- stmtElseBody :: [Stmt]
- stmtIfLocation :: Location
- data StmtWhileContent = StmtWhileContent {}
- data StmtReturnContent = StmtReturnContent {
- stmtReturnValue :: Maybe Exp
- stmtReturnLocation :: Location
- data ExpCallContent = ExpCallContent {}
- data VarFieldContent = VarFieldContent {}
- data VarSimpleContent = VarSimpleContent {}
- data VarSubscriptContent = VarSubscriptContent {}
- data Var
- locationVar :: Var -> Location
Documentation
- every file has exactly one root 🌱
- classes, functions and methods are organized as statements ( not declarations )
- this enables a simpler view for modules, namespaces, nested classes etc.
Instances
FromJSON Root Source # | |
ToJSON Root Source # | |
Generic Root Source # | |
Show Root Source # | |
Eq Root Source # | |
Ord Root Source # | |
type Rep Root Source # | |
Defined in Ast type Rep Root = D1 ('MetaData "Root" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "Root" 'PrefixI 'True) (S1 ('MetaSel ('Just "filename") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "stmts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]))) |
ExpInt ExpIntContent | |
ExpStr ExpStrContent | |
ExpVar ExpVarContent | |
ExpBool ExpBoolContent | |
ExpCall ExpCallContent | |
ExpBinop ExpBinopContent | |
ExpLambda ExpLambdaContent |
Instances
FromJSON Exp Source # | |
ToJSON Exp Source # | |
Generic Exp Source # | |
Show Exp Source # | |
Eq Exp Source # | |
Ord Exp Source # | |
type Rep Exp Source # | |
Defined in Ast type Rep Exp = D1 ('MetaData "Exp" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) ((C1 ('MetaCons "ExpInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpIntContent)) :+: (C1 ('MetaCons "ExpStr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpStrContent)) :+: C1 ('MetaCons "ExpVar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpVarContent)))) :+: ((C1 ('MetaCons "ExpBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpBoolContent)) :+: C1 ('MetaCons "ExpCall" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpCallContent))) :+: (C1 ('MetaCons "ExpBinop" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpBinopContent)) :+: C1 ('MetaCons "ExpLambda" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpLambdaContent))))) |
Instances
FromJSON Stmt Source # | |
ToJSON Stmt Source # | |
Generic Stmt Source # | |
Show Stmt Source # | |
Eq Stmt Source # | |
Ord Stmt Source # | |
type Rep Stmt Source # | |
Defined in Ast type Rep Stmt = D1 ('MetaData "Stmt" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (((C1 ('MetaCons "StmtExp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: (C1 ('MetaCons "StmtIf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtIfContent)) :+: C1 ('MetaCons "StmtTry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtTryContent)))) :+: ((C1 ('MetaCons "StmtCall" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExpCallContent)) :+: C1 ('MetaCons "StmtFunc" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtFuncContent))) :+: (C1 ('MetaCons "StmtDecvar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DecVarContent)) :+: C1 ('MetaCons "StmtBreak" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtBreakContent))))) :+: ((C1 ('MetaCons "StmtClass" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtClassContent)) :+: (C1 ('MetaCons "StmtWhile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtWhileContent)) :+: C1 ('MetaCons "StmtImport" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtImportContent)))) :+: ((C1 ('MetaCons "StmtMethod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtMethodContent)) :+: C1 ('MetaCons "StmtAssign" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtAssignContent))) :+: (C1 ('MetaCons "StmtReturn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtReturnContent)) :+: C1 ('MetaCons "StmtContinue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 StmtContinueContent)))))) |
Param | |
|
Instances
FromJSON Param Source # | |
ToJSON Param Source # | |
Generic Param Source # | |
Show Param Source # | |
Eq Param Source # | |
Ord Param Source # | |
type Rep Param Source # | |
Defined in Ast type Rep Param = D1 ('MetaData "Param" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "Param" 'PrefixI 'True) (S1 ('MetaSel ('Just "paramName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParamName) :*: (S1 ('MetaSel ('Just "paramNominalType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalTy) :*: S1 ('MetaSel ('Just "paramSerialIdx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word)))) |
data DataMember Source #
DataMember | |
|
Instances
FromJSON DataMember Source # | |
Defined in Ast parseJSON :: Value -> Parser DataMember # parseJSONList :: Value -> Parser [DataMember] # omittedField :: Maybe DataMember # | |
ToJSON DataMember Source # | |
Defined in Ast toJSON :: DataMember -> Value # toEncoding :: DataMember -> Encoding # toJSONList :: [DataMember] -> Value # toEncodingList :: [DataMember] -> Encoding # omitField :: DataMember -> Bool # | |
Generic DataMember Source # | |
Defined in Ast type Rep DataMember :: Type -> Type from :: DataMember -> Rep DataMember x to :: Rep DataMember x -> DataMember | |
Show DataMember Source # | |
Defined in Ast showsPrec :: Int -> DataMember -> ShowS show :: DataMember -> String showList :: [DataMember] -> ShowS | |
Eq DataMember Source # | |
Defined in Ast (==) :: DataMember -> DataMember -> Bool (/=) :: DataMember -> DataMember -> Bool | |
Ord DataMember Source # | |
Defined in Ast compare :: DataMember -> DataMember -> Ordering (<) :: DataMember -> DataMember -> Bool (<=) :: DataMember -> DataMember -> Bool (>) :: DataMember -> DataMember -> Bool (>=) :: DataMember -> DataMember -> Bool max :: DataMember -> DataMember -> DataMember min :: DataMember -> DataMember -> DataMember | |
type Rep DataMember Source # | |
Defined in Ast type Rep DataMember = D1 ('MetaData "DataMember" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "DataMember" 'PrefixI 'True) (S1 ('MetaSel ('Just "dataMemberName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MembrName) :*: (S1 ('MetaSel ('Just "dataMemberNominalType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalTy) :*: S1 ('MetaSel ('Just "dataMemberInitValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Exp))))) |
data DataMembers Source #
Instances
data StmtMethodContent Source #
Instances
FromJSON StmtMethodContent Source # | |
Defined in Ast parseJSON :: Value -> Parser StmtMethodContent # parseJSONList :: Value -> Parser [StmtMethodContent] # omittedField :: Maybe StmtMethodContent # | |
ToJSON StmtMethodContent Source # | |
Defined in Ast toJSON :: StmtMethodContent -> Value # toEncoding :: StmtMethodContent -> Encoding # toJSONList :: [StmtMethodContent] -> Value # toEncodingList :: [StmtMethodContent] -> Encoding # omitField :: StmtMethodContent -> Bool # | |
Generic StmtMethodContent Source # | |
Defined in Ast type Rep StmtMethodContent :: Type -> Type from :: StmtMethodContent -> Rep StmtMethodContent x to :: Rep StmtMethodContent x -> StmtMethodContent | |
Show StmtMethodContent Source # | |
Defined in Ast showsPrec :: Int -> StmtMethodContent -> ShowS show :: StmtMethodContent -> String showList :: [StmtMethodContent] -> ShowS | |
Eq StmtMethodContent Source # | |
Defined in Ast (==) :: StmtMethodContent -> StmtMethodContent -> Bool (/=) :: StmtMethodContent -> StmtMethodContent -> Bool | |
Ord StmtMethodContent Source # | |
Defined in Ast compare :: StmtMethodContent -> StmtMethodContent -> Ordering (<) :: StmtMethodContent -> StmtMethodContent -> Bool (<=) :: StmtMethodContent -> StmtMethodContent -> Bool (>) :: StmtMethodContent -> StmtMethodContent -> Bool (>=) :: StmtMethodContent -> StmtMethodContent -> Bool max :: StmtMethodContent -> StmtMethodContent -> StmtMethodContent min :: StmtMethodContent -> StmtMethodContent -> StmtMethodContent | |
type Rep StmtMethodContent Source # | |
Defined in Ast type Rep StmtMethodContent = D1 ('MetaData "StmtMethodContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "StmtMethodContent" 'PrefixI 'True) ((S1 ('MetaSel ('Just "stmtMethodReturnType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalTy) :*: (S1 ('MetaSel ('Just "stmtMethodName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MethdName) :*: S1 ('MetaSel ('Just "stmtMethodParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Param]))) :*: ((S1 ('MetaSel ('Just "stmtMethodBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]) :*: S1 ('MetaSel ('Just "stmtMethodLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Location)) :*: (S1 ('MetaSel ('Just "hostingClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassName) :*: S1 ('MetaSel ('Just "hostingClassSupers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SuperName]))))) |
Instances
FromJSON Methods Source # | |
ToJSON Methods Source # | |
Generic Methods Source # | |
Show Methods Source # | |
Eq Methods Source # | |
Ord Methods Source # | |
type Rep Methods Source # | |
Defined in Ast type Rep Methods = D1 ('MetaData "Methods" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "Methods" 'PrefixI 'True) (S1 ('MetaSel ('Just "actualMethods") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map MethdName StmtMethodContent)))) |
data StmtClassContent Source #
Instances
FromJSON StmtClassContent Source # | |
Defined in Ast parseJSON :: Value -> Parser StmtClassContent # parseJSONList :: Value -> Parser [StmtClassContent] # omittedField :: Maybe StmtClassContent # | |
ToJSON StmtClassContent Source # | |
Defined in Ast toJSON :: StmtClassContent -> Value # toEncoding :: StmtClassContent -> Encoding # toJSONList :: [StmtClassContent] -> Value # toEncodingList :: [StmtClassContent] -> Encoding # omitField :: StmtClassContent -> Bool # | |
Generic StmtClassContent Source # | |
Defined in Ast type Rep StmtClassContent :: Type -> Type from :: StmtClassContent -> Rep StmtClassContent x to :: Rep StmtClassContent x -> StmtClassContent | |
Show StmtClassContent Source # | |
Defined in Ast showsPrec :: Int -> StmtClassContent -> ShowS show :: StmtClassContent -> String showList :: [StmtClassContent] -> ShowS | |
Eq StmtClassContent Source # | |
Defined in Ast (==) :: StmtClassContent -> StmtClassContent -> Bool (/=) :: StmtClassContent -> StmtClassContent -> Bool | |
Ord StmtClassContent Source # | |
Defined in Ast compare :: StmtClassContent -> StmtClassContent -> Ordering (<) :: StmtClassContent -> StmtClassContent -> Bool (<=) :: StmtClassContent -> StmtClassContent -> Bool (>) :: StmtClassContent -> StmtClassContent -> Bool (>=) :: StmtClassContent -> StmtClassContent -> Bool max :: StmtClassContent -> StmtClassContent -> StmtClassContent min :: StmtClassContent -> StmtClassContent -> StmtClassContent | |
type Rep StmtClassContent Source # | |
Defined in Ast type Rep StmtClassContent = D1 ('MetaData "StmtClassContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "StmtClassContent" 'PrefixI 'True) ((S1 ('MetaSel ('Just "stmtClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClassName) :*: S1 ('MetaSel ('Just "stmtClassSupers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SuperName])) :*: (S1 ('MetaSel ('Just "stmtClassDataMembers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DataMembers) :*: S1 ('MetaSel ('Just "stmtClassMethods") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Methods)))) |
data StmtFuncContent Source #
StmtFuncContent | |
|
Instances
FromJSON StmtFuncContent Source # | |
Defined in Ast parseJSON :: Value -> Parser StmtFuncContent # parseJSONList :: Value -> Parser [StmtFuncContent] # omittedField :: Maybe StmtFuncContent # | |
ToJSON StmtFuncContent Source # | |
Defined in Ast toJSON :: StmtFuncContent -> Value # toEncoding :: StmtFuncContent -> Encoding # toJSONList :: [StmtFuncContent] -> Value # toEncodingList :: [StmtFuncContent] -> Encoding # omitField :: StmtFuncContent -> Bool # | |
Generic StmtFuncContent Source # | |
Defined in Ast type Rep StmtFuncContent :: Type -> Type from :: StmtFuncContent -> Rep StmtFuncContent x to :: Rep StmtFuncContent x -> StmtFuncContent | |
Show StmtFuncContent Source # | |
Defined in Ast showsPrec :: Int -> StmtFuncContent -> ShowS show :: StmtFuncContent -> String showList :: [StmtFuncContent] -> ShowS | |
Eq StmtFuncContent Source # | |
Defined in Ast (==) :: StmtFuncContent -> StmtFuncContent -> Bool (/=) :: StmtFuncContent -> StmtFuncContent -> Bool | |
Ord StmtFuncContent Source # | |
Defined in Ast compare :: StmtFuncContent -> StmtFuncContent -> Ordering (<) :: StmtFuncContent -> StmtFuncContent -> Bool (<=) :: StmtFuncContent -> StmtFuncContent -> Bool (>) :: StmtFuncContent -> StmtFuncContent -> Bool (>=) :: StmtFuncContent -> StmtFuncContent -> Bool max :: StmtFuncContent -> StmtFuncContent -> StmtFuncContent min :: StmtFuncContent -> StmtFuncContent -> StmtFuncContent | |
type Rep StmtFuncContent Source # | |
Defined in Ast type Rep StmtFuncContent = D1 ('MetaData "StmtFuncContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "StmtFuncContent" 'PrefixI 'True) ((S1 ('MetaSel ('Just "stmtFuncReturnType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalTy) :*: (S1 ('MetaSel ('Just "stmtFuncName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FuncName) :*: S1 ('MetaSel ('Just "stmtFuncParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Param]))) :*: (S1 ('MetaSel ('Just "stmtFuncBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]) :*: (S1 ('MetaSel ('Just "stmtFuncAnnotations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Exp]) :*: S1 ('MetaSel ('Just "stmtFuncLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Location))))) |
data DecPackageContent Source #
Instances
data DecVarContent Source #
DecVarContent | |
|
Instances
FromJSON DecVarContent Source # | |
Defined in Ast parseJSON :: Value -> Parser DecVarContent # parseJSONList :: Value -> Parser [DecVarContent] # omittedField :: Maybe DecVarContent # | |
ToJSON DecVarContent Source # | |
Defined in Ast toJSON :: DecVarContent -> Value # toEncoding :: DecVarContent -> Encoding # toJSONList :: [DecVarContent] -> Value # toEncodingList :: [DecVarContent] -> Encoding # omitField :: DecVarContent -> Bool # | |
Generic DecVarContent Source # | |
Defined in Ast type Rep DecVarContent :: Type -> Type from :: DecVarContent -> Rep DecVarContent x to :: Rep DecVarContent x -> DecVarContent | |
Show DecVarContent Source # | |
Defined in Ast showsPrec :: Int -> DecVarContent -> ShowS show :: DecVarContent -> String showList :: [DecVarContent] -> ShowS | |
Eq DecVarContent Source # | |
Defined in Ast (==) :: DecVarContent -> DecVarContent -> Bool (/=) :: DecVarContent -> DecVarContent -> Bool | |
Ord DecVarContent Source # | |
Defined in Ast compare :: DecVarContent -> DecVarContent -> Ordering (<) :: DecVarContent -> DecVarContent -> Bool (<=) :: DecVarContent -> DecVarContent -> Bool (>) :: DecVarContent -> DecVarContent -> Bool (>=) :: DecVarContent -> DecVarContent -> Bool max :: DecVarContent -> DecVarContent -> DecVarContent min :: DecVarContent -> DecVarContent -> DecVarContent | |
type Rep DecVarContent Source # | |
Defined in Ast type Rep DecVarContent = D1 ('MetaData "DecVarContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "DecVarContent" 'PrefixI 'True) (S1 ('MetaSel ('Just "decVarName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VarName) :*: (S1 ('MetaSel ('Just "decVarNominalType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalTy) :*: S1 ('MetaSel ('Just "decVarInitValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Exp))))) |
data ExpIntContent Source #
Instances
data ExpStrContent Source #
Instances
data ExpBoolContent Source #
Instances
Instances
FromJSON Operator Source # | |
ToJSON Operator Source # | |
Generic Operator Source # | |
Show Operator Source # | |
Eq Operator Source # | |
Ord Operator Source # | |
type Rep Operator Source # | |
Defined in Ast type Rep Operator = D1 ('MetaData "Operator" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) ((C1 ('MetaCons "PLUS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MINUS" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TIMES" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DIVIDE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PERCENT" 'PrefixI 'False) (U1 :: Type -> Type)))) |
data ExpLambdaContent Source #
Instances
data ExpBinopContent Source #
Instances
FromJSON ExpBinopContent Source # | |
Defined in Ast parseJSON :: Value -> Parser ExpBinopContent # parseJSONList :: Value -> Parser [ExpBinopContent] # omittedField :: Maybe ExpBinopContent # | |
ToJSON ExpBinopContent Source # | |
Defined in Ast toJSON :: ExpBinopContent -> Value # toEncoding :: ExpBinopContent -> Encoding # toJSONList :: [ExpBinopContent] -> Value # toEncodingList :: [ExpBinopContent] -> Encoding # omitField :: ExpBinopContent -> Bool # | |
Generic ExpBinopContent Source # | |
Defined in Ast type Rep ExpBinopContent :: Type -> Type from :: ExpBinopContent -> Rep ExpBinopContent x to :: Rep ExpBinopContent x -> ExpBinopContent | |
Show ExpBinopContent Source # | |
Defined in Ast showsPrec :: Int -> ExpBinopContent -> ShowS show :: ExpBinopContent -> String showList :: [ExpBinopContent] -> ShowS | |
Eq ExpBinopContent Source # | |
Defined in Ast (==) :: ExpBinopContent -> ExpBinopContent -> Bool (/=) :: ExpBinopContent -> ExpBinopContent -> Bool | |
Ord ExpBinopContent Source # | |
Defined in Ast compare :: ExpBinopContent -> ExpBinopContent -> Ordering (<) :: ExpBinopContent -> ExpBinopContent -> Bool (<=) :: ExpBinopContent -> ExpBinopContent -> Bool (>) :: ExpBinopContent -> ExpBinopContent -> Bool (>=) :: ExpBinopContent -> ExpBinopContent -> Bool max :: ExpBinopContent -> ExpBinopContent -> ExpBinopContent min :: ExpBinopContent -> ExpBinopContent -> ExpBinopContent | |
type Rep ExpBinopContent Source # | |
Defined in Ast type Rep ExpBinopContent = D1 ('MetaData "ExpBinopContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "ExpBinopContent" 'PrefixI 'True) ((S1 ('MetaSel ('Just "expBinopLeft") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Just "expBinopRight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :*: (S1 ('MetaSel ('Just "expBinopOperator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Operator) :*: S1 ('MetaSel ('Just "expBinopLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Location)))) |
data ExpVarContent Source #
Instances
data StmtAssignContent Source #
Instances
data StmtTryContent Source #
StmtTryContent | |
|
Instances
FromJSON StmtTryContent Source # | |
Defined in Ast parseJSON :: Value -> Parser StmtTryContent # parseJSONList :: Value -> Parser [StmtTryContent] # omittedField :: Maybe StmtTryContent # | |
ToJSON StmtTryContent Source # | |
Defined in Ast toJSON :: StmtTryContent -> Value # toEncoding :: StmtTryContent -> Encoding # toJSONList :: [StmtTryContent] -> Value # toEncodingList :: [StmtTryContent] -> Encoding # omitField :: StmtTryContent -> Bool # | |
Generic StmtTryContent Source # | |
Defined in Ast type Rep StmtTryContent :: Type -> Type from :: StmtTryContent -> Rep StmtTryContent x to :: Rep StmtTryContent x -> StmtTryContent | |
Show StmtTryContent Source # | |
Defined in Ast showsPrec :: Int -> StmtTryContent -> ShowS show :: StmtTryContent -> String showList :: [StmtTryContent] -> ShowS | |
Eq StmtTryContent Source # | |
Defined in Ast (==) :: StmtTryContent -> StmtTryContent -> Bool (/=) :: StmtTryContent -> StmtTryContent -> Bool | |
Ord StmtTryContent Source # | |
Defined in Ast compare :: StmtTryContent -> StmtTryContent -> Ordering (<) :: StmtTryContent -> StmtTryContent -> Bool (<=) :: StmtTryContent -> StmtTryContent -> Bool (>) :: StmtTryContent -> StmtTryContent -> Bool (>=) :: StmtTryContent -> StmtTryContent -> Bool max :: StmtTryContent -> StmtTryContent -> StmtTryContent min :: StmtTryContent -> StmtTryContent -> StmtTryContent | |
type Rep StmtTryContent Source # | |
Defined in Ast type Rep StmtTryContent = D1 ('MetaData "StmtTryContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "StmtTryContent" 'PrefixI 'True) (S1 ('MetaSel ('Just "stmtTryPart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]) :*: (S1 ('MetaSel ('Just "stmtCatchPart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]) :*: S1 ('MetaSel ('Just "stmtTryLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Location)))) |
data StmtBreakContent Source #
Instances
data StmtImportContent Source #
StmtImportContent | |
|
Instances
data StmtContinueContent Source #
Instances
data StmtIfContent Source #
StmtIfContent | |
|
Instances
FromJSON StmtIfContent Source # | |
Defined in Ast parseJSON :: Value -> Parser StmtIfContent # parseJSONList :: Value -> Parser [StmtIfContent] # omittedField :: Maybe StmtIfContent # | |
ToJSON StmtIfContent Source # | |
Defined in Ast toJSON :: StmtIfContent -> Value # toEncoding :: StmtIfContent -> Encoding # toJSONList :: [StmtIfContent] -> Value # toEncodingList :: [StmtIfContent] -> Encoding # omitField :: StmtIfContent -> Bool # | |
Generic StmtIfContent Source # | |
Defined in Ast type Rep StmtIfContent :: Type -> Type from :: StmtIfContent -> Rep StmtIfContent x to :: Rep StmtIfContent x -> StmtIfContent | |
Show StmtIfContent Source # | |
Defined in Ast showsPrec :: Int -> StmtIfContent -> ShowS show :: StmtIfContent -> String showList :: [StmtIfContent] -> ShowS | |
Eq StmtIfContent Source # | |
Defined in Ast (==) :: StmtIfContent -> StmtIfContent -> Bool (/=) :: StmtIfContent -> StmtIfContent -> Bool | |
Ord StmtIfContent Source # | |
Defined in Ast compare :: StmtIfContent -> StmtIfContent -> Ordering (<) :: StmtIfContent -> StmtIfContent -> Bool (<=) :: StmtIfContent -> StmtIfContent -> Bool (>) :: StmtIfContent -> StmtIfContent -> Bool (>=) :: StmtIfContent -> StmtIfContent -> Bool max :: StmtIfContent -> StmtIfContent -> StmtIfContent min :: StmtIfContent -> StmtIfContent -> StmtIfContent | |
type Rep StmtIfContent Source # | |
Defined in Ast type Rep StmtIfContent = D1 ('MetaData "StmtIfContent" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "StmtIfContent" 'PrefixI 'True) ((S1 ('MetaSel ('Just "stmtIfCond") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Just "stmtIfBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt])) :*: (S1 ('MetaSel ('Just "stmtElseBody") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]) :*: S1 ('MetaSel ('Just "stmtIfLocation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Location)))) |
data StmtWhileContent Source #
Instances
data StmtReturnContent Source #
StmtReturnContent | |
|
Instances
data ExpCallContent Source #
Instances
data VarFieldContent Source #
Instances
data VarSimpleContent Source #
Instances
data VarSubscriptContent Source #
Instances
Instances
FromJSON Var Source # | |
ToJSON Var Source # | |
Generic Var Source # | |
Show Var Source # | |
Eq Var Source # | |
Ord Var Source # | |
type Rep Var Source # | |
Defined in Ast type Rep Var = D1 ('MetaData "Var" "Ast" "dhscanner-ast-0.1.0.3-inplace" 'False) (C1 ('MetaCons "VarSimple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VarSimpleContent)) :+: (C1 ('MetaCons "VarField" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VarFieldContent)) :+: C1 ('MetaCons "VarSubscript" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VarSubscriptContent)))) |
locationVar :: Var -> Location Source #