Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.TreeWizard.find()


  }

  @Test 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])))");
    final List<? extends Object> subtrees = wiz.find(t, "(A B)");
    List<? extends Object> elements = subtrees;
    String found = elements.toString();
    String expecting = "[foo, big]";
    assertEquals(expecting, found);
  }
View Full Code Here


  }

  @Test 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])))");
    final List subtrees = wiz.find(t, "(A B)");
    List elements = subtrees;
    String found = elements.toString();
    String expecting = "[foo, big]";
    assertEquals(expecting, found);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.