o

de.uni_luebeck.isp.tessla.tessla_compiler

IntermediateCodeTypeInference

object IntermediateCodeTypeInference

Class containing code for determining the type of ImpLan expressions and adding casts. Does not perform type checking in any way. Hence this class should only be used for code which is known to be type correct.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IntermediateCodeTypeInference
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def castExpression(exp: ImpLanExpr, target: Option[ImpLanType], varTypes: Map[String, ImpLanType]): ImpLanExpr

    Casts an expression to a target type if necessary.

    Casts an expression to a target type if necessary. Also assures type equality by wrapping sub-expressions into casts where necessary.

    exp

    Expression to be casted

    target

    Type to which the expression should be casted. Optional. If None only the sub-expressions are casted if necessary.

    varTypes

    Type environment, mapping every possibly involved variable identifier to its type

    returns

    Expression potentially wrapped into a IntermediateCode.CastingExpression and all sub-expression with non-expected type also wrapped into a cast expression.

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def generateCodeWithCasts(stmts: Seq[ImpLanStmt], varTypes: Map[String, ImpLanType], retType: Option[ImpLanType] = None): Seq[ImpLanStmt]

    Adds casts to sub-expressions of a statement sequence where necessary

    Adds casts to sub-expressions of a statement sequence where necessary

    stmts

    Statements to be examined.

    varTypes

    Type environment, mapping every possibly involved variable identifier to its type

    retType

    Type to which return statements from stmts are casted. Optional. If None, no casting is performed for these return statements (but still for sub-expressions)

    returns

    Statement sequence with casts added

  10. def generateCodeWithCasts(listing: SourceListing, varTypes: Map[String, ImpLanType]): SourceListing

    Includes casts where necessary in a source listing

    Includes casts where necessary in a source listing

    listing

    The source listing to be examined

    varTypes

    Type environment, mapping every possibly involved variable identifier to its type

    returns

    The source listing with casts added

  11. def generateFunctionCast(innerExp: ImpLanExpr, from: FunctionType, to: FunctionType, varTypes: Map[String, ImpLanType]): ImpLanExpr

    Casts a function expression into a function expression with another signature by wrapping a lambda expression around the original function.

    Casts a function expression into a function expression with another signature by wrapping a lambda expression around the original function. The parameters and return value are casted in the usual way when calling the original function.

    Example:

    f : LongType x LongType -> LongType casted to Lazy[GeneralType] x Lazy[GeneralType] -> Lazy[GeneralType]

    would produce

    (tp1: Lazy[GeneralType], tp2: Lazy[GeneralType]) => {(Lazy[GeneralType])(f((LongType)tp1, (LongType)tp2)}

    innerExp

    Expression to be casted.

    from

    Type of innerExp

    to

    Type to cast to

    varTypes

    Type environment, mapping every possibly involved variable identifier to its type

    returns

    Casted expression (wrapped into lambda)

  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. def typeInference(impLanExpr: ImpLanExpr, varTypes: Map[String, ImpLanType]): ImpLanType

    Determines the type of an IntermediateCode.ImpLanExpr.

    Determines the type of an IntermediateCode.ImpLanExpr. This function may return error-prone results if the examined expression is not type-correct.

    impLanExpr

    Expression to be examined

    varTypes

    Type environment, mapping every possibly involved variable identifier to its type

    returns

    Type of the expression

  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped