MCPcopy Create free account
hub / github.com/antlr/codebuff / updateCurrentST

Method updateCurrentST

output/java/1.4.19/STViz.java:293–331  ·  view source on GitHub ↗
(STViewFrame m)

Source from the content-addressed store, hash-verified

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