[antlr-interest] About C runtime question.

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Jan 15 02:36:10 PST 2008


Hi Jim,


>From here:
    
    http://www.antlr.org/wiki/display/ANTLR3/ANTLR3+Code+Generation+-+C

> As there is no such thing as an object reference in C, I chose to create a
> number of typedef structs that reflect the calling interface chosen by Terence
> in the Java version of the same. The initialization of a parser, lexer, input
> stream or internal structure therefore consists of allocating the memory
> required for an instance of the typedef struct that represents the interface,
> initializing any counters, pointers and buffers etc, then populating a number
> of pointers to functions that implement the equivalent of the methods in the
> Java class.

Sounds like each time for each new object, is executed population of
function pointers?

I think more effective prepare this once, and in the object structure keep
only pointer to StructOfFuncsOfClassXXXX, exactly as C++ do.

No ?

P.S. I have not read sources yet


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the antlr-interest mailing list