MCPcopy Index your code
hub / github.com/antlr/codebuff / updateCurrentST

Method updateCurrentST

output/java8/1.4.12/STViz.java:292–328  ·  view source on GitHub ↗
(STViewFrame m)

Source from the content-addressed store, hash-verified

290 }
291
292 private void updateCurrentST(STViewFrame m) {
293// System.out.println("updateCurrentST(): currentScope.st="+currentScope.st);
294 // update all views according to currentScope.st
295 updateStack(currentScope, m); // STACK
296 updateAttributes(currentScope, m); // ATTRIBUTES
297 setText(m.bytecode, currentScope.st.impl.disasm()); // BYTECODE DIS.
298 setText(m.template, currentScope.st.impl.template); // TEMPLATE SRC
299 JTreeASTModel astModel = new JTreeASTModel(new CommonTreeAdaptor(), currentScope.st.impl.ast);
300 viewFrame.ast.setModel(astModel);
301
302 // highlight output text and, if {...} subtemplate, region in ST src
303 // get last event for currentScope.st; it's the event that captures ST eval
304 if ( currentEvent instanceof EvalExprEvent ) {
305 EvalExprEvent exprEvent = (EvalExprEvent)currentEvent;
306 highlight(m.output, exprEvent.outputStartChar, exprEvent.outputStopChar);
307 highlight(m.template, exprEvent.exprStartChar, exprEvent.exprStopChar);
308 }
309 else {
310 EvalTemplateEvent templateEvent;
311 if ( currentEvent instanceof EvalTemplateEvent ) {
312 templateEvent = (EvalTemplateEvent)currentEvent;
313 }
314 else {
315 List<InterpEvent> events = currentScope.events;
316 templateEvent = (EvalTemplateEvent)events.get(events.size()-1);
317 }
318 if ( templateEvent!=null ) {
319 highlight(m.output, templateEvent.outputStartChar, templateEvent.outputStopChar);
320 }
321 if ( currentScope.st.isAnonSubtemplate() ) {
322 Interval r = currentScope.st.impl.getTemplateRange();
323 //System.out.println("currentScope.st src range="+r);
324 //m.template.moveCaretPosition(r.a);
325 highlight(m.template, r.a, r.b);
326 }
327 }
328 }
329
330 protected void setText(JEditorPane component, String text) {
331 List<Integer> windowsLineEndingsList = new ArrayList<Integer>();

Callers 2

valueChangedMethod · 0.95
caretUpdateMethod · 0.95

Calls 9

updateStackMethod · 0.95
updateAttributesMethod · 0.95
setTextMethod · 0.95
highlightMethod · 0.95
getMethod · 0.65
sizeMethod · 0.65
disasmMethod · 0.45
isAnonSubtemplateMethod · 0.45
getTemplateRangeMethod · 0.45

Tested by

no test coverage detected