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
However, IntegerLiteral that is declared in the tokens section appears wrongly in JavaParser class instead of JavaLexer class.
Currently, both ANTLR 4.1 Java and C# targets generate such classes.
More specifically, the tokens{} block does work in a combined grammar, but it only adds the specified tokens to the generated parser. This prevents the lexer from using the tokens in a ->type() command.
Apparently making this work is non-trivial. If you need access to items from the tokens{} block within your lexer rules (e.g. for a ->type command), you'll need to use separate lexer and parser grammars for now.
I modified your Java.g4 to the following file to make it suitable for the 4.1-opt release of ANTLR.
https://github.com/exKAZUu/Code2Xml/blob/92f3abaf173ebe31b5755c1d3cba7b3906e2d0ec/Code2Xml.Languages.ANTLRv4/Processors/Java/Java.g4
However,
IntegerLiteral
that is declared in the tokens section appears wrongly inJavaParser
class instead ofJavaLexer
class.Currently, both ANTLR 4.1 Java and C# targets generate such classes.
Note that the following issue shows the background to find this bug.
https://github.com/sharwell/antlr4cs/issues/28
The text was updated successfully, but these errors were encountered: