[antlr-interest] what does noConstructors do?

Stefan Rank e9725431 at student.tuwien.ac.at
Sun Jun 5 23:06:26 PDT 2005


on 05.06.2005 23:00 Bryan Ewbank said the following:
> "noConstructor=true" in the options section of the parser (not the
> options section of the file) suppresses generation of the default
> constructor for the parser, at least in C++.  It works for me, and
> allows me to pass the required factory object to the (hand-written)
> constructor.
> 
> Try diffing the generated files with and without - it's a small
> difference, (A #ifdef/#endif pair in C++).
> 

Yes thanks, I just verified that. Cpp generation disables the 
constructors via the preprocessor.

and I forgot to include my details in my question :) :
I would like to do that for Java (and later on for Python).
I am using ANTLR 2.7.5 (on winxp at the moment).

There seems to be no effect of "noConstructors" for Java.
Is this unimplemented?

If so, will it be possible in the all new and powerful ANTLR 3 ?
(then I would happily shut up now ;-)

stefan


> On 6/5/05, Stefan Rank <e9725431 at student.tuwien.ac.at> wrote:
> 
>>Hi you, helpful list,
>>
>>I just wanted to use the option
>>noConstructors = true;
>>for my parser to tailor, e.g., visibility of the parser.
> 
> 
>>best,
>>stefan
>>


More information about the antlr-interest mailing list