import { Category } from "../grammar/category" ; /**
 * A parse tree that represents the derivation of a string based on the
 * rules in a  Grammar . Parse trees recursively contain
 * other parse trees, so they can be iterated through to
 * find the entire derivation of a category.
 * <p>
 * Parse trees are essentially partial views of a Chart from a
 * given  State or  Category . They represent the completed
 * category at a given string index and origin position.
  export interface ParseTree < T > { category : Category < T > ; children : ParseTree < T > [ ] ; token ? : T ; } param category param children export function createParseTree < T > ( category , children = [ ] ) { return { category , children } ; } export function addRightMost < T > ( addTo , addMe ) { addTo . children . push ( addMe ) ; }