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