CodeQL library for Python
codeql/python-all 0.11.13 (changelog, source)
Search

Class AstElementNode

An AstNode printed in the print-viewer.

This class can be overridden to define more specific behavior for some AstNodes. The getChildNode and getStmtList methods can be overridden to easily set up a child-parent relation between different AstElementNodes. Be very careful about overriding getChild, as getChildNode and getStmtList depend on the default behavior of getChild.

Import path

import semmle.python.PrintAst

Direct supertypes

Indirect supertypes

Known direct subtypes

Fields

Predicates

getAstNode

Gets the AstNode that is printed by this print node.

getChild

Gets the child node at index childIndex. Child indices must be unique, but need not be contiguous.

getChildNode

Gets a child node for the AstNode that this print node represents.

getLocation

Gets the location of this node in the source code.

getStmtList

Gets the indexth StmtList that is a child of the AstNode that this print node represents. label is used for pretty-printing a label in the parent-child relation in the ast-viewer.

toString

Gets a textual representation of this node in the PrintAst output tree.

Inherited predicates

getAChild

Gets a child of this node.

from PrintAstNode
getChildEdgeLabel

Gets the label for the edge from this node to the specified child. By default, this is just the index of the child, but subclasses can override this.

from PrintAstNode
getParent

Gets the parent of this node, if any.

from PrintAstNode
getProperty

Gets the value of the property of this node, where the name of the property is key.

from PrintAstNode

Charpred