public Piece RepeatRangeTimes(Piece atom, Integer minTimes, Integer maxTimes) { int min = minTimes.Value; int max = maxTimes.Value; return new Piece { Node = new RepeatNode(atom.Node, min, max) }; }
public Piece RepeatMinTimes(Piece atom, Integer minTimes) { int min = minTimes.Value; return new Piece { Node = new RepeatNode(atom.Node, min, int.MaxValue) }; }
public Piece RepeatTimes(Piece atom, Integer timesInteger) { int times = timesInteger.Value; return new Piece { Node = new RepeatNode(atom.Node, times, times) }; }
public Piece OneOrMore(Piece atom) { return new Piece { Node = RepeatNode.OneOrMore(atom.Node) }; }
public Piece ZeroOrMore(Piece atom) { return new Piece { Node = RepeatNode.ZeroOrMore(atom.Node) }; }
public Piece Optional(Piece atom) { return new Piece { Node = RepeatNode.Optional(atom.Node) }; }
public Branch Branch(Piece[] pieces) { return new Branch { Node = AstNode.Cat(pieces.Select(p => p.Node)) }; }