CFGLib.Parsers.Forests.ForestOption.AddNode C# (CSharp) Method

AddNode() private static method

private static AddNode ( SppfNode node, List startList, Sentence rhs, int position ) : void
node SppfNode
startList List
rhs Sentence
position int
return void
		private static void AddNode(SppfNode node, List<ForestNode[]> startList, Sentence rhs, int position) {
			ForestNode nodeToAdd;
			if (node is TerminalNode) {
				nodeToAdd = new ForestLeaf((TerminalNode)node);
			} else {
				nodeToAdd = new ForestInternal((SymbolNode)node, (Nonterminal)rhs[position]);
			}
			foreach (var children in startList) {
				children[position] = nodeToAdd;
			}
		}