Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full TLA+ parsing #1

Open
erichocean opened this issue Nov 21, 2021 · 2 comments
Open

full TLA+ parsing #1

erichocean opened this issue Nov 21, 2021 · 2 comments

Comments

@erichocean
Copy link

Just an FYI (from your talk here: https://www.youtube.com/watch?v=trm9Lp0yt6Y), you can parse TLA+ with either Apalache (it outputs JSON which you can then walk in whatever language you want), or there's a Python project here (based on an Ocaml project): https://github.com/tlaplus/tla_python

Either way, you don't have to build the TLA+ parsing from scratch.

@ahelwer
Copy link

ahelwer commented Feb 9, 2022

Another alternative is the tree-sitter grammar: https://github.com/tlaplus-community/tree-sitter-tlaplus

It isn't really made to be the backbone of an interpreter/compiler/transpiler, but it is complete and has minimal runtime requirements. See the dev examples here: https://github.com/tlaplus-community/tlaplus-tool-dev-examples/tree/main/tree-sitter

Will Schultz has used it to make a web interpreter for TLA+: https://github.com/will62794/tla-web

@bugarela
Copy link
Owner

bugarela commented Feb 9, 2022

Thanks for the tips! I've actually been postponing taking care of this (terrible) parser of mine for a while now, but this week I've started a converter from Apalache's internal representation (from the produced JSON) to mine. I believe it's the best alternative right now since it's the most used tool from all these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants