Given the following ANTLR 4.1 grammar, with one line intentionally commented out ...
grammar Foobar;
//whyDoesThisRuleHelp : expression ;
expression : operand | binaryOperation ;
binaryOperation : operand WS BINARY_OPERATOR WS expression ;
operand : LETTER ;
BINARY_OPERATOR : 'EQ' ;
LETTER : [a-z] ;
WS : [ \n]+ ;
.. why does echo -n "a EQ b" | grun Foobar expression
produce
line 1:6 mismatched input '<EOF>' expecting WS
.. but if we uncomment the block : expression ;
line above then grun
produces no errors?