[antlr-interest] Get code in constructor (Java target)

Gustaf Johansson gustaf.j at gmail.com
Fri Jul 10 01:37:18 PDT 2009


Hello,

I have a global hashmap that i want to initialize in the constructor.
Currently i use a null check upon usage and initalize if null, but
this seems like a performance waste when the constructor could be
used.

I tried the @init and have checked the book but im unable to find any
reference to how to do this.
Is it currently possible to place arbitrary code in the constructors?

Best Regards Gustaf


More information about the antlr-interest mailing list