[antlr-interest] C Runtime - list container suggestions

Jim Idle jimi at temporal-wave.com
Tue Aug 14 09:18:32 PDT 2007


Yes - this is my thought too.

> -----Original Message-----
> From: Gavin Lambert [mailto:antlr at mirality.co.nz]
> Sent: Tuesday, August 14, 2007 1:09 AM
> To: Jim Idle; antlr-interest Interest
> Subject: Re: [antlr-interest] C Runtime - list container suggestions
> 
> At 10:29 14/08/2007, Jim Idle wrote:
> >I will implement a temporary fix, then look at changing to
> >vectors, which are faster than the hash table for this anyway. I
> >think my doubts were whether you should be able to delete an
> >element from the list and expect the keys to be preserved, or
> >whether the key should be an ordinal, in that you can delete list
> >entry #1 as many times as there is a list entry #1 left. I need
> >to decide which it should be then implement either a key field in
> >the structure (so that it does not reuse the same key in the
> >hashtable), or change to vectors and make the key ordinal (which
> >is what I think a list means actually).
> 
> By normal definitions, a "list" could either be a "linked list" or
> a "vector"; either way it's logically unkeyed (though frequently
> they are implicitly keyed by their position in the
> collection).  So for a "list" I think everyone would expect the
> behaviour that if you deleted item #1 then item #2 would "move" to
> become the new item #1.  (Which is not what it does right now.)
> 
> I imagine hashtables could still be useful in some places (eg. the
> string factory), but I suspect most of the public stuff should
> probably be dealing with lists.



More information about the antlr-interest mailing list