示例#1
0
        public void EmitJs(TextWriter output, string content)
        {
            var tree = SyntaxTree.ParseCompilationUnit(content);

            var root = (CompilationUnitSyntax)tree.GetRoot();

            var emitter = new JavaScriptWalker(output);
            emitter.Visit(root);
        }
示例#2
0
        public void EmitJs(TextWriter output, string content)
        {
            var tree = SyntaxTree.ParseText(content);

            var root = (CompilationUnitSyntax)tree.GetRoot();

            var emitter = new JavaScriptWalker(output);

            emitter.Visit(root);
        }
示例#3
0
        private void Compile(TextWriter output, string content, string path)
        {
            var tree = SyntaxTree.ParseCompilationUnit(content, path);

            var root = (CompilationUnitSyntax)tree.GetRoot();

            var collector = new ClassCollector();
            collector.Visit(root);

            foreach (var @class in collector.Classes)
            {
                var emitter = new JavaScriptWalker(output);
                emitter.Visit(@class);
            }
        }
示例#4
0
        private void Compile(TextWriter output, string content, string path)
        {
            var tree = SyntaxTree.ParseText(content, path);

            var root = (CompilationUnitSyntax)tree.GetRoot();

            var collector = new ClassCollector();

            collector.Visit(root);

            foreach (var @class in collector.Classes)
            {
                var emitter = new JavaScriptWalker(output);
                emitter.Visit(@class);
            }
        }