View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.lang.ecmascript.ast;
5   
6   import org.mozilla.javascript.ast.FunctionCall;
7   
8   public class ASTFunctionCall extends AbstractEcmascriptNode<FunctionCall> {
9       public ASTFunctionCall(FunctionCall functionCall) {
10  	super(functionCall);
11      }
12  
13      /**
14       * Accept the visitor.
15       */
16      public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
17  	return visitor.visit(this, data);
18      }
19  
20      public EcmascriptNode getTarget() {
21  	return (EcmascriptNode) jjtGetChild(0);
22      }
23  
24      public int getNumArguments() {
25  	return node.getArguments().size();
26      }
27  
28      public EcmascriptNode getArgument(int index) {
29  	return (EcmascriptNode) jjtGetChild(index + 1);
30      }
31  
32      public boolean hasArguments() {
33  	return getNumArguments() != 0;
34      }
35  }