Exemple #1
0
        private IFormulaComponent[] CreateComponents(ParseTreeElement rootElement)
        {
            IList list = new ArrayList();

            rootElement.AddAsRPN(list);

            var arr = new IFormulaComponent[list.Count];

            list.CopyTo(arr, 0);
            return(arr);
        }
Exemple #2
0
        internal Formula(FormulaEngine owner, string expression)
        {
            Engine = owner;
            // By default, we evaluate to a primitive
            ResultType = OperandType.Primitive;
            // Get our analyzer, have it parse the expression, and get all our information from it
            var analyzer = (CustomFormulaAnalyzer)Engine.Parser.Analyzer;
            ParseTreeElement rootElement = Parse(expression);

            ReferenceParseInfo[] infos = analyzer.ReferenceInfos;
            ProcessParseInfos(infos);
            Template = CreateTemplateString(expression, infos);
            analyzer.ResetReferences();
            _components = CreateComponents(rootElement);
            ValidateComponents();
            ComputeRawReferenceHashCodes();
            ComputeDependencyReferences();
        }
Exemple #3
0
 public ParseTreeElement(ParseTreeElement.EnumType type)
 {
     this.type = type;
 }