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, makeParenthesizedpublic 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 Nodepublic boolean isSelfModifying()
ExpressionisSelfModifying in class Expressionpublic Expression getAssignmentDest()
AssignmentgetAssignmentDest in interface Assignment<Expression>public Expression getAssignmentSource()
AssignmentgetAssignmentSource in interface Assignment<Expression>public Node accept(NodeVisitor<? extends LexicalContext> visitor)
public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodepublic boolean isAlwaysFalse()
ExpressionisAlwaysFalse in class Expressionpublic boolean isAlwaysTrue()
ExpressionisAlwaysTrue in class Expressionpublic void toString(StringBuilder sb, boolean printType)
Nodepublic 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