if (attr == null || !Comparing.equal(KnownAttribute.METHODS.getName(), attr.getName())) return PsiReference.EMPTY_ARRAY;
PsiElement id = o.getId();
BnfLiteralExpression value = o.getLiteralExpression();
if (id == null || value != null) return PsiReference.EMPTY_ARRAY;
final String psiImplUtilClass = getRootAttribute(attr, KnownAttribute.PSI_IMPL_UTIL_CLASS);
final JavaHelper javaHelper = JavaHelper.getJavaHelper(o.getProject());
return new PsiReference[] {
new PsiPolyVariantReferenceBase<BnfListEntry>(o, TextRange.from(id.getStartOffsetInParent(), id.getTextLength())) {
private List<NavigatablePsiElement> getTargetMethods(String methodName) {
BnfRule rule = PsiTreeUtil.getParentOfType(getElement(), BnfRule.class);
String mixinClass = ParserGeneratorUtil.getAttribute(rule, KnownAttribute.MIXIN);
String ruleClass = rule == null ? null : ParserGeneratorUtil.getQualifiedRuleClassName(rule, false);
List<NavigatablePsiElement> implMethods = javaHelper.findClassMethods(psiImplUtilClass, true, methodName, -1, ruleClass);
List<NavigatablePsiElement> mixinMethods = javaHelper.findClassMethods(mixinClass, false, methodName, -1);
return ContainerUtil.concat(mixinMethods, implMethods);
}
@NotNull
@Override