public final class BinaryNode extends Expression implements Assignment<Expression>
Constructor and Description |
---|
BinaryNode(long token,
Expression lhs,
Expression rhs)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Node |
accept(NodeVisitor<? extends LexicalContext> visitor)
Assist in IR navigation.
|
<R> R |
accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Provides a means to navigate the IR.
|
Expression |
getAssignmentDest()
Get assignment destination.
|
Expression |
getAssignmentSource()
Get the assignment source.
|
Expression |
getLhs()
Get the left hand side expression for this node
|
Expression |
getRhs()
Get the right hand side expression for this node
|
boolean |
isAlwaysFalse()
Returns true if the runtime value of this expression is always false when converted to
boolean as per ECMAScript ToBoolean conversion.
|
boolean |
isAlwaysTrue()
Returns true if the runtime value of this expression is always true when converted to boolean
as per ECMAScript ToBoolean conversion.
|
boolean |
isAssignment()
Check if this node is an assignment
|
boolean |
isComparison()
Returns true if the node is a comparison operation (either equality, inequality, or
relational).
|
boolean |
isLogical()
Returns true if the node is a logical operation.
|
static boolean |
isLogical(TokenType tokenType)
Returns true if the token type represents a logical operation.
|
boolean |
isRelational()
Returns true if the node is a relational operation (less than (or equals), greater than (or
equals)).
|
boolean |
isSelfModifying()
Is this a self modifying assignment?
|
BinaryNode |
setLHS(Expression lhs)
Set the left hand side expression for this node
|
BinaryNode |
setRHS(Expression rhs)
Set the right hand side expression for this node
|
void |
toString(StringBuilder sb,
boolean printType)
Print logic that decides whether to show the optimistic type or not - for example it should
not be printed after just parse, when it hasn't been computed, or has been set to a trivially
provable value
|
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isParenthesized, makeParenthesized
public BinaryNode(long token, Expression lhs, Expression rhs)
token
- tokenlhs
- left hand siderhs
- right hand sidepublic boolean isComparison()
public boolean isRelational()
public boolean isLogical()
public static boolean isLogical(TokenType tokenType)
tokenType
- the token typepublic boolean isAssignment()
isAssignment
in class Node
public boolean isSelfModifying()
Expression
isSelfModifying
in class Expression
public Expression getAssignmentDest()
Assignment
getAssignmentDest
in interface Assignment<Expression>
public Expression getAssignmentSource()
Assignment
getAssignmentSource
in interface Assignment<Expression>
public Node accept(NodeVisitor<? extends LexicalContext> visitor)
public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Node
public boolean isAlwaysFalse()
Expression
isAlwaysFalse
in class Expression
public boolean isAlwaysTrue()
Expression
isAlwaysTrue
in class Expression
public void toString(StringBuilder sb, boolean printType)
Node
public Expression getLhs()
public Expression getRhs()
public BinaryNode setLHS(Expression lhs)
lhs
- new left hand side expressionpublic BinaryNode setRHS(Expression rhs)
rhs
- new left hand side expression