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
guitarvydas
10/24/2022, 3:11 AM
Maybe Ohm-Editor (Ohm-JS)?
n
Nicholas Yang
10/24/2022, 3:21 AM
Ooh interesting…I do like PEGs. Need to see how it handles CSTs
g
guitarvydas
10/24/2022, 3:44 AM
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’
...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
Nicholas Yang
11/26/2022, 6:59 PM
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