Exemplo n.º 1
0
 // *****************************************************************************
 // IMatchable implementation
 // *****************************************************************************
 public override bool Match(MatchNode matchNode, MatchEngine engine)
 {
     if (!base.Match(matchNode, engine))
     {
         return(false);
     }
     foreach (KeyValuePair <IMatchable.MatchProperties, MatchNode.RuleValue> rule in matchNode
              .GetRules())
     {
         MatchNode.RuleValue        value = rule.Value;
         IMatchable.MatchProperties key   = rule.Key;
         if (key == IMatchable.MatchProperties.Exprent_Consttype)
         {
             if (!value.value.Equals(this.constType))
             {
                 return(false);
             }
         }
         else if (key == IMatchable.MatchProperties.Exprent_Constvalue)
         {
             if (value.IsVariable() && !engine.CheckAndSetVariableValue(value.value.ToString()
                                                                        , this.value))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Exemplo n.º 2
0
 // *****************************************************************************
 // IMatchable implementation
 // *****************************************************************************
 public override bool Match(MatchNode matchNode, MatchEngine engine)
 {
     if (!base.Match(matchNode, engine))
     {
         return(false);
     }
     MatchNode.RuleValue rule = matchNode.GetRules().GetOrNull(IMatchable.MatchProperties
                                                               .Exprent_Var_Index);
     if (rule != null)
     {
         if (rule.IsVariable())
         {
             return(engine.CheckAndSetVariableValue((string)rule.value, this.index));
         }
         else
         {
             return(this.index == int.Parse((string)rule.value));
         }
     }
     return(true);
 }
Exemplo n.º 3
0
 // *****************************************************************************
 // IMatchable implementation
 // *****************************************************************************
 public override bool Match(MatchNode matchNode, MatchEngine engine)
 {
     if (!base.Match(matchNode, engine))
     {
         return(false);
     }
     foreach (KeyValuePair <IMatchable.MatchProperties, MatchNode.RuleValue> rule in matchNode
              .GetRules())
     {
         MatchNode.RuleValue        value = rule.Value;
         IMatchable.MatchProperties key   = rule.Key;
         if (key == IMatchable.MatchProperties.Exprent_Invocation_Parameter)
         {
             if (value.IsVariable() && (value.parameter >= lstParameters.Count || !engine.CheckAndSetVariableValue
                                            (value.value.ToString(), lstParameters[value.parameter])))
             {
                 return(false);
             }
         }
         else if (key == IMatchable.MatchProperties.Exprent_Invocation_Class)
         {
             if (!value.value.Equals(this.classname))
             {
                 return(false);
             }
         }
         else if (key == IMatchable.MatchProperties.Exprent_Invocation_Signature)
         {
             if (!value.value.Equals(this.name + this.stringDescriptor))
             {
                 return(false);
             }
         }
     }
     return(true);
 }