Top Fields Constructors Methods
org.python.indexer.ast

public Class NImport

extends NNode
Class Inheritance
Imports
org.python.indexer.Builtins, .Indexer, .NBinding, .Scope, org.python.indexer.types.NModuleType, .NType, .NUnknownType, java.util.List

Field Summary

Modifier and TypeField and Description
public List<NAlias>
pack-priv static final long
Inherited from org.python.indexer.ast.NNode:
parent

Constructor Summary

AccessConstructor and Description
public
NImport(List<NAlias> aliases)

public
NImport(List<NAlias> aliases, int start, int end)

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
addReferences(Scope s, NQname qname, boolean putTopInScope)

pack-priv static void
protected void
bindNames(Scope s)

Overrides org.python.indexer.ast.NNode.bindNames.

Called by resolver to bind names into the passed scope.

public boolean
bindsName()

Overrides org.python.indexer.ast.NNode.bindsName.

Returns true if this is a name-binding node.

private void
importName(Scope s, NAlias a, NModuleType
the module that is actually bound to the imported name. for import x.y.z as foo, it is z, a sub-module of x.y. For import x.y.z it is x.
mt
)

Import a module's alias (if present) or top-level name into the current scope.

public NType
resolve(Scope s)

Overrides org.python.indexer.ast.NNode.resolve.

Node should set the resolved type in its type field and also return it.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
visit(NNodeVisitor
the object to call with this node. If the visitor returns true, the node also passes its children to the visitor.
v
)

Implements abstract org.python.indexer.ast.NNode.visit.

Visits this node and optionally its children.

Inherited from org.python.indexer.ast.NNode:
addChildrenaddChildrenaddErroraddErroraddTypeaddWarningaddWarningendgetAstRootgetDeepestNodeAtOffsetgetEnclosingNamespacegetFilegetParentgetTablegetTypeisCallisClassDefisFunctionDefisLambdaisModuleisNamelengthresolveExprresolveListresolveListAsUnionsetEndsetParentsetStartsetTypestartvisitNodevisitNodeList

Field Detail

aliasesback to summary
public List<NAlias> aliases
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides org.python.indexer.ast.NNode.serialVersionUID.

Constructor Detail

NImportback to summary
public NImport(List<NAlias> aliases)
NImportback to summary
public NImport(List<NAlias> aliases, int start, int end)

Method Detail

addReferencesback to summary
pack-priv static void addReferences(Scope s, NQname qname, boolean putTopInScope)
bindAliasesback to summary
pack-priv static void bindAliases(Scope s, List<NAlias> aliases) throws Exception
bindNamesback to summary
protected void bindNames(Scope s) throws Exception

Overrides org.python.indexer.ast.NNode.bindNames.

Doc from org.python.indexer.ast.NNode.bindNames.

Called by resolver to bind names into the passed scope.

Annotations
@Override
bindsNameback to summary
public boolean bindsName()

Overrides org.python.indexer.ast.NNode.bindsName.

Doc from org.python.indexer.ast.NNode.bindsName.

Returns true if this is a name-binding node. Includes functions/lambdas, function/lambda params, classes, assignments, imports, and implicit assignment via for statements and except clauses.

Annotations
@Override
importNameback to summary
private void importName(Scope s, NAlias a, NModuleType mt) throws Exception

Import a module's alias (if present) or top-level name into the current scope. Creates references to the other names in the alias.

Parameters
mt:NModuleType

the module that is actually bound to the imported name. for import x.y.z as foo, it is z, a sub-module of x.y. For import x.y.z it is x.

resolveback to summary
public NType resolve(Scope s) throws Exception

Overrides org.python.indexer.ast.NNode.resolve.

Doc from org.python.indexer.ast.NNode.resolve.

Node should set the resolved type in its type field and also return it.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
visitback to summary
public void visit(NNodeVisitor v)

Implements abstract org.python.indexer.ast.NNode.visit.

Doc from org.python.indexer.ast.NNode.visit.

Visits this node and optionally its children.

Parameters
v:NNodeVisitor

the object to call with this node. If the visitor returns true, the node also passes its children to the visitor.

Annotations
@Override