FSMLang Release Notes

Revision 1.44 14 December 2024

New C language output variant creating an event-oriented array is provided.

Most full tests now create each variant (event-state table, state array, and, event array). In order to create identical output with each, "noAction" debug print statements have been added to the state and event array variants to match the those which were already present in the event-state table variant.

The full tests which test all variants also have a size target producing a file of that name, containing the size of the image created by each variant. New make include files, variants.mk and create_target.mk support the variant related targets.

The FSM function may now be profiled. See --add-profiling-macros and --profile-sub-fsms.

PlantUML generation for the case that there is a single loopback for a state is correctly formatted.

The HTML class for the first state no longer indicates that the state has no entry point.

A new language output, reStructuredText, is now provided via the -tr option.

It is now possible to indicate that a transition function will return "noTransition".

Data blocks now support more than one level of indirection.

The native impl block is now included in the source before the generated macros, thus preceding any generated code.

Revision 1.43.1 17 July 2024

Correct exit code (0) now returned on successful operation when input files are not in the execution directory.

Event cross reference only output now correctly includes ...noEvent entries for sub-machines.

Revision 1.43 23 May 2024

C language event enumeration cross reference is now publishable to an external file, in any of three formats: json, csv, tab-delimited, and, XML. See the new command line options, --event-cross-ref-only and --event-cross-ref-format.

Revision 1.42 15 February 2024

Multiple levels of sub-machines are now supported.

Header files created has changed due to support of multiple sub-machine levels

New CL option family, "-M, -Mh, -Md" added for exploitation of gnu make

Revision 1.41 19 November 2023

New keywords, prologue and epilogue are provided. These keywords modify native and implementation. epilogue causes the block to be placed at the end of its respective file. prologue is optional; blocks so modified are still placed at the beginning of the respective files.

Revision 1.40 6 September 2023

A run function is provided in addition to the RUN macro.

Arbitrary plantuml code can be added, either as individual strings or files that will be copied, immediately after the opening @plantuml and before any FSMLang generated code.

In switch machines, states which have no transitions will not contain code to invoke any "on transition" functions.

A "cross-reference" giving the value and names of the event enumeration as a comment before the enumeration declaration may be requested.

State functions now return correct types when events have data.

Titles and legends may now be requested in plantuml output.

Revision 1.39 8 August 2023

Top-level events may now have associated data.

Revision 1.38 10 May 2023

Bug which swapped named entry and exit functions fixed.

Revision 1.37 11 April 2023

--add-machine-name can be used to have the machine name included when --short-debug-names is used. The output is still reduced, since the machine name is included only once per line.

Two macros are introduced: ACTION_RETURN_TYPE, which is defined as the return type for action functions; and, FSM_TYPE which is defined as the type of the machine. These macros can be used to facilitate movement of action functions between sub-machines.

Doc comments are now picked up when used with parent::

A new keyword, "all" is added, which must appear in parentheses, to designate a state or event vector subsuming all events or states.

States may now have entry and exit functions: on (entry|exit) [function_name] where [function_name] is optional.

Revision 1.36 8 March 2023

braces can now appear inside of native and data blocks

<matrix> transition <state> is now legal as a transition only statement.

transition statements appearing immediately after a sub-machine no longer cause an error.

new command line option --force-generation-of-event-passing-actions forces the generation of event passing actions when weak function generation is inhibited.

Revision 1.35 28 February 2023

added new option --short-debug-names to generate machine debug info without name prefix.

Contributed by maintainer Daniel Jasinsky

Revision 1.34  

1.34 was not released.

Revision 1.33 19 February 2023

Fixed bug in PlantUML generation which resulted in malformed transitions when shared events are involved.

Added "numAllEvents" macro to the top level event enumeration.

Revision 1.32 10 February 2023

The macro EVENT_IS_NOT_EXCLUDED_FROM_LOG(e) can be used to exclude events from the main loop debug log.

Revision 1.31 8 February 2023 DECLARE_%s_MACHINE macro now correctly formed.
Revision 1.30 5 February 2023 DECLARE_%s_MACHINE macro now correctly formed.
Revision 1.29 3 February 2023

Declare data translation functions in switch machines.

Allow states to declare that sub-machines are to be inhibited therein.

