public QStr Str(char[] buffer, int start, int length) { return(QStr.Parse(buffer, start, length)); }
public SreExpr LiteralMatch(QStr str) { return new SreExpr { Node = new CatNode(str.Text.Select(ch => CharSetNode.Create(ch))) }; }
public IntSet Range(QStr charPairs) { var intervals = new List<IntInterval>(); string text = charPairs.Text; int len = text.Length; if (len % 2 != 0) { throw new Exception("Invalid range pairs."); } for (int i = 0; i < len; i+=2) { intervals.Add(new IntInterval(text[i], text[i + 1])); } var cset = IntSet.Ranges(intervals.ToArray()); return cset; }
public CSetSreExpr CharSet(QStr str) { return CSet(IntSet.Of(str.Text)); }