[antlr-interest] Re: ANTLR generated C (not C++), anyone??

Sergey Bogdanov serge.bogdanov at intel.com
Wed Jul 21 12:52:07 PDT 2004


--- In antlr-interest at yahoogroups.com, Ric Klaren <klaren at c...> 
wrote:
> Hi,
> 
> On Wed, Jul 21, 2004 at 07:46:32AM -0700, Bryan Ewbank wrote:
> > I'm evaluating ANTLR as a replacement for lex, yacc, and several
> > thousand lines of source code in a legacy system.  The key 
problem is
> > that ANTLR generates C++ code - not C - and there doesn't seem 
to be
> > a clear way for C to interface neatly with C++.
> 
> It will probably be a horror to try and do that.
> 

ANTLR could pretty much be used the same way as lex/yacc and others 
by utilising callback C functions. At this level 'extern "C"' 
interface would cleanly solve all your problems. There could be a 
pretty small piece of c++ code to satisfy ANTLR initialization and 
you have to acquire a limited knowledge of some ANTLR data types to 
correctly interface your callbacks, mainly the Token class.




 
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