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

public abstract class Expression extends Node
Common superclass for all expression nodes. Expression nodes can have an associated symbol as well as a type.
  • 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:
      true if this expression is enclosed in parenthesis, returns false otherwise.
    • makeParenthesized

      public final void makeParenthesized(int parenStart, int parenFinish)
      Marks this expression as enclosed in parenthesis.
    • getStart

      public int getStart()
      Description copied from class: Node
      Get start position for node
      Overrides:
      getStart in class Node
      Returns:
      start position
    • getStartWithoutParens

      public final int getStartWithoutParens()
    • getFinish

      public int getFinish()
      Description copied from class: Node
      Get the finish position for this node in the source string
      Overrides:
      getFinish in class Node
      Returns:
      finish
    • getFinishWithoutParens

      public final int getFinishWithoutParens()