Exemplo n.º 1
0
        public void Keyword()
        {
            string [] identifiers = new string[] {
                "a.d",
                "a-d",
                "a.d",
                "a\\d",
                "a_d",
                "_ad",
                "ad5"
            };

            for (int i = 0; i < identifiers.Length; i++)
            {
                string identifier = identifiers[i];

                ExpressionTokenizer et = new ExpressionTokenizer();
                et.InitTokenizer(identifier);
                Assert.AreEqual(identifier, et.TokenText, "#A1");
                Assert.AreEqual(ExpressionTokenizer.TokenType.Keyword, et.CurrentToken, "#A2:" + identifier);
                et.GetNextToken();
                Assert.AreEqual(identifier, et.TokenText, "#B1");
                Assert.AreEqual(ExpressionTokenizer.TokenType.EOF, et.CurrentToken, "#B2:" + identifier);
            }
        }