Replies: 1 comment 1 reply
-
Aha! There's two of us! I also struggled to find this documented anywhere, even in off-site tutorials! After a lot of searching, I started experimenting, and your command should look something like:
To build a split grammar with ANTLR, you pass both the lexer and parser grammar files as arguments to When providing split grammar files, ANTLR seems to pass the filenames through to the parser/lexer output files, so it won't tack on |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I have a probably very simple question, but for some reason I just can't find a solution to it. I am trying to parse a C++ code for my project (I'm building a transpiler). The grammar for C++ is separated, namely it doesn't have a single .g4 file but it has two of them, CPP14Lexer.g4 and CPP14Parser.g4. How can I generate parser this way? When I used a singe .g4 file, I did it with this command in my command prompt:
antlr4 -Dlanguage=Python3 -visitor GrammarName.g4
Thank you very much for your help!
Beta Was this translation helpful? Give feedback.
All reactions