private static void WriteTree(SyntaxTreeNode node, StringBuilder treeBuilder, int depth = 0)
        {
            if (node == null)
            {
                return;
            }
            if (depth > 1)
            {
                WriteIndent(treeBuilder, depth);
            }

            if (depth > 0)
            {
                treeBuilder.Append("|-- ");
            }

            treeBuilder.AppendLine(ConvertEscapseSequences(node.ToString()));
            if (node.IsBlock)
            {
                foreach (SyntaxTreeNode child in ((Block)node).Children)
                {
                    WriteTree(child, treeBuilder, depth + 1);
                }
            }
        }
 private void WriteNode(int indent, SyntaxTreeNode node)
 {
     string content = node.ToString().Replace("\r", "\\r")
         .Replace("\n", "\\n")
         .Replace("{", "{{")
         .Replace("}", "}}");
     if (indent > 0)
     {
         content = new String('.', indent * 2) + content;
     }
     WriteTraceLine(content);
     Block block = node as Block;
     if (block != null)
     {
         foreach (SyntaxTreeNode child in block.Children)
         {
             WriteNode(indent + 1, child);
         }
     }
 }