private static Interval <int> CreateRange(PrimitiveMatchEntry operandMatch)
 {
     return(operandMatch switch
     {
         RangeMatchEntry rangeMatch => rangeMatch.IntRange,
         SingleMatchEntry singleMatch => CreateRange(singleMatch.Operand, singleMatch.Operand),
         _ => throw new InvalidOperationException()
     });
Beispiel #2
0
        private static char GetMinChar(PrimitiveMatchEntry entry)
        {
            if (entry is RangeEntry range)
            {
                return(range.First);
            }

            return(((CharEntry)entry).Char);
        }
Beispiel #3
0
 protected QuantifierEntry ZeroOrMore(PrimitiveMatchEntry match)
 {
     return(new QuantifierEntry(match, QuantifierKind.ZeroOrMore, QuantifierMode.Greedy));
 }
Beispiel #4
0
 protected QuantifierEntry Exact(int count, PrimitiveMatchEntry match)
 {
     return(new QuantifierEntry(match, QuantifierHelper.Exact(count), QuantifierMode.Greedy));
 }
Beispiel #5
0
 protected QuantifierEntry Between(int from, int to, PrimitiveMatchEntry match)
 {
     return(new QuantifierEntry(match, QuantifierHelper.Between(from, to), QuantifierMode.Greedy));
 }
 public GroupExecutionPathData(PrimitiveMatchEntry match, ExecutionPath path)
 {
     Match = match;
     Path  = path;
 }
 public ExecutionPathGroup(PrimitiveMatchEntry match, IEnumerable <ExecutionPath> executionPaths)
 {
     Match          = match;
     ExecutionPaths = BuildPathArray(executionPaths);
 }
 public ExecutionPathGroup(TOperand operand, IEnumerable <ExecutionPath> executionPaths)
 {
     Match          = new SingleMatchEntry(operand);
     ExecutionPaths = BuildPathArray(executionPaths);
 }
 private ExecutionPathGroup()
 {
     Match          = null;
     ExecutionPaths = new ExecutionPath[0];
 }