[antlr-interest] A problem with EOF.

Akhilesh Mritunjai virtualaspirin at yahoo.com
Sat Nov 27 13:26:11 PST 2004



Off the head:

You'd need to tell ANTLR that a null is expected.

define a lexer rule:

NULL_CHAR: '\u0000';

then define your parser rule like:

text:
  subrules ... ... ... NULL_CHAR! EOF! ;

This ought to solve the problem.

- Akhilesh

--- prashantdeva <prashantdeva at yahoo.com> wrote:
> But now when the end of the string is reached, Antlr
> wants a EOF
> instead of a null, so it throws an exception saying
> 'unexpected token
> found : null'.



	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list