Sharing a project built on Lark in case it's a useful real-world Earley example. #1606
stzifkas
started this conversation in
Show and tell
Replies: 1 comment 2 replies
|
Thanks!
You mean, because of performance issues? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
pluto-ecss transpiles PLUTO - a spacecraft operations DSL standardised by ESA (ECSS-E-ST-70-32C) - into readable Python.
The grammar's defining challenge is unquoted multi-word identifiers ("Reaction Wheel3 of AOC of Satellite") coexisting with English-word keywords, which I handle with a low-priority catch-all WORD terminal (priority -10) so keyword literals always win, plus rule-level assembly of identifiers.
Along the way I hit — and worked around — an Earley lexer-priority edge case that might be interesting to you. Grammar is 168 lines and self-contained:
https://github.com/stzifkas/pluto-ecss/blob/main/src/pluto_ecss/grammar.lark
Thanks for Lark! the Earley/dynamic-lexer combo is what made this DSL tractable at all. Happy to be listed as an example project if that's useful to others.
All reactions