2009/3/23 Jim Idle <[email protected]>
> Lukasz Guminski wrote:
>
> I have just noticed the problem with alphanum.
>
> ...
>
>
> fragment CR :'\r';
> fragment LF : '\n';
> INSIGNIFICANT_CHAR:.;
>
> You still need:
>
>
> INSIGNIFICANT_CHAR:. { skip(); };
>
> I think.
>
You're right. Thank you.
BTW is it possible to solve the problem via a mixture of syntactic and
semantic predicates in the way I initially tried?
block_open
: ((BLOCK_BOUNDARY
block_name)=>{stack.size()==0||!stack.peek().equals($block_name.text)}?) =>
BLOCK_BOUNDARY block_name BLOCK_BOUNDARY
{stack.push($block_name.text);System.out.println("start of block " +
$block_name.text);};
If so, how to do it? I have a feeling that it would be a more general
solution than delegating the task to the lexer as we did.
Lucas
>
>
> Jim
>
>
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address