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

Representation of a compile-time instance of a reactor. More...

Inherits org.lflang.generator.NamedInstance< Instantiation >.

Public Member Functions

ReactionInstanceGraph assignLevels ()
 Assign levels to all reactions within the same root as this reactor.
void clearCaches ()
 Clear any cached data in this reactor and its children.
void clearCaches (boolean includingRuntimes)
 Clear any cached data in this reactor and its children.
ReactorInstance getChildReactorInstance (Instantiation definition)
 Return the instance of a child rector created by the specified definition or null if there is none.
Set< NamedInstance<?> > getCycles ()
 Return the set of ReactionInstance and PortInstance that form causality loops in the topmost parent reactor in the instantiation hierarchy.
getDefinition ()
 Return the definition, which is the AST node for this object.
int getDepth ()
 Get the depth of the reactor instance.
String getFullName ()
 Return the full name of this instance, which has the form "a.b.c", where "c" is the name of this instance, "b" is the name of its container, and "a" is the name of its container, stopping at the container in main.
String getFullNameWithJoiner (String joiner)
 Return a string of the form "a.b.c", where "." is replaced by the specified joiner, "c" is the name of this instance, "b" is the name of its container, and "a" is the name of its container, stopping at the container in main.
PortInstance getInput (String name)
 Return the specified input by name or null if there is no such input.
ModeInstance getMode (boolean direct)
 Returns the directly/indirectly enclosing mode.
String getName ()
 Override the base class to append [i_d], where d is the depth, if this reactor is in a bank of reactors.
PortInstance getOutput (String name)
 Return the specified output by name or null if there is no such output.
ParameterInstance getParameter (String name)
 Return a parameter matching the specified name if the reactor has one and otherwise return null.
ReactorInstance getParent ()
 Return the parent or null if this is a top-level reactor.
TriggerInstance< BuiltinTriggerVariablegetShutdownTrigger ()
 Return the shutdown trigger or null if not used in any reaction.
TriggerInstance< BuiltinTriggerVariablegetStartupTrigger ()
 Return the startup trigger or null if not used in any reaction.
TimeValue getTimeValue (Expression expr)
 Assuming that the given expression denotes a valid time, return a time value.
int getTotalWidth ()
 If this reactor is a bank or any of its parents is a bank, return the total number of runtime instances, which is the product of the widths of all the parents.
int getTotalWidth (int atDepth)
 If this reactor is a bank or any of its parents is a bank, return the total number of runtime instances, which is the product of the widths of all the parents.
Set< TriggerInstance<? extends Variable > > getTriggers ()
 Return the trigger instances (input ports, timers, and actions that trigger reactions) belonging to this reactor instance.
Set< TriggerInstance<? extends Variable > > getTriggersAndReads ()
 Return the trigger instances (input ports, timers, and actions that trigger reactions) together the ports that the reaction reads but that don't trigger it.
int getWidth ()
 Return the width of this instance, which in this base class is 1.
boolean hasCycles ()
 Return true if the top-level parent of this reactor has causality cycles.
boolean hasParent (ReactorInstance container)
 Return true if this instance has the specified parent (possibly indirectly, anywhere up the hierarchy).
Integer initialIntParameterValue (Parameter parameter)
 Given a parameter definition for this reactor, return the initial integer value of the parameter.
List< Instantiation > instantiations ()
 Return a list of Instantiation objects for evaluating parameter values.
boolean isBank ()
 Returns true if this is a bank of reactors.
boolean isGeneratedDelay ()
 Return true if this is a generated delay reactor that originates from an "after" delay on a connection.
boolean isMainOrFederated ()
 Returns whether this is a main or federated reactor.
boolean isParent (ReactorInstance r)
 Return true if the specified reactor instance is either equal to this reactor instance or a parent of it.
ActionInstance lookupActionInstance (Action action)
 Return the action instance within this reactor instance corresponding to the specified action reference.
ModeInstance lookupModeInstance (Mode mode)
 Returns the mode instance within this reactor instance corresponding to the specified mode reference.
ParameterInstance lookupParameterInstance (Parameter parameter)
 Given a parameter definition, return the parameter instance corresponding to that definition, or null if there is no such instance.
PortInstance lookupPortInstance (Port port)
 Given a port definition, return the port instance corresponding to that definition, or null if there is no such instance.
PortInstance lookupPortInstance (VarRef reference)
 Given a reference to a port belonging to this reactor instance, return the port instance.
