コード例 #1
0
        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));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
 public abstract XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc);
コード例 #7
0
 public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public override XSolverResult Resolve(IXSolverContext context)
 {
     return(this.Token.Resolve(context, this.LeftChild, this.RightChild, null));
 }
コード例 #9
0
 public override XSolverResult Resolve(IXSolverContext context)
 {
     return(this.Token.Resolve(context, null, null, null));
 }
コード例 #10
0
 public abstract XSolverResult Resolve(IXSolverContext context);
コード例 #11
0
 public override XSolverResult Resolve(IXSolverContext context, XTreeNodeBase na, XTreeNodeBase nb, XTreeNodeBase nc)
 {
     return(XSolverResult.FromData(this.Data));
 }