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.LabeledStatement;
    7
    8   public class ASTLabeledStatement extends AbstractEcmascriptNode<LabeledStatement> {
    9       public ASTLabeledStatement(LabeledStatement labeledStatement) {
    10  	super(labeledStatement);
    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 int getNumLabels() {
    21  	return node.getLabels().size();
    22      }
    23
    24      public ASTLabel getLabel(int index) {
    25  	return (ASTLabel) jjtGetChild(index);
    26      }
    27
    28      public EcmascriptNode getStatement() {
    29  	return (EcmascriptNode) jjtGetChild(jjtGetNumChildren() - 1);
    30      }
    31  }