On Wed, Mar 31, 2010 at 11:47 AM, Anton Bychkov <bychkov.an...@gmail.com>wrote:

> ...
> There is also a strange thing in rule view, it looks like antlr does
> not see LParen and RParen in twiddle operator.
> I attached screenshot with it.
>

Ah, I see. There are no other tokens than '(' and ')' defined, so
~(LParen|RParen) is wrong. Try adding a "fall through" DOT in your lexer
grammar:

skipper
       @init {
               int braceCount = 1;
       }
       : (
       LParen
       {
               braceCount ++;
       }
       | RParen
       {
               braceCount --;
               if(braceCount == 0)
               {
                       LTOKEN = EOF_TOKEN;
               }
       }
       | Other
       ) *
       ;

LParen : '(' ;
RParen : ')' ;
Other  :  .  ;

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to