Class ADQLNode
source code
object --+
|
utils.autonode.AutoNode --+
|
ADQLNode
- Known Subclasses:
-
- ColumnBearingNode
- , Comparison
- , FieldInfoedNode
- , FromClause
- , JoinOperator
- , JoinSpecification
- , OffsetSpec
- , QualifiedStar
- , SelectList
- , SubJoin
- , TableName
- , TransparentNode
- , morphpg._PGQS
A node within an ADQL parse tree.
ADQL nodes may be parsed out; in that case, they have individual
attributes and are craftily flattened in special methods. We do this for
nodes that are morphed.
Other nodes basically just have a children attribute, and their
flattening is just a concatenation for their flattened children. This is
convenient as long as they are not morphed.
To derive actual classes, define
-
the _a_<name> class attributes you need,
-
the type (a nonterminal from the ADQL grammar)
-
plus bindings if the class handles more than one symbol,
-
a class method _getInitKWs(cls, parseResult); see below.
-
a method flatten() -> string if you define a parsed ADQLNode.
-
a method _polish() that is called just before the constructor is done
and can be used to create more attributes. There is no need to call
_polish of superclasses.
The _getInitKWs methods must return a dictionary mapping constructor
argument names to values. You do not need to manually call superclass
_getInitKWs, since the fromParseResult classmethod figures out all
_getInitKWs in the inheritance tree itself. It calls all of them in the
normal MRO and updates the argument dictionary in reverse order.
The fromParseResult class method additionally filters out all names
starting with an underscore; this is to allow easy returning of
locals().
|
|
|
flatten(self)
returns a string representation of the text content of the tree. |
source code
|
|
|
|
|
|
|
|
|
|
Inherited from utils.autonode.AutoNode :
change ,
iterAttributes ,
iterChildren ,
iterNodeChildren ,
iterNodes
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
repr(x)
- Overrides:
object.__repr__
- (inherited documentation)
|
returns a string representation of the text content of the tree.
This default implementation will only work if you returned all parsed
elements as children. This, in turn, is something you only want to do if
you are sure that the node is question will not be morphed.
Otherwise, override it to create an SQL fragment out of the parsed
attributes.
|
returns a list of all preterminal children of all children of
self.
A child is preterminal if it has string content.
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|