use of com.google.javascript.jscomp.parsing.parser.trees.SwitchStatementTree in project closure-compiler by google.
the class Parser method parseSwitchStatement.
// 12.11 The switch Statement
private ParseTree parseSwitchStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SWITCH);
eat(TokenType.OPEN_PAREN);
ParseTree expression = parseExpression();
eat(TokenType.CLOSE_PAREN);
eat(TokenType.OPEN_CURLY);
ImmutableList<ParseTree> caseClauses = parseCaseClauses();
eat(TokenType.CLOSE_CURLY);
return new SwitchStatementTree(getTreeLocation(start), expression, caseClauses);
}
Aggregations