示例#1
0
        /// <summary>
        /// 编译FireML
        /// </summary>
        public FireMLRoot CompileFireML()
        {
            FireMLRoot root = new FireMLRoot();

            #region 读取Asset
            AssetBuilder assetBuilder = new AssetBuilder(this);
            assetBuilder.Build(assetFiles, root);
            #endregion

            #region 构造AST
            ASTBuilder astBuilder = new ASTBuilder(this);
            astBuilder.Build(plotFiles, root);
            #endregion

            #region AST合法性检查
            ASTChecker astChecker = new ASTChecker(this);
            astChecker.Check(root);
            #endregion

            #region 生成ID号
            IDGenerator idGenerator = new IDGenerator();
            idGenerator.Generate(root);
            #endregion

            #region 资源存在性检查
            //ContentChecker contentChecker = new ContentChecker(this);
            //contentChecker.Check(root);
            #endregion

            if (errorList.Count > 0)
            {
                return(null);
            }
            else
            {
                return(root);
            }
        }
        /// <summary>
        /// 编译FireML
        /// </summary>
        public FireMLRoot CompileFireML()
        {
            FireMLRoot root = new FireMLRoot();

            #region 读取Asset
            AssetBuilder assetBuilder = new AssetBuilder(this);
            assetBuilder.Build(assetFiles, root);
            #endregion

            #region 构造AST
            ASTBuilder astBuilder = new ASTBuilder(this);
            astBuilder.Build(plotFiles, root);
            #endregion

            #region AST合法性检查
            ASTChecker astChecker = new ASTChecker(this);
            astChecker.Check(root);
            #endregion

            #region 生成ID号
            IDGenerator idGenerator = new IDGenerator();
            idGenerator.Generate(root);
            #endregion

            #region 资源存在性检查
            //ContentChecker contentChecker = new ContentChecker(this);
            //contentChecker.Check(root);
            #endregion

            if (errorList.Count > 0)
                return null;
            else
                return root;
        }