Java 类org.antlr.runtime.tree.CommonTreeAdaptor 实例源码

项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if ( currentEvent instanceof EvalExprEvent ) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if ( currentEvent instanceof EvalTemplateEvent ) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
            }
            if ( templateEvent!=null ) {
                highlight(m.output,
                          templateEvent.outputStartChar,
                          templateEvent.outputStopChar);
            }
            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:codebuff    文件:STViz.java   
private void updateCurrentST(STViewFrame m) {
//      System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
        // update all views according to currentScope.st
        updateStack(currentScope, m);                      // STACK
        updateAttributes(currentScope, m);                 // ATTRIBUTES
        setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
        setText(m.template, 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
        if (currentEvent instanceof EvalExprEvent) {
            EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
            highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
            highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
        }
        else {
            EvalTemplateEvent templateEvent;
            if (currentEvent instanceof EvalTemplateEvent) {
                templateEvent = (EvalTemplateEvent)currentEvent;
            }
            else {
                List<InterpEvent> events = currentScope.events;
                templateEvent = (EvalTemplateEvent)events.get(events.size() - 1);
            }

            if (templateEvent != null) {
                highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar);
            }

            if ( currentScope.st.isAnonSubtemplate() ) {
                Interval r = currentScope.st.impl.getTemplateRange();
                //System.out.println("currentScope.st src range="+r);
                //m.template.moveCaretPosition(r.a);
                highlight(m.template, r.a, r.b);
            }
        }
    }
项目:goworks    文件:CompiledModelParser.java   
private TemplateGroupRuleReturnScope buildAstForGroupTemplates(TemplateGroupWrapper group) {
    TreeAdaptor adaptor = new CommonTreeAdaptor();
    Object tree = adaptor.nil();
    for (CompiledST template : group.getCompiledTemplates()) {
        adaptor.addChild(tree, template.ast);
    }

    return new TemplateGroupRuleReturnScope(group, (CommonTree)tree);
}
项目:antlrworks2    文件:CompiledModelParser.java   
private TemplateGroupRuleReturnScope buildAstForGroupTemplates(TemplateGroupWrapper group) {
    TreeAdaptor adaptor = new CommonTreeAdaptor();
    Object tree = adaptor.nil();
    for (CompiledST template : group.getCompiledTemplates()) {
        adaptor.addChild(tree, template.ast);
    }

    return new TemplateGroupRuleReturnScope(group, (CommonTree)tree);
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}
项目:codebuff    文件:JTreeASTModel.java   
public JTreeASTModel(Object root) {
    this.adaptor = new CommonTreeAdaptor();
    this.root = root;
}