[antlr-interest] Antlr v4 - C++ target

Gokulakannan Somasundaram gokul007 at gmail.com
Mon Jan 23 20:12:24 PST 2012


Hi All,
         I have decided to spend some time to come up with a C++ Target for
ANTLR 3.4, as i need it desperately for my project. I have started working
on it and i am going to come with a initial version within a week or two.
My ideas
a) The details of the parser related functionality will be stolen from C
Target
b) It is not going to have function pointers/virtual functions. Its going
to be all templates
c) It is going to be a header-only library.
d) Its going to have Exception handling
e) I am going to replace structures like string, vector, stack, hash map,
list etc with data structures in C++
f) I am trying to make it as much type-safe as possible

But Since i don't have much experience with building Trees, i am not going
to touch the .stg files of the Tree Parser. I need some-one to take it up,
once i put out the first version.

Any suggestions?

Thanks,
Gokul.

On Sat, Jan 21, 2012 at 4:35 PM, Gokulakannan Somasundaram <
gokul007 at gmail.com> wrote:

> it is v3. Some of the function pointers have been converted to member
> functions. It basically has removed the flexibility of overriding some of
> the token related functions. But the performance gain is that the space
> occupied by those function pointers are saved. So this patch can be
> considered by those who use C++, don't want to override any of the token
> specific functionality ( which will definitely be useful to many ).
>
> Gokul.
>
>
> On Sat, Jan 21, 2012 at 10:34 AM, Terence Parr <parrt at cs.usfca.edu> wrote:
>
>> the code says antlr3XXX. is it v4 or v3?
>> Ter
>> On Jan 20, 2012, at 6:22 PM, A Z wrote:
>>
>> > With this (very quickly written) code I see about 7MB/sec for the lexer
>> > using clang++ and using static linking. Memory use is about 30:1 but
>> many
>> > features have been removed, like getText and setText.
>> >
>>
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>
>
>


More information about the antlr-interest mailing list