Examples of toStringTree()


Examples of antlr.CommonAST.toStringTree()

     
    }

    CommonAST ast = (CommonAST)parser.getAST();
    if (ast != null)
      System.out.println(ast.toStringTree());
    else
      System.out.println("nothing returned");
   
  }
}
View Full Code Here

Examples of antlr.collections.AST.toStringTree()

        InputStream stream = new FileInputStream(env.get(ToolCorbaConstants.CFG_IDLFILE).toString());
        IDLParser parser = new IDLParser(new IDLLexer(stream));
        parser.specification();
        AST idlTree = parser.getAST();

        System.out.println(idlTree.toStringTree());
       
        Object obj = env.get(ToolConstants.CFG_OUTPUTDIR);
        String outputDir = ".";
        if (obj != null) {
            outputDir = obj.toString();
View Full Code Here

Examples of antlr.collections.AST.toStringTree()

    parser.setFilter( false );
    parser.statement();
    AST ast = parser.getAST();

    if ( logging ) {
      System.out.println( "AST  :  " + ast.toStringTree() + "" );
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      parser.showAst( ast, new PrintStream( baos ) );
      System.out.println( baos.toString() );
    }
View Full Code Here

Examples of com.google.javascript.rhino.Node.toStringTree()

    List<DiGraphNode<Node, Branch>> cfgNodes =
        Ordering.from(cfg.getOptionalNodeComparator(true)).sortedCopy(cfg.getDirectedGraphNodes());

    // IMPLICIT RETURN must always be last.
    Node implicitReturn = cfgNodes.remove(cfgNodes.size() - 1).getValue();
    assertNull(implicitReturn == null ? "null" : implicitReturn.toStringTree(),
        implicitReturn);

    assertEquals("Wrong number of CFG nodes",
        nodeTypes.size(), cfgNodes.size());
    for (int i = 0; i < cfgNodes.size(); i++) {
View Full Code Here

Examples of com.google.javascript.rhino.Node.toStringTree()

              parentClass = typeParser.getNominalType(
                      docNode, ownerType, parentScope, typeParameters);
              if (parentClass == null) {
                warnings.add(JSError.make(
                    declNode, EXTENDS_NON_OBJECT, functionName,
                    docNode.toStringTree()));
              } else if (parentClass.isInterface()) {
                warnings.add(JSError.make(
                    declNode, TypeCheck.CONFLICTING_EXTENDED_TYPE,
                    "constructor", functionName));
                parentClass = null;
View Full Code Here

Examples of com.google.javascript.rhino.Node.toStringTree()

    if (!negativeResult.isEquivalentTo(negativeNode)) {
      fail("Not equal:" +
          "\nExpected: " + negative +
          "\nBut was : " + (new Compiler()).toSource(negativeResult) +
          "\nExpected tree:\n" + negativeNode.toStringTree() +
          "\nActual tree:\n" + negativeResult.toStringTree());
    }
  }

  public void testTryMinimizeCondSimple() {
    minCond("x", "x", "x");
View Full Code Here

Examples of org.antlr.runtime.tree.CommonTree.toStringTree()

        ANTLRv3Lexer lex = new ANTLRv3Lexer(input);
        tokens = new TokenRewriteStream(lex);
        ANTLRv3Parser g = new ANTLRv3Parser(tokens);
        ANTLRv3Parser.grammarDef_return r = g.grammarDef();
        CommonTree t = r.getTree();
        if (tree_option) System.out.println(t.toStringTree());
        rewrite(g.getTreeAdaptor(),t,g.getTokenNames());
    }

    public void rewrite(TreeAdaptor adaptor, CommonTree t, String[] tokenNames) throws Exception {
        TreeWizard wiz = new TreeWizard(adaptor, tokenNames);
View Full Code Here

Examples of org.antlr.runtime.tree.CommonTree.toStringTree()

  protected static final TreeAdaptor adaptor = new CommonTreeAdaptor();

  @Test public void testSingleNode() throws Exception {
    TreeWizard wiz = new TreeWizard(adaptor, tokens);
    CommonTree t = (CommonTree)wiz.create("ID");
    String found = t.toStringTree();
    String expecting = "ID";
    assertEquals(expecting, found);
  }

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

Examples of org.antlr.runtime.tree.CommonTree.toStringTree()

  }

  @Test public void testSingleNodeWithArg() throws Exception {
    TreeWizard wiz = new TreeWizard(adaptor, tokens);
    CommonTree t = (CommonTree)wiz.create("ID[foo]");
    String found = t.toStringTree();
    String expecting = "foo";
    assertEquals(expecting, found);
  }

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

Examples of org.antlr.runtime.tree.CommonTree.toStringTree()

  }

  @Test public void testSingleNodeTree() throws Exception {
    TreeWizard wiz = new TreeWizard(adaptor, tokens);
    CommonTree t = (CommonTree)wiz.create("(A)");
    String found = t.toStringTree();
    String expecting = "A";
    assertEquals(expecting, found);
  }

  @Test public void testSingleLevelTree() throws Exception {
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.