lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.generator.c.CEnclavedReactorTransformation Class Reference

The AST transformation enabling enclaved execution in the C target. More...

Inherits org.lflang.ast.AstTransformation.

Public Member Functions

void applyTransformation (List< Reactor > reactors)
 Part of the AstTransformation interface.
 CEnclavedReactorTransformation (Resource mainResource, CTypes types)
void setEnvParams (ReactorInstance conn, ReactorInstance source, ReactorInstance dest)
 Set the environment pointers which are parameters to the enclave connection reactor.

Public Attributes

final ConnectionGraph< Instantiation, EnclaveConnection > connGraph
 The AST transformation also collects information about the enclave connections.
final Map< Instantiation, Pair< Instantiation, Instantiation > > enclavedConnections
 We also expose a map of Instantiations of EnclavedConnection reactors to their upstream and downstream Instantiations.
Instantiation PARENT = factory.createInstantiation()

Static Public Attributes

static String delayParamName = "delay"
static String destEnvParamName = "dest_env"
static String enclaveConnectionLibraryPath = "/lib/c/EnclaveConnection.lf"
static final LfFactory factory = ASTUtils.factory
static String hasAfterDelayParamName = "has_after_delay"
static String isPhysicalParamName = "is_physical"
static String sourceEnvParamName = "source_env"

Protected Attributes

CTypes types

Package Attributes

Reactor connectionReactor = null
 We only need a single ConnectionReactor since it uses generics.

Detailed Description

The AST transformation enabling enclaved execution in the C target.

This transformation finds all connections involving an enclave and inserts a special connection Reactor there. The connection Reactor is inspired by the after-delay reactors. They consist of an action and two reactions. The first reaction, the delay reaction, schedules events received onto the action. The other reaction, the forward reaction writes the scheduled event to its output port.

Constructor & Destructor Documentation

◆ CEnclavedReactorTransformation()

org.lflang.generator.c.CEnclavedReactorTransformation.CEnclavedReactorTransformation ( Resource mainResource,
CTypes types )

Member Function Documentation

◆ applyTransformation()

void org.lflang.generator.c.CEnclavedReactorTransformation.applyTransformation ( List< Reactor > reactors)

Part of the AstTransformation interface.

Performs the transformation.

Parameters
reactorsA list of Reactor instances to perform the AST transformation on.

Implements org.lflang.ast.AstTransformation.

◆ setEnvParams()

void org.lflang.generator.c.CEnclavedReactorTransformation.setEnvParams ( ReactorInstance conn,
ReactorInstance source,
ReactorInstance dest )

Set the environment pointers which are parameters to the enclave connection reactor.

Parameters
connThe generated enclave connection reactor
sourceThe upstream reactor
destThe downstream reactor

Member Data Documentation

◆ connectionReactor

Reactor org.lflang.generator.c.CEnclavedReactorTransformation.connectionReactor = null
package

We only need a single ConnectionReactor since it uses generics.

◆ connGraph

final ConnectionGraph<Instantiation, EnclaveConnection> org.lflang.generator.c.CEnclavedReactorTransformation.connGraph
Initial value:
=
This implements a special graph that I call a ConnectionGraph.
Definition ConnectionGraph.java:15

The AST transformation also collects information about the enclave connections.

Note that this is on the AST graph, containing Instantiations, not ReactorInstances. This graph is exposed and used later to build the graph of ReactorInstances that are enclaves.

◆ delayParamName

String org.lflang.generator.c.CEnclavedReactorTransformation.delayParamName = "delay"
static

◆ destEnvParamName

String org.lflang.generator.c.CEnclavedReactorTransformation.destEnvParamName = "dest_env"
static

◆ enclaveConnectionLibraryPath

String org.lflang.generator.c.CEnclavedReactorTransformation.enclaveConnectionLibraryPath = "/lib/c/EnclaveConnection.lf"
static

◆ enclavedConnections

final Map<Instantiation, Pair<Instantiation, Instantiation> > org.lflang.generator.c.CEnclavedReactorTransformation.enclavedConnections
Initial value:
=
new HashMap<>()

We also expose a map of Instantiations of EnclavedConnection reactors to their upstream and downstream Instantiations.

◆ factory

final LfFactory org.lflang.generator.c.CEnclavedReactorTransformation.factory = ASTUtils.factory
static

◆ hasAfterDelayParamName

String org.lflang.generator.c.CEnclavedReactorTransformation.hasAfterDelayParamName = "has_after_delay"
static

◆ isPhysicalParamName

String org.lflang.generator.c.CEnclavedReactorTransformation.isPhysicalParamName = "is_physical"
static

◆ PARENT

Instantiation org.lflang.generator.c.CEnclavedReactorTransformation.PARENT = factory.createInstantiation()

◆ sourceEnvParamName

String org.lflang.generator.c.CEnclavedReactorTransformation.sourceEnvParamName = "source_env"
static

◆ types

CTypes org.lflang.generator.c.CEnclavedReactorTransformation.types
protected

The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/generator/c/CEnclavedReactorTransformation.java