[antlr-interest] ANTLR C/C++ parser with C++ output

David Wigg wiggjd at lsbu.ac.uk
Mon Aug 23 08:47:31 PDT 2004


FYI I have now published an updated version (3.0 July 2004) of
our ANTLR parser for C/C++ with C++ output and it is now
available from the http://www.antlr.org website.

Improvements can be sumarised as,

1.  Clearer, more accurate and up to date grammar. Where
corrections were needed I tried to make the grammar match more
nearly the published C++ grammar. I have also tried to reduce
the number and extent of built in C++ action statements
especially those requiring the use of supporting C++ software.

2.  I have introduced the idea of subclassing the users
application code (which would normally be embedded in the
grammar file). This separation of application code from the
grammar code makes the system easier to understand. A fully
coded example is included which can easily be adapted for the
users own use.

      I would recommend users of previous versions of our
CPP_parser to consider adopting subclassing of their application
code in order simplify taking this latest version of the
CPP_parser. The example supplied (MyCode.cpp) shows how this can 
be done.

3.  I have introduced some additional action statements under
the users control which I have found particularly useful for
testing and for checking that changes have not produced any
serious side effect(s) in previously tested files.

4.  I also describe how the library file can easily be amended
in LLkParser.hpp and LLkParser.cpp to provide a flexible control
of antlr tracing. I realise there will be other ways of doing
this, but this is half implemented and is easy to complete.

5.  I have also included some test data so a user can verify
that their system has been set up correctly.

Please note that this latest version continues to require
parsing of pre-processed, *.i files. However, one user is
working on a version which we hope will enable us to parse
source code, *.cpp files directly. Some encouraging progress has
been made and if you are interested in this possibility, please
let me know.

Further more detailed information is available in MyReadMe.txt
in the antlr.org/grammar/cpp file.

If you do download a copy I would be interested to hear how you
get on with it.

David Wigg
Research Fellow
Centre for Systems and Software Engineering
London South Bank University
UK.




 
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