Generated golang parser has syntax error

34 views
Skip to first unread message

Jason Gu

unread,
Apr 28, 2020, 10:48:35 PM4/28/20
to antlr-discussion

I tried to use antlr-4.8-complete.jar to generate java9 lexer and parser in golang.
I used the Java.g4 downloaded from https://github.com/antlr/grammars-v4/blob/master/java/java9/Java9.g4 and ran the command:

antlr4 -Dlanguage=Go Java9.g4

I got 4 go files including java9_lexer.go

But I found there exists syntax errors in java9_lexer.go:
image

And I can't compile this file:
image

Anyone here can help?

Reply all
Reply to author
Forward
0 new messages