Statemachine¶
Source: examples/statemachine
statemachine is a compact modeling example where semantic rules matter more
than expression parsing. It is especially useful when you want to study
whole-model validation and editor support together.
What it shows¶
- a state-oriented modeling language
- semantic validation rules
- formatting and LSP integration
- a VS Code client for interactive testing
Useful entry points¶
- CLI:
./build/examples/statemachine/pegium-example-statemachine-cli - LSP:
./build/examples/statemachine/pegium-example-statemachine-lsp
What to read first¶
Start with:
examples/statemachine/src/StatemachineModule.cppfor the service setupexamples/statemachine/src/validation/StatemachineValidator.cppfor typed validation checksexamples/statemachine/src/lsp/StatemachineFormatter.cppfor the formatter
Why start here¶
Use this example when your language centers on connected model elements and validation rules rather than expression evaluation.
Use this example when¶
- semantic validation is central to the language
- the domain is graph- or state-based
- you want a compact modeling example with editor support