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

Method updateCurrentST

output/java8/1.4.17/STViz.java:294–332  ·  view source on GitHub ↗
(STViewFrame m)

Source from the content-addressed store, hash-verified

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