class IntermediateCodeUtils extends AnyRef

DSL-Style state class for easy generation of ImpLan code. Functions of this class can be called iteratively to produce ImpLan step by step.

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

Instance Constructors

  1. new IntermediateCodeUtils(stmts: Seq[ImpLanStmt], blockState: Seq[BlockState] = Seq(Out), ifTryStack: Seq[Seq[ImpLanStmt]] = Seq(), elseCatchStack: Seq[Seq[ImpLanStmt]] = Seq(), condStack: Seq[Seq[Seq[ImpLanExpr]]] = Seq())

    stmts

    Sequence of already generated statements

    blockState

    Stack keeping track of unclosed ifs/try-catchs

    ifTryStack

    Stack of statements in If/Try blocks which are not closed yet

    elseCatchStack

    Stack of statements in Else/Catch blocks which are not closed yet

    condStack

    Stack of conditions of if blocks which are not closed yet

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. def Assignment(lhs: Variable, rhs: ImpLanExpr, default: Option[ImpLanExpr], typ: ImpLanType): IntermediateCodeUtils

    Add assignment to the code

    Add assignment to the code

    lhs

    The left hand side of the assignment

    rhs

    The right hand side of the assignment

    default

    The default value the variable has until the assignment . Must match the default value from other assignments to this variable. Optional.

    typ

    The type of the assigned identifier. Must match the type from other assignments to this variable.

    returns

    IntermediateCodeUtils representing the new state

  5. def Assignment(lhs: Variable, rhs: ImpLanExpr, default: ImpLanExpr, typ: ImpLanType): IntermediateCodeUtils

    Add assignment to the code

    Add assignment to the code

    lhs

    The left hand side of the assignment

    rhs

    The right hand side of the assignment

    default

    The default value the variable has until the assignment . Must match the default value from other assignments to this variable.

    typ

    The type of the assigned identifier. Must match the type from other assignments to this variable.

    returns

    IntermediateCodeUtils representing the new state

  6. def Catch(): IntermediateCodeUtils

    Closes the innermost try and starts its catch block.

    Closes the innermost try and starts its catch block. In the scope of the catch block a variable var_err exists which holds the thrown error. Fails if there was no previous unclosed try block.

    returns

    IntermediateCodeUtils representing the new state

  7. def Else(): IntermediateCodeUtils

    Closes the innermost if and starts its else block.

    Closes the innermost if and starts its else block. Fails if there was no previous unclosed if block.

    returns

    IntermediateCodeUtils representing the new state

  8. def EndIf(): IntermediateCodeUtils

    Closes the innermost if.

    Closes the innermost if. Fails if there is none.

    returns

    IntermediateCodeUtils representing the new state

  9. def EndTry(): IntermediateCodeUtils

    Closes the innermost try.

    Closes the innermost try. Fails if there is none.

    returns

    IntermediateCodeUtils representing the new state

  10. def FinalAssignment(lhs: Variable, default: ImpLanVal, typ: ImpLanType, lazyDef: Boolean = false): IntermediateCodeUtils

    Add a final assignment to the code.

    Add a final assignment to the code. May be called twice for the same lhs but only with exactly the same params.

    lhs

    The left hand side of the assignment

    default

    The value the variable has.

    typ

    The type of the assigned identifier.

    lazyDef

    Flag indicating if the variable is of type lazy

    returns

    IntermediateCodeUtils representing the new state

  11. def FunctionCall(name: String, params: Seq[ImpLanExpr], typeHint: FunctionType): IntermediateCodeUtils

    Add a function call to the generated code.

    Add a function call to the generated code.

    name

    The name of the function to be called

    params

    The param expressions of the call

    typeHint

    The type of the called function

    returns

    IntermediateCodeUtils representing the new state

  12. def If(cond: Seq[Seq[ImpLanExpr]]): IntermediateCodeUtils

    Adds an If statement to the code.

    Adds an If statement to the code. Has to be closed with EndIf. Further generated statements are added inside the if.

    cond

    The Ifs condition in DNF

    returns

    IntermediateCodeUtils representing the new state

  13. def LambdaApplication(exp: ImpLanExpr, params: Seq[ImpLanExpr]): IntermediateCodeUtils

    Add a lambda call to the generated code.

    Add a lambda call to the generated code.

    exp

    The expression to be called

    params

    The param expressions of the call

    returns

    IntermediateCodeUtils representing the new state

  14. def Try(): IntermediateCodeUtils

    Adds a Try statement to the code.

    Adds a Try statement to the code. Has to be followed by Catch and closed with EndTry. Further generated statements are added inside the try.

    returns

    IntermediateCodeUtils representing the new state

  15. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  16. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def generateStatements: Seq[ImpLanStmt]

    Returns current statements.

    Returns current statements. Checks if all if/trys are closed.

    returns

    Sequence of statements from the current state

  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  30. 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