[antlr-interest] disable warnings in v3?
fhaupt at informatik.uni-wuerzburg.de
fhaupt at informatik.uni-wuerzburg.de
Wed Jan 10 08:53:02 PST 2007
Hi,
actually using this version:
verbatim
: '<verbatim>' (options {greedy=false;k=1;} : a=. {verbatime.addContent(a.getText());}
)* '</verbatim>'
;
works so far, and only gives one warning ... but it discards the right match possibility, so its ok.
thanks
fabian
On Wed, Jan 10, 2007 at 10:50:15PM +1300, Gavin Lambert wrote:
> At 21:04 9/01/2007, fhaupt at informatik.uni-wuerzburg.de wrote:
> >: '<verbatim>' (options {greedy=false;} : a=.
> >{
> > verbatime.addContent(a.getText());
> >}
> >)* '</verbatim>'
> >;
>
> IIRC, the greedy option needs to be in the same scope as both the . and the *. Try writing it like
> this:
>
> : '<verbatim>' (options {greedy=false;} :
> (a=. { verbatime.addContent(a.getText()); }
> )*) '</verbatim>'
> ;
>
> (Haven't tested this, but it seems plausible.)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20070110/37efa954/attachment.bin
More information about the antlr-interest
mailing list