I am currently getting ...
error(56): AqlCommentTest.g4:12:4: reference to undefined rule: htmlCommentDeclaration error(56): AqlCommentTest.g4:13:4: reference to undefined rule: mdCommentDeclaration
Import for lexer grammar seems to be loading. The following files are a problem.
AqlCommentTest.g4
grammar AqlCommentTest; import AqlLexerRules; import AqlComment; program: commentDeclaration+; commentDeclaration: htmlCommentDeclaration
AqlComment.g4
grammar AqlComment; import AqlLexerRules; htmlCommentDeclaration: 'html' '{' '(*' STRING '*)' '}'; mdCommentDeclaration: 'md' '{' '(*' STRING '*)' '}';
AqlLexerRules.g4
lexer grammar AqlLexerRules; STRING : '"' [az]? '"' ;
Errors can be stopped by removing 'import AqlLexerRules;' from the AqlCommentTest.g4 file.
Why does this βfixβ the problem?
How to check if antlr4 import statement is really applied?
source share