title: Using Rhino's Javascript parser, how to get the comments?
body: <p>I have some javascript files and parse it using Rhino's javascript parser.</p>
  
  <p>but I can't get the comments.</p>
  
  <p>How can I get the comments?</p>
  
  <p>here's a part of my code.</p>
  
  <p>run this code, "comment" variable has null.
  also, while running "astRoot.toSource();", it shows only javascript code. no comment included. it disappeared!</p>
  
  <p>[java code]</p>
  
  <pre><code>public void parser() {
      AstRoot astRoot = new Parser().parse(this.jsString, this.uri, 1);
  
      List&lt;AstNode&gt; statList = astRoot.getStatements();
      for(Iterator&lt;AstNode&gt; iter = statList.iterator(); iter.hasNext();) {
          FunctionNode fNode = (FunctionNode)iter.next();
  
          System.out.println("*** function Name : " + fNode.getName() + ", paramCount : " + fNode.getParamCount() + ", depth : " + fNode.depth());
  
          AstNode bNode = fNode.getBody();
          Block block = (Block)bNode;
          visitBody(block);
      }
  
      System.out.println(astRoot.toSource());
      SortedSet&lt;Comment&gt; comment = astRoot.getComments();
      if(comment == null)
          System.out.println("comment is null");
  }
  </code></pre>