public abstract class BaseVariableNode extends BaseTypedDefinitionNode implements IVariableNode, IInitializableDefinitionNode
Modifier and Type | Field and Description |
---|---|
protected int |
equalsOperatorStart
Offset at which the equals operator ("=") starts
|
protected boolean |
isConst |
typeNode, typeOperatorStart
definition, nameNode
emptyNodeArray, parent
UNKNOWN
Constructor and Description |
---|
BaseVariableNode(IdentifierNode nameNode)
Constructor.
|
BaseVariableNode(IdentifierNode nameNode,
ExpressionNodeBase typeNode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
analyze(EnumSet<PostProcessStep> set,
ASScope scope,
Collection<ICompilerProblem> problems) |
protected boolean |
buildInnerString(StringBuilder sb)
For debugging only.
|
protected IDecorationPart |
createDecorationPart() |
protected void |
ensureTypeNode()
Ensures the that this variable will have a type as a child.
|
ExpressionNodeBase |
getAssignedValueNode() |
int |
getDeclarationEnd()
Get the local end offset of this variable declaration.
|
DefinitionBase |
getDefinition() |
int |
getEqualsOperatorEnd()
Get the offset at which the equals operator ("=") ends
|
int |
getEqualsOperatorStart()
Get the offset at which the equals operator ("=") starts
|
KeywordNode |
getKeywordNode() |
String |
getVariableType()
Returns the type of this variable as it exist in source.
|
IExpressionNode |
getVariableTypeNode()
Returns the
IExpressionNode that corresponds to the type node of
this IVariableNode |
boolean |
hasEqualsOperator() |
protected void |
init(ExpressionNodeBase node) |
boolean |
isConst()
Returns if this variable is decorated with
const |
void |
setAssignedValue(IASToken equalsOperator,
ExpressionNodeBase value)
Set the assigned value.
|
protected void |
setChildren(boolean fillInOffsets)
If this node has custom children (names, arguments, etc), shove them into
the list of children.
|
void |
setIsConst(boolean isConst)
Sets a flag to indicate that this node is a constant
|
void |
setKeyword(IASToken keyword) |
void |
setKeyword(KeywordNode keyword) |
buildBindableGetter, buildBindableSetter, fillinDefinition, getTypeName, getTypeNode, getTypeOperatorEnd, getTypeOperatorStart, hasExplicitType, hasTypeOperator, isAnyType, isVoidType, setType
addDecorationChildren, addModifier, fillInMetadata, fillInModifiers, fillInNamespaceAndModifiers, getASDocComment, getDecorationPart, getMetaInfos, getMetaTags, getMetaTagsNode, getModifiers, getModifiersContainer, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNamespaceNode, getNameStart, getNodeStartForTooling, getSpanningStart, hasExplicitComment, hasModifier, hasNamespace, normalize, setASDocComment, setDefinition, setMetaTags, setModifiersContainer, setNamespace
addChild, addChild, addChildInOrder, addChildPostNormalize, addTemporaryChild, getChild, getChildCount, getInitialChildCount, optimizeChildren, removeAllChildren, removeChild, removeTemporaryChild, replaceChild, sortChildren, swapChildren
buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getASScope, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getStart, getSucceedingNode, getWorkspace, isTerminal, isTransparent, looselyContains, runPostProcess, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, toString, tryGetOffsetLookup, verify
getColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, span
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getVariableClassification
getASDocComment, hasExplicitComment
getContainingFilePath, getMetaInfos, getMetaTags, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNameStart, getPackageName, getQualifiedName, getShortName, hasModifier, hasNamespace, isImplicit
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
protected int equalsOperatorStart
protected boolean isConst
public BaseVariableNode(IdentifierNode nameNode)
nameNode
- The node containing the name of the variable/argument.public BaseVariableNode(IdentifierNode nameNode, ExpressionNodeBase typeNode)
nameNode
- The node containing the name of the variable/argument.typeNode
- The node containing the type of the variable/argument.protected void setChildren(boolean fillInOffsets)
NodeBase
setChildren
in class NodeBase
protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
analyze
in class BaseDefinitionNode
protected boolean buildInnerString(StringBuilder sb)
NodeBase
buildOuterString()
.
It is overridden by subclasses to display optional node-specific
information in the middle of the string, between the node type and the
location information.buildInnerString
in class NodeBase
protected void init(ExpressionNodeBase node)
init
in class BaseTypedDefinitionNode
protected IDecorationPart createDecorationPart()
createDecorationPart
in class BaseDefinitionNode
public DefinitionBase getDefinition()
getDefinition
in interface IDefinitionNode
getDefinition
in class BaseDefinitionNode
public IExpressionNode getVariableTypeNode()
IVariableNode
IExpressionNode
that corresponds to the type node of
this IVariableNode
getVariableTypeNode
in interface IVariableNode
IExpressionNode
or nullpublic String getVariableType()
IVariableNode
*
is returnedgetVariableType
in interface IVariableNode
public boolean isConst()
IVariableNode
const
isConst
in interface IVariableNode
const
existspublic int getDeclarationEnd()
IVariableNode
getDeclarationEnd
in interface IVariableNode
public final ExpressionNodeBase getAssignedValueNode()
getAssignedValueNode
in interface IVariableNode
public void setAssignedValue(IASToken equalsOperator, ExpressionNodeBase value)
IInitializableDefinitionNode
setAssignedValue
in interface IInitializableDefinitionNode
equalsOperator
- ASToken containing the equals operator =
.value
- node containing the assigned valuepublic void setKeyword(IASToken keyword)
public void setKeyword(KeywordNode keyword)
public void setIsConst(boolean isConst)
isConst
- true if we are a constantprotected void ensureTypeNode()
public boolean hasEqualsOperator()
public int getEqualsOperatorStart()
public int getEqualsOperatorEnd()
public final KeywordNode getKeywordNode()
Copyright © 2016 The Apache Software Foundation. All rights reserved.