hssqlppp-0.6.0: SQL parser and type checker

Safe HaskellNone
LanguageHaskell2010

Database.HsSqlPpp.Annotation

Contents

Description

Contains the annotation data types and a few auxiliary functions.

Synopsis

Annotation data types

data Annotation Source

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

Constructors

Annotation 

Fields

anSrc :: Maybe SourcePosition

source position for this node

anType :: Maybe TypeExtra

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

anErrs :: [TypeError]

any type errors

anImplicitCast :: Maybe TypeExtra

if an implicit cast is needed between this node an its parent, this the target type of cast. If no implicit cast is needed, this is Nothing

anCatUpd :: [CatalogUpdate]

any catalog updates that a statement produces, used only for ddl Statements

type SourcePosition = (FilePath, Int, Int) Source

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

getAnnotation :: Data a => a -> Annotation Source

get the annotation for the root element of the tree passed

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

Update the first annotation in a tree using the function supplied

emptyAnnotation :: Annotation Source

An annotation value with no information.