Example #1
0
		private List<ForestNode[]> BuildChildren() {
			var count = _family.Production.Rhs.Count;
			if (count == 0) {
				if (_family.Members.Count != 1) {
					throw new Exception();
				}
				var leaf = new ForestLeaf((EpsilonNode)_family.Members[0]);
				return new List<ForestNode[]> { new ForestNode[1] { leaf } };
			}
			var start = new ForestNode[count];
			var startList = new List<ForestNode[]> { start };
			BuildChildrenHelper(_family, startList, _family.Production.Rhs, count - 1);
			return startList;
		}
Example #2
0
		public ForestNodeNode(ForestNode node, string id, int rank) {
			Node = node;
			Id = id;
			Rank = rank;
		}