コード例 #1
0
ファイル: AstWriter.cs プロジェクト: JamesTryand/IronScheme
        /// <summary>
        /// Write out the given AST
        /// </summary>
        internal static void Dump(Node /*!*/ node, string /*!*/ descr, TextWriter /*!*/ writer)
        {
            Debug.Assert(node != null);
            Debug.Assert(descr != null);
            Debug.Assert(writer != null);

            AstWriter dv = new AstWriter();

            dv.DoDump(node, descr, writer);
        }
コード例 #2
0
ファイル: AstWriter.cs プロジェクト: JamesTryand/IronScheme
        /// <summary>
        /// Write out the given rule's AST (only if ShowRules is enabled)
        /// </summary>
        public static void Dump <T>(StandardRule <T> rule)
        {
            if (ScriptDomainManager.Options.ShowRules)
            {
#if !SILVERLIGHT
                ConsoleColor color = Console.ForegroundColor;
                try {
                    Console.ForegroundColor = GetAstColor();
#endif
                AstWriter.Dump(rule.Test, "Rule.Test", System.Console.Out);
                AstWriter.Dump(rule.Target, "Rule.Target", System.Console.Out);
#if !SILVERLIGHT
            }
            finally {
                Console.ForegroundColor = color;
            }
#endif
            }
        }