public class MyNumeric : NumberParser{ public int MinValue { get; set; }
public int MaxValue { get; set; }
protected override ParseMatch InnerParse(ParseArgs args) { var pos = args.Scanner.Position; var match = base.InnerParse(args); if (match.Success) { var str = args.Scanner.SubString(match.Index, match.Length); int val; if (int.TryParse(str, out val)) { if (val >= MinValue && val <= MaxValue) { return match; } } } args.Scanner.SetPosition(pos); return args.NoMatch; }}