Module annotations
source code
Adding field infos to columns and other objects in an ADQL parse
tree.
When we want to generate VOTables from ADQL queries, we must know
types, units, ucds, and the like, and we need to know STC information for
all columns in a query.
To do that, we traverse the parse tree postorder looking for nodes
that have an addFieldInfos method (note the plural). These then get
called, which causes one of the classes in adql.fieldinfos to be
constructed and assigned to the node's fieldInfos attribute. The source
for these infos is either an AnnotationContext (and thus typically the
user-supplied retrieveFieldInfos function) or derived annotations. These
are computed by the nodes themselves, using their addFieldInfo
(singular!) method.
|
__package__ = ' gavo.adql '
|
adds annotations to all nodes wanting some.
This is done by a postorder traversal of the tree, identifying all
annotable objects.
context can be an AnnotationContext instance. You can also just pass
in a adql.FieldInfoGetter instance. In that case, annotation runs with
the default stc equivalence policy.
The function returns the context used in any case.
|
dumps an ADQL parse tree, giving the computed annotations.
For debugging.
|