[antlr-interest] Re: 2.7.2 released: get it while it's hot!

Ric Klaren klaren at cs.utwente.nl
Wed Jan 22 09:27:34 PST 2003


Hi,

On Wed, Jan 22, 2003 at 03:35:21PM -0000, xadeck <decoret at graphics.lcs.mit.edu> wrote:
> 1) it would be useful to have an empty virtual function init() called
> at the end of each constructor of each base class (at least lexers and
> parsers) so when you override them (one very nice feature of antlr)
> you can overide this init() and ensure some initializiation (such as
> for examples setting line number to 0,etc..) is performed. Right now
> it seems to me you have to tell programmer using your derived lexer to
> be sure to call init().

In the new version you can at least in C++ mode turn off the antlr
generated constructors. So you can nicely initialize stuff using
initalizers etc. (I did not enable this for java mode since this is less of
an issue with java since it has no concept of initializers (or use for the
concept so you'd want ;) ))

> 2) When generating grammar in C++ with AST disabled (using gcc-3.2)
> there is a (annoying) warning due to the following code in parser.cpp
> void parser::initializeASTFactory(
> ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory )
> {
> }
> could just ensure that no argument name (factory) is given when
> initializeASTFactory is empty. This way anltr code would compiled
> nicelly without any warning.

AFAIK this is a gcc-ism. Not 100% sure if it's portable so I never bothered
about it. (read very low on my priority list)

Thanks for the input,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  Chaos is found in greatest abundance wherever order is being sought.
  --- Terry Pratchet


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list