trait Expr[+V <: Var[V]] extends ASTNode[V]
Represents an expression. In general, every expression should be a simple expression, where the child expressions are just Vars or Consts. However, when the code is going to be transformed to human readable code (e.g., Java oder Scala), then it is possible to build up complex/nested expressions after all transformations and static analyses have been performed.
- Source
- Expr.scala
- Alphabetic
- By Inheritance
- Expr
- ASTNode
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def astID: Int
Each type of node is assigned a different
id
to make it easily possible to do a switch over all nodes.Each type of node is assigned a different
id
to make it easily possible to do a switch over all nodes.- Definition Classes
- ASTNode
- abstract def cTpe: ComputationalType
The computational type of the underlying value.
The computational type of the underlying value.
I.e., an approximation of the type of the underlying value. It is the best type information directly available. The precision of the type information depends on the number of pre-/post-processing steps that are done.
- abstract def forallSubExpressions[W >: V <: Var[W]](p: (Expr[W]) => Boolean): Boolean
Returns
true
if the given predicate evaluates totrue
for all direct subexpressions of this expression; if the evaluation should perform a recursive decent then it needs to be done by the predicate! - abstract def isSideEffectFree: Boolean
true
if the statement/expression is GUARANTEED to have no externally observable effect if it is not executed.true
if the statement/expression is GUARANTEED to have no externally observable effect if it is not executed. Sideeffect free instructions can be removed if the result of the evaluation of the expression/statement is not used. For those instructions, which may result in an exception, it has to be guaranteed that the exception is NEVER thrown. For example, a div instruction is sideeffect free if it is (statically) known that the divisor is always not equal to zero; otherwise, even if the result value is not used, the expression is not (potentially) side effect free. An array load is only side effect free if the array reference is non-null and if the index is valid.- returns
true
if the expression is GUARENTEED to have no side effect other than wasting some CPU cycles if it is not executed.
- Definition Classes
- ASTNode
- Note
Deeply nested expressions are not supported; i.e. an expression's sub-expressions have to be Var or Const expressions. Generally, a statements expressions have to to simple expressions too - except of the Assignment statement; in the latter case the right-expression can have references to simple expressions. Hence, in case of Assignment statements the side-effect freenes is determined by the referenced expression; in all other cases the side-effect freeness is determined directly by the statement/expression.
- abstract def isValueExpression: Boolean
true
if this expression is a Var. - abstract def isVar: Boolean
- abstract def subExpr(index: Int): Expr[V]
Returns the sub expression with the given index; if the index is wrong the result is undefined!
- abstract def subExprCount: Int
The number of sub expression directly referenced by this expression.
The number of sub expression directly referenced by this expression. A unary expression has one sub expression (the operand), a binary expression has two and a method has as many as explicit and implicit (
this
) parameters exist.- Note
Transitive dependencies are not counted.
- abstract def toCanonicalForm(implicit ev: <:<[V, DUVar[ValueInformation]]): Expr[DUVar[ValueInformation]]
See org.opalj.value.ValueInformation.toCanonicalForm for detail.
See org.opalj.value.ValueInformation.toCanonicalForm for detail.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def asArrayLength: ArrayLength[V]
- def asArrayLoad: ArrayLoad[V]
- def asBinaryExpr: BinaryExpr[V]
- def asClassConst: ClassConst
- def asCompare: Compare[V]
- def asDoubleConst: DoubleConst
- def asDynamicConst: DynamicConst
- def asFieldRead: FieldRead[V]
- def asFloatConst: FloatConst
- def asFunctionCall: FunctionCall[V]
- def asGetField: GetField[V]
- def asGetStatic: GetStatic
- def asInstanceFunctionCall: InstanceFunctionCall[V]
- def asInstanceOf: InstanceOf[V]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asIntConst: IntConst
- def asInvokedynamicFunctionCall: InvokedynamicFunctionCall[V]
- def asLongConst: LongConst
- def asMethodHandleConst: MethodHandleConst
- def asMethodTypeConst: MethodTypeConst
- def asNew: New
- def asNewArray: NewArray[V]
- def asNonVirtualFunctionCall: NonVirtualFunctionCall[V]
- def asNullExpr: NullExpr
- def asParam: Param
- def asPrefixExpr: PrefixExpr[V]
- def asPrimitiveTypeCastExpr: PrimitiveTypecastExpr[V]
- def asStaticFunctionCall: StaticFunctionCall[V]
- def asStringConst: StringConst
- def asVar: V
- def asVirtualFunctionCall: VirtualFunctionCall[V]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def isArrayLoad: Boolean
- def isClassConst: Boolean
- def isCompare: Boolean
- def isConst: Boolean
- def isDoubleConst: Boolean
- def isDynamicConst: Boolean
- def isFieldRead: Boolean
- def isFloatConst: Boolean
- def isFunctionCall: Boolean
- def isGetField: Boolean
- def isGetStatic: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isIntConst: Boolean
- def isLongConst: Boolean
- def isMethodHandleConst: Boolean
- def isMethodTypeConst: Boolean
- def isNew: Boolean
- def isNewArray: Boolean
- def isNullExpr: Boolean
- def isStaticFunctionCall: Boolean
- def isStringConst: Boolean
- def isVirtualFunctionCall: Boolean
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated