org.python.indexer.ast
Class NAlias
- java.lang.Object
-
- org.python.indexer.ast.NNode
-
- org.python.indexer.ast.NAlias
-
- All Implemented Interfaces:
- java.io.Serializable
public class NAlias extends NNode
A name alias. Used for the components of import and import-from statements.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description NNameanameThe alias name, if an "as" clause was specified.java.lang.StringnameThe un-parsed qname or simple name corresponding toqname.NQnameqnameRepresents one of three possibilities: import stmt: qname of one of the imported modules import-from stmt: qname of the referenced module import-from stmt: simple name imported from referenced module
-
Constructor Summary
Constructors Constructor and Description NAlias(java.lang.String name, NQname qname, NName aname)NAlias(java.lang.String name, NQname qname, NName aname, int start, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetBoundName()Returns the alias, if non-null, else the simple name.NTyperesolve(Scope s)Resolves and returns the referencedNModuleTypein an import or or import-from statement.java.lang.StringtoString()voidvisit(NNodeVisitor v)Visits this node and optionally its children.-
Methods inherited from class org.python.indexer.ast.NNode
addChildren, addChildren, addType, bindsName, end, getAstRoot, getDeepestNodeAtOffset, getEnclosingNamespace, getFile, getParent, getTable, getType, isCall, isClassDef, isFunctionDef, isLambda, isModule, isName, length, resolveExpr, setEnd, setParent, setStart, setType, start
-
-
-
-
Field Detail
-
qname
public NQname qname
Represents one of three possibilities:- import stmt: qname of one of the imported modules
- import-from stmt: qname of the referenced module
- import-from stmt: simple name imported from referenced module
-
name
public java.lang.String name
The un-parsed qname or simple name corresponding toqname.
-
aname
public NName aname
The alias name, if an "as" clause was specified.
-
-
Method Detail
-
getBoundName
public java.lang.String getBoundName()
Returns the alias, if non-null, else the simple name.
-
resolve
public NType resolve(Scope s) throws java.lang.Exception
Resolves and returns the referencedNModuleTypein an import or or import-from statement. NImportFrom statements manually resolve their child NAliases.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
visit
public void visit(NNodeVisitor v)
Description copied from class:NNodeVisits this node and optionally its children.
-
-
DMelt 3.0 © DataMelt by jWork.ORG