public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { XSolverResult sra = na.Resolve(context); if (sra.Error != null) { return(sra); } XSolverResult srb = nb.Resolve(context); if (srb.Error != null) { return(srb); } var s = sra.Data as string; if (s == null) { return(XSolverResult.FromData(false)); } var re = srb.Data as Regex; if (re == null) { return(XSolverResult.FromData(false)); } Match match = re.Match(s); return(XSolverResult.FromData(match.Success)); }
public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { if (context.ReferenceSolver == null) { return(XSolverResult.FromData(null)); } return(context.ReferenceSolver.GetValue(this)); }
public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { XSolverResult result = na.Resolve(context); if (result.Error != null) { return(result); } bool value = XSolverHelpers.AsBool(result.Data); return(XSolverResult.FromData(value == false)); }
public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { XSolverResult sra = na.Resolve(context); if (sra.Error != null) { return(sra); } XSolverResult srb = nb.Resolve(context); if (srb.Error != null) { return(srb); } bool value = XSolverHelpers.Match(sra.Data, srb.Data); return(XSolverResult.FromData(value)); }
public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { var pattern = this.Data as string; if (pattern == null) { return(XSolverResult.FromData(null)); } var flags = this.Flags ?? string.Empty; RegexOptions options = RegexOptions.None; if (flags.Contains('i')) { options |= RegexOptions.IgnoreCase; } var re = new Regex(pattern, options); return(XSolverResult.FromData(re)); }
public abstract XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc);
public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { throw new NotImplementedException(); }
public override XSolverResult Resolve(IXSolverContext context) { return(this.Token.Resolve(context, this.LeftChild, this.RightChild, null)); }
public override XSolverResult Resolve(IXSolverContext context) { return(this.Token.Resolve(context, null, null, null)); }
public abstract XSolverResult Resolve(IXSolverContext context);
public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc) { return(XSolverResult.FromData(this.Data)); }