[antlr-interest] Antlr 3.2 vs. Bison 2.4.2+Flex 2.5.35 Speed/Memory

Jim Idle jimi at temporal-wave.com
Sat May 22 10:34:51 PDT 2010


There needs to be a 3.2.1 to catch up the other targets to the Java Target. We released 3.2 for your book but I had not implemented the extensions you made for 3.2 yet.

There is also the fact that the input stream is implemented by method calls in ANTLR and not direct pointers (but there is a macro you can turn on to do it like bison if you know the encoding in advance), and we are also keeping track of the follow stack for error recovery, which LALR isn't very good at (and there is a macro in the development branch that allows turning off the stack). 

So, the ANTLR C runtime is performing a whole bunch of tasks that bison isn't. The only thing to add is the token stream that can discard after certain checkpoints. However, if you are producing a tree, then you need the tokens in the tree anyway, so such things are really only good for record traversal and so on, which is probably better done with awk anyway.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Terence Parr
> Sent: Saturday, May 22, 2010 9:19 AM
> To: ANTLR interest
> Subject: Re: [antlr-interest] Antlr 3.2 vs. Bison 2.4.2+Flex 2.5.35
> Speed/Memory
> 
> Very interesting. The token stream in v3.2 I don't think but first
> tokens by default, but it still buffers all of the input characters...
> 
> Ter
> On May 21, 2010, at 10:00 PM, Jim Idle wrote:
> 
> > Well, you're comparing apples to cheese here. Bison/Flex do not
> create complicated tokens with method calls and so on, so ANTLR is
> winning here in reality. That said, I am going to implementing some of
> this stuff with a more fly weight pattern in v4. However, it sounds
> like you need to implement your own token stream that discards the
> tokens at certain points.
> >
> > Jim
> 
> 
> 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