RustStreamCodeGenerator

de.uni_luebeck.isp.tessla.tessla_compiler.backends.rustBackend.RustStreamCodeGenerator

Handles the translation of stream related functions.

Attributes

rustNonStreamCodeGenerator

A RustNonStreamCodeGenerator that handles non-stream related code.

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

override def produceConstStepCode(output_id: Identifier, output_type: TypeExpression, value_expr: ExpressionOrRef, trigger_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = const(...) expression

Produces code for a x = const(...) expression

Attributes

currSrc

The source listing the generated block is added to.

output_id

The id const is assigned to

output_type

Type of the output stream

trigger_expr

Argument expression for triggering stream

value_expr

Argument expressions for const value

Definition Classes
override def produceCountStepCode(output_id: Identifier, count_stream_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = count(...) expression

Produces code for a x = count(...) expression

Attributes

count_stream_expr

Expression of the stream to be counted

currSrc

The source listing the generated block is added to.

output_id

The id count is assigned to

Definition Classes
override def produceDefaultFromStepCode(output_id: Identifier, output_type: TypeExpression, stream_expr: ExpressionOrRef, default_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = defaultFrom(...) expression

Produces code for a x = defaultFrom(...) expression

Attributes

currSrc

The source listing the generated block is added to.

default_expr

The stream parameter of the defaultFrom

output_id

The id defaultFrom is assigned to

output_type

The type of id. Must be Events[...]

stream_expr

The stream parameter of the defaultFrom

Definition Classes
override def produceDefaultStepCode(output_id: Identifier, output_type: TypeExpression, stream_expr: ExpressionOrRef, default_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = default(...) expression

Produces code for a x = default(...) expression

Attributes

currSrc

The source listing the generated block is added to.

default_expr

The default parameter of the default

output_id

The id default is assigned to

output_type

The type of id. Must be Events[...]

stream_expr

The stream parameter of the default

Definition Classes
override def produceDelayStepCode(output_id: Identifier, delay_expr: ExpressionOrRef, reset_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = delay(...) expression

Produces code for a x = delay(...) expression

Attributes

currSrc

The source listing the generated block is added to.

delay_expr

The delay-stream parameter of the delay

output_id

The id delay is assigned to

reset_expr

The reset-stream parameter of the delay

Definition Classes
override def produceFilterStepCode(output_id: Identifier, output_type: TypeExpression, value_expr: ExpressionOrRef, condition_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = filter(...) expression

Produces code for a x = filter(...) expression

Attributes

condition_expr

Argument expressions for filter condition stream

currSrc

The source listing the generated block is added to.

output_id

The id filter is assigned to

output_type

Type of the output stream

value_expr

Argument expressions for filter value stream

Definition Classes
override def produceFoldStepCode(output_id: Identifier, output_type: TypeExpression, stream_expr: ExpressionOrRef, init_expr: ExpressionOrRef, function_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = fold(...) expression

Produces code for a x = fold(...) expression

Attributes

currSrc

The source listing the generated block is added to.

function_expr

Expression of the function used for folding

init_expr

Expression of the initial value for the folding

output_id

The id fold is assigned to

output_type

Type of the output stream

stream_expr

Expression of the stream to be folded

Definition Classes
def produceInputCode(stream_id: Identifier, stream_type: TypeExpression, stream_name: String, srcSegments: SourceSegments): Unit

Produces code reading the input (variable inputStream and value) and storing it.

Produces code reading the input (variable inputStream and value) and storing it.

Attributes

srcSegments

The source segments the generated block is added to. There is code attached to the input, and output section.

stream_id

The input stream to be handled

stream_type

This is the original name of the stream from the tessla spec

override def produceLastStepCode(output_id: Identifier, output_type: TypeExpression, values_expr: ExpressionOrRef, trigger_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = last(...) expression

Produces code for a x = last(...) expression

Attributes

currSrc

The source listing the generated block is added to.

output_id

The id last is assigned to

output_type

The type of id. Must be Events[...]

trigger_expr

The trigger/clock-stream parameter of the last

values_expr

The value-stream parameter of the last

Definition Classes
override def produceLiftStepCode(output_id: Identifier, output_type: TypeExpression, argument_exprs: Seq[ExpressionOrRef], function_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = lift(...) expression

Produces code for a x = lift(...) expression

Attributes

argument_exprs

The arguments of the lift except the last one (function)

currSrc

The source listing the generated block is added to.

function_expr

The lifted function

output_id

The id lift is assigned to

output_type

The type of id. Must be Events[...]

Definition Classes
override def produceMergeStepCode(output_id: Identifier, output_type: TypeExpression, argument_exprs: Seq[ExpressionOrRef], currSrc: SourceSegments): Unit

Produces code for a x = merge(...) expression

Produces code for a x = merge(...) expression

Attributes

argument_exprs

The stream expressions to be merged

currSrc

The source listing the generated block is added to.

output_id

The id merge is assigned to

output_type

The type of id. Must be Events[...]

Definition Classes
override def produceNativeFunctionStepCode(output_id: Identifier, output_type: TypeExpression, name: String, argument_exprs: Seq[ExpressionOrRef], argument_types: Seq[TypeExpression], currSource: SourceSegments): Unit

Produces code for a x = native:<name>(...) expression

Produces code for a x = native:<name>(...) expression

Attributes

argument_exprs

The arguments passed to e

argument_types

The type arguments passed to e

currSource

The source listing where the generated code is attached to.

name

The function name which is applied with args and typeArgs and then assigned

output_id

The id which is assigned (must be of stream type)

output_type

The Type of the output stream

Definition Classes
override def produceNilStepCode(output_id: Identifier, output_type: TypeExpression, currSrc: SourceSegments): Unit

Produces code for a x = nil expression

Produces code for a x = nil expression

Attributes

currSrc

The source listing the generated block is added to.

output_id

The id nil is assigned to

output_type

The type of id. Must be Events[...]

Definition Classes
def produceOutputCode(id: Identifier, typ: TypeExpression, name: String, srcSegments: SourceSegments, raw: Boolean, outputNames: Set[String]): Unit

Add code for output generation to the source segments. The output gets value, error, timestamp passed and if the printing format is raw (i.e. only value, not the current timestamp) and has to be translated accordingly in the final code generation

Add code for output generation to the source segments. The output gets value, error, timestamp passed and if the printing format is raw (i.e. only value, not the current timestamp) and has to be translated accordingly in the final code generation

Attributes

id

The id of the stream to be printed

name

The alias name of id for printing.

raw

If the output should be printed raw (without timestamp). Is passed to [TC]output.

srcSegments

The source segments the generated block is added to. There is code attached to the output segment.

typ

id's type. Must be Events[...]

override def producePureStepCode(output_id: Identifier, output_type: TypeExpression, stream_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = pure(...) expression

Produces code for a x = pure(...) expression

Attributes

currSrc

The source listing the generated block is added to.

output_id

The id pure is assigned to

output_type

Type of the output stream

stream_expr

Stream to be filtered

Definition Classes
override def produceReduceStepCode(output_id: Identifier, output_type: TypeExpression, stream_expr: ExpressionOrRef, function_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = reduce(...) expression

Produces code for a x = reduce(...) expression

Attributes

currSrc

The source listing the generated block is added to.

function_expr

Expression of the function used for reducing

output_id

The id reduce is assigned to

output_type

Type of the output stream

stream_expr

Expression of the stream to be reduced

Definition Classes
override def produceSignalLiftStepCode(output_id: Identifier, output_type: TypeExpression, argument_exprs: Seq[ExpressionOrRef], function_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = slift(...) expression

Produces code for a x = slift(...) expression

Attributes

argument_exprs

The arguments of the lift except the last one (function)

currSrc

The source listing the generated block is added to.

function_expr

The lifted function

output_id

The id slift is assigned to

output_type

The type of id. Must be Events[...]

Definition Classes
override def produceTimeStepCode(output_id: Identifier, stream_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = time(...) expression

Produces code for a x = time(...) expression

Attributes

currSrc

The source listing the generated block is added to.

output_id

The id time is assigned to

stream_expr

The base-stream parameter of the time

Definition Classes
override def produceUnitIfStepCode(output_id: Identifier, condition_expr: ExpressionOrRef, currSrc: SourceSegments): Unit

Produces code for a x = unitIf(...) expression

Produces code for a x = unitIf(...) expression

Attributes

condition_expr

Expression of the stream with the condition for unitIf

currSrc

The source listing the generated block is added to.

output_id

The id unitIf is assigned to

Definition Classes

Inherited methods

final protected def externResolution(e: ExpressionOrRef, definitions: Map[Identifier, DefinitionExpression]): ExternExpression

Attributes

Inherited from:
StreamCodeGeneratorInterface
def translateExternSignalExpression(id: Identifier, e: ExternExpression, args: Seq[ExpressionOrRef], typeArgs: Seq[TypeExpression], currSource: SourceSegments): ReturnType

Translates an assignment to a stream variable to the corresponding ImpLan Code and attaches it in a given source listing. The assigned expression has to be (and is always in TeSSLa Core) an application.

Translates an assignment to a stream variable to the corresponding ImpLan Code and attaches it in a given source listing. The assigned expression has to be (and is always in TeSSLa Core) an application.

Attributes

args

The arguments passed to e

currSource

The source listing where the generated code is attached to. It is attached to the stepSource section of the source listing.

e

The expression which is applicated with args and typeArgs and then assigned

id

The id which is assigned (must be of stream type)

typeArgs

The type arguments passed to e

Returns:

The modified source listing

Inherited from:
StreamCodeGeneratorInterface
def translateStreamDefinitionExpression(id: Identifier, expression: DefinitionExpression, definitions: Map[Identifier, DefinitionExpression], currSrc: SourceSegments): ReturnType

Translates a definition expression, which is always an assignment of an external signal application to a stream variable and attaches it in a given source collection.

Translates a definition expression, which is always an assignment of an external signal application to a stream variable and attaches it in a given source collection.

Attributes

currSrc

The source listing where the generated code is attached to.

definitions

The map with all definition expressions

expression

The application expression

id

The id which is assigned (must be of stream type)

Returns:

The modified source listing

Inherited from:
StreamCodeGeneratorInterface