[antlr-interest] Re: ANTLR generated C (not C++), anyone??
serge.bogdanov at intel.com
Wed Jul 21 12:52:07 PDT 2004
--- In antlr-interest at yahoogroups.com, Ric Klaren <klaren at c...>
> 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
> > that ANTLR generates C++ code - not C - and there doesn't seem
> > 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:
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
More information about the antlr-interest