1
2
3
4 package net.sourceforge.pmd.lang.ecmascript.ast;
5
6 import org.mozilla.javascript.ast.LetNode;
7
8 public class ASTLetNode extends AbstractEcmascriptNode<LetNode> {
9 public ASTLetNode(LetNode letNode) {
10 super(letNode);
11 }
12
13
14
15
16 public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
17 return visitor.visit(this, data);
18 }
19
20 public ASTVariableDeclaration getVariables() {
21 return (ASTVariableDeclaration) jjtGetChild(0);
22 }
23
24 public boolean hasBody() {
25 return node.getBody() != null;
26 }
27
28 public EcmascriptNode getBody() {
29 if (hasBody()) {
30 return (EcmascriptNode) jjtGetChild(jjtGetNumChildren() - 1);
31 } else {
32 return null;
33 }
34 }
35 }