use of com.google.javascript.jscomp.parsing.parser.trees.ClassDeclarationTree in project closure-compiler by google.
the class Parser method parseClass.
private ParseTree parseClass(boolean isExpression) {
SourcePosition start = getTreeStartLocation();
eat(TokenType.CLASS);
IdentifierToken name = null;
if (!isExpression || peekId()) {
name = eatId();
}
ParseTree superClass = null;
if (peek(TokenType.EXTENDS)) {
eat(TokenType.EXTENDS);
superClass = parseExpression();
}
eat(TokenType.OPEN_CURLY);
ImmutableList<ParseTree> elements = parseClassElements();
eat(TokenType.CLOSE_CURLY);
return new ClassDeclarationTree(getTreeLocation(start), name, superClass, elements);
}
Aggregations