예제 #1
0
        private List <char> Check()
        {
            List <char> k = new List <char>();
            token       t;

            ind = 0;
            while (true)
            {
                try
                {
                    t = GetToken();
                    tokens.AddToken(t);
                }

                catch (Exception e)
                {
                    if (e.Message == "UnexpectedChar")
                    {
                        k.Add(str[ind - 1]);
                    }
                    else if (e.Message == "EOF")
                    {
                        break;
                    }
                }
            }
            ind = 0;
            return(k);
        }
예제 #2
0
        private TokenList SubList(int a, int b)
        {
            TokenList tok = new TokenList();

            for (int i = a; i <= b; i++)
            {
                tok.AddToken(tokens[i]);
            }
            return(tok);
        }