public AtLeastOnceUntilParser(Parser <TToken, T> parser, Parser <TToken, U> terminator, bool keepResults) : base(ExpectedUtil.Concat(parser.Expected, terminator.Expected)) { _parser = parser; _terminator = terminator; _round2Expected = ExpectedUtil.Union(parser.Expected, terminator.Expected); _keepResults = keepResults; }
public Map1Parser( Func <T1, R> func, Parser <TToken, T1> parser1 ) : base(ExpectedUtil.Concat(parser1.Expected)) { _func = func; _p1 = parser1; }
public Map2Parser( Func <T1, T2, R> func, Parser <TToken, T1> parser1, Parser <TToken, T2> parser2 ) : base(ExpectedUtil.Concat(parser1.Expected, parser2.Expected)) { _func = func; _p1 = parser1; _p2 = parser2; }
public Map3Parser( Func <T1, T2, T3, R> func, Parser <TToken, T1> parser1, Parser <TToken, T2> parser2, Parser <TToken, T3> parser3 ) : base(ExpectedUtil.Concat(parser1.Expected, parser2.Expected, parser3.Expected)) { _func = func; _p1 = parser1; _p2 = parser2; _p3 = parser3; }
public Map5Parser( Func <T1, T2, T3, T4, T5, R> func, Parser <TToken, T1> parser1, Parser <TToken, T2> parser2, Parser <TToken, T3> parser3, Parser <TToken, T4> parser4, Parser <TToken, T5> parser5 ) : base(ExpectedUtil.Concat(parser1.Expected, parser2.Expected, parser3.Expected, parser4.Expected, parser5.Expected)) { _func = func; _p1 = parser1; _p2 = parser2; _p3 = parser3; _p4 = parser4; _p5 = parser5; }
public Map7Parser( Func <T1, T2, T3, T4, T5, T6, T7, R> func, Parser <TToken, T1> parser1, Parser <TToken, T2> parser2, Parser <TToken, T3> parser3, Parser <TToken, T4> parser4, Parser <TToken, T5> parser5, Parser <TToken, T6> parser6, Parser <TToken, T7> parser7 ) : base(ExpectedUtil.Concat(parser1.Expected, parser2.Expected, parser3.Expected, parser4.Expected, parser5.Expected, parser6.Expected, parser7.Expected)) { _func = func; _p1 = parser1; _p2 = parser2; _p3 = parser3; _p4 = parser4; _p5 = parser5; _p6 = parser6; _p7 = parser7; }
private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected() => ExpectedUtil.Concat(_parser.Expected, _terminator.Expected);
public RepeatStringParser(Parser <TToken, char> parser, int count) : base(ExpectedUtil.Concat(Enumerable.Repeat(parser.Expected, count))) { _parser = parser; _count = count; }
public SequenceParser(IEnumerable <Parser <TToken, T> > parsers) : base(ExpectedUtil.Concat(parsers.Select(p => p.Expected))) { _parsers = parsers.ToList(); }
private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected() => ExpectedUtil.Concat(Enumerable.Repeat(_parser.Expected, _count));
public OneOfParser(List <Parser <TToken, T> > parsers) : base(ExpectedUtil.Union(parsers.Select(p => p.Expected))) { _parsers = parsers; }
private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected() => ExpectedUtil.Union(_parsers.Select(p => p.Expected));
private OneOfParser(Parser <TToken, T>[] parsers) : base(ExpectedUtil.Union(parsers.Select(p => p.Expected))) { _parsers = parsers; }
public SequenceParser(Parser <TToken, T>[] parsers) : base(ExpectedUtil.Concat(parsers.Select(p => p.Expected))) { _parsers = parsers; }
private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected() => ExpectedUtil.Concat(_p1.Expected, _p2.Expected, _p3.Expected, _p4.Expected, _p5.Expected, _p6.Expected, _p7.Expected);