private static void printTree(Phrase phraseTree, int level) { p(phraseTree.Intermediate.PhraseCategory.ToString(), level); p(phraseTree.Intermediate.Head.Word, level); if (phraseTree.Intermediate.hasComplement) { printTree(phraseTree.Intermediate.Complement, level + 1); } }
// Constructor chaining see http://stackoverflow.com/questions/829870/calling-constructor-from-other-constructor-in-same-class /// <summary> /// Creates a new instance of Intermediate /// </summary> /// <param name="head">The head of the intermediate phrase</param> /// <param name="Complement">The complement phrase to attach</param> public Intermediate(Terminal head, Phrase Complement) : this(head) { this.Complement = Complement; }
/// <summary> /// Creates a new instance of <c>Phrase</c> and sets the <see cref="Intermediate"/> and <see cref="Specifier"/>. /// </summary> /// <param name="specifier">The speicifer phrase.</param> /// <param name="i">The Intermediate phrase.</param> public Phrase(Phrase specifier, Intermediate i) { Specifier = specifier; Intermediate = i; }