Esempio n. 1
0
 public Start(IReadOnlyList <IOrType <IToken, ISetUp> > allTokens, ElementMatchingContext context, int currentIndex)
 {
     AllTokens  = allTokens ?? throw new ArgumentNullException(nameof(allTokens));
     Context    = context ?? throw new ArgumentNullException(nameof(context));
     StartIndex = currentIndex;
     EndIndex   = currentIndex;
 }
Esempio n. 2
0
 public Matched(IReadOnlyList <IOrType <IToken, ISetUp> > allTokens, ElementMatchingContext context, T value, int startIndex, int endIndex)
 {
     AllTokens  = allTokens ?? throw new ArgumentNullException(nameof(allTokens));
     Context    = context ?? throw new ArgumentNullException(nameof(context));
     Value      = value;
     EndIndex   = endIndex;
     StartIndex = startIndex;
 }
Esempio n. 3
0
 // TODO this should not take tokens
 // and we should protect the tokens from being accessed on non-matched entries
 // I want to encode tokens and matchedness in the type
 // this is going to be a few types and interfaces with this static class that creates the real private inner classes
 public static ITokenMatching <T> MakeNotMatch(ElementMatchingContext context)
 {
     return(new NotMatched(context));
 }
Esempio n. 4
0
 public static IMatchedTokenMatching <T> MakeMatch(IReadOnlyList <IToken> tokens, ElementMatchingContext context, T value)
 {
     return(new Matched(tokens, context, value));
 }
Esempio n. 5
0
 public static IMatchedTokenMatching <T> MakeStart(IReadOnlyList <IToken> tokens, ElementMatchingContext context)
 {
     return(new Matched(tokens, context, default));
 }
Esempio n. 6
0
 public NotMatched(ElementMatchingContext context)
 {
     Context = context ?? throw new ArgumentNullException(nameof(context));
 }
Esempio n. 7
0
 public Matched(IReadOnlyList <IToken> tokens, ElementMatchingContext context, T value)
 {
     Tokens  = tokens ?? throw new ArgumentNullException(nameof(tokens));
     Context = context ?? throw new ArgumentNullException(nameof(context));
     Value   = value;
 }
Esempio n. 8
0
 public static IMatchedTokenMatching MakeStart(IReadOnlyList <IOrType <IToken, ISetUp> > tokens, ElementMatchingContext context, int currentIndex)
 {
     return(new Start(tokens, context, currentIndex));
 }