Exemple #1
0
        static char ReadCharCharCode(RegExpPokeableReader reader, int digitsWanted)
        {
            string s = string.Empty;

            for (int i = 0; i < digitsWanted; i++)
            {
                int num2 = reader.Read();
                if (num2 == -1)
                {
                    break;
                }
                s = s + ((char)num2);
            }
            return((char)int.Parse(s, NumberStyles.HexNumber));
        }
Exemple #2
0
        static string ReadUnicodeCategoryName(RegExpPokeableReader reader)
        {
            if (reader.Read() != 0x7b)
            {
                throw new ArgumentException(@"Incorrect mask: '{' expected after '\p' or '\P'");
            }
            string str = string.Empty;

            while (true)
            {
                int num = reader.Read();
                switch (num)
                {
                case -1:
                    throw new ArgumentException(@"Incorrect mask: '}' expected after '\p{unicode_category_name' or '\P{unicode_category_name'");

                case 0x7d:
                    return(str);
                }
                str = str + ((char)num);
            }
        }
Exemple #3
0
 public RegExpYylex(TextReader reader, CultureInfo parseCulture)
 {
     this._reader       = new RegExpPokeableReader(reader);
     this._parseCulture = parseCulture;
 }