I should clarify: it parses a variant of EBNF. The specific syntax is explained at https://benknoble.github.io/loner/ and https://benknoble.github.io/loner/demo.html#syntax
On Saturday, July 17, 2021 at 8:50:48 PM UTC-4 D. Ben Knoble wrote: > I haven't touched Clojure in a year or two, and I'm not familiar with > instaparse. > > I can say, from a terminology stand-point, that a grammar (such as one in > EBNF) can produce a parser, which then produces parse-trees of input > strings. So, perhaps you mean that you want parse-trees of strings in the > grammar of EBNF? It took me a few reads to come to this conclusion—the > expression "get a parse tree of the EBNF" threw me off. > > It seems likely that instaparse is producing a parser, and may throw away > the underlying graph (parse-tree) of the grammar. > > Regardless, I have a Scala tool that parses EBNF. I'm not sure about > interop, but it's all JVM, right? https://github.com/benknoble/loner > > On Saturday, July 17, 2021 at 3:21:36 PM UTC-4 [email protected] wrote: > >> >> Hi all, >> >> I was hoping that I can call >> >> (instaparse.core/parser "my ::= 'ebnf' | 'grammar' ") >> >> to get a parse tree of the EBNF. I'd like to convert the EBNF to a >> tree-sitter grammar.js. >> >> But when I evaluate the above expression, I only see a the original EBNF >> input, reformatted, and without comments: >> >> => my = "ebnf" | "grammar" >> >> Is there a way to get hands on the underlying structure, i.e. the parse >> tree? >> >> Best, Jakob >> > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/0cf7ef4c-6d49-46ed-9c4e-26258fe2dbb5n%40googlegroups.com.
