Exemplo n.º 1
0
 public Map1Parser(
     Func <T1, R> func,
     Parser <TToken, T1> parser1
     ) : base(ExpectedUtil.Concat(parser1.Expected))
 {
     _func = func;
     _p1   = parser1;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
 private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected()
 => ExpectedUtil.Concat(_parser.Expected, _terminator.Expected);
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 8
0
 public RepeatStringParser(Parser <TToken, char> parser, int count) : base(ExpectedUtil.Concat(Enumerable.Repeat(parser.Expected, count)))
 {
     _parser = parser;
     _count  = count;
 }
Exemplo n.º 9
0
 public SequenceParser(IEnumerable <Parser <TToken, T> > parsers) : base(ExpectedUtil.Concat(parsers.Select(p => p.Expected)))
 {
     _parsers = parsers.ToList();
 }
Exemplo n.º 10
0
 private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected()
 => ExpectedUtil.Concat(Enumerable.Repeat(_parser.Expected, _count));
Exemplo n.º 11
0
 public SequenceParser(Parser <TToken, T>[] parsers) : base(ExpectedUtil.Concat(parsers.Select(p => p.Expected)))
 {
     _parsers = parsers;
 }
Exemplo n.º 12
0
 private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected()
 => ExpectedUtil.Concat(_p1.Expected, _p2.Expected, _p3.Expected, _p4.Expected, _p5.Expected, _p6.Expected, _p7.Expected);
Exemplo n.º 13
0
 private protected override ImmutableSortedSet <Expected <TToken> > CalculateExpected()
 => ExpectedUtil.Concat(_parsers.Select(p => p.Expected));