NonStreamCodeGenerator

de.uni_luebeck.isp.tessla.tessla_compiler.NonStreamCodeGenerator

Class for the translation of TeSSLa expressions of non-stream type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def translateAssignment(id: Identifier, e: ExpressionOrRef, tm: TypeArgManagement, defContext: Map[Identifier, DefinitionExpression]): ImpLanStmt

Translates an assignment from TeSSLa to ImpLan

Translates an assignment from TeSSLa to ImpLan

Value parameters

defContext

Definition context depicting all var names in the current scope to their definition expression

e

The expression assigned to id

id

The id which is assigned

tm

The TypeArgManagement to resolve type parameters

Attributes

Returns

The translated assignment

Definition Classes
override def translateBody(body: Map[Identifier, DefinitionExpression], ret: ExpressionOrRef, tm: TypeArgManagement, defContext: Map[Identifier, DefinitionExpression]): Seq[ImpLanStmt]

Translates a block of statements with return expression (i.e. the body of a lambda) to IntermediateCode.ImpLanStmts

Translates a block of statements with return expression (i.e. the body of a lambda) to IntermediateCode.ImpLanStmts

Value parameters

body

The sequence of statements to be translated

defContext

Definition context depicting all var names in the current scope to their definition expression

ret

The return expression of the block

tm

The TypeArgManagement to resolve type parameters

Attributes

Returns

The translated block. Contains a IntermediateCode.ReturnStatement at the end

Definition Classes
override def translateExpressionOrRef(e: ExpressionOrRef, tm: TypeArgManagement, defContext: Map[Identifier, DefinitionExpression]): ImpLanExpr

Translates an ExpressionOrRef to a corresponding IntermediateCode.ImpLanExpr

Translates an ExpressionOrRef to a corresponding IntermediateCode.ImpLanExpr

Value parameters

defContext

Definition context depicting all var names in the current scope to their definition expression

e

The expression to be translated

tm

The TypeArgManagement to resolve type parameters

Attributes

Returns

The translated expression

Definition Classes
override def translateExtern(e: ExternExpression, tm: TypeArgManagement, defContext: Map[Identifier, DefinitionExpression]): ImpLanExpr

Value parameters

defContext

Definition context depicting all var names in the current scope to their definition expression

e

Translates an ExternExpression. If the extern is of function type a lambda expression is wrapped around it. If the extern is directly applied this lambda is most likely unnecessary and this function should not be used for translation of the called extern.

tm

The TypeArgManagement to resolve type parameters

Attributes

Returns

The translated expression

Definition Classes
override def translateFunction(e: FunctionExpression, tm: TypeArgManagement, defContext: Map[Identifier, DefinitionExpression]): ImpLanExpr

Translates a TeSSLa Core FunctionExpression to an ImpLan IntermediateCode.LambdaExpression

Translates a TeSSLa Core FunctionExpression to an ImpLan IntermediateCode.LambdaExpression

Value parameters

defContext

Definition context depicting all var names in the current scope to their definition expression

e

The function to be translated

tm

The TypeArgManagement to resolve type parameters

Attributes

Returns

The translated function expression

Definition Classes
override def translateFunctionCall(e: ExpressionOrRef, args: Seq[ImpLanExpr], tm: TypeArgManagement, defContext: Map[Identifier, DefinitionExpression]): ImpLanExpr

Translates a function application to ImpLan

Translates a function application to ImpLan

Value parameters

args

The argument expressions of the application

defContext

Definition context depicting all var names in the current scope to their definition expression

e

The function expression which is applied

tm

The TypeArgManagement to resolve type parameters

Attributes

Returns

The translated function application

Definition Classes

Inherited methods

protected def finalAssignmentPossible(e: ExpressionOrRef): Boolean

Checks whether a given expression only uses identifiers from definedIdentifiers, i.e. those already defined

Checks whether a given expression only uses identifiers from definedIdentifiers, i.e. those already defined

Value parameters

e

Expression to be examined

Attributes

Returns

Whether all subexpressions are already defined and and the expression can hence be evaluated

Inherited from:
NonStreamCodeGeneratorInterface
protected def getInlinedArgs(args: Seq[ExpressionOrRef], defContext: Map[Identifier, DefinitionExpression]): Seq[ExpressionOrRef]

Inlines all references in a function application's parameters according to inlining information from ExtendedSpecification

Inlines all references in a function application's parameters according to inlining information from ExtendedSpecification

Value parameters

args

The arguments applied to e

defContext

Definition context depicting all var names in the current scope to their definition expression

Attributes

Returns

The modified parameter expressions

Inherited from:
NonStreamCodeGeneratorInterface
protected def inlineVars(e: DefinitionExpression, defContext: Map[Identifier, DefinitionExpression]): DefinitionExpression

Inlines all ExpressionRef (variable references) to variables in the inlining set of the ExtendedSpecification in a DefinitionExpression except those of function type

Inlines all ExpressionRef (variable references) to variables in the inlining set of the ExtendedSpecification in a DefinitionExpression except those of function type

Value parameters

defContext

Definition context depicting all var names in the current scope to their definition expression

e

The expression where variable references should be inlined

Attributes

Returns

The modified expression

Inherited from:
NonStreamCodeGeneratorInterface
protected def inlineVarsBody(body: Map[Identifier, DefinitionExpression], defContext: Map[Identifier, DefinitionExpression]): Map[Identifier, DefinitionExpression]

Applies inlineVars on all statements in body

Applies inlineVars on all statements in body

Value parameters

body

Sequence of statements where inlineVars is applied on

defContext

Definition context depicting all var names in the current scope to their definition expression

Attributes

Returns

The modified body

Inherited from:
NonStreamCodeGeneratorInterface
protected def inlineVarsRef(e: ExpressionOrRef, defContext: Map[Identifier, DefinitionExpression]): ExpressionOrRef

Inlines all ExpressionRef (variable references) to variables in the inlining set of the ExtendedSpecification in an ExpressionOrRef except those of function type

Inlines all ExpressionRef (variable references) to variables in the inlining set of the ExtendedSpecification in an ExpressionOrRef except those of function type

Value parameters

defContext

Definition context depicting all var names in the current scope to their definition expression

e

The expression where variable references should be inlined

Attributes

Returns

The modified expression

Inherited from:
NonStreamCodeGeneratorInterface

Inherited fields

protected var definedIdentifiers: Map[Identifier, DeclarationType]

Set of identifiers which are assigned with final assignments. If an assignment uses exclusively existing assignments it can also be finally assigned Otherwise (in case of recursion) it must be assigned with a dummy default value first

Set of identifiers which are assigned with final assignments. If an assignment uses exclusively existing assignments it can also be finally assigned Otherwise (in case of recursion) it must be assigned with a dummy default value first

Attributes

Inherited from:
NonStreamCodeGeneratorInterface