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.SwitchStatement;
07
08 public class ASTSwitchStatement extends AbstractEcmascriptNode<SwitchStatement> {
09 public ASTSwitchStatement(SwitchStatement switchStatement) {
10 super(switchStatement);
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 getExpression() {
21 return (EcmascriptNode) jjtGetChild(0);
22 }
23
24 public int getNumCases() {
25 return node.getCases().size();
26 }
27
28 public ASTSwitchCase getSwitchCase(int index) {
29 return (ASTSwitchCase) jjtGetChild(index + 1);
30 }
31 }
|