A helper class for AST transformations needed for federated execution.
More...
A helper class for AST transformations needed for federated execution.
- Author
- Soroush Bateni
-
Edward A. Lee
◆ addReactorDefinition()
| Reactor org.lflang.federated.generator.FedASTUtils.addReactorDefinition |
( |
String | name, |
|
|
Resource | resource ) |
|
static |
Add a reactor definition with the given name to the given resource and return it.
◆ findFederatedReactor()
| Reactor org.lflang.federated.generator.FedASTUtils.findFederatedReactor |
( |
Resource | resource | ) |
|
|
static |
Find the federated reactor in a .lf file.
- Parameters
-
| resource | Resource representing a .lf file. |
- Returns
- The federated reactor if found.
◆ getReactionBankIndex()
| int org.lflang.federated.generator.FedASTUtils.getReactionBankIndex |
( |
Reaction | reaction | ) |
|
|
static |
◆ hasDestinationReaction()
| boolean org.lflang.federated.generator.FedASTUtils.hasDestinationReaction |
( |
PortInstance | port | ) |
|
|
static |
Return true if the given port has at least one destination reaction.
- Parameters
-
◆ hasSourceReaction()
| boolean org.lflang.federated.generator.FedASTUtils.hasSourceReaction |
( |
PortInstance | port | ) |
|
|
static |
Return true if the given port has at least one source reaction.
- Parameters
-
◆ makeCommunication()
Replace the specified connection with communication between federates.
If the connection has no source reactions or no destination reactions, then return without doing anything.
- Parameters
-
| connection | Network connection between two federates. |
| resource | The resource from which the ECore model was derived. |
| coordination | One of CoordinationType.DECENTRALIZED or CoordinationType.CENTRALIZED. |
| messageReporter | Used to report errors encountered. |
◆ safe()
| static< E > List< E > org.lflang.federated.generator.FedASTUtils.safe |
( |
List< E > | list | ) |
|
|
static |
Return a null-safe List.
- Parameters
-
| <E> | The type of the list |
| list | The potentially null List |
- Returns
- Empty list or the original list
◆ setReactionBankIndex()
| void org.lflang.federated.generator.FedASTUtils.setReactionBankIndex |
( |
Reaction | reaction, |
|
|
int | bankIndex ) |
|
static |
Mark the specified reaction to belong to only the specified bank index.
This is needed because reactions cannot declare a specific bank index as an effect or trigger. Reactions that send messages between federates, including absent messages, need to be specific to a bank member.
- Parameters
-
| reaction | The reaction. |
| bankIndex | The bank index, or -1 if there is no bank. |
◆ networkIDReceiver
| int org.lflang.federated.generator.FedASTUtils.networkIDReceiver = 0 |
|
static |
The documentation for this class was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/federated/generator/FedASTUtils.java