QUT.Gplex.Parser.AAST.ReParser.Primary C# (CSharp) Method

Primary() private method

private Primary ( ) : RegExTree
return RegExTree
            internal RegExTree Primary()
            {
                RegExTree tmp;
                Unary     pls;
                if (!esc && chr == '"')
                    tmp = LitString();
                else if (!esc && chr == '(')
                {
                    scan();
                    tmp = Term();
                    checkAndScan(')');
                }
                else
                    tmp = Primitive();

                if (!esc && chr == '*')
                {
                    scan();
                    tmp = new Unary(RegOp.closure, tmp);
                }
                else if (!esc && chr == '+')
                {
                    pls = new Unary(RegOp.closure, tmp);
                    pls.minRep = 1;
                    scan();
                    tmp = pls;
                }
                else if (!esc && chr == '?')
                {
                    pls = new Unary(RegOp.finiteRep, tmp);
                    pls.minRep = 0;
                    pls.maxRep = 1;
                    scan();
                    tmp = pls;
                }
                else if (!esc && chr == '{' && Char.IsDigit(peek()))
                {
                    pls = new Unary(RegOp.finiteRep, tmp);
                    GetRepetitions(pls);
                    tmp = pls;
                }
                return tmp;
            }