public static FxtLog Run(XmlSchemaSet schemas, XElement trafo, interpreter i)
        {
            var trafos = new List <IFxtTransformation>();
            var log    = new FxtLog();

            // Compile if necessary
            if (!schemas.IsCompiled)
            {
                schemas.Compile();
            }
            if (trafo == null)
            {
                return(log);
            }

            // Interpret trafo
            i(schemas, trafo, log, trafos);

            // Execute trafos
            foreach (var x in trafos)
            {
                x.Run();
            }

            // Re-compile
            foreach (var x in schemas.XmlSchemas())
            {
                schemas.Reprocess(x);
            }
            schemas.Compile();
            return(log);
        }
        public static FxtLog Run(XmlSchemaSet schemas, XElement trafo, interpreter i)
        {
            FxtLog fxtLog;
            List <IFxtTransformation> trafos = new List <IFxtTransformation>();
            FxtLog log = new FxtLog();

            if (!schemas.IsCompiled)
            {
                schemas.Compile();
            }
            if (trafo != null)
            {
                i(schemas, trafo, log, trafos);
                foreach (IFxtTransformation x in trafos)
                {
                    x.Run();
                }
                foreach (XmlSchema x in schemas.XmlSchemas())
                {
                    schemas.Reprocess(x);
                }
                schemas.Compile();
                fxtLog = log;
            }
            else
            {
                fxtLog = log;
            }
            return(fxtLog);
        }
Example #3
0
        public static FxtLog Run(XmlSchemaSet schemas, XElement trafo, interpreter i) 
        {
            var trafos = new List<IFxtTransformation>();
            var log = new FxtLog();

            // Compile if necessary
            if (!schemas.IsCompiled)
                schemas.Compile();
            if (trafo==null)
                return log;

            // Interpret trafo
            i(schemas, trafo,log,trafos);

            // Execute trafos
            foreach (var x in trafos) 
                x.Run();

            // Re-compile
            foreach (var x in schemas.XmlSchemas())
                schemas.Reprocess(x);
            schemas.Compile();                
            return log;
        }
Example #4
0
    // Use this for initialization
    void Start()
    {
        var inter = new interpreter("1291-1254");

        Debug.Log("计算结果" + inter.expr());
    }
Example #5
0
	// Use this for initialization
	void Start () {
        var inter = new interpreter("1291-1254");
        Debug.Log("计算结果" + inter.expr());

	}