Exemple #1
0
        ///<summary>
        /// If the element is found in the semantic action environment and is not a null pointer, return
        /// true. Otherwise, return false.
        ///</summary>
        public override bool Evaluate(SemanticOperationHandler handler)
        {
            String         name   = Value;
            Scope <Object> theMap = handler.SemanticOperationVariableMap;

            return(theMap.ContainsKey(name) && theMap[name] != null);
        }
 public override void SetNestedOperationState(String name, Object value)
 {
     foreach (SemanticOperation action in nestedSemanticActionList)
     {
         SemanticOperationHandler handler = SemanticOperationHandler;
         action.SemanticOperationHandler = handler;
         handler.SetOperationState(action, name, value);
         action.SetNestedOperationState(name, value);
     }
 }
Exemple #3
0
        public SemanticOperationHandler GetSemanticOperationHandler()
        {
            SemanticOperationHandler result = this.semanticOperationHandler;

            if (result == null)
            {
                ElementState parentES = Parent;
                if (parentES != null && parentES is SemanticOperation)
                {
                    SemanticOperation parent = (SemanticOperation)parentES;
                    result = parent.GetSemanticOperationHandler();
                    this.semanticOperationHandler = result;
                }
            }
            return(result);
        }
        public override bool Evaluate(SemanticOperationHandler handler)
        {
            bool flag = true;

            if (checks != null)
            {
                foreach (Condition check in checks)
                {
                    flag = flag && check.Evaluate(handler);
                    if (!flag)
                    {
                        break;
                    }
                }
            }
            return(flag);
        }
 public override void SetNestedOperationState(String name, Object value)
 {
     if (cases != null)
     {
         foreach (IfSemanticOperation aCase in cases)
         {
             SemanticOperationHandler handler = SemanticOperationHandler;
             aCase.SemanticOperationHandler = handler;
             SemanticOperationHandler.SetOperationState(aCase, name, value);
             aCase.SetNestedOperationState(name, value);
         }
     }
     if (otherwise != null)
     {
         semanticOperationHandler.SetOperationState(otherwise, name, value);
         otherwise.SetNestedOperationState(name, value);
     }
 }
Exemple #6
0
 public override bool Evaluate(SemanticOperationHandler handler)
 {
     return(!check.Evaluate(handler));
 }
 public virtual bool Evaluate(SemanticOperationHandler handler)
 {
     Debug.WriteLine("Condition.Evaluate() gets called: this should never happen.");
     return(false);
 }