internal InputQueue PrintSyntaxTree(StreamWriter writer, InputQueue queue, int value) { string toAppend = ""; for (int i = 0; i < value; i++) { toAppend += "\t"; } if (Derivations.Count != 0 || Type.Equals(Classes.Epsilon)) { writer.WriteLine(toAppend + Type); } else { writer.WriteLine(toAppend + Type + ": " + queue.Pop()); } foreach (ClassNode child in Derivations) { queue = child.PrintSyntaxTree(writer, queue, value + 1); } return(queue); }
private void IMPORT(ClassNode lex) { entry.Pop(); IDENTIFIER(lex.Derivations[1]); IDENTIFIER2(lex.Derivations[2]); entry.Pop(); }