ScalaBackend

de.uni_luebeck.isp.tessla.tessla_compiler.backends.scalaBackend.ScalaBackend
class ScalaBackend(ioInterface: Boolean, userIncludes: String) extends BackendInterface

BackendInterface implementation for the translation to Scala code

Value parameters

userIncludes

Additional user-specific code which is included on top of the generated scala source. Can be used e.g. for additional includes

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def generateChunkCode(stmts: Seq[ImpLanStmt]): (String, String)

Translates a sequence of IntermediateCode.ImpLanStmt to the corresponding code in the target language. In difference to generateCode it splits the statements into groups of size chunkSize and creates an own method for each of them.

Translates a sequence of IntermediateCode.ImpLanStmt to the corresponding code in the target language. In difference to generateCode it splits the statements into groups of size chunkSize and creates an own method for each of them.

Value parameters

stmts

The sequence of statements to be translated.

Attributes

Returns

Tuple with the chunk methods as first parameter and chunk method calls as second parameter.

override def generateCode(stmts: Seq[ImpLanStmt]): String

Translates a sequence of IntermediateCode.ImpLanStmt to the corresponding code in Scala.

Translates a sequence of IntermediateCode.ImpLanStmt to the corresponding code in Scala.

Value parameters

stmts

The sequence of statements to be translated.

Attributes

Returns

The generated code in Scala

Definition Classes
def generateVariableDeclarations(vars: Seq[(String, (ImpLanType, Option[ImpLanExpr], DeclarationType))]): Seq[String]

Translates a map of variables with base information (type, default value, lazy assignment) to corresponding variable declarations in Scala.

Translates a map of variables with base information (type, default value, lazy assignment) to corresponding variable declarations in Scala.

Value parameters

vars

Map of variables to be translated: Name -> (Type x Default value x Lazy assignment)

Attributes

Returns

Sequence of variable definitions in Scala

Concrete fields

override val chunkSize: Int

Inherited fields

val phase: TesslaPhase[SourceListing, String]

Phase from a IntermediateCode.SourceListing to real-world source code as String. Therefore the sections of the IntermediateCode.SourceListing are translated to code and included at special places of the template code by replacing

Phase from a IntermediateCode.SourceListing to real-world source code as String. Therefore the sections of the IntermediateCode.SourceListing are translated to code and included at special places of the template code by replacing

  • //VARDEF by a section where all used variables are defined
  • //TRIGGER by the translation of tsGenSource
  • //STEP by the translation of stepSource
  • //TAIL by the translation of tailSource
  • //INPUTPROCESSING by the translation of inputProcessing
  • //STATIC by the translation of staticSource

For more details on the requirements of the template see the markdown documents in doc

Value parameters

orgListing

The source listing to be translated

Attributes

Returns

The source code of the generated monitor program

Inherited from:
BackendInterface
protected var variables: Seq[(String, (ImpLanType, Option[ImpLanExpr], DeclarationType))]

Attributes

Inherited from:
BackendInterface