Case of same number of input nodes and nodes to replace:
j = 0;
for (i = startChildIndex; i <= stopChildIndex; i++)
{
child = (pANTLR3_BASE_TREE) newChildren->get(newChildren, *j*);
parent->children->set(parent->children, i, child, NULL, ANTLR3_FALSE);
child->setParent(child, parent);
child->setChildIndex(child, i);
}
Why "j"? It is always 0. "i - startChildIndex" may be used instead of "j".
In case of more nodes to input we use what we can, then adding new nodes.
But we adding to the end of the children vector instead of inserting to
vector after nodes that we reused. (libantlr3c-3.3-SNAPSHOT)
Dmitry Ilyin
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.