ReactionInstance lookupReactionInstance (Reaction reaction)
 Return the reaction instance within this reactor instance corresponding to the specified reaction.
ReactorInstance lookupReactorInstance (Instantiation instantiation)
 Return the reactor instance within this reactor that has the specified instantiation.
TimerInstance lookupTimerInstance (Timer timer)
 Return the timer instance within this reactor instance corresponding to the specified timer reference.
WatchdogInstance lookupWatchdogInstance (Watchdog watchdog)
 Return the watchdog instance within this reactor instance corresponding to the specified watchdog reference.
List< ReactorInstanceparents ()
 Return a list of all the parents starting with the root().
 ReactorInstance (Instantiation definition, ReactorInstance parent, MessageReporter reporter, int desiredDepth, List< Reactor > reactors)
 Create a runtime instance from the specified definition and with the specified parent that instantiated it.
 ReactorInstance (Reactor reactor, MessageReporter reporter)
 Create a new instantiation hierarchy that starts with the given top-level reactor.
 ReactorInstance (Reactor reactor, MessageReporter reporter, int desiredDepth)
 Create a new instantiation hierarchy that starts with the given top-level reactor but only creates contained reactors up to the specified depth.
 ReactorInstance (Reactor reactor, MessageReporter reporter, List< Reactor > reactors)
 Create a new instantiation hierarchy that starts with the given top-level reactor.
 ReactorInstance (Reactor reactor, ReactorInstance parent, MessageReporter reporter)
 Create a new instantiation with the specified parent.
Expression resolveParameters (Expression e)
ReactorInstance root ()
 Return the root reactor, which is the top-level parent.
void setWidth (int width)
 Set the width.
String toString ()
 Return a descriptive string.
String uniqueID ()

Static Public Member Functions

static void connectPortInstances (RuntimeRange< PortInstance > src, RuntimeRange< PortInstance > dst, Connection connection)
 Connect the given left port range to the given right port range.

Public Attributes

final List< ActionInstanceactions = new ArrayList<>()
 The action instances belonging to this reactor instance.
final List< ReactorInstancechildren = new ArrayList<>()
 The contained reactor instances, in order of declaration.
CEnclaveInstance containingEnclave
 The enclave instance corresponding to the containing reactor that is an enclave.
final ReactorInstance containingEnclaveReactor
 The nearest containing reactor instance that is an enclave.
final List< PortInstanceinputs = new ArrayList<>()
 The input port instances belonging to this reactor instance.
final List< ModeInstancemodes = new ArrayList<>()
 The mode instances belonging to this reactor instance.
final List< PortInstanceoutputs = new ArrayList<>()
 The output port instances belonging to this reactor instance.
final List< ParameterInstanceparameters = new ArrayList<>()
 The parameters of this instance.
final List< ReactionInstancereactions = new ArrayList<>()
 List of reaction instances for this reactor instance.
final ReactorDecl reactorDeclaration
 The reactor declaration in the AST.
final Reactor reactorDefinition
 The reactor after imports are resolve.
final boolean recursive
 Indicator that this reactor has itself as a parent, an error condition.
final List< StateVariableInstancestates = new ArrayList<>()
 The state variable instances belonging to this reactor instance.
final List< TimerInstancetimers = new ArrayList<>()
 The timer instances belonging to this reactor instance.
final Integer tpoLevel
 The Total Port Order level with which this was annotated, or null if there is no TPO annotation.
TypeParameterizedReactor tpr
 FIXME: What is this?
final List< WatchdogInstancewatchdogs = new ArrayList<>()
 List of watchdog instances for this reactor instance.

Static Public Attributes

static int identifierLengthLimit
 A limit on the number of characters returned by uniqueID.

Protected Member Functions

void createReactionInstances ()
 Create all the reaction instances of this reactor instance and record the dependencies and antidependencies between ports, actions, and timers and reactions.
void createWatchdogInstances ()
 Create all the watchdog instances of this reactor instance.
TriggerInstance< BuiltinTriggerVariablegetOrCreateBuiltinTrigger (BuiltinTriggerRef trigger)
 Returns the built-in trigger or create a new one if none exists.

Protected Attributes

List< Instantiation > _instantiations
 The nested list of instantiations that created this reactor instance.
Map< BuiltinTrigger, TriggerInstance< BuiltinTriggerVariable > > builtinTriggers
 The map of used built-in triggers.
