I'm facing the problem that in my custom language I have many definitions in a row. If parsing one definition fails, the complete AST becomes erroneous.
The situation in detail:
This is the grammar:
definition ::= prolog definitionPart?
prolog::= IDENTIFIER (EXTENDS PARENT_REFERENCE)?
private definitionPart ::= OPENING_BRACKET definitionBody CLOSING_BRACKET
definitionBody ::= ENTRY*
The language and the psi look like this:
You see that I have 2 definitions: SOMETHING and SOMETHING_ELSE and the AST looks. However when I add a sytax error in SOMETHING, also SOMETHING_ELSE breaks:
Leaving out the PARENT_REFERENCE throws the error in SOMETHING. Now only one definition is parsed because of the error in SOMETHING.
Is there a way to use recoverWhile or recoverUntil attributes in the grammar to parse the correct definitions?
Thanks in advance,