[antlr-interest] disable warnings in v3?
fhaupt at informatik.uni-wuerzburg.de
fhaupt at informatik.uni-wuerzburg.de
Tue Jan 9 00:04:04 PST 2007
hi,
thanks for the reply,
however:
the error remains.
My rule looks like this now:
verbatim
returns [Element verbatime=null]
@init {
verbatime=new Element("programlisting");
}
: '<verbatim>' (options {greedy=false;} : a=.
{
verbatime.addContent(a.getText());
}
)* '</verbatim>'
;
if I use the pure thing like:
verbatim: '<verbatim>' (options{greedy=false;}:.*) '</verbatim>';
it works fine :/
thanks:)
greets fabian
> Indeed there is:
>
> Assuming you are using v3, change that rule to
>
> verbatim: '<verbatim>' (options{greedy=false;}:.*) '</verbatim>'
>
> ANTLR matches greedily by default, so the ambiguities reported are between the .* loop
> and the characters of the '</verbatim>' string.
>
> That should do the trick, the same thing is normally done for comments :)
>
> HTH,
> - -k
> - --
> Kay Röpke
> http://classdump.org/
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (Darwin)
>
> iD8DBQFFoxPwfhv+DUzSptARAnZ5AJwJR5fTinxAoh2kn2mIIvepPSXHRgCfdfvT
> J6oAI+2snIbQM+KI62N6/3c=
> =IRXX
> -----END PGP SIGNATURE-----
>
-------------- 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/20070109/bcd8bb14/attachment.bin
More information about the antlr-interest
mailing list