Package org.antlr.runtime.tree

Examples of org.antlr.runtime.tree.CommonTreeAdaptor


                    updateCurrentST(viewFrame);
                }
            }
        );

    JTreeASTModel astModel = new JTreeASTModel(new CommonTreeAdaptor(), currentScope.st.impl.ast);
    viewFrame.ast.setModel(astModel);
    viewFrame.ast.addTreeSelectionListener(
      new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
          TreePath path = treeSelectionEvent.getNewLeadSelectionPath();
View Full Code Here


    updateAttributes(currentScope, m);             // ATTRIBUTES
    m.bytecode.moveCaretPosition(0);
        m.bytecode.setText(currentScope.st.impl.disasm()); // BYTECODE DIS.
    m.template.moveCaretPosition(0);
    m.template.setText(currentScope.st.impl.template); // TEMPLATE SRC
    JTreeASTModel astModel = new JTreeASTModel(new CommonTreeAdaptor(), currentScope.st.impl.ast);
    viewFrame.ast.setModel(astModel);

    // highlight output text and, if {...} subtemplate, region in ST src
    // get last event for currentScope.st; it's the event that captures ST eval
    List<InterpEvent> events = currentScope.events;
View Full Code Here

        this.adaptor = adaptor;
        this.root = root;
    }

    public JTreeASTModel(Object root) {
        this.adaptor = new CommonTreeAdaptor();
        this.root = root;
    }
View Full Code Here

    r2.addChild(new CommonTree(new CommonToken(107)));
    r1.addChild(r2);
    r0.addChild(new CommonTree(new CommonToken(104)));
    r0.addChild(new CommonTree(new CommonToken(105)));

    CommonTree dup = (CommonTree)(new CommonTreeAdaptor()).dupTree(r0);

    assertNull(dup.parent);
    assertEquals(-1, dup.childIndex);
    dup.sanityCheckParentAndChildIndexes();
  }
View Full Code Here

    CommonTree oldRoot = new CommonTree((Token)null);
    oldRoot.addChild(new CommonTree(new CommonToken(101)));
    oldRoot.addChild(new CommonTree(new CommonToken(102)));
    oldRoot.addChild(new CommonTree(new CommonToken(103)));

    TreeAdaptor adaptor = new CommonTreeAdaptor();
    adaptor.becomeRoot(newRoot, oldRoot);
    newRoot.sanityCheckParentAndChildIndexes();
  }
View Full Code Here

    CommonTree oldRoot = new CommonTree(new CommonToken(101));
    oldRoot.addChild(new CommonTree(new CommonToken(102)));
    oldRoot.addChild(new CommonTree(new CommonToken(103)));

    TreeAdaptor adaptor = new CommonTreeAdaptor();
    adaptor.becomeRoot(newRoot, oldRoot);
    newRoot.sanityCheckParentAndChildIndexes();
  }
View Full Code Here

    CommonTree oldRoot = new CommonTree((Token)null);
    oldRoot.addChild(new CommonTree(new CommonToken(101)));
    oldRoot.addChild(new CommonTree(new CommonToken(102)));
    oldRoot.addChild(new CommonTree(new CommonToken(103)));

    TreeAdaptor adaptor = new CommonTreeAdaptor();
    adaptor.becomeRoot(newRoot, oldRoot);
    newRoot.sanityCheckParentAndChildIndexes();
  }
View Full Code Here

    CommonTree oldRoot = new CommonTree(new CommonToken(101));
    oldRoot.addChild(new CommonTree(new CommonToken(102)));
    oldRoot.addChild(new CommonTree(new CommonToken(103)));

    TreeAdaptor adaptor = new CommonTreeAdaptor();
    adaptor.becomeRoot(newRoot, oldRoot);
    newRoot.sanityCheckParentAndChildIndexes();
  }
View Full Code Here

        this.adaptor = adaptor;
        this.root = root;
    }

    public JTreeASTModel(Object root) {
        this.adaptor = new CommonTreeAdaptor();
        this.root = root;
    }
View Full Code Here

          }
                }
            }
        );

    JTreeASTModel astModel = new JTreeASTModel(new CommonTreeAdaptor(), currentScope.st.impl.ast);
    viewFrame.ast.setModel(astModel);
    viewFrame.ast.addTreeSelectionListener(
      new TreeSelectionListener() {
        @Override
        public void valueChanged(TreeSelectionEvent treeSelectionEvent) {
View Full Code Here

TOP

Related Classes of org.antlr.runtime.tree.CommonTreeAdaptor

Copyright © 2018 www.massapicom. 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.