[antlr-interest] ANTLR 3.0b5 problem with predicates
Shmuel Siegel
ssiegel at finjan.com
Fri Nov 24 05:23:01 PST 2006
Right, the sources where I found those lines are antlr 2 grammars. My
question is how do I do the same thing in antlr3 for situations where
greedy=false doesn't suffice. Antlr3 generates unusable code for the
same constructs.
-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Micheal J
Sent: Friday, November 24, 2006 2:45 PM
To: 'ANTLR Interest'
Subject: Re: [antlr-interest] ANTLR 3.0b5 problem with predicates
Hi,
> "greedy=false" works great if I want to include the
> terminating characters in the token. But if I merely want to
> stop the catchall prior to some tokens, I really need a predicate.
> As I stated in my previous post, the cpp_parser grammar uses
> { input.LA(2)!='/' }? '*'
> The java1.5 sample uses the same method to terminate the
> multi-line comment.
>
> I still think that this is a bug.
You're talking about V2 grammars right?
Micheal
-----------------------
The best way to contact me is via the list/forum. My time is very
limited.
More information about the antlr-interest
mailing list