// ***************************************************************************** // 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); }
public override bool Match(MatchNode matchNode, MatchEngine engine) { if (matchNode.GetType() != MatchNode.Matchnode_Exprent) { return(false); } foreach (KeyValuePair <IMatchable.MatchProperties, MatchNode.RuleValue> rule in matchNode .GetRules()) { IMatchable.MatchProperties key = rule.Key; if (key == IMatchable.MatchProperties.Exprent_Type && this.type != (int)rule.Value .value) { return(false); } if (key == IMatchable.MatchProperties.Exprent_Ret && !engine.CheckAndSetVariableValue ((string)rule.Value.value, this)) { return(false); } } return(true); }
// ***************************************************************************** // 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); }