org.python.indexer.ast
Class NAttribute
- java.lang.Object
-
- org.python.indexer.ast.NNode
-
- org.python.indexer.ast.NAttribute
-
- All Implemented Interfaces:
- java.io.Serializable
public class NAttribute extends NNode
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NAttribute(NNode target, NName attr)NAttribute(NNode target, NName attr, int start, int end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description NNamegetAttr()java.lang.StringgetAttributeName()NNodegetTarget()NTyperesolve(Scope s)Node should set the resolved type in itsNNode.typefield and also return it.voidsetAttr(NName attr)Sets the attribute node.voidsetAttr(Scope s, NType v)Assign some definite value to the attribute.voidsetTarget(NNode target)Sets the target node.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
-
-
-
-
Method Detail
-
getAttributeName
public java.lang.String getAttributeName()
-
setAttr
public void setAttr(NName attr)
Sets the attribute node. Used when constructing the AST.- Throws:
java.lang.IllegalArgumentException- if the param is null
-
getAttr
public NName getAttr()
-
setTarget
public void setTarget(NNode target)
Sets the target node. Used when constructing the AST.- Throws:
java.lang.IllegalArgumentException- if the param is null
-
getTarget
public NNode getTarget()
-
setAttr
public void setAttr(Scope s, NType v) throws java.lang.Exception
Assign some definite value to the attribute. Used during the name resolution pass. This method is called when this node is in the lvalue of an assignment, in which case it is called in lieu ofresolve(org.python.indexer.Scope).- Throws:
java.lang.Exception
-
resolve
public NType resolve(Scope s) throws java.lang.Exception
Description copied from class:NNodeNode should set the resolved type in itsNNode.typefield and also return it.
-
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