public static Stylesheet CompileCode(string code)
        {
            var expressionExecutor = new ExpressionExecutor();
            var dssParser          = new DssParser();
            var dssCompiler        = new DssCompiler(expressionExecutor);
            var sourceInfo         = new SourceCodeInfo("TestCode", code);
            var instructions       = dssParser.Parse(sourceInfo);

            return(dssCompiler.Compile(instructions));
        }
        private static IStyle parseTestStyle()
        {
            var fileInfo           = new PhysicalFileInfo(new System.IO.FileInfo(@"C:\Playground\AbsoluteGraphicsPlatform\tests\TestFiles\TestStyle1.dss"));
            var expressionExecutor = new ExpressionExecutor();
            var dssParser          = new DssParser();
            var dssCompiler        = new DssCompiler(expressionExecutor);

            var sourceInfo   = new SourceCodeInfo(fileInfo);
            var instructions = dssParser.Parse(sourceInfo);
            var style        = dssCompiler.Compile(instructions);

            return(style);
        }
示例#3
0
        public static IStyle GetStyle(string filename)
        {
            var fileProvider       = IO.GetTestFileProvider();
            var expressionExecutor = new ExpressionExecutor();
            var dssParser          = new DssParser();
            var dssCompiler        = new DssCompiler(expressionExecutor);

            var fileInfo     = fileProvider.GetFileInfo(filename);
            var sourceInfo   = new SourceCodeInfo(fileInfo);
            var instructions = dssParser.Parse(sourceInfo);
            var style        = dssCompiler.Compile(instructions);

            return(style);
        }