/** Visitor method: compute source positions for * a list of catch clauses in try statements. */ public SourceRange cspCatchers(List<JCCatch> trees) { if ((trees == null) || !(trees.nonEmpty())) return null; SourceRange list_sr = new SourceRange(); for (List<JCCatch> l = trees; l.nonEmpty(); l = l.tail) { list_sr.mergeWith(csp(l.head)); } positions.put(trees, list_sr); return list_sr; }
public void visitTypeArray(JCArrayTypeTree tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.elemtype)); result = sr; }
public void visitIndexed(JCArrayAccess tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.indexed)); sr.mergeWith(csp(tree.index)); result = sr; }
public void visitAssignop(JCAssignOp tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.lhs)); sr.mergeWith(csp(tree.rhs)); result = sr; }
public void visitCatch(JCCatch tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.param)); sr.mergeWith(csp(tree.body)); result = sr; }
public void visitTry(JCTry tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.body)); sr.mergeWith(cspCatchers(tree.catchers)); sr.mergeWith(csp(tree.finalizer)); result = sr; }
public void visitForLoop(JCForLoop tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.init)); sr.mergeWith(csp(tree.cond)); sr.mergeWith(csp(tree.step)); sr.mergeWith(csp(tree.body)); result = sr; }
public void visitSkip(JCSkip tree) { // endPos is the same as startPos for the empty statement SourceRange sr = new SourceRange(startPos(tree), startPos(tree)); result = sr; }
public void visitTypeParameter(JCTypeParameter tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.bounds)); result = sr; }
public void visitTypeArray(JCArrayTypeTree tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.elemtype)); result = sr; }
public void visitUnary(JCUnary tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.arg)); result = sr; }
public void visitNewArray(JCNewArray tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.elemtype)); sr.mergeWith(csp(tree.dims)); sr.mergeWith(csp(tree.elems)); result = sr; }
public void visitAssert(JCAssert tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.cond)); sr.mergeWith(csp(tree.detail)); result = sr; }
public void visitReturn(JCReturn tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.expr)); result = sr; }
public void visitConditional(JCConditional tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.cond)); sr.mergeWith(csp(tree.truepart)); sr.mergeWith(csp(tree.falsepart)); result = sr; }
public void visitCase(JCCase tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.pat)); sr.mergeWith(csp(tree.stats)); result = sr; }
public void visitSwitch(JCSwitch tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.selector)); sr.mergeWith(cspCases(tree.cases)); result = sr; }
public void visitForeachLoop(JCEnhancedForLoop tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.var)); sr.mergeWith(csp(tree.expr)); sr.mergeWith(csp(tree.body)); result = sr; }
public void visitWhileLoop(JCWhileLoop tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.cond)); sr.mergeWith(csp(tree.body)); result = sr; }
public void visitDoLoop(JCDoWhileLoop tree) { SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); sr.mergeWith(csp(tree.body)); sr.mergeWith(csp(tree.cond)); result = sr; }