Package org.antlr.runtime.tree

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


  }

  @Test public void testEqualsWithText() throws Exception {
    TreeWizard wiz = new TreeWizard(adaptor, tokens);
    CommonTree t1 = (CommonTree)wiz.create("(A B[foo] C)");
    CommonTree t2 = (CommonTree)wiz.create("(A B[foo] C)");
    boolean same = TreeWizard.equals(t1, t2, adaptor);
    assertTrue(same);
  }
 
  @Test public void testEqualsWithMismatchedText() throws Exception {
View Full Code Here


    assertTrue(same);
  }
 
  @Test public void testEqualsWithMismatchedText() throws Exception {
    TreeWizard wiz = new TreeWizard(adaptor, tokens);
    CommonTree t1 = (CommonTree)wiz.create("(A B[foo] C)");
    CommonTree t2 = (CommonTree)wiz.create("(A B C)");
    boolean same = TreeWizard.equals(t1, t2, adaptor);
    assertTrue(!same);
  }
View Full Code Here

  }
 
  @Test public void testEqualsWithMismatchedText() throws Exception {
    TreeWizard wiz = new TreeWizard(adaptor, tokens);
    CommonTree t1 = (CommonTree)wiz.create("(A B[foo] C)");
    CommonTree t2 = (CommonTree)wiz.create("(A B C)");
    boolean same = TreeWizard.equals(t1, t2, adaptor);
    assertTrue(!same);
  }

  @Test public void testFindPattern() throws Exception {
View Full Code Here

    assertTrue(!same);
  }

  @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

  }

  public static ASTNode buildASTNode(String colName)
  {
    TreeWizard tw = new TreeWizard(adaptor, Windowing2Parser.tokenNames);
    Object o = tw.create(sprintf("(TABLEORCOL Identifier[%s])", colName));
    return (ASTNode) o;
  }

  public static void validateComparable(ObjectInspector OI, String errMsg)
      throws WindowingException
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.