[antlr-interest] (no subject)

Terence Parr parrt at cs.usfca.edu
Fri Apr 20 10:54:19 PDT 2007


On Apr 20, 2007, at 7:06 AM, craig at palantir.co.za wrote:

> Hi,
>
> Why does the grammar below mismatch on the space in the following  
> test input.

Looks ok to me. What exactly was the exception you got and which  
character position?

Ter
>
> grammar csv;
> options {
>    language=java;
> }
>
> r  : ID (COMMA ID)+ EOF;
> ID : 'a'..'z' + ;
> COMMA              :               ',';
> WS  :  (' '|'\r'|'\t'|'\u000C'|'\n')+ {$channel=HIDDEN;}
>     ;
>
> When I run with
> test, testing, testagain
>
> It is not ignoring the whitespace? Should $channel=HIDDEN not do  
> the trick here?
>
> Regards
> Craig
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>



More information about the antlr-interest mailing list