Lines Matching refs:node
265 /** Get the start position for a tree node. The start position is
267 * token of the node's source text.
268 * @param tree The tree node
293 JCClassDecl node = (JCClassDecl)tree;
294 if (node.mods.pos != Position.NOPOS)
295 return node.mods.pos;
305 JCMethodDecl node = (JCMethodDecl)tree;
306 if (node.mods.pos != Position.NOPOS)
307 return node.mods.pos;
308 if (node.typarams.nonEmpty()) // List.nil() used for no typarams
309 return getStartPos(node.typarams.head);
310 return node.restype == null ? node.pos : getStartPos(node.restype);
324 JCNewClass node = (JCNewClass)tree;
325 if (node.encl != null)
326 return getStartPos(node.encl);
330 JCVariableDecl node = (JCVariableDecl)tree;
331 if (node.mods.pos != Position.NOPOS) {
332 return node.mods.pos;
334 return getStartPos(node.vartype);
338 JCErroneous node = (JCErroneous)tree;
339 if (node.errs != null && node.errs.nonEmpty())
340 return getStartPos(node.errs.head);
386 JCIf node = (JCIf)tree;
387 if (node.elsepart == null) {
388 return getEndPos(node.thenpart, endPositions);
390 return getEndPos(node.elsepart, endPositions);
402 JCTry node = (JCTry)tree;
403 if (node.finalizer != null) {
404 return getEndPos(node.finalizer, endPositions);
405 } else if (!node.catchers.isEmpty()) {
406 return getEndPos(node.catchers.last(), endPositions);
408 return getEndPos(node.body, endPositions);
427 JCErroneous node = (JCErroneous)tree;
428 if (node.errs != null && node.errs.nonEmpty())
429 return getEndPos(node.errs.last(), endPositions);
515 public static Env<AttrContext> scopeFor(JCTree node, JCCompilationUnit unit) {
516 return scopeFor(pathFor(node, unit));
524 public static List<JCTree> pathFor(final JCTree node, final JCCompilationUnit unit) {
537 if (tree == node)
627 public static Symbol symbolFor(JCTree node) {
628 node = skipParens(node);
629 switch (node.getTag()) {
631 return ((JCClassDecl) node).sym;
633 return ((JCMethodDecl) node).sym;
635 return ((JCVariableDecl) node).sym;
641 public static boolean isDeclaration(JCTree node) {
642 node = skipParens(node);
643 switch (node.getTag()) {