public static WholeNumberPart Produce(IEnumerable <Symbol> symbols, out IEnumerable <Symbol> symbolsToProcess) { // whole-number-part = digit-sequence IEnumerable <Symbol> s = null; DigitSequence d = DigitSequence.Produce(symbols, out s); if (d != null) { symbolsToProcess = s; return(new WholeNumberPart(d)); } symbolsToProcess = null; return(null); }
public static FractionalPart Produce(IEnumerable <Symbol> symbols) { // fractional-part = full-stop digit-sequence if (!symbols.Any()) { return(null); } if (symbols.First() is FullStop) { IEnumerable <Symbol> s = null; DigitSequence d = DigitSequence.Produce(symbols.Skip(1), out s); if (d == null || s.Any()) { return(null); } return(new FractionalPart(new FullStop(), d)); } return(null); }