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, typeOperatorStartdefinition, nameNodeemptyNodeArray, parentUNKNOWN| 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, setTypeaddDecorationChildren, 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, setNamespaceaddChild, addChild, addChildInOrder, addChildPostNormalize, addTemporaryChild, getChild, getChildCount, getInitialChildCount, optimizeChildren, removeAllChildren, removeChild, removeTemporaryChild, replaceChild, sortChildren, swapChildrenbuildStringRecursive, 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, verifygetColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, spanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetVariableClassificationgetASDocComment, hasExplicitCommentgetContainingFilePath, getMetaInfos, getMetaTags, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNameStart, getPackageName, getQualifiedName, getShortName, hasModifier, hasNamespace, isImplicitcontains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getParent, getSpanningStart, getSucceedingNode, isTerminalgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartprotected 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)
NodeBasesetChildren in class NodeBaseprotected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
analyze in class BaseDefinitionNodeprotected boolean buildInnerString(StringBuilder sb)
NodeBasebuildOuterString().
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 NodeBaseprotected void init(ExpressionNodeBase node)
init in class BaseTypedDefinitionNodeprotected IDecorationPart createDecorationPart()
createDecorationPart in class BaseDefinitionNodepublic DefinitionBase getDefinition()
getDefinition in interface IDefinitionNodegetDefinition in class BaseDefinitionNodepublic IExpressionNode getVariableTypeNode()
IVariableNodeIExpressionNode that corresponds to the type node of
this IVariableNodegetVariableTypeNode in interface IVariableNodeIExpressionNode or nullpublic String getVariableType()
IVariableNode* is returnedgetVariableType in interface IVariableNodepublic boolean isConst()
IVariableNodeconstisConst in interface IVariableNodeconst existspublic int getDeclarationEnd()
IVariableNodegetDeclarationEnd in interface IVariableNodepublic final ExpressionNodeBase getAssignedValueNode()
getAssignedValueNode in interface IVariableNodepublic void setAssignedValue(IASToken equalsOperator, ExpressionNodeBase value)
IInitializableDefinitionNodesetAssignedValue in interface IInitializableDefinitionNodeequalsOperator - 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.