|
Database.HsSqlPpp.Ast.Annotator |
|
|
|
|
Description |
Contains the data types and functions for annotating
an ast and working with annotated trees, including the
representations of SQL data types.
Annotations:
- are attached to some of the ast node data types, but not quite all of them;
- types annotations are attached to most nodes during type checking;
- type errors are attached to the lowest down node that the type error is detected at;
- nodes who fail the type check or whose type depends on a node with a type error are
given the type TypeCheckFailed;
- each statement has an additional StatementInfo annotation attached to it;
- the parser fills in the source position annotation in every annotatable ast node.
|
|
Synopsis |
|
|
|
|
Annotation functions
|
|
|
Takes an ast, and adds annotations, including types, type errors,
and statement info. Type checks against defaultEnv.
|
|
|
As annotateAst but you supply an environment to check
against. See Environment module for how to read an Environment from
an existing database so you can type check against it.
|
|
|
Testing utility, mainly used to check an expression for type errors
or to get its type.
|
|
|
Type check multiple asts, allowing type checking references in later
files to definitions in earlier files.
|
|
|
Type check an ast, and return the resultant Environment as well
as the annotated ast.
|
|
Annotated tree utils
|
|
|
run through the ast, and pull the type annotation from each
of the top level items.
|
|
|
Run through the ast given and return a list of statementinfos
from the top level items.
|
|
|
|
|
runs through the ast given and returns a list of all the type errors
in the ast. Recurses into all ast nodes to find type errors.
This is the function to use to see if an ast has passed the type checking process.
Returns a Maybe SourcePos and the list of type errors for each node which has one or
more type errors.
|
|
|
Run through the ast and return all the annotations attached to
a Statement node.
|
|
Produced by Haddock version 2.6.0 |