https://github.com/capacitorset/fsm-maker
Creates FSMs from a YAML description.
https://github.com/capacitorset/fsm-maker
Last synced: 6 months ago
JSON representation
Creates FSMs from a YAML description.
- Host: GitHub
- URL: https://github.com/capacitorset/fsm-maker
- Owner: CapacitorSet
- License: mit
- Created: 2016-01-12T12:52:56.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-30T09:29:33.000Z (almost 10 years ago)
- Last Synced: 2025-09-26T11:43:48.185Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 533 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fsm-maker
===
Un transpiler YAML → JSON → C per macchine a stati finiti.
# Esempi di utilizzo
`fsm.yaml` contiene la descrizione YAML di un semplice ascensore a tre piani. Il comando
node make
crea una rappresentazione intermedia in JSON, e il comando
node target/C/compile
compila la rappresentazione intermedia in codice C, adatto per esempio al caricamento su un microcontrollore. Il file di output si trova in `target/C/fsm.c`
# Overview
`fsm-maker` legge una stringa YAML, trasforma i parametri da stringhe a formati personalizzati, e scrive questa rappresentazione intermedia in `fsm.json`.
Poi, il compilatore di target legge questa rappresentazione, sostituisce i relativi placeholder in `template.c` (ad esempio: `/*NUM_TRANSIZIONI*/` viene sostituito con il numero effettivo di transizioni), e scrive il risultato in `fsm.c`.
Il funzionamento viene descritto dettagliatamente in Relazione.md.