[antlr-interest] Puzzled by leading dot

Bryan Ewbank ewbank at gmail.com
Tue Mar 15 11:29:01 PST 2005


I think what you need is to add EOF and/or newline processing.  For
EOF processing, change this:
     line : item (SEMI item)*
to this:
     line : item (SEMI item)* EOF

For newline/whitespace processing, you need to mark tokens as being
skipped.  I don't use ANTLR for lexing, but look for "SKIP" in the
manual and/or the examples.  This will allow ANTLR to ignore the
whitespace between your tokens.

On Tue, 15 Mar 2005 09:19:51 -0800 (PST), Juergen Weber
<weberjn at yahoo.com> wrote:
> Thanks Alexey,
> 
> I changed to
> 
> ...extends Lexer;
> 
> DOTSE:
> 
>    ".SE"
>         ;
> 
> But still
> 
> Exception in thread "main" line 1:4: unexpected char:
> ' '
> 
> Do I have to quote the dot? How?
> 
> Thanks,
> Juergen
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!
> http://smallbusiness.yahoo.com/resources/
>


More information about the antlr-interest mailing list