[antlr-interest] Re: unexpected token ... and a new question

offline314159 offline at shaw.ca
Tue Feb 10 17:35:44 PST 2004


Thanks for the fix, that sets it up just fine.

As it happens, it seems that there are spaces where a whitespace is
semantically different from one with a linefeed in it, so i'm kind of
stuck with it.

However, since i'm getting answers anyway, perhaps i can get a tip on
this one as well:

I want rules to match a few different types of words - there's a few
literals, some words that begin "X-" and then there's a few places
where any non-control ascii character is allowed, provided semicolons
are escaped.

These are three separate types of token, but you can imagine there are
a few ambiguities - how do i go about handling that?

--- In antlr-interest at yahoogroups.com, "lgcraymer" <lgc at m...> wrote:
> I'm not sure that it's the only problem, but the ANTLR grammar does
not recognize '+' or '*' as suffixes--you need the parentheses.  
> Replace WS* with (WS)* and CRLF with (CRLF)+.
> 
> Also, for most grammars it is better to ignore the formatting
information--WS and CRLF (set token type to "SKIP"), for example.  
> There are exceptions, but they are better identified as such.




 
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