pyfcstm.dsl.node
State Machine DSL Abstract Syntax Tree (AST) Nodes.
This module defines the Abstract Syntax Tree (AST) building blocks used by the
State Machine Domain Specific Language (DSL). The classes provide a structured
representation of DSL constructs such as states, transitions, expressions,
and executable actions. Instances of these classes are typically produced by
a parser and can be serialized back to DSL syntax via str().
The main public components include:
ASTNode- Root base class for all AST nodes.StateDefinition- State declarations with nested structure.TransitionDefinitionandForceTransitionDefinition- State transitions.Import-related nodes such as
ImportStatement,ImportDefMapping, andImportEventMapping.StateMachineDSLProgram- Root program container.Statement and action blocks such as
OperationAssignment,EnterStatement,ExitStatement, andDuringStatement.
Note
The AST classes are data-only and focus on structure. There is no evaluation or execution logic in this module.
Example:
>>> from pyfcstm.dsl.node import (
... StateDefinition, TransitionDefinition, ChainID,
... StateMachineDSLProgram, DefAssignment, Integer
... )
>>> def_var = DefAssignment("counter", "int", Integer("0"))
>>> trans = TransitionDefinition("idle", "active", ChainID(["idle", "start"]), None, [])
>>> root = StateDefinition("idle", transitions=[trans])
>>> program = StateMachineDSLProgram([def_var], root)
>>> print(program)
def int counter = 0;
state idle {
idle -> active :: start;
}
__all__
- pyfcstm.dsl.node.__all__ = ['ASTNode', 'Identifier', 'ChainID', 'Expr', 'Literal', 'Boolean', 'Integer', 'HexInt', 'Float', 'Constant', 'Name', 'Paren', 'UnaryOp', 'BinaryOp', 'ConditionalOp', 'UFunc', 'Statement', 'ConstantDefinition', 'InitialAssignment', 'DefAssignment', 'ImportMappingStatement', 'ImportDefSelector', 'ImportDefExactSelector', 'ImportDefSetSelector', 'ImportDefPatternSelector', 'ImportDefFallbackSelector', 'ImportDefTargetTemplate', 'ImportDefMapping', 'ImportEventMapping', 'ImportStatement', 'OperationalDeprecatedAssignment', 'Preamble', 'Operation', 'Condition', 'TransitionDefinition', 'ForceTransitionDefinition', 'StateDefinition', 'OperationalStatement', 'OperationAssignment', 'OperationIfBranch', 'OperationIf', 'EventDefinition', 'StateMachineDSLProgram', 'INIT_STATE', 'EXIT_STATE', 'ALL', 'EnterStatement', 'EnterOperations', 'EnterAbstractFunction', 'EnterRefFunction', 'ExitStatement', 'ExitOperations', 'ExitAbstractFunction', 'ExitRefFunction', 'DuringStatement', 'DuringOperations', 'DuringAbstractFunction', 'DuringRefFunction', 'DuringAspectStatement', 'DuringAspectOperations', 'DuringAspectAbstractFunction', 'DuringAspectRefFunction']
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
INIT_STATE
- pyfcstm.dsl.node.INIT_STATE = INIT_STATE
Special singleton marker representing the initial state in a state machine.
This is used to define transitions from the initial pseudo-state.
EXIT_STATE
- pyfcstm.dsl.node.EXIT_STATE = EXIT_STATE
Special singleton marker representing the exit state in a state machine.
This is used to define transitions to the final pseudo-state.
ALL
- pyfcstm.dsl.node.ALL = ALL
Special singleton marker representing all states in a state machine.
This is used to define transitions or actions that apply to all states.
ASTNode
Identifier
ChainID
- class pyfcstm.dsl.node.ChainID(path: List[str], is_absolute: bool = False)[source]
Represents a chained identifier (e.g.,
a.b.c) in the state machine DSL.- Parameters:
path (List[str]) – List of string components that make up the chained identifier
is_absolute (bool) – Whether the identifier is absolute (starts with
/)
- Return type:
Example:
>>> chain_id = ChainID(['state1', 'event']) >>> str(chain_id) 'state1.event' >>> abs_id = ChainID(['root', 'event'], is_absolute=True) >>> str(abs_id) '/root.event'
Expr
Literal
- class pyfcstm.dsl.node.Literal(raw: str)[source]
Base class for literal values in expressions.
Literal values are constants directly expressed in the code, such as numbers, booleans, or predefined constants.
- Parameters:
raw (str) – The raw string representation of the literal
- Return type:
- __str__() str[source]
Convert the literal to its string representation.
- Returns:
String representation of the literal’s value
- Return type:
str
- property value: Any
Get the actual value of the literal.
- Returns:
The evaluated value of the literal
- Return type:
Any
Integer
HexInt
Float
Boolean
Constant
Name
- class pyfcstm.dsl.node.Name(name: str)[source]
Represents a named reference in the state machine DSL.
Names are used to reference variables, states, or other named elements.
- Parameters:
name (str) – The identifier name
- Return type:
Example:
>>> var_name = Name("counter") >>> str(var_name) 'counter'
Paren
- class pyfcstm.dsl.node.Paren(expr: Expr)[source]
Represents a parenthesized expression in the state machine DSL.
Parentheses are used to control the order of operations in expressions.
Example:
>>> inner_expr = BinaryOp(Name("a"), "+", Name("b")) >>> paren_expr = Paren(inner_expr) >>> str(paren_expr) '(a + b)'
UnaryOp
- class pyfcstm.dsl.node.UnaryOp(op: str, expr: Expr)[source]
Represents a unary operation in the state machine DSL.
Unary operations apply a single operator to an expression.
- Parameters:
op (str) – The unary operator (e.g.,
"!","not","-")expr (Expr) – The expression to which the operator is applied
- Return type:
Example:
>>> not_expr = UnaryOp("not", Name("condition")) >>> str(not_expr) '!condition'
BinaryOp
- class pyfcstm.dsl.node.BinaryOp(expr1: Expr, op: str, expr2: Expr)[source]
Represents a binary operation in the state machine DSL.
Binary operations apply an operator to two expressions.
- Parameters:
- Return type:
Example:
>>> add_expr = BinaryOp(Name("a"), "+", Name("b")) >>> str(add_expr) 'a + b' >>> and_expr = BinaryOp(Name("x"), "and", Name("y")) >>> str(and_expr) 'x && y'
ConditionalOp
- class pyfcstm.dsl.node.ConditionalOp(cond: Expr, value_true: Expr, value_false: Expr)[source]
Represents a conditional (ternary) operation in the state machine DSL.
The conditional operation evaluates a condition and returns one of two expressions based on whether the condition is true or false.
- Parameters:
- Return type:
Example:
>>> cond_op = ConditionalOp(Name("x"), Integer("1"), Integer("0")) >>> str(cond_op) '(x) ? 1 : 0'
UFunc
- class pyfcstm.dsl.node.UFunc(func: str, expr: Expr)[source]
Represents a unary function call in the state machine DSL.
Unary functions apply a named function to a single expression.
- Parameters:
func (str) – The function name
expr (Expr) – The expression to which the function is applied
- Return type:
Example:
>>> func_call = UFunc("abs", Name("x")) >>> str(func_call) 'abs(x)'
Statement
OperationalStatement
ConstantDefinition
- class pyfcstm.dsl.node.ConstantDefinition(name: str, expr: Expr)[source]
Represents a constant definition statement in the state machine DSL.
- Parameters:
name (str) – The name of the constant
expr (Expr) – The expression defining the constant’s value
- Return type:
Example:
>>> const_def = ConstantDefinition("MAX_COUNT", Integer("100")) >>> str(const_def) 'MAX_COUNT = 100;'
InitialAssignment
- class pyfcstm.dsl.node.InitialAssignment(name: str, expr: Expr)[source]
Represents an initial assignment statement in the state machine DSL.
Initial assignments are used to set initial values for variables.
- Parameters:
name (str) – The name of the variable
expr (Expr) – The expression defining the variable’s initial value
- Return type:
Example:
>>> init_assign = InitialAssignment("counter", Integer("0")) >>> str(init_assign) 'counter := 0;'
DefAssignment
- class pyfcstm.dsl.node.DefAssignment(name: str, type: str, expr: Expr, _span: Span | None = None)[source]
Represents a definition assignment statement in the state machine DSL.
Definition assignments are used to declare and initialize typed variables.
- Parameters:
name (str) – The name of the variable
type (str) – The type of the variable
expr (Expr) – The expression defining the variable’s value
- Return type:
Example:
>>> def_assign = DefAssignment("counter", "int", Integer("0")) >>> str(def_assign) 'def int counter = 0;'
OperationalDeprecatedAssignment
- class pyfcstm.dsl.node.OperationalDeprecatedAssignment(name: str, expr: Expr)[source]
Represents a deprecated form of operational assignment in the state machine DSL.
- Parameters:
name (str) – The name of the variable
expr (Expr) – The expression defining the variable’s value
- Return type:
Example:
>>> op_assign = OperationalDeprecatedAssignment( ... "counter", BinaryOp(Name("counter"), "+", Integer("1")) ... ) >>> str(op_assign) 'counter := counter + 1;'
Condition
- class pyfcstm.dsl.node.Condition(expr: Expr)[source]
Represents a condition in the state machine DSL.
Conditions are used in transitions and other contexts to determine when actions should occur.
Example:
>>> cond = Condition(BinaryOp(Name("counter"), ">=", Integer("10"))) >>> str(cond) 'counter >= 10'
Preamble
- class pyfcstm.dsl.node.Preamble(stats: List[ConstantDefinition | InitialAssignment])[source]
Represents a preamble section in the state machine DSL.
The preamble contains constant definitions and initial assignments that set up the state machine’s environment.
- Parameters:
stats (List[Union[ConstantDefinition, InitialAssignment]]) – List of statements in the preamble
- Return type:
Example:
>>> const_def = ConstantDefinition("MAX", Integer("100")) >>> init_assign = InitialAssignment("counter", Integer("0")) >>> preamble = Preamble([const_def, init_assign]) >>> print(str(preamble)) MAX = 100; counter := 0;
Operation
- class pyfcstm.dsl.node.Operation(stats: List[OperationalDeprecatedAssignment])[source]
Represents an operation block in the state machine DSL.
Operations are sequences of assignments that modify the state machine’s variables.
- Parameters:
stats (List[OperationalDeprecatedAssignment]) – List of operational assignments
- Return type:
Example:
>>> op1 = OperationalDeprecatedAssignment( ... "counter", BinaryOp(Name("counter"), "+", Integer("1")) ... ) >>> op2 = OperationalDeprecatedAssignment("flag", Boolean("true")) >>> operation = Operation([op1, op2]) >>> print(str(operation)) counter := counter + 1; flag := true;
ImportMappingStatement
ImportDefSelector
ImportDefExactSelector
ImportDefSetSelector
ImportDefPatternSelector
- class pyfcstm.dsl.node.ImportDefPatternSelector(pattern: str)[source]
Represents a wildcard-based source selector in an import
defmapping.The selector is intentionally preserved as raw DSL text rather than being decomposed into finer-grained AST nodes. This keeps the DSL layer permissive enough for patterns whose literal segments would not fit the plain
IDtoken constraints, such as suffixes that start with digits.- Parameters:
pattern (str) – Raw selector pattern text
- Return type:
ImportDefFallbackSelector
ImportDefTargetTemplate
- class pyfcstm.dsl.node.ImportDefTargetTemplate(template: str)[source]
Represents the right-hand target template of an import
defmapping.The template is stored as raw DSL text at the AST layer. Placeholder and wildcard semantics are validated and interpreted in later assembly phases.
- Parameters:
template (str) – Raw template text
- Return type:
ImportDefMapping
- class pyfcstm.dsl.node.ImportDefMapping(selector: ImportDefSelector, target_template: ImportDefTargetTemplate)[source]
Represents a variable mapping rule inside an import block.
- Parameters:
selector (ImportDefSelector) – Source selector of the mapping rule
target_template (ImportDefTargetTemplate) – Target template of the mapping rule
- Return type:
ImportEventMapping
ImportStatement
- class pyfcstm.dsl.node.ImportStatement(source_path: str, alias: str, extra_name: str | None = None, mappings: List[ImportMappingStatement] | None = None)[source]
Represents a single import statement inside a composite state.
- Parameters:
source_path (str) – Import source path string from the DSL
alias (str) – Local alias name of the imported root state
extra_name (Optional[str]) – Optional display-name override for the imported state
mappings (List[ImportMappingStatement]) – Mapping rules declared inside the import block
- Return type:
TransitionDefinition
- class pyfcstm.dsl.node.TransitionDefinition(from_state: str | _StateSingletonMark, to_state: str | _StateSingletonMark, event_id: ChainID | None, condition_expr: Expr | None, post_operations: List[OperationalStatement], _span: Span | None = None)[source]
Represents a transition definition in the state machine DSL.
Transitions define how the state machine moves from one state to another in response to events and conditions.
- Parameters:
from_state (Union[str, _StateSingletonMark]) – The source state name or
INIT_STATEsingletonto_state (Union[str, _StateSingletonMark]) – The target state name or
EXIT_STATEsingletonevent_id (Optional[ChainID]) – Optional event identifier that triggers the transition
condition_expr (Optional[Expr]) – Optional condition expression that must be true for the transition
post_operations (List[OperationalStatement]) – List of operation statements to perform after the transition
- Return type:
Example:
>>> init_trans = TransitionDefinition(INIT_STATE, "idle", None, None, []) >>> event_trans = TransitionDefinition( ... "idle", "active", ChainID(["idle", "start"]), None, [] ... ) >>> op = OperationAssignment("counter", Integer("0")) >>> cond_trans = TransitionDefinition( ... "active", "idle", None, ... BinaryOp(Name("counter"), ">", Integer("10")), ... [op], ... )
ForceTransitionDefinition
- class pyfcstm.dsl.node.ForceTransitionDefinition(from_state: str | _StateSingletonMark, to_state: str | _StateSingletonMark, event_id: ChainID | None, condition_expr: Expr | None, _span: Span | None = None)[source]
Represents a forced transition definition in the state machine DSL.
Forced transitions override normal transitions and are used for special cases like error handling or interrupts.
- Parameters:
from_state (Union[str, _StateSingletonMark]) – The source state name or
ALLsingletonto_state (Union[str, _StateSingletonMark]) – The target state name or
EXIT_STATEsingletonevent_id (Optional[ChainID]) – Optional event identifier that triggers the transition
condition_expr (Optional[Expr]) – Optional condition expression that must be true for the transition
- Return type:
Example:
>>> force_trans = ForceTransitionDefinition(ALL, "error", None, None) >>> str(force_trans) '! * -> error;'
StateDefinition
- class pyfcstm.dsl.node.StateDefinition(name: str, extra_name: str | None = None, events: List[EventDefinition] | None = None, imports: List[ImportStatement] | None = None, substates: List[StateDefinition] | None = None, transitions: List[TransitionDefinition] | None = None, enters: List[EnterStatement] | None = None, durings: List[DuringStatement] | None = None, exits: List[ExitStatement] | None = None, during_aspects: List[DuringAspectStatement] | None = None, force_transitions: List[ForceTransitionDefinition] | None = None, is_pseudo: bool = False, _span: Span | None = None)[source]
Represents a state definition in the state machine DSL.
States are the fundamental building blocks of state machines, containing transitions, substates, and actions to be performed on entry, during, and exit.
- Parameters:
name (str) – The name of the state
extra_name (Optional[str]) – Optional additional name for the state
events (List[EventDefinition]) – List of events defined within this state
imports (List[ImportStatement]) – List of import statements declared within this state
substates (List[StateDefinition]) – List of nested state definitions
transitions (List[TransitionDefinition]) – List of transitions from this state
enters (List[EnterStatement]) – List of actions to perform when entering the state
durings (List[DuringStatement]) – List of actions to perform while in the state
exits (List[ExitStatement]) – List of actions to perform when exiting the state
during_aspects (List[DuringAspectStatement]) – List of aspect-specific actions to perform while in the state
force_transitions (List[ForceTransitionDefinition]) – List of forced transitions from this state
is_pseudo (bool) – Whether this is a pseudo state
- Return type:
Example:
>>> simple_state = StateDefinition("idle") >>> str(simple_state) 'state idle;' >>> trans = TransitionDefinition( ... "idle", "active", ChainID(["idle", "start"]), None, [] ... ) >>> state_with_trans = StateDefinition("idle", transitions=[trans])
OperationAssignment
- class pyfcstm.dsl.node.OperationAssignment(name: str, expr: Expr)[source]
Represents an operation assignment in the state machine DSL.
Operation assignments are used to modify variables during transitions or state actions.
- Parameters:
name (str) – The name of the variable
expr (Expr) – The expression defining the new value
- Return type:
Example:
>>> op_assign = OperationAssignment( ... "counter", BinaryOp(Name("counter"), "+", Integer("1")) ... ) >>> str(op_assign) 'counter = counter + 1;'
OperationIfBranch
- class pyfcstm.dsl.node.OperationIfBranch(condition: Expr | None, statements: List[OperationalStatement])[source]
Represents a single branch inside an operation-block
ifstatement.- Parameters:
condition (Optional[Expr]) – Branch condition, or
Nonefor the finalelsebranch.statements (List[OperationalStatement]) – Statements executed when the branch is selected.
- Return type:
OperationIf
- class pyfcstm.dsl.node.OperationIf(branches: List[OperationIfBranch])[source]
Represents an
if / else if / elsestatement inside an operation block.- Parameters:
branches (List[OperationIfBranch]) – Ordered branch list. The last branch may have
condition=Noneto representelse.- Return type:
EventDefinition
- class pyfcstm.dsl.node.EventDefinition(name: str, extra_name: str | None = None)[source]
Represents an event definition in the state machine DSL.
Events are signals that can trigger transitions or other actions within the state machine.
- Parameters:
name (str) – The name of the event
extra_name (Optional[str]) – Optional additional name for the event
- Return type:
Example:
>>> event = EventDefinition("start") >>> str(event) 'event start;' >>> named_event = EventDefinition("start", "Start Event") >>> str(named_event) 'event start named "Start Event";'
StateMachineDSLProgram
- class pyfcstm.dsl.node.StateMachineDSLProgram(definitions: List[DefAssignment], root_state: StateDefinition)[source]
Represents a complete state machine DSL program.
A program consists of variable definitions and a root state that contains the entire state machine hierarchy.
- Parameters:
definitions (List[DefAssignment]) – List of variable definitions
root_state (StateDefinition) – The root state of the state machine
- Return type:
Example:
>>> def_var = DefAssignment("counter", "int", Integer("0")) >>> root = StateDefinition("root") >>> program = StateMachineDSLProgram([def_var], root) >>> print(str(program)) def int counter = 0; state root;
EnterStatement
EnterOperations
- class pyfcstm.dsl.node.EnterOperations(operations: List[OperationalStatement], name: str | None = None)[source]
Represents a block of operations to perform when entering a state.
- Parameters:
operations (List[OperationalStatement]) – List of operation statements
name (Optional[str]) – Optional name for the operation block
- Return type:
Example:
>>> op = OperationAssignment("counter", Integer("0")) >>> enter_ops = EnterOperations([op]) >>> print(str(enter_ops)) enter { counter = 0; }
EnterAbstractFunction
- class pyfcstm.dsl.node.EnterAbstractFunction(name: str | None, doc: str | None)[source]
Represents an abstract function to call when entering a state.
Abstract functions are placeholders for implementation-specific behavior.
- Parameters:
name (Optional[str]) – Optional name of the function
doc (Optional[str]) – Optional documentation for the function
- Return type:
Example:
>>> enter_func = EnterAbstractFunction("initState", "Initialize the state") >>> print(str(enter_func)) enter abstract initState /* Initialize the state */
EnterRefFunction
- class pyfcstm.dsl.node.EnterRefFunction(name: str | None, ref: ChainID)[source]
Represents a reference function to call when entering a state.
Reference functions point to existing functions defined elsewhere.
- Parameters:
name (Optional[str]) – Optional name of the function
ref (ChainID) – Chain identifier referencing the function
- Return type:
Example:
>>> ref_func = EnterRefFunction("init", ChainID(["common", "initialize"])) >>> str(ref_func) 'enter init ref common.initialize;'
ExitStatement
ExitOperations
- class pyfcstm.dsl.node.ExitOperations(operations: List[OperationalStatement], name: str | None = None)[source]
Represents a block of operations to perform when exiting a state.
- Parameters:
operations (List[OperationalStatement]) – List of operation statements
name (Optional[str]) – Optional name for the operation block
- Return type:
Example:
>>> op = OperationAssignment("active", Boolean("false")) >>> exit_ops = ExitOperations([op]) >>> print(str(exit_ops)) exit { active = false; }
ExitAbstractFunction
- class pyfcstm.dsl.node.ExitAbstractFunction(name: str | None, doc: str | None)[source]
Represents an abstract function to call when exiting a state.
Abstract functions are placeholders for implementation-specific behavior.
- Parameters:
name (Optional[str]) – Optional name of the function
doc (Optional[str]) – Optional documentation for the function
- Return type:
Example:
>>> exit_func = ExitAbstractFunction("cleanupState", "Clean up resources") >>> print(str(exit_func)) exit abstract cleanupState /* Clean up resources */
ExitRefFunction
- class pyfcstm.dsl.node.ExitRefFunction(name: str | None, ref: ChainID)[source]
Represents a reference function to call when exiting a state.
Reference functions point to existing functions defined elsewhere.
- Parameters:
name (Optional[str]) – Optional name of the function
ref (ChainID) – Chain identifier referencing the function
- Return type:
Example:
>>> ref_func = ExitRefFunction("cleanup", ChainID(["common", "cleanup"])) >>> str(ref_func) 'exit cleanup ref common.cleanup;'
DuringStatement
DuringOperations
- class pyfcstm.dsl.node.DuringOperations(aspect: str | None, operations: List[OperationalStatement], name: str | None = None)[source]
Represents a block of operations to perform while in a state.
- Parameters:
aspect (Optional[str]) – Optional aspect name (e.g.,
"entry","do","exit")operations (List[OperationalStatement]) – List of operation statements
name (Optional[str]) – Optional name for the operation block
- Return type:
Example:
>>> op = OperationAssignment("counter", BinaryOp(Name("counter"), "+", Integer("1"))) >>> during_ops = DuringOperations("do", [op]) >>> print(str(during_ops)) during do { counter = counter + 1; }
DuringAbstractFunction
- class pyfcstm.dsl.node.DuringAbstractFunction(name: str | None, aspect: str | None, doc: str | None)[source]
Represents an abstract function to call while in a state.
Abstract functions are placeholders for implementation-specific behavior.
- Parameters:
name (Optional[str]) – Optional name of the function
aspect (Optional[str]) – Optional aspect name (e.g.,
"entry","do","exit")doc (Optional[str]) – Optional documentation for the function
- Return type:
Example:
>>> during_func = DuringAbstractFunction("processData", "do", "Process incoming data") >>> print(str(during_func)) during do abstract processData /* Process incoming data */
DuringRefFunction
- class pyfcstm.dsl.node.DuringRefFunction(name: str | None, aspect: str | None, ref: ChainID)[source]
Represents a reference function to call while in a state.
Reference functions point to existing functions defined elsewhere.
- Parameters:
name (Optional[str]) – Optional name of the function
aspect (Optional[str]) – Optional aspect name (e.g.,
"entry","do","exit")ref (ChainID) – Chain identifier referencing the function
- Return type:
Example:
>>> ref_func = DuringRefFunction("process", "do", ChainID(["common", "process"])) >>> str(ref_func) 'during do process ref common.process;'
DuringAspectStatement
DuringAspectOperations
- class pyfcstm.dsl.node.DuringAspectOperations(aspect: str, operations: List[OperationalStatement], name: str | None = None)[source]
Represents a block of aspect-specific operations to perform while in a state.
- Parameters:
aspect (str) – The aspect name (e.g.,
"before","after")operations (List[OperationalStatement]) – List of operation statements
name (Optional[str]) – Optional name for the operation block
- Return type:
Example:
>>> op = OperationAssignment("counter", BinaryOp(Name("counter"), "+", Integer("1"))) >>> during_ops = DuringAspectOperations("before", [op]) >>> print(str(during_ops)) >> during before { counter = counter + 1; }
DuringAspectAbstractFunction
- class pyfcstm.dsl.node.DuringAspectAbstractFunction(name: str | None, aspect: str, doc: str | None)[source]
Represents an abstract function to call for a specific aspect while in a state.
Abstract functions are placeholders for implementation-specific behavior.
- Parameters:
name (Optional[str]) – Optional name of the function
aspect (str) – The aspect name (e.g.,
"before","after")doc (Optional[str]) – Optional documentation for the function
- Return type:
Example:
>>> during_func = DuringAspectAbstractFunction( ... "processData", "before", "Process incoming data" ... ) >>> print(str(during_func)) >> during before abstract processData /* Process incoming data */
DuringAspectRefFunction
- class pyfcstm.dsl.node.DuringAspectRefFunction(name: str | None, aspect: str, ref: ChainID)[source]
Represents a reference function to call for a specific aspect while in a state.
Reference functions point to existing functions defined elsewhere.
- Parameters:
name (Optional[str]) – Optional name of the function
aspect (str) – The aspect name (e.g.,
"before","after")ref (ChainID) – Chain identifier referencing the function
- Return type:
Example:
>>> ref_func = DuringAspectRefFunction( ... "process", "before", ChainID(["common", "process"]) ... ) >>> str(ref_func) '>> during before process ref common.process;'