intellij-plugin-v4 icon indicating copy to clipboard operation
intellij-plugin-v4 copied to clipboard

Extraneous input '<EOF>'

Open marcospassos opened this issue 7 years ago • 2 comments

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:

image

In contrast to:

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

image

marcospassos avatar Jan 05 '18 23:01 marcospassos

@parrt I suspect it's a limitation/bug in org.antlr.v4.runtime.ParserInterpreter, wdyt?

bjansen avatar Dec 31 '18 20:12 bjansen

@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.

parrt avatar Jan 01 '19 18:01 parrt