[antlr-interest] how to check if a optional token exists or not ??

Johannes Luber jaluber at gmx.de
Fri Nov 16 03:17:14 PST 2007


Austin Hastings wrote:
> In java, ANTLR creates a named variable for each label you use. Check
> for meta == null, without using a '$' sign.
> 
> if (meta != null)

I'd like to add that in 3.1 the check for null is done automatically for
you. The original code will work then fine.

Johannes


More information about the antlr-interest mailing list