use of com.intellij.lang.impl.PsiBuilderAdapter in project intellij by bazelbuild.
the class BuildParserTest method createAST.
private ASTNode createAST(String text) {
ParserDefinition definition = new BuildParserDefinition();
PsiParser parser = definition.createParser(getProject());
Lexer lexer = definition.createLexer(getProject());
PsiBuilderImpl psiBuilder = new PsiBuilderImpl(getProject(), null, definition, lexer, new CharTableImpl(), text, null, null);
PsiBuilderAdapter adapter = new PsiBuilderAdapter(psiBuilder) {
@Override
public void error(String messageText) {
super.error(messageText);
errors.add(messageText);
}
};
return parser.parse(definition.getFileNodeType(), adapter);
}
Aggregations