[antlr-interest] Unexpected behavior - Error?
Christoph Schinko
c.schinko at cgv.tugraz.at
Tue Mar 9 07:41:35 PST 2010
Hi Bart!
Thanks for the quick answer! Adding an EOF to the rule solves the issue
in the toy example. Unfortunately we are using custom token label types
and are now getting a ClassCastException. It seems that we now have the
problem mentioned here:
http://www.antlr.org/pipermail/antlr-interest/2009-November/036712.html
Any thoughts on that?
On 09.03.2010 15:04, Bart Kiers wrote:
> Hi Chris,
>
> Since the input '<<<<<<< .mine' does not contain any illegal tokens,
> the parser just stops parsing since (statement)* will also match
> nothing. You'll want to "tell" your parser to continue parsing all the
> way to the end of your token stream. Do that by adding an EOF to the
> end of your entry-point: presumably the source parser rule:
>
> source
> : (statement)* EOF
> ;
>
> Regards,
>
> Bart.
>
--
Dipl.-Ing. Christoph Schinko c.schinko at cgv.tugraz.at
Institute of Computer Graphics and Knowledge Visualization
Graz University of Technology tel: +43 (316) 873-5416
Inffeldgasse 16c, 8010 Graz, Austria
More information about the antlr-interest
mailing list