Esempio n. 1
0
 public QStr Str(char[] buffer, int start, int length)
 {
     return(QStr.Parse(buffer, start, length));
 }
Esempio n. 2
0
 public SreExpr LiteralMatch(QStr str)
 {
     return new SreExpr { Node = new CatNode(str.Text.Select(ch => CharSetNode.Create(ch))) };
 }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 public CSetSreExpr CharSet(QStr str)
 {
     return CSet(IntSet.Of(str.Text));
 }