コード例 #1
0
        /// <summary>
        /// 获取源代码的规范格式
        /// <para>语法分析的副产品</para>
        /// </summary>
        /// <param name="tree">语法树</param>
        /// <returns></returns>
        public static double GetValue(this SyntaxTree <EnumTokenTypeExpression, EnumVTypeExpression, TreeNodeValueExpression> tree)
        {
            if (tree == null)
            {
                return(double.NaN);
            }

            var tmpTree = tree.Clone() as SyntaxTree <EnumTokenTypeExpression, EnumVTypeExpression, TreeNodeValueExpression>;

            _GetValue(tmpTree);

            return(double.Parse(tmpTree.Tag.ToString()));
        }