private static Interval <int> CreateRange(PrimitiveMatchEntry operandMatch) { return(operandMatch switch { RangeMatchEntry rangeMatch => rangeMatch.IntRange, SingleMatchEntry singleMatch => CreateRange(singleMatch.Operand, singleMatch.Operand), _ => throw new InvalidOperationException() });
private static char GetMinChar(PrimitiveMatchEntry entry) { if (entry is RangeEntry range) { return(range.First); } return(((CharEntry)entry).Char); }
protected QuantifierEntry ZeroOrMore(PrimitiveMatchEntry match) { return(new QuantifierEntry(match, QuantifierKind.ZeroOrMore, QuantifierMode.Greedy)); }
protected QuantifierEntry Exact(int count, PrimitiveMatchEntry match) { return(new QuantifierEntry(match, QuantifierHelper.Exact(count), QuantifierMode.Greedy)); }
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]; }