Exemplo n.º 1
0
        public bool Parse(Accessibility accessibility, string str)
        {
            m_strSpec       = str;
            m_accessibility = accessibility;

            // Create a scanner
            StringScanner s = new StringScanner(str);

            // Parse target spec
            if (s.current != '.')
            {
                m_specTarget = new IdentifierSpec();
                if (!m_specTarget.Parse(s))
                {
                    return(false);
                }
            }

            // Parse member spec
            if (s.current == '.')
            {
                s.SkipForward(1);

                if (!s.eof)
                {
                    // Parse rhs
                    m_specMember = new IdentifierSpec();
                    if (!m_specMember.Parse(s))
                    {
                        return(false);
                    }
                }
            }
            else
            {
                if (m_specTarget != null)
                {
                    m_specNonMember = m_specTarget;
                    m_specTarget    = null;
                }
                else
                {
                    return(false);
                }
            }

            if (!s.eof)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        public bool Parse(Accessibility accessibility, string str)
        {
            m_strSpec = str;
            m_accessibility = accessibility;

            // Create a scanner
            StringScanner s = new StringScanner(str);

            // Parse target spec
            if (s.current != '.')
            {
                m_specTarget = new IdentifierSpec();
                if (!m_specTarget.Parse(s))
                    return false;
            }

            // Parse member spec
            if (s.current == '.')
            {
                s.SkipForward(1);

                if (!s.eof)
                {
                    // Parse rhs
                    m_specMember = new IdentifierSpec();
                    if (!m_specMember.Parse(s))
                        return false;
                }
            }
            else
            {
                if (m_specTarget != null)
                {
                    m_specNonMember = m_specTarget;
                    m_specTarget = null;
                }
                else
                    return false;
            }

            if (!s.eof)
                return false;

            return true;
        }