コード例 #1
0
        public void TestFindPattern() /*throws Exception*/
        {
            TreeWizard wiz       = new TreeWizard(adaptor, tokens);
            CommonTree t         = (CommonTree)wiz.Create("(A B C (A[foo] B[bar]) (D (A[big] B[dog])))");
            IList      subtrees  = wiz.Find(t, "(A B)");
            IList      elements  = subtrees;
            string     found     = elements.ToElementString();
            string     expecting = "[foo, big]";

            Assert.AreEqual(expecting, found);
        }