Beispiel #1
0
		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;
		}
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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>());
        }