ScalaConstants

de.uni_luebeck.isp.tessla.tessla_compiler.backends.scalaBackend.ScalaConstants

Class containing Scala-specific constants for the translation

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def builtinFunctionCallTranslation(name: String, oArgs: Seq[ImpLanExpr], transFunc: ImpLanExpr => String, typeHint: FunctionType): String

Performs the translation of functions in ImpLan to functions in Scala Only functions starting and ending with two underscores (_) are translated. Note: Mutable datastructures are not yet handled on this branch since they are not generated

Performs the translation of functions in ImpLan to functions in Scala Only functions starting and ending with two underscores (_) are translated. Note: Mutable datastructures are not yet handled on this branch since they are not generated

Value parameters

name

Name of the function which is called

oArgs

Argument expressions of the function call

transFunc

Function used to translate the arguments

typeHint

The type signature of the called function.

Attributes

Returns

The translated function call in Scala

def typeTranslation(t: ImpLanType): String

Translates an IntermediateCode.ImpLanType to its corresponding Scala type.

Translates an IntermediateCode.ImpLanType to its corresponding Scala type.

  • The Lazy container type is translated as Function0
  • The generic type is translated as Any
  • The error type is translated as Throwable
  • Options are translated to an own type ErrorOption which is able to capture an error

Value parameters

t

Type to be translated

Attributes

Returns

Corresponding Scala type

def valueTranslation(v: ImpLanVal): String

Translates an IntermediateCode.ImpLanVal to its corresponding Scala value.

Translates an IntermediateCode.ImpLanVal to its corresponding Scala value.

  • None/Some are translated to special values EONone/EOSome to be able to capture errors in Somes

Value parameters

v

The value to be translated

Attributes

Returns

The corresponding value in Scala