gavo.stc.common module¶
Definitions and shared code for STC processing.
-
class
gavo.stc.common.
ASTNode
(id=None, ucd=None)[source]¶ Bases:
gavo.utils.autonode.AutoNode
The base class for all nodes in STC ASTs.
-
inexactAttrs
= {}¶
-
-
class
gavo.stc.common.
ColRef
(dest)[source]¶ Bases:
gavo.utils.stanxml.Stub
A column reference instead of a true value, occurring in an STC-S tree.
-
apply
(func)[source]¶ does nothing.
Stubs don’t have what Element.apply needs, so we don’t even pretend.
-
name_
= '_colRef'¶
-
toParam
= False¶
-
-
class
gavo.stc.common.
GeometryColRef
(dest)[source]¶ Bases:
gavo.stc.common.ColRef
A ColRef that refers to an in-DB geometry.
These comprise the entire arguments of a geometry (or all coordinates of a vector). They implement __len__ as soon as they are validated (in stcsast; we don’t do col. refs in stc-x); their len is the expected number of elements.
-
expectedLength
= None¶
-
-
exception
gavo.stc.common.
STCError
(msg='', hint=None)[source]¶ Bases:
gavo.utils.excs.Error
-
exception
gavo.stc.common.
STCInternalError
(msg='', hint=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised when assumptions about the library behaviour are violated.
-
exception
gavo.stc.common.
STCLiteralError
(msg, literal=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised when a literal is not well-formed.
There is an attribute literal giving the malformed literal.
-
exception
gavo.stc.common.
STCNotImplementedError
(msg='', hint=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised when the current implementation limits are reached.
-
exception
gavo.stc.common.
STCSParseError
(msg, expr=None, pos=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised if an STC-S expression could not be parsed.
Low-level routines raise a pyparsing ParseException. Only higher level functions raise this error. The offending expression is in the expr attribute, the start position of the offending phrase in pos.
-
exception
gavo.stc.common.
STCUnitError
(msg='', hint=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised when some impossible operation on units is requested.
-
exception
gavo.stc.common.
STCValueError
(msg='', hint=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised when some STC specification is inconsistent.
-
exception
gavo.stc.common.
STCXBadError
(msg='', hint=None)[source]¶ Bases:
gavo.stc.common.STCError
is raised when something is wrong with STC-X.