You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at class org.antlr.v4.gui.TestRig method process() starting at line 123 I noticed that Lexer classname has to be the same as parser classname.
line 125: String lexerName = grammarName+"Lexer";
How is it possible to use multiple different parsers to use the same lexer?
The text was updated successfully, but these errors were encountered:
When I generate a lexer from a lexer grammar then org.antlr.v4.Tool generates a lexer with classname grammarName.
When I generate a parser from a parser grammar then org.antlr.v4.Tool generates a parser with classname grammarName.
When I generate a parser from a generic grammar (both lexer and parser) then org.antlr.v4.Tool generates a lexer with classname grammarName+"Lexer" and parser with grammarName+"Lexer".
So there is a tight coupling with the lexer classname and parser classname.
This is problematic when trying to generate one lexer for multiple grammars.
I also feel that this coupling is weakly documented.
Looking at class org.antlr.v4.gui.TestRig method process() starting at line 123 I noticed that Lexer classname has to be the same as parser classname.
line 125:
String lexerName = grammarName+"Lexer";
How is it possible to use multiple different parsers to use the same lexer?
The text was updated successfully, but these errors were encountered: