Пример #1
0
        protected FusionAst InvokeAndParseDsl(string identifier, string code)
        {
            IFusionDsl dsl = null;

            if (this.dslFactory == null || (dsl = dslFactory.create(identifier)) == null)
            {
                throw new DslException("Unable to create DSL - unintialized DSL-factory?");
            }
            var transpiledFusion = dsl.Transpile(code);
            var parser           = new Parser();

            parser.SetDslFactory(dslFactory);
            var temporaryAst   = parser.Parse("value = " + transpiledFusion + "\n");
            var processedValue = temporaryAst.Children["value"];

            return(processedValue);
        }
Пример #2
0
 public void RegisterDsl(string identifier, IFusionDsl dsl)
 {
     this.registeredDsls.Add(identifier, dsl);
 }