protected override IEnumerable<TData> ApplyImpl(TData input, TOffset start) { var results = new List<TData>(); foreach (Match<TData, TOffset> match in Matcher.AllMatches(input, start)) results.Add(RuleSpec.ApplyRhs(this, match)); return results; }
protected override IEnumerable <TData> ApplyImpl(TData input, TOffset start) { TData data = input; foreach (Match <TData, TOffset> match in Matcher.AllMatches(input, start).ToArray()) { RuleSpec.ApplyRhs(this, match, out data); } return(data.ToEnumerable()); }
protected override IEnumerable <TData> ApplyImpl(TData input, TOffset start) { var results = new List <TData>(); foreach (Match <TData, TOffset> match in Matcher.AllMatches(input, start)) { TData outputData; RuleSpec.ApplyRhs(this, match, out outputData); results.Add(outputData); } return(results); }
protected override IEnumerable <TData> ApplyImpl(TData input, TOffset start) { bool applied = false; TData data = input; Match <TData, TOffset> match = Matcher.Match(input, start); while (match.Success) { TOffset nextOffset = RuleSpec.ApplyRhs(this, match, out data); applied = true; match = Matcher.Match(data, nextOffset); } if (applied) { return(data.ToEnumerable()); } return(Enumerable.Empty <TData>()); }