hssqlppp-0.3.1: SQL parser and type checker




Contains the annotation data types and a few auxiliary functions.


Annotation data types

data Annotation Source

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




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 StatementType

'statement type' - 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)Source

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

type StatementType = ([Type], [(String, Type)])Source

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

getAnnotation :: Data a => a -> AnnotationSource

get the annotation for the root element of the tree passed

updateAnnotations :: Data a => (Annotation -> Annotation) -> a -> aSource

update all the annotations in a tree

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

Update the first annotation in a tree using the function supplied

getAnnotations :: Data a => a -> [Annotation]Source

get all the annotations from a tree

emptyAnnotation :: AnnotationSource

An annotation value with no information.

resetAnnotations :: Data a => a -> aSource

Set all the annotations in a tree to be emptyAnnotation.