Beispiel #1
0
        private XzaarExpression Bind(AstNode entry)
        {
            var binder    = new NodeTypeBinder();
            var boundNode = binder.Process(entry);
            var program   = Visit(boundNode);

            return(program);
        }
        public static string FormatCode(string code)
        {
            var ast           = new NodeTypeBinder().Process(Reduce(code, out _));
            var compiler      = new ExpressionCompiler();
            var expression    = compiler.Compile(ast as EntryNode);
            var codeGenerator = new XzaarScriptCodeFormatter();

            return(codeGenerator.Visit(expression).TrimEnd('\r', '\n'));
        }