int depth
 The depth in the hierarchy of this instance.
MessageReporter reporter
 The generator that created this reactor instance.

Package Attributes

definition
 The Instantiation AST object from which this was created.
ReactorInstance parent
 The reactor instance that creates this instance.
HashMap< String, Integer > uniqueIDCount
 Map from a name of the form a_b_c to the number of unique IDs with that prefix that have been already assigned.
int width
 The width of this instance.

Detailed Description

Representation of a compile-time instance of a reactor.

If the reactor is instantiated as a bank of reactors, or if any of its parents is instantiated as a bank of reactors, then one instance of this ReactorInstance class represents all the runtime instances within these banks. The getTotalWidth() method returns the number of such runtime instances, which is the product of the bank width of this reactor instance and the bank widths of all of its parents. There is exactly one instance of this ReactorInstance class for each graphical rendition of a reactor in the diagram view.

For the main reactor, which has no parent, once constructed, this object represents the entire Lingua Franca program. If the program has causality loops (a programming error), then hasCycles() will return true and getCycles() will return the ports and reaction instances involved in the cycles.

Author
Marten Lohstroh
Edward A. Lee

Constructor & Destructor Documentation

◆ ReactorInstance() [1/5]

org.lflang.generator.ReactorInstance.ReactorInstance ( Reactor reactor,
MessageReporter reporter,
List< Reactor > reactors )

Create a new instantiation hierarchy that starts with the given top-level reactor.

Parameters
reactorThe top-level reactor.
reporterThe error reporter.
reactorsThe list of all reactors in the program.

◆ ReactorInstance() [2/5]

org.lflang.generator.ReactorInstance.ReactorInstance ( Reactor reactor,
MessageReporter reporter )

Create a new instantiation hierarchy that starts with the given top-level reactor.

Parameters
reactorThe top-level reactor.
reporterThe error reporter.

◆ ReactorInstance() [3/5]

org.lflang.generator.ReactorInstance.ReactorInstance ( Reactor reactor,
MessageReporter reporter,
int desiredDepth )

Create a new instantiation hierarchy that starts with the given top-level reactor but only creates contained reactors up to the specified depth.

Parameters
reactorThe top-level reactor.
reporterThe error reporter.
desiredDepthThe depth to which to go, or -1 to construct the full hierarchy.

◆ ReactorInstance() [4/5]

org.lflang.generator.ReactorInstance.ReactorInstance ( Reactor reactor,
ReactorInstance parent,
MessageReporter reporter )

Create a new instantiation with the specified parent.

This constructor is here to allow for unit tests. It should not be used for any other purpose.

Parameters
reactorThe top-level reactor.
parentThe parent reactor instance.
reporterThe error reporter.

◆ ReactorInstance() [5/5]

org.lflang.generator.ReactorInstance.ReactorInstance ( Instantiation definition,
ReactorInstance parent,
MessageReporter reporter,
int desiredDepth,
List< Reactor > reactors )

Create a runtime instance from the specified definition and with the specified parent that instantiated it.

Parameters
definitionThe instantiation statement in the AST.
parentThe parent, or null for the main rector.
reporterAn error reporter.
desiredDepthThe depth to which to expand the hierarchy.
reactorsThe list of all reactors in the program.

Member Function Documentation

◆ assignLevels()

ReactionInstanceGraph org.lflang.generator.ReactorInstance.assignLevels ( )

Assign levels to all reactions within the same root as this reactor.

The level of a reaction r is equal to the length of the longest chain of reactions that must have the opportunity to execute before r at each tag. This returns a non-empty graph if a causality cycle exists.

This method uses a variant of Kahn's algorithm, which is linear in V + E, where V is the number of vertices (reactions) and E is the number of edges (dependencies between reactions).

Returns
An empty graph if successful and otherwise a graph with runtime reaction instances that form cycles.

◆ clearCaches() [1/2]

void org.lflang.generator.ReactorInstance.clearCaches ( )

Clear any cached data in this reactor and its children.

This is useful if a mutation has been realized.

◆ clearCaches() [2/2]

void org.lflang.generator.ReactorInstance.clearCaches ( boolean includingRuntimes)

Clear any cached data in this reactor and its children.

This is useful if a mutation has been realized.

Parameters
includingRuntimesIf false, leave the runtime instances of reactions intact. This is useful for federated execution where levels are computed using the top-level connections, but then those connections are discarded.

