public abstract class BinaryOperatorNodeBase extends OperatorNodeBase implements IBinaryOperatorNode
IOperatorNode.ExpressionType, IOperatorNode.OperatorType
Modifier and Type | Field and Description |
---|---|
protected ExpressionNodeBase |
leftOperandNode
The expression to the left of the operator
|
protected ExpressionNodeBase |
rightOperandNode
The expression to the right of the operator
|
operatorStart
flags
emptyNodeArray, parent
UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
BinaryOperatorNodeBase(BinaryOperatorNodeBase other)
Copy constructor.
|
|
BinaryOperatorNodeBase(IASToken op,
ExpressionNodeBase left,
ExpressionNodeBase right)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static BinaryOperatorNodeBase |
create(IASToken operatorToken,
ExpressionNodeBase leftOperand,
ExpressionNodeBase rightOperand)
Factory method for various kinds of binary operator nodes.
|
protected void |
fillInOffsets()
If the start and end offsets haven't been set explicitly, fill them in
based on the offsets of the children.
|
IASNode |
getChild(int i)
Get a particular child of this node
|
int |
getChildCount()
Get the number of children
|
IOperatorNode.ExpressionType |
getExpressionType()
Returns the type of expression that is represented by this node
|
IExpressionNode |
getLeftOperandNode()
Get expression to the left of the operator
|
IExpressionNode |
getRightOperandNode()
Get expression to the right of the operator
|
boolean |
isOperatingOnArray() |
protected ITypeDefinition |
resolveAssignmentType(ICompilerProject project)
Utility method called by
resolveType(ICompilerProject)
in subclasses for assignment operators. |
protected ITypeDefinition |
resolveLogicalType(ICompilerProject project)
|
ITypeDefinition |
resolveType(ICompilerProject project)
The type of the result of this expression.
|
protected void |
setChildren(boolean fillInOffsets)
If this node has custom children (names, arguments, etc), shove them into
the list of children.
|
void |
setLeftOperandNode(ExpressionNodeBase leftOperandNode)
Sets the left-hand side of the expression.
|
void |
setRightOperandNode(ExpressionNodeBase rightOperandNode)
Sets the right side of the expression
|
buildInnerString, getOperatorAbsoluteEnd, getOperatorAbsoluteStart, getOperatorEnd, getOperatorStart, getOperatorText, isTerminal
computeNamespaceReference, copy, copyForInitializer, getASScope, getBaseExpression, getDecorationNode, getDependencyType, getMName, getParentExpression, hasParenthesis, inFilter, inWith, isDynamicExpression, isPackageReference, normalize, resolve, setHasParenthesis
analyze, buildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getSpanningStart, getStart, getSucceedingNode, getWorkspace, isTransparent, looselyContains, replaceChild, runPostProcess, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, swapChildren, 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
getOperator, getOperatorAbsoluteEnd, getOperatorAbsoluteStart, getOperatorEnd, getOperatorStart
copyForInitializer, hasParenthesis, isDynamicExpression, resolve
contains, getAncestorOfType, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
protected ExpressionNodeBase leftOperandNode
protected ExpressionNodeBase rightOperandNode
public BinaryOperatorNodeBase(IASToken op, ExpressionNodeBase left, ExpressionNodeBase right)
Creates a BinaryOperatorNode
from an operator and both operands.
If either operand is null
, we will synthesize
empty IdentifierNode
to repair the tree.
op
- operator tokenleft
- first operandright
- second operandprotected BinaryOperatorNodeBase(BinaryOperatorNodeBase other)
other
- The node to copy.public static BinaryOperatorNodeBase create(IASToken operatorToken, ExpressionNodeBase leftOperand, ExpressionNodeBase rightOperand)
public int getChildCount()
IASNode
getChildCount
in interface IASNode
getChildCount
in class NodeBase
public IASNode getChild(int i)
IASNode
protected void setChildren(boolean fillInOffsets)
NodeBase
setChildren
in class NodeBase
protected void fillInOffsets()
NodeBase
fillInOffsets
in class NodeBase
public ITypeDefinition resolveType(ICompilerProject project)
IExpressionNode
resolveType
in interface IExpressionNode
resolveType
in class ExpressionNodeBase
project
- The ICompilerProject
to use to do lookups.ITypeDefinition
of the type this expression results in.public IOperatorNode.ExpressionType getExpressionType()
IOperatorNode
getExpressionType
in interface IOperatorNode
public IExpressionNode getLeftOperandNode()
IBinaryOperatorNode
getLeftOperandNode
in interface IBinaryOperatorNode
public IExpressionNode getRightOperandNode()
IBinaryOperatorNode
getRightOperandNode
in interface IBinaryOperatorNode
public void setLeftOperandNode(ExpressionNodeBase leftOperandNode)
leftOperandNode
- Left-hand side expression.public void setRightOperandNode(ExpressionNodeBase rightOperandNode)
rightOperandNode
- ExpressionNodeBase to the right of the operatorpublic boolean isOperatingOnArray()
protected ITypeDefinition resolveAssignmentType(ICompilerProject project)
resolveType(ICompilerProject)
in subclasses for assignment operators.protected ITypeDefinition resolveLogicalType(ICompilerProject project)
Copyright © 2016 The Apache Software Foundation. All rights reserved.