View Javadoc

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