| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | NNode.
Assumes nodes are always traversed in increasing order of their start positions. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| protected NNode | |
| pack-priv static final long | |
| private int | |
| private transient NType | type
This is marked transient to prevent serialization. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| protected void | |
| protected void | |
| public NType | |
| protected void | |
| protected void | |
| protected void | |
| public boolean | |
| public int | |
| public NNode | |
| public NNode | Returns: the deepest AST node whose start is greater than or equal to the offset, and whose end is less than or equal to the offset. Returnsnull
if no node overlaps sourceOffset.the spot at which to look for a node sourceOffset)Searches the AST for the deepest node that overlaps the specified source offset. |
| public Scope | Returns: the enclosing function, class, instance, module or builtin scope. If this node has not yet been resolved, returns the builtin namespace.Returns the innermost enclosing scope for doing (non-attribute) name lookups. |
| public String | |
| public NNode | |
| public Scope | |
| public NType | |
| private static NType | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public int | |
| public NType | |
| public static NType | |
| protected void | resolveList(List<? extends NNode> nodes, Scope s)
Resolves each element of a node list in the passed scope. |
| protected NType | resolveListAsUnion(List<? extends NNode> nodes, Scope s)
Utility method to resolve every node in |
| public void | |
| public void | |
| public void | |
| public NType | |
| public int | |
| public abstract void | visit(NNodeVisitor
the object to call with this node.
If the visitor returns visitor)true, the node also
passes its children to the visitor.Visits this node and optionally its children. |
| protected void | |
| protected void |
| end | back to summary |
|---|---|
| private int end | |
| parent | back to summary |
|---|---|
| protected NNode parent | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| start | back to summary |
|---|---|
| private int start | |
| type | back to summary |
|---|---|
| private transient NType type This is marked transient to prevent serialization. We re-resolve ASTs
after deserializing them. It is private to ensure that the type is never
| |
| NNode | back to summary |
|---|---|
| public NNode() | |
| NNode | back to summary |
|---|---|
| public NNode(int start, int end) | |
| addChildren | back to summary |
|---|---|
| public void addChildren(NNode... nodes) | |
| addChildren | back to summary |
|---|---|
| public void addChildren(List<? extends NNode> nodes) | |
| addError | back to summary |
|---|---|
| protected void addError(String msg) | |
| addError | back to summary |
|---|---|
| protected void addError(NNode loc, String msg) | |
| addType | back to summary |
|---|---|
| public NType addType(NType newType) Adds a new type for the node, creating a union of the previous type and the new type.
| |
| addWarning | back to summary |
|---|---|
| protected void addWarning(String msg) | |
| addWarning | back to summary |
|---|---|
| protected void addWarning(NNode loc, String msg) | |
| bindNames | back to summary |
|---|---|
| protected void bindNames(Scope s) throws Exception Called by resolver to bind names into the passed scope. | |
| bindsName | back to summary |
|---|---|
| public boolean bindsName() Returns
| |
| end | back to summary |
|---|---|
| public int end() | |
| getAstRoot | back to summary |
|---|---|
| public NNode getAstRoot() | |
| getDeepestNodeAtOffset | back to summary |
|---|---|
| public NNode getDeepestNodeAtOffset(int sourceOffset) Searches the AST for the deepest node that overlaps the specified source offset. Can be called from any node in the AST, as it traverses to the parent before beginning the search.
| |
| getEnclosingNamespace | back to summary |
|---|---|
| public Scope getEnclosingNamespace() Returns the innermost enclosing scope for doing (non-attribute) name lookups. If the current node defines a scope, it returns the parent scope for name lookups.
| |
| getFile | back to summary |
|---|---|
public String getFile()
| |
| getParent | back to summary |
|---|---|
| public NNode getParent() | |
| getTable | back to summary |
|---|---|
| public Scope getTable() Utility alias for | |
| getType | back to summary |
|---|---|
| public NType getType() Returns the type for this node. It is never | |
| handleExceptionInResolve | back to summary |
|---|---|
| private static NType handleExceptionInResolve(NNode n, Throwable t) | |
| isCall | back to summary |
|---|---|
| public boolean isCall() | |
| isClassDef | back to summary |
|---|---|
| public boolean isClassDef() | |
| isFunctionDef | back to summary |
|---|---|
| public boolean isFunctionDef() | |
| isLambda | back to summary |
|---|---|
| public boolean isLambda() | |
| isModule | back to summary |
|---|---|
| public boolean isModule() | |
| isName | back to summary |
|---|---|
| public boolean isName() | |
| length | back to summary |
|---|---|
| public int length() | |
| resolve | back to summary |
|---|---|
| public NType resolve(Scope s) throws Exception Node should set the resolved type in its | |
| resolveExpr | back to summary |
|---|---|
| public static NType resolveExpr(NNode n, Scope s) | |
| resolveList | back to summary |
|---|---|
| protected void resolveList(List<? extends NNode> nodes, Scope s) Resolves each element of a node list in the passed scope.
Node list may be empty or | |
| resolveListAsUnion | back to summary |
|---|---|
| protected NType resolveListAsUnion(List<? extends NNode> nodes, Scope s) Utility method to resolve every node in | |
| setEnd | back to summary |
|---|---|
| public void setEnd(int end) | |
| setParent | back to summary |
|---|---|
| public void setParent(NNode parent) | |
| setStart | back to summary |
|---|---|
| public void setStart(int start) | |
| setType | back to summary |
|---|---|
| public NType setType(NType newType) Sets the type for the node.
| |
| start | back to summary |
|---|---|
| public int start() | |
| visit | back to summary |
|---|---|
| public abstract void visit(NNodeVisitor visitor) Visits this node and optionally its children.
| |
| visitNode | back to summary |
|---|---|
| protected void visitNode(NNode n, NNodeVisitor v) | |
| visitNodeList | back to summary |
|---|---|
| protected void visitNodeList(List<? extends NNode> nodes, NNodeVisitor v) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | dispatch(NNode node)
Overrides org. Every visited node is passed to this method. |
| public NNode | Returns: the node, ornull if no node overlaps the offsetReturns the deepest node overlapping the desired source offset. |
| DeepestOverlappingNodeFinder | back to summary |
|---|---|
| public DeepestOverlappingNodeFinder(int offset) | |
| dispatch | back to summary |
|---|---|
| public boolean dispatch(NNode node) Overrides org. Doc from org. Every visited node is passed to this method. The semantics
for halting traversal are the same as for
| |
| getNode | back to summary |
|---|---|
| public NNode getNode() Returns the deepest node overlapping the desired source offset.
| |