intellij-plugin-v4
intellij-plugin-v4 copied to clipboard
Extraneous input '<EOF>'
We have an use case where we need to match a ';' or the end of the file. The following simplified grammar works great, matching either foo, foo; or foo or foo; or foo;:
grammar Example;
root: conjunction EOF ;
conjunction: conjunction 'or' conjunction | atom ;
atom: 'foo' ( ';' | EOF ) ;
WS: [ \n\t\r]+ -> channel(HIDDEN);
However, the plugin reports the following error which does not exist in fact:

In contrast to:
> java org.antlr.v4.gui.TestRig Example root -tree
> foo
(root (conjunction (atom foo <EOF>)) <EOF>)

@parrt I suspect it's a limitation/bug in org.antlr.v4.runtime.ParserInterpreter, wdyt?
@bjansen yeah, must be. Though, i did create that for use with the plugin i think ;) hmm...i don't have the energy to track that down.