hssqlppp-0.4.0: SQL parser and type checker

Database.HsSqlPpp.Annotation

Contents

Description

Contains the annotation data types and a few auxiliary functions.

Synopsis

Annotation data types

data Annotation

Annotation type - one of these is attached to most of the data types used in the ast.

Constructors

Annotation 

Fields

asrc :: Maybe SourcePosition

source position for this node

atype :: Maybe Type

type of the node, Nothing if the tree hasn't been typechecked or if a type error prevents determining the type

errs :: [TypeError]

any type errors

stType :: Maybe ParameterizedStatementType

used for getting the in and out types of a parameterized statement

catUpd :: [CatalogUpdate]

any catalog updates that a ddl statement produces

fnProt :: Maybe FunctionPrototype

the matched function prototype for a funcall

infType :: Maybe Type

inferred type - fake type inference used for getting the type of ? placeholders in parameterized statements

type SourcePosition = (String, Int, Int)

Represents a source file position, usually set by the parser.

type ParameterizedStatementType = ([Type], [(String, Type)])

Statement type is used for getting type information for a parameterized statement.

getAnnotation :: Data a => a -> Annotation

get the annotation for the root element of the tree passed

updateAnnotation :: Data a => (Annotation -> Annotation) -> a -> a

Update the first annotation in a tree using the function supplied

emptyAnnotation :: Annotation

An annotation value with no information.