ASTAstRoot.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.AstRoot;
07 
08 public class ASTAstRoot extends AbstractEcmascriptNode<AstRoot> {
09     public ASTAstRoot(AstRoot astRoot) {
10   super(astRoot);
11     }
12 
13     /**
14      * Accept the visitor.
15      */
16     @Override
17     public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
18   return visitor.visit(this, data);
19     }
20 
21     public int getNumComments() {
22   return node.getComments() != null ? node.getComments().size() 0;
23     }
24 
25     public ASTComment getComment(int index) {
26   return (ASTCommentjjtGetChild(jjtGetNumChildren() - getNumComments() + index);
27     }
28 }