ParsingContext (SyntaxTreeBuilder builder, LanguageLevel languageLevel) { return new ParsingContext(builder, languageLevel) { private final StatementParsing myStatementParsing = new AnnotationParser(this); private final ExpressionParsing myExpressionParsing = new ExpressionParsing(this) { @Override protected IElementType getReferenceType() { return PyDocstringTokenTypes.DOC_REFERENCE; } }; @Override public StatementParsing getStatementParser() { return myStatementParsing; } @Override public ExpressionParsing getExpressionParser() { return myExpressionParsing; } }; }