Class Expr

    • Field Detail

      • type

        protected Type type
    • Constructor Detail

      • Expr

        public Expr​(Type type)
        Constructor. Initializes an expression with a given type.
        Parameters:
        type - The initial Type (descriptor) of this expression.
    • Method Detail

      • setType

        public boolean setType​(Type type)
        Sets the type of this expression. Returns whether or not the type changed as a result of calling this method.
      • isDef

        public boolean isDef()
        Returns whether or not this expression is a defining occurrence. By default, false is returned.
      • stmt

        public Stmt stmt()
        Returns the statement to which this expression belongs. It essentially searches up the expression tree for this expression's first ancestor which is a Stmt.
      • type

        public Type type()
        Returns the Type of this expression.
      • cleanupOnly

        public void cleanupOnly()
        Cleans up this expression only, not its children.
        Specified by:
        cleanupOnly in class Node
      • setDef

        public void setDef​(DefExpr def)
        Sets the expression that defines this expression.
        Parameters:
        def - Defining expression.
      • def

        public DefExpr def()
        Returns the expression in which this Expr is defined.
      • exprHashCode

        public abstract int exprHashCode()
        Returns the hash code for this expresion.
      • equalsExpr

        public abstract boolean equalsExpr​(Expr other)
        Compares this expression to another.
        Parameters:
        other - Expr to which to compare this.
      • clone

        public abstract java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • copyInto

        protected Expr copyInto​(Expr expr)
        Copies the contents of another expression in this one.
        Parameters:
        expr - The expression from which to copy.
      • comparator

        public java.lang.Object comparator()
        Returns an Object that can be used to compare other Expr to this.