[antlr-interest] ANTLR 3.1 gives RewriteEmptyStreamException, ANTLR3.0.1 does not ?

Terence Parr parrt at cs.usfca.edu
Mon Sep 29 10:07:39 PDT 2008


On Sep 29, 2008, at 12:25 AM, David Pearce wrote:
> Now, if I use some boiler plate code to create a lexer/parser (see end
> of email), and then fire the following input into it "(())", I get the
> following error:
>
>> org.antlr.runtime.tree.RewriteEmptyStreamException: rule listBody
>
> The reason is that the empty production has no rewrite.  However, in
> ANTLR 3.0.1, this error did not happen.
>
> So, my question is: is this is a bug, or intentional behaviour?  I

hi!

It is proper behavior; if there is no listBody then list must indicate  
there is an error.

Ter


More information about the antlr-interest mailing list