[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grammar questions

"Etienne M. Gagnon" wrote:

> > When I specify a rule in grammar like xxx* there's a function for setting
> > that node's data - generated into the node source file:
> >...
> > Wouldn't this all be equivalent to '_xxx_.addAll (list)' ?
> > Isn't creating arrays like that slow?
> This one is not intuitive to see for the casual reader;-) It is done to
> avoid generating spurious "ConcurrentModificationException", as you are
> most likely walking the AST when you modify it.

I have to confess i'm no expert on Java Collections but is there a difference
between .add and .addAll? Or is the added list being modified in a concurrent
thread during .addAll?

> > And more. Isn't that functions used for modfifying the tree by users?
> > If so then it doesn't replace the list but appends the contents. Is
> > that valid behavior? Shouldn't it clear() it first?
> Good point.  I think clear() should be called.  Could you submit a bug
> about it at http://sourceforge.net/bugs/?func=addbug&group_id=5704

Sorry. The sourceforge gave me a "ERROR: ERROR getting bug_id". It
seems to be broken.