public override void ExpandTree(InteriorNode parent, SymbolsDictionary symbols, Positions positions) { SyntaxTreeNode node = null; foreach (int num in this.GetResolvedSymbols(symbols)) { if (symbols.GetParticle(num) != this.particle) { symbols.IsUpaEnforced = false; } LeafNode node2 = new LeafNode(positions.Add(num, this.particle)); if (node == null) { node = node2; } else { InteriorNode node3 = new ChoiceNode { LeftChild = node, RightChild = node2 }; node = node3; } } if (parent.LeftChild == this) { parent.LeftChild = node; } else { parent.RightChild = node; } }
public void AddChoice() { SyntaxTreeNode node = (SyntaxTreeNode) this.stack.Pop(); InteriorNode node2 = new ChoiceNode { LeftChild = node }; this.stack.Push(node2); }
public void AddChoice() { SyntaxTreeNode node = (SyntaxTreeNode)this.stack.Pop(); InteriorNode node2 = new ChoiceNode { LeftChild = node }; this.stack.Push(node2); }
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; } }
public void AddChoice() { SyntaxTreeNode node = (SyntaxTreeNode)stack.Pop(); InteriorNode choice = new ChoiceNode(); choice.LeftChild = node; stack.Push(choice); }