◆ connectPortInstances()

void org.lflang.generator.ReactorInstance.connectPortInstances ( RuntimeRange< PortInstance > src,
RuntimeRange< PortInstance > dst,
Connection connection )
static

Connect the given left port range to the given right port range.

NOTE: This method is public to enable its use in unit tests. Otherwise, it should be private. This is why it is defined here, in the section labeled "Private methods."

Parameters
srcThe source range.
dstThe destination range.
connectionThe connection establishing this relationship.

◆ createReactionInstances()

void org.lflang.generator.ReactorInstance.createReactionInstances ( )
protected

Create all the reaction instances of this reactor instance and record the dependencies and antidependencies between ports, actions, and timers and reactions.

This also records the dependencies between reactions that follows from the order in which they are defined.

◆ createWatchdogInstances()

void org.lflang.generator.ReactorInstance.createWatchdogInstances ( )
protected

Create all the watchdog instances of this reactor instance.

◆ getChildReactorInstance()

ReactorInstance org.lflang.generator.ReactorInstance.getChildReactorInstance ( Instantiation definition)

Return the instance of a child rector created by the specified definition or null if there is none.

Parameters
definitionThe definition of the child reactor ("new" statement).

◆ getCycles()

Set< NamedInstance<?> > org.lflang.generator.ReactorInstance.getCycles ( )

Return the set of ReactionInstance and PortInstance that form causality loops in the topmost parent reactor in the instantiation hierarchy.

This will return an empty set if there are no causality loops.

◆ getDefinition()

T org.lflang.generator.NamedInstance< T extends EObject >.getDefinition ( )
inherited

Return the definition, which is the AST node for this object.

◆ getDepth()

int org.lflang.generator.NamedInstance< T extends EObject >.getDepth ( )
inherited

Get the depth of the reactor instance.

This is 0 for the main reactor, 1 for reactors immediately contained therein, etc.

◆ getFullName()

String org.lflang.generator.NamedInstance< T extends EObject >.getFullName ( )
inherited

Return the full name of this instance, which has the form "a.b.c", where "c" is the name of this instance, "b" is the name of its container, and "a" is the name of its container, stopping at the container in main.

If any reactor in the hierarchy is in a bank of reactors then, it will appear as a[index]. Similarly, if c is a port in a multiport, it will appear as c[index].

Returns
The full name of this instance.

◆ getFullNameWithJoiner()

String org.lflang.generator.NamedInstance< T extends EObject >.getFullNameWithJoiner ( String joiner)
inherited

Return a string of the form "a.b.c", where "." is replaced by the specified joiner, "c" is the name of this instance, "b" is the name of its container, and "a" is the name of its container, stopping at the container in main.

Returns
A string representing this instance.

◆ getInput()

PortInstance org.lflang.generator.ReactorInstance.getInput ( String name)

Return the specified input by name or null if there is no such input.

Parameters
nameThe input name.

◆ getMode()

ModeInstance org.lflang.generator.NamedInstance< T extends EObject >.getMode ( boolean direct)
inherited

Returns the directly/indirectly enclosing mode.

Parameters
directflag whether to check only for direct enclosing mode or also consider modes of parent reactor instances.
Returns
The mode, if any, null otherwise.

◆ getName()

String org.lflang.generator.ReactorInstance.getName ( )

Override the base class to append [i_d], where d is the depth, if this reactor is in a bank of reactors.

Returns
The name of this instance.

◆ getOrCreateBuiltinTrigger()

TriggerInstance< BuiltinTriggerVariable > org.lflang.generator.ReactorInstance.getOrCreateBuiltinTrigger ( BuiltinTriggerRef trigger)
protected

Returns the built-in trigger or create a new one if none exists.

◆ getOutput()

PortInstance org.lflang.generator.ReactorInstance.getOutput ( String name)

Return the specified output by name or null if there is no such output.

Parameters
nameThe output name.

◆ getParameter()

ParameterInstance org.lflang.generator.ReactorInstance.getParameter ( String name)

Return a parameter matching the specified name if the reactor has one and otherwise return null.

Parameters
nameThe parameter name.

◆ getParent()

ReactorInstance org.lflang.generator.NamedInstance< T extends EObject >.getParent ( )
inherited

Return the parent or null if this is a top-level reactor.

◆ getShutdownTrigger()

