kdevelop java language support plugin grammer file

I’ve been working on updating the deprecated kdev-java repository. I think that the majority of it is now functional, but I don’t know how grammar files function and it seems quite difficult to figure out with such a large, complicated file. I was hoping to get some help with a few different errors that happen because of this specifically, and hopefully learn how to fix issues that persist in the future after I understand it better.

The grammar file is located here.

one problem I’m having is with instanceOf, where the newer formating fails to parse correctly, giving a variety of errors.

the current rule specifically instanceOf is this:

(  (#additionalExpression=relationalExpressionRest)+
| INSTANCEOF instanceofType=type
| IDENTIFIER
| 0
)

 → relationalExpression ;;

this is my current test case:

public void instanceTest()
{
    if(s instanceof String str)
    {
    }
}

hopfully someone can help me with this, and I’m sory if my code isn’t the most legible. I’m trying to get it to work first then clean up my code afterward

1 Like

I understand if no one knows how to halp with this specific problem. could someone direct me to someone or somewhere that might?
also I just realized I spelled grammar wrong