示例#1
0
        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);
        }
示例#2
0
文件: Ogma.cs 项目: plets-x1/plets-x1
 private void IMPORT(ClassNode lex)
 {
     entry.Pop();
     IDENTIFIER(lex.Derivations[1]);
     IDENTIFIER2(lex.Derivations[2]);
     entry.Pop();
 }