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

Method updateCurrentST

output/java/1.4.14/STViz.java:291–329  ·  view source on GitHub ↗
(STViewFrame m)

Source from the content-addressed store, hash-verified

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