Does anybody know if there’s a parser generator li...
# thinking-together
n
Does anybody know if there’s a parser generator like tree-sitter, i.e. produces a CST instead of an AST, but that can be used as a compiler frontend? Tree-sitter kinda can be, but it’s not the easiest
g
Maybe Ohm-Editor (Ohm-JS)?
👍 1
n
Ooh interesting…I do like PEGs. Need to see how it handles CSTs
g
I have been using Ohm-JS for a year or two. I would be happy to discuss in more depth. I love PEGs and Ohm-JS in particular.
The Discord server for Ohm-JS is called ‘Ohm Land’
🤣 2
d
You may try Langium framework if you need it in the JS world.
...Sorry, hit the enter button too fast. I've some more to say. :-) For the Java environment Xtext is a good choice (historically the predecessor of Langium; both are sharing the same idea/approach). The main advantage for your requirement is, I guess, that by defining the concrete syntax grammar implicitly a tree data algebra is defined what the parser is using to create the tree representation of a sentence of your language. You may see this as a Concrete Syntax Tree and process it that way. (Or did I interpret your "CST" wrongly?)
n
Interesting. Yeah I like the idea of something that is explicitly integrated with language servers and therefore IDEs. I’m writing a blog post about these precise tools, what I call “tooling for tooling”, that I’ll probably post here soon