ASTFunctionCall.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.ecmascript.ast;
05 
06 import org.mozilla.javascript.ast.FunctionCall;
07 
08 public class ASTFunctionCall extends AbstractEcmascriptNode<FunctionCall> {
09     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 (EcmascriptNodejjtGetChild(0);
22     }
23 
24     public int getNumArguments() {
25   return node.getArguments().size();
26     }
27 
28     public EcmascriptNode getArgument(int index) {
29   return (EcmascriptNodejjtGetChild(index + 1);
30     }
31 
32     public boolean hasArguments() {
33   return getNumArguments() != 0;
34     }
35 }