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

Generate code for state variables. More...

Static Public Member Functions

static String generateDeclarations (TypeParameterizedReactor reactor, CTypes types, boolean suppressLineDirectives)
 Generate code for state variables of a reactor in the form "stateVar.type stateVar.name;".
static String generateInitializer (ReactorInstance instance, String selfRef, StateVar stateVar, ModeInstance mode, CTypes types)
 If the state is initialized with a parameter, then do not use a temporary variable.

Detailed Description

Generate code for state variables.

Member Function Documentation

◆ generateDeclarations()

String org.lflang.generator.c.CStateGenerator.generateDeclarations ( TypeParameterizedReactor reactor,
CTypes types,
boolean suppressLineDirectives )
static

Generate code for state variables of a reactor in the form "stateVar.type stateVar.name;".

Parameters
reactorTypeParameterizedReactor
typesA helper object for types
suppressLineDirectivesWhether to suppress the generation of line directives.

◆ generateInitializer()

String org.lflang.generator.c.CStateGenerator.generateInitializer ( ReactorInstance instance,
String selfRef,
StateVar stateVar,
ModeInstance mode,
CTypes types )
static

If the state is initialized with a parameter, then do not use a temporary variable.

Otherwise, do, because static initializers for arrays and structs have to be handled this way, and there is no way to tell whether the type of the array is a struct.

Parameters
instanceReactorInstance
selfRefReference to the self struct.
stateVarThe state variable (StateVar)
modeModeInstance
typesThe C-specific type conversion functions.
Returns
String

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