Skip to content

Add State enum for state machines#923

Merged
bocchino merged 55 commits intomainfrom
issue-615-sm-enum
Mar 4, 2026
Merged

Add State enum for state machines#923
bocchino merged 55 commits intomainfrom
issue-615-sm-enum

Conversation

@bocchino
Copy link
Collaborator

@bocchino bocchino commented Feb 19, 2026

This PR adds the State enum for state machines and revises the C++ code gen to match. This way we can use the state enum in FPP events and telemetry. Closes #615.

This PR also does the following:

  • Replace classes with objects, to remove parentheses from primitive types in the AST. This is a code simplification.
  • Refactor AST state transformer to eliminate duplicated code.
  • Move include resolution out of CheckSemantics and into each tool that calls CheckSemantics. This approach is more uniform, and it makes more sense now another syntax pass precedes analysis (AddStateEnums).
  • Fix an issue where type defs inside state machines inside components were not named properly.
  • Fix an issue in enum code gen where enum constant T could shadow enum T.

Tandem development for this PR is here: https://github.com/bocchino/fprime/tree/fpp-issue-615-sm-enum.

Add dependency from state machine to state machine enum
Regenerate test output
Use State Machine enum to represent state
Add description of State enum
@bocchino bocchino requested review from Kronos3 and jwest115 February 19, 2026 22:51
@bocchino bocchino added the fprime-fpp tandem F Prime and FPP tandem development label Feb 19, 2026
@bocchino bocchino changed the base branch from main to issue-927-implied-string-deps February 25, 2026 16:46
@bocchino
Copy link
Collaborator Author

I had to merge the issue 927 branch into this one. I pointed this PR to that branch to get an accurate diff comparison.

@bocchino bocchino changed the base branch from issue-927-implied-string-deps to main February 26, 2026 22:34
Copy link
Collaborator

@Kronos3 Kronos3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I have one minor comment

@bocchino bocchino merged commit e068ecd into main Mar 4, 2026
37 checks passed
@bocchino bocchino deleted the issue-615-sm-enum branch March 4, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fprime-fpp tandem F Prime and FPP tandem development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-generate an FPP enumeration for the state of an FPP state machine

2 participants