Exemplo n.º 1
0
        internal bool TryValidate(Store sto, Func <Item> getItem)
        {
            bool result = true;

            if (StepType == StepType.Property && Evaluate is LiteralParse e)
            {
                if (sto.TryLookUpProperty(e.Text, out Property property))
                {
                    StepType = StepType.Property;
                    Evaluate = new LiteralProperty(this, property, getItem);
                }
                else
                {
                    Error = StepError.UnknownProperty;
                    return(false);
                }
            }
            else if (Input != null)
            {
                foreach (var step in Input)
                {
                    result &= step.TryValidate(sto, getItem); // recursive depth-first traversal
                }
            }
            return(result);
        }
Exemplo n.º 2
0
 private static void AppendText(StepType type, EvaluateStep eval, StringBuilder sb)
 {
     if (eval.ValType == ValType.IsUnresolved)
     {
         sb.Append(_defaultText.TryGetValue(type, out string txt) ? txt : " ?? ");
     }
     else
     {
         sb.Append(eval.Text);
     }
 }
Exemplo n.º 3
0
 internal ComputeStep(StepType stepType)
 {
     StepType = stepType;
     Evaluate = Value.LiteralUnresolved;
 }
Exemplo n.º 4
0
        private StepState _flags2;      // used by TryResolve()

        #region Constructor  ==================================================
        internal ComputeStep(LiteralParse evaluate)
        {
            StepType = StepType.Parse;
            Evaluate = evaluate;
        }