Class Expression
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Expression
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
BinaryNode,BlockExpression,ClassNode,ErrorNode,ExpressionList,FunctionNode,IdentNode,JoinPredecessorExpression,LiteralNode,ObjectNode,OptionalExpression,ParameterNode,TemplateLiteralNode,TernaryNode,UnaryNode
Common superclass for all expression nodes. Expression nodes can have an associated symbol as
well as a type.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionintGet the finish position for this node in the source stringfinal intintgetStart()Get start position for nodefinal intbooleanReturns true if the runtime value of this expression is always false when converted to boolean as per ECMAScript ToBoolean conversion.booleanReturns true if the runtime value of this expression is always true when converted to boolean as per ECMAScript ToBoolean conversion.final booleanDetermines whether this expression is enclosed in parenthesis.booleanIs this a self modifying assignment?final voidmakeParenthesized(int parenStart, int parenFinish) Marks this expression as enclosed in parenthesis.Methods inherited from class com.oracle.js.parser.ir.Node
accept, accept, clone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString, toString
-
Method Details
-
isSelfModifying
public boolean isSelfModifying()Is this a self modifying assignment?- Returns:
- true if self modifying, e.g. a++, or a*= 17
-
isAlwaysFalse
public boolean isAlwaysFalse()Returns true if the runtime value of this expression is always false when converted to boolean as per ECMAScript ToBoolean conversion. Used in control flow calculations.- Returns:
- true if this expression's runtime value converted to boolean is always false.
-
isAlwaysTrue
public boolean isAlwaysTrue()Returns true if the runtime value of this expression is always true when converted to boolean as per ECMAScript ToBoolean conversion. Used in control flow calculations.- Returns:
- true if this expression's runtime value converted to boolean is always true.
-
isParenthesized
public final boolean isParenthesized()Determines whether this expression is enclosed in parenthesis.- Returns:
trueif this expression is enclosed in parenthesis, returnsfalseotherwise.
-
makeParenthesized
public final void makeParenthesized(int parenStart, int parenFinish) Marks this expression as enclosed in parenthesis. -
getStart
-
getStartWithoutParens
public final int getStartWithoutParens() -
getFinish
-
getFinishWithoutParens
public final int getFinishWithoutParens()
-