Analyze() 공개 메소드

Analyze the text. Fills the error and token lists.
public Analyze ( ) : void
리턴 void
예제 #1
0
        public void Analyze_OK01()
        {
            const string text = "  service test\r\n  {\r\n rpc test1 (test2) returns (test3);\r\n}\r\n";

              var lex = new Lexer(text);

              lex.Analyze();

              Assert.AreEqual(7, lex.Tokens.Count);
              Assert.AreEqual(0, lex.Errors.Count);
              Assert.AreEqual(18, lex.Index);
        }
예제 #2
0
        public void Analyze_NOK01()
        {
            const string text = "\r\n  service test\r\n  {\r\n rpx test1 (test2) returns (test3);\r\n}\r\n" + // rpx instead of rpc
                          "  service test\r\n  {\r\n rpc test1 (test2) returns (test3);\r\n}\r\n";

              var lex = new Lexer(text);

              lex.Analyze();

              Assert.AreEqual(9, lex.Tokens.Count);
              Assert.AreEqual(11, lex.Errors.Count);
              Assert.AreEqual(37, lex.Index);
        }