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

Generate code for the bodies of reactions that handle connections with logical delays specified with the after keyword. More...

Inherits org.lflang.generator.c.CDelayBodyGenerator.

Public Member Functions

void finalizeReactions (Reaction delayReaction, Reaction forwardReaction)
 Used to optionally apply additional transformations to the generated reactions.
boolean generateAfterDelaysWithVariableWidth ()
 Indicates whether delay banks generated from after delays should have a variable length width.
String generateDelayBody (Action action, VarRef port)
 Generate code for the body of a reaction that takes an input and schedules an action with the value of that input.
String generateDelayGeneric ()
 Generate code for the generic type to be used in the class definition of a generated delay reactor.
String generateForwardBody (Action action, VarRef port)
 Generate code for the body of a reaction that is triggered by the given action and writes its value to the given port.
 PythonDelayBodyGenerator (PythonTypes types)

Public Attributes

String GEN_DELAY_CLASS_NAME = "_lf_GenDelay"
 Constant that specifies how to name generated delay reactors.

Protected Attributes

CTypes types

Detailed Description

Generate code for the bodies of reactions that handle connections with logical delays specified with the after keyword.

Constructor & Destructor Documentation

◆ PythonDelayBodyGenerator()

org.lflang.generator.python.PythonDelayBodyGenerator.PythonDelayBodyGenerator ( PythonTypes types)

Member Function Documentation

◆ finalizeReactions()

void org.lflang.generator.python.PythonDelayBodyGenerator.finalizeReactions ( Reaction delayReaction,
Reaction forwardReaction )

Used to optionally apply additional transformations to the generated reactions.

Implements org.lflang.generator.DelayBodyGenerator.

◆ generateAfterDelaysWithVariableWidth()

boolean org.lflang.generator.c.CDelayBodyGenerator.generateAfterDelaysWithVariableWidth ( )
inherited

Indicates whether delay banks generated from after delays should have a variable length width.

If this is true, any delay reactors that are inserted for after delays on multiport connections will have an unspecified variable length width. The code generator is then responsible for inferring the correct width of the delay bank, which is only possible if the precise connection width is known at compile time.

If this is false, the width specification of the generated bank will list all the ports listed on the right side of the connection. This gives the code generator the information needed to infer the correct width at runtime.

Implements org.lflang.generator.DelayBodyGenerator.

◆ generateDelayBody()

String org.lflang.generator.python.PythonDelayBodyGenerator.generateDelayBody ( Action action,
VarRef port )

Generate code for the body of a reaction that takes an input and schedules an action with the value of that input.

Parameters
actionThe action to schedule
portThe port to read from

Reimplemented from org.lflang.generator.c.CDelayBodyGenerator.

◆ generateDelayGeneric()

String org.lflang.generator.c.CDelayBodyGenerator.generateDelayGeneric ( )
inherited

Generate code for the generic type to be used in the class definition of a generated delay reactor.

Implements org.lflang.generator.DelayBodyGenerator.

◆ generateForwardBody()

String org.lflang.generator.python.PythonDelayBodyGenerator.generateForwardBody ( Action action,
VarRef port )

Generate code for the body of a reaction that is triggered by the given action and writes its value to the given port.

This realizes the receiving end of a logical delay specified with the 'after' keyword.

Parameters
actionThe action that triggers the reaction
portThe port to write to.

Reimplemented from org.lflang.generator.c.CDelayBodyGenerator.

Member Data Documentation

◆ GEN_DELAY_CLASS_NAME

String org.lflang.generator.DelayBodyGenerator.GEN_DELAY_CLASS_NAME = "_lf_GenDelay"
inherited

Constant that specifies how to name generated delay reactors.

◆ types

CTypes org.lflang.generator.c.CDelayBodyGenerator.types
protectedinherited

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/python/PythonDelayBodyGenerator.java