[antlr-interest] About C runtime question.
Jim Idle
jimi at temporal-wave.com
Thu Jan 17 20:55:40 PST 2008
Read the sources ;-) The 'objects' that are created a lot, such as
tokens and strings, are not populated by initializing each method
pointer individually.
> -----Original Message-----
> From: Ruslan Zasukhin [mailto:sunshine at public.kherson.ua]
> Sent: Tuesday, January 15, 2008 2:36 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] About C runtime question.
>
> 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