示例#1
0
        public void findKeyword(SSLexLexeme z_lexeme)
        {
            var num1 = 0;
            var num2 = this.m_keyTables[0].m_keys.Length;

            while (num2 > num1)
            {
                var index = num1 + (num2 - num1) / 2;
                var key   = this.m_keyTables[0].m_keys[index];
                var str   = new string(value : z_lexeme.lexeme());
                var num3  = this.m_keyTables[0].m_index[index * 3 + 1] != 1 ? str.CompareTo(strB: key) : str.ToLower().CompareTo(strB: key);
                if (num3 < 0)
                {
                    if (num1 == index)
                    {
                        break;
                    }
                    num2 = index;
                }
                else
                {
                    if (num3 == 0)
                    {
                        z_lexeme.setToken(q_token: this.m_keyTables[0].m_index[index * 3]);
                        break;
                    }

                    if (num2 == index + 1)
                    {
                        break;
                    }
                    num1 = index;
                }
            }
        }
示例#2
0
        public SSLexLexeme remove()
        {
            SSLexLexeme ssLexLexeme = null;

            if (Count != 0)
            {
                ssLexLexeme = (SSLexLexeme)Dequeue();
            }
            return(ssLexLexeme);
        }