Exemplo n.º 1
0
        private RegExp ParseUnionExp()
        {
            RegExp e = this.ParseInterExp();

            if (this.Match('|'))
            {
                e = RegExp.MakeUnion(e, this.ParseUnionExp());
            }

            return(e);
        }
Exemplo n.º 2
0
        private RegExp ParseCharClasses()
        {
            RegExp e = this.ParseCharClass();

            while (this.More() && !this.Peek("]"))
            {
                e = RegExp.MakeUnion(e, this.ParseCharClass());
            }

            return(e);
        }
Exemplo n.º 3
0
        private RegExp ParseCharClass()
        {
            char @char = this.ParseCharExp();

            if (this.Match('-'))
            {
                if (this.Peek("]"))
                {
                    return(RegExp.MakeUnion(RegExp.MakeChar(@char), RegExp.MakeChar('-')));
                }

                return(RegExp.MakeCharRange(@char, this.ParseCharExp()));
            }

            return(RegExp.MakeChar(@char));
        }