[antlr-interest] More, Status of C++ backend?

Jim Idle jimi at temporal-wave.com
Tue Jan 1 18:20:38 PST 2008


> -----Original Message-----
> From: Ruslan Zasukhin [mailto:sunshine at public.kherson.ua]
...
> > Porting a C++ 2.7 grammar to 3.x C probably involves more work on 
the
> > grammar and tree stuff than it does on the C++ to C work. In general 
I
> > advise people to limit the action code to API calls, which means 
that
> > you would need to supply a C linkable interface to your current 
code,
> > then keep your grammar and action ode as separate as possible. 
Grammars
> > that hae too much of the for actions directly typed in to them tend 
to
> > be difficult to read anyway.
> 
> Do you mean something as
> 
> Tree_rule:
>     {Sql_Node_Ptr p = make_sql_insert_node(); }
> 
> ?
> 
> All our such factories return our C++ nodes.
> 
> I do not see reason why this should not work in C runtime,
> Except as make it compile as CPP.
> 
The generated C needs a little tweaking so that you could compile it as 
CPP - it isn't difficult to do this and I have been meaning to. I would 
suggest that you try a few examples and see if you feel your performance 
problems would be solved this way. They probably would be, but I am 
happy to make any improvements that practical applications reveal to be 
worth it.

Jim



More information about the antlr-interest mailing list