Put the current event into the FSM struct; this should not be used to make decisions (that's what the machine itself is for!), but for refined error reporting (or the like) in actions.

Revision 1.28 2 February 2023 EOLs which crept back into DBG_PRINTFs removed.
Revision 1.27 8 January 2023

Sub-machines can designate events as being shared from the parent machine. Moreover, these events can designate data translation functions. Code is generated to call the sub-machine whenever the parent experiences the event. Any data translation function is called before the sub-machine is called.

A native impl(ementation)? block can be defined in the machine qualifier section, analogous to the native block preceding the machine, the native implementation block is copied into the source file, rather than the header.

Revision 1.26 19 December 2022 RUN_STATE_MACHINE and DECLARE_xxx_MACHINE comply with MISRA C:2012:20.7
Revision 1.25 11 December 2022

The event-state table now scrolls when needed.

--css-content-internal=true with -th option copies css content into the html file. The default is to reference the styleshet externally.

--css-content-filename=<filename> with -th option uses the indicated file for css content.

Revision 1.24 8 December 2022

-tp option produces PlantUML output.

--include-svg-img=true with -th option adds html image tag before event-state table. The src attribute of the tag is set to [filename].svg. The alt attribute is used to point out that the image must be generated separately.

Revision 1.23 25 November 2022

enum typedefs C++ compliant.

Sub-machine typedefs and declarations precede data block declaration.

Revision 1.22 23 November 2022

FSM_REVISION macro set the numeric fsm revision string now available.

Revision 1.21 14 November 2022

Sub-machines no longer have their own event enumerations; rather, all machines use one enumeration created at the top level. This resolves warnings generated by armcc. Convenience macros are provided for referencing the right enumeration.

Sub-machines no longer generate unnecessary state transition function declarations.

Revision 1.20 20 October 2022 --core-logging-only=true suppresses the generation of debug logging outside of the core fsm function.
Revision 1.19 7 September 2022 --generate-weak-fns=false suppresses the generation of weak function stubs.
Revision 1.18 31 August 2022 findAndRunSubMachine not declared when no sub-machines are present.
Revision 1.17 29 August 2022 Data initialization is mediated through a macro.
Revision 1.16 28 August 2022 C Switch Machines now generate any sub-machines.
Revision 1.15 24 August 2022 Compact table generation correctly references states and state transition functions.
Revision 1.14 16 August 2023 returns statements with multiple entries can now end with a namespace event reference.
Revision 1.13 16 August 2023 RUN_STATE_MACHINE and DECLARE_%s_MACHINE now enclose parameters in parentheses.
Revision 1.12 15 August 2023 "Action returns" statements can now reference sub-machine events and "parent" events.
Revision 1.11 12 August 2022 Remove line-endings from generated DBG_PRINTF statements.
Revision 1.10 7 August 2022 Create weakly linked stubs for all user functions. Cygwin seems to have trouble with this. It works for Mingwsa. Have not tested Linux.
Revision 1.9 6 August 2022 Removed the concept of an "active" sub state machine; all sub-machines can run based on the event given to the top level machine.
Revision 1.8 23 July 2022 introduces Hierarchical state machines.
Revision 1.7 13 July 2021
  • introduces the concept of transition functions to machines having actions which return states.
  • extends the -c option to machines having actions which return void. This required no code changes.
  • introduces a new machine qualifier: 'on transition ID;' where ID names a function which will be called
  • whenever the state changes. The function takes a pointer to the machine, and the value of the new state.
Revision 1.6 28 January 2020 adds a new command line option, -c, which will create a more compact event/state table. The option is currently only meaningful when -tc is used with machines having actions which return events.

Compaction is achieved by creating a table of pointers to the action functions along with an enum to index it. This enum and the state enum are used to create the event/state table basic type; and, the enums are declared with the packed attribute. Thus, for machines having less than 256 actions and states, the size of the basic event/state table type struct is only 2 bytes.

When transition functions are used, a similar table/enum pair is constructed.

Revision 1.5   adds a new output type modifier, 's'. Specifying -ts will create a machine in which each state is handled by a function, which switches on the event to execute the appropriate action function and select the next state. This type of machine uses no memory, as there is no event/state table; the machine is purely code.

Also, the "actions return states" machine is fixed.

Revision 1.4   adds two new functions:
  • transitions may now be done through functions, rather than designated states. As with actions, these are not previously declared; they are simply stated. The function arguments are first a pointer to the machine, followed by the event causing the transition.
  • both actions and transitions may be given return declarations. These are in the form of "name returns ...;" where "name" is a previously seen action or transition function name. Presently, this information is used only to enhance the HTML page.
Revision 1.3   quiets a warning about the shadowing of a global variable by a local variable; the warning was correct, but the shadowing was not consequential. In the spirit of "no warnings are the only good warnings"....
Revision 1.2   adds a new option: "-i0" will inhibit the creation of an instance of the machine. Any other argument to -i, or not having -i0 will cause the creation of an instance, which is the historical behavior.
Revision 1.1   separates the action/transition array from the machine structure. Two benefits proceed from this: first, the array can be made constant; and second, the machine structure can now be instantiated multiple times. A macro is provided by which machines may be easily declared.