01: package org.acm.seguin.refactor.method;
02:
03: import net.sourceforge.jrefactory.ast.ASTMethodDeclaration;
04: import net.sourceforge.jrefactory.ast.ASTBlock;
05: import net.sourceforge.jrefactory.ast.Node;
06:
07: class EMDigger {
08: Node dig(ASTMethodDeclaration start) {
09: ASTBlock block = (ASTBlock) start.jjtGetChild(start
10: .jjtGetNumChildren() - 1);
11: Node current = block.jjtGetFirstChild();
12: while (current.jjtGetNumChildren() == 1) {
13: current = current.jjtGetFirstChild();
14: }
15: return current;
16: }
17:
18: Node last(ASTMethodDeclaration start) {
19: ASTBlock block = (ASTBlock) start.jjtGetChild(start
20: .jjtGetNumChildren() - 1);
21: return block;
22: }
23: }
|