0
votes

Essentially I would like to combine these g4 files:

https://github.com/apache/groovy/tree/master/src/antlr

into a single file which I can use with this clojure library:

https://github.com/aphyr/clj-antlr

which currently requires a combined parser/lexer file. How does one hack the files so they exist as correct grammar in a single file? I've rule out concatenating the files and removing the lexer and parase gammar prefixes as described here: https://github.com/antlr/antlr4/blob/master/doc/grammars.md

1

1 Answers

1
votes

You cannot combine these grammars, because the lexer grammar uses an own super class and lexer modes. Both are not possible with a combined grammar.