public override void ExpandTree(InteriorNode parent, SymbolsDictionary symbols, Positions positions) {
SyntaxTreeNode replacementNode = null;
foreach(int symbol in GetResolvedSymbols(symbols)) {
if (symbols.GetParticle(symbol) != particle) {
symbols.IsUpaEnforced = false;
}
LeafNode node = new LeafNode(positions.Add(symbol, particle));
if (replacementNode == null) {
replacementNode = node;
}
else {
InteriorNode choice = new ChoiceNode();
choice.LeftChild = replacementNode;
choice.RightChild = node;
replacementNode = choice;
}
}
if (parent.LeftChild == this) {
parent.LeftChild = replacementNode;
}
else {
parent.RightChild = replacementNode;
}
}