TriggerInstance< BuiltinTriggerVariable > org.lflang.generator.ReactorInstance.getShutdownTrigger ( )

Return the shutdown trigger or null if not used in any reaction.

◆ getStartupTrigger()

TriggerInstance< BuiltinTriggerVariable > org.lflang.generator.ReactorInstance.getStartupTrigger ( )

Return the startup trigger or null if not used in any reaction.

◆ getTimeValue()

TimeValue org.lflang.generator.ReactorInstance.getTimeValue ( Expression expr)

Assuming that the given expression denotes a valid time, return a time value.

If the value is given as a parameter reference, this will look up the precise time value assigned to this reactor instance.

◆ getTotalWidth() [1/2]

int org.lflang.generator.ReactorInstance.getTotalWidth ( )

If this reactor is a bank or any of its parents is a bank, return the total number of runtime instances, which is the product of the widths of all the parents.

Return -1 if the width cannot be determined.

◆ getTotalWidth() [2/2]

int org.lflang.generator.ReactorInstance.getTotalWidth ( int atDepth)

If this reactor is a bank or any of its parents is a bank, return the total number of runtime instances, which is the product of the widths of all the parents.

Return -1 if the width cannot be determined.

Parameters
atDepthThe depth at which to determine the width. Use 0 to get the total number of instances. Use 1 to get the number of instances within a single top-level bank member (this is useful for federates).

◆ getTriggers()

Set< TriggerInstance<? extends Variable > > org.lflang.generator.ReactorInstance.getTriggers ( )

Return the trigger instances (input ports, timers, and actions that trigger reactions) belonging to this reactor instance.

◆ getTriggersAndReads()

Set< TriggerInstance<? extends Variable > > org.lflang.generator.ReactorInstance.getTriggersAndReads ( )

Return the trigger instances (input ports, timers, and actions that trigger reactions) together the ports that the reaction reads but that don't trigger it.

Returns
The trigger instances belonging to this reactor instance.

◆ getWidth()

int org.lflang.generator.NamedInstance< T extends EObject >.getWidth ( )
inherited

Return the width of this instance, which in this base class is 1.

Subclasses PortInstance and ReactorInstance change this to the multiport and bank widths respectively.

◆ hasCycles()

boolean org.lflang.generator.ReactorInstance.hasCycles ( )

Return true if the top-level parent of this reactor has causality cycles.

◆ hasParent()

boolean org.lflang.generator.NamedInstance< T extends EObject >.hasParent ( ReactorInstance container)
inherited

Return true if this instance has the specified parent (possibly indirectly, anywhere up the hierarchy).

◆ initialIntParameterValue()

Integer org.lflang.generator.ReactorInstance.initialIntParameterValue ( Parameter parameter)

Given a parameter definition for this reactor, return the initial integer value of the parameter.

If the parameter is overridden when instantiating this reactor or any of its containing reactors, use that value. Otherwise, use the default value in the reactor definition. If the parameter cannot be found or its value is not an integer, return null.

Parameters
parameterThe parameter definition (a syntactic object in the AST).
Returns
An integer value or null.

◆ instantiations()

List< Instantiation > org.lflang.generator.ReactorInstance.instantiations ( )

Return a list of Instantiation objects for evaluating parameter values.

The first object in the list is the AST Instantiation that created this reactor instance, the second is the AST instantiation that created the containing reactor instance, and so on until there are no more containing reactor instances. This will return an empty list if this reactor instance is at the top level (is main).

◆ isBank()

boolean org.lflang.generator.ReactorInstance.isBank ( )

Returns true if this is a bank of reactors.

Returns
true if a reactor is a bank, false otherwise

◆ isGeneratedDelay()

boolean org.lflang.generator.ReactorInstance.isGeneratedDelay ( )

Return true if this is a generated delay reactor that originates from an "after" delay on a connection.

Returns
True if this is a generated delay, false otherwise.

◆ isMainOrFederated()

boolean org.lflang.generator.ReactorInstance.isMainOrFederated ( )

Returns whether this is a main or federated reactor.

Returns
true if reactor definition is marked as main or federated, false otherwise.

◆ isParent()

boolean org.lflang.generator.ReactorInstance.isParent ( ReactorInstance r)

Return true if the specified reactor instance is either equal to this reactor instance or a parent of it.

Parameters
rThe reactor instance.

◆ lookupActionInstance()

ActionInstance org.lflang.generator.ReactorInstance.lookupActionInstance ( Action action)

Return the action instance within this reactor instance corresponding to the specified action reference.

Parameters
actionThe action as an AST node.
Returns
The corresponding action instance or null if the action does not belong to this reactor.

◆ lookupModeInstance()

ModeInstance org.lflang.generator.ReactorInstance.lookupModeInstance ( Mode mode)

Returns the mode instance within this reactor instance corresponding to the specified mode reference.

Parameters
modeThe mode as an AST node.
Returns
The corresponding mode instance or null if the mode does not belong to this reactor.

◆ lookupParameterInstance()

ParameterInstance org.lflang.generator.ReactorInstance.lookupParameterInstance ( Parameter parameter)

Given a parameter definition, return the parameter instance corresponding to that definition, or null if there is no such instance.

Parameters
parameterThe parameter definition (a syntactic object in the AST).
Returns
A parameter instance, or null if there is none.

◆ lookupPortInstance() [1/2]

PortInstance org.lflang.generator.ReactorInstance.lookupPortInstance ( Port port)

Given a port definition, return the port instance corresponding to that definition, or null if there is no such instance.

Parameters
portThe port definition (a syntactic object in the AST).
Returns
A port instance, or null if there is none.

◆ lookupPortInstance() [2/2]

PortInstance org.lflang.generator.ReactorInstance.lookupPortInstance ( VarRef reference)

Given a reference to a port belonging to this reactor instance, return the port instance.

Return null if there is no such instance.

Parameters
referenceThe port reference.
Returns
A port instance, or null if there is none.

◆ lookupReactionInstance()

ReactionInstance org.lflang.generator.ReactorInstance.lookupReactionInstance ( Reaction reaction)

Return the reaction instance within this reactor instance corresponding to the specified reaction.

Parameters
reactionThe reaction as an AST node.
Returns
The corresponding reaction instance or null if the reaction does not belong to this reactor.

◆ lookupReactorInstance()

ReactorInstance org.lflang.generator.ReactorInstance.lookupReactorInstance ( Instantiation instantiation)

Return the reactor instance within this reactor that has the specified instantiation.

Note that this may be a bank of reactors. Return null if there is no such reactor instance.

◆ lookupTimerInstance()

TimerInstance org.lflang.generator.ReactorInstance.lookupTimerInstance ( Timer timer)

Return the timer instance within this reactor instance corresponding to the specified timer reference.

Parameters
timerThe timer as an AST node.
Returns
The corresponding timer instance or null if the timer does not belong to this reactor.

◆ lookupWatchdogInstance()

WatchdogInstance org.lflang.generator.ReactorInstance.lookupWatchdogInstance ( Watchdog watchdog)

Return the watchdog instance within this reactor instance corresponding to the specified watchdog reference.

Parameters
watchdogThe watchdog as an AST node.
Returns
The corresponding watchdog instance or null if the watchdog does not belong to this reactor.

◆ parents()

List< ReactorInstance > org.lflang.generator.NamedInstance< T extends EObject >.parents ( )
inherited

Return a list of all the parents starting with the root().

◆ resolveParameters()

Expression org.lflang.generator.ReactorInstance.resolveParameters ( Expression e)

◆ root()

ReactorInstance org.lflang.generator.NamedInstance< T extends EObject >.root ( )
inherited

Return the root reactor, which is the top-level parent.

Returns
The top-level parent.

◆ setWidth()

void org.lflang.generator.NamedInstance< T extends EObject >.setWidth ( int width)
inherited

Set the width.

This method is here for testing only and should not be used for any other purpose.

Parameters
widthThe new width.

◆ toString()

String org.lflang.generator.ReactorInstance.toString ( )

Return a descriptive string.

◆ uniqueID()

String org.lflang.generator.ReactorInstance.uniqueID ( )
See also
NamedInstance.uniqueID()

Append _main to the name of the main reactor to allow instantiations within that reactor to have the same name.

Member Data Documentation

◆ _instantiations

List<Instantiation> org.lflang.generator.ReactorInstance._instantiations
protected

The nested list of instantiations that created this reactor instance.

◆ actions

final List<ActionInstance> org.lflang.generator.ReactorInstance.actions = new ArrayList<>()

The action instances belonging to this reactor instance.

◆ builtinTriggers

Map<BuiltinTrigger, TriggerInstance<BuiltinTriggerVariable> > org.lflang.generator.ReactorInstance.builtinTriggers
protected
Initial value:
=
new HashMap<>()

The map of used built-in triggers.

◆ children

final List<ReactorInstance> org.lflang.generator.ReactorInstance.children = new ArrayList<>()

The contained reactor instances, in order of declaration.

For banks of reactors, this includes both the bank definition Reactor (which has bankIndex == -2) followed by each of the bank members (which have bankIndex >= 0).

◆ containingEnclave

CEnclaveInstance org.lflang.generator.ReactorInstance.containingEnclave

The enclave instance corresponding to the containing reactor that is an enclave.

◆ containingEnclaveReactor

final ReactorInstance org.lflang.generator.ReactorInstance.containingEnclaveReactor

The nearest containing reactor instance that is an enclave.

◆ definition

T org.lflang.generator.NamedInstance< T extends EObject >.definition
packageinherited

The Instantiation AST object from which this was created.

◆ depth

int org.lflang.generator.NamedInstance< T extends EObject >.depth
protectedinherited

The depth in the hierarchy of this instance.

This is 0 for main or federated, 1 for the reactors immediately contained, etc.

◆ identifierLengthLimit

int org.lflang.generator.NamedInstance< T extends EObject >.identifierLengthLimit
staticinherited

A limit on the number of characters returned by uniqueID.

◆ inputs

final List<PortInstance> org.lflang.generator.ReactorInstance.inputs = new ArrayList<>()

The input port instances belonging to this reactor instance.

◆ modes

final List<ModeInstance> org.lflang.generator.ReactorInstance.modes = new ArrayList<>()

The mode instances belonging to this reactor instance.

◆ outputs

final List<PortInstance> org.lflang.generator.ReactorInstance.outputs = new ArrayList<>()

The output port instances belonging to this reactor instance.

◆ parameters

final List<ParameterInstance> org.lflang.generator.ReactorInstance.parameters = new ArrayList<>()

The parameters of this instance.

◆ parent

ReactorInstance org.lflang.generator.NamedInstance< T extends EObject >.parent
packageinherited

The reactor instance that creates this instance.

◆ reactions

final List<ReactionInstance> org.lflang.generator.ReactorInstance.reactions = new ArrayList<>()

List of reaction instances for this reactor instance.

◆ reactorDeclaration

final ReactorDecl org.lflang.generator.ReactorInstance.reactorDeclaration

The reactor declaration in the AST.

This is either an import or Reactor declaration.

◆ reactorDefinition

final Reactor org.lflang.generator.ReactorInstance.reactorDefinition

The reactor after imports are resolve.

◆ recursive

final boolean org.lflang.generator.ReactorInstance.recursive

Indicator that this reactor has itself as a parent, an error condition.

◆ reporter

MessageReporter org.lflang.generator.ReactorInstance.reporter
protected

The generator that created this reactor instance.

◆ states

final List<StateVariableInstance> org.lflang.generator.ReactorInstance.states = new ArrayList<>()

The state variable instances belonging to this reactor instance.

◆ timers

final List<TimerInstance> org.lflang.generator.ReactorInstance.timers = new ArrayList<>()

The timer instances belonging to this reactor instance.

◆ tpoLevel

final Integer org.lflang.generator.ReactorInstance.tpoLevel

The Total Port Order level with which this was annotated, or null if there is no TPO annotation.

TPO is total port order. See https://github.com/icyphy/lf-pubs/blob/54af48a97cc95058dbfb3333b427efb70294f66c/federated/TOMACS/paper.tex#L1353

◆ tpr

TypeParameterizedReactor org.lflang.generator.ReactorInstance.tpr

FIXME: What is this?

◆ uniqueIDCount

HashMap<String, Integer> org.lflang.generator.NamedInstance< T extends EObject >.uniqueIDCount
packageinherited

Map from a name of the form a_b_c to the number of unique IDs with that prefix that have been already assigned.

If none have been assigned, then there is no entry in this map. This map should be non-null only for the main reactor (the top level).

◆ watchdogs

final List<WatchdogInstance> org.lflang.generator.ReactorInstance.watchdogs = new ArrayList<>()

List of watchdog instances for this reactor instance.

◆ width

int org.lflang.generator.NamedInstance< T extends EObject >.width
packageinherited

The width of this instance.

This is 1 for everything except a PortInstance representing a multiport and a ReactorInstance representing a bank.


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/ReactorInstance.java