[antlr-interest] Porting from antlr 2.7.1 to 2.7.4

Sergey Bogdanov serge.bogdanov at intel.com
Wed Jul 7 07:09:02 PDT 2004


Hi,
    I am trying to port a parser (cpp) which actually works ok with
2.7.1 to 2.7.4. There is one issue and some suggestions.

First, the issue, which is a completely new way to handle
heterogenuous asts. 2.7.1 used c++ constructors to build and allocate
new ast objects  which worked perfectly well. Now it looks like antler
creates a registration table. As a result, every ast needs to be
supplied with a 'factory' and 'initialization'. There are about 100
different asts in the application and making those changes is
difficult. So, there are two questions:
    1. is there a backwards compatibility mode?
    2. what was the reason for changing the way to handle heterogenous
asts? Current mechanism looks like an overcomplicated one.

Now, some suggestions.
    1. One difference I've fond was that 2.7.1 declared temporary asts
and tokens no matter what. Therefore the following worked ok:
    rule: LSQR ... RSQR! {#RSQR->...};
Now, there is no declaration for RSQR temp if the bang is used and c++
compilation fails. It is easy to work around by supplying an element
id 'rsqr1:RSQR!' but this would be a good help if antlr at least
warned that an undeclared element had been used in the action.

    2. It would be nice to automatically generate ANTLR_VERSION macro
definition in the C++ code.

    3. for the future antlr develpments bacward compatibility should
be taken in account.

Thank you.







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list