frame-lang / frame_transpiler

Frame is a markdown language for creating state machines (automata) in Python as well as generating UML documentation.
MIT License
65 stars 9 forks source link

Grammar for Frame syntax (especially expression syntax) #18

Open walkie opened 3 years ago

walkie commented 3 years ago

It would be very helpful to have a grammar for Frame's syntax.

Currently, Frame's grammar is documented only informally on the Frame Notation page. However, some aspects of the grammar are very under-specified there.

The biggest gap is Frame's expression syntax. A grammar for that piece of the language would be especially helpful.

Fortunately, Frame expressions seem to follow standard conventions, so guessing at the syntax has mostly worked out. However, the lack of a grammar significantly impacts debugging since it's impossible to determine whether errors are bugs in the Frame spec, a conceptual misunderstanding of how Frame works, or bugs in the Frame implementation. It also makes filing issues and working on Frame itself more difficult.

frame-lang commented 3 years ago

I did some looking for BNF standards and found this: https://bnfc.readthedocs.io/en/latest/index.html.

Thoughts? Anything else you've used and liked?

frame-lang commented 3 years ago

I think I'll just conform to EBNF: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form. I'll create a google doc and share it to get started.

walkie commented 3 years ago

Sounds good! Any variety of EBNF should work fine as long as it's internally consistent. 👍