Added sealed type support
https://github.com/JetBrains/Grammar-Kit/issues/305
- Added inspections for sealed rules
- Updated default Java version to 17
The concept of having rules with interface but without implementations are new to the PSI structure. There are many concepts that rely on this, such as mixin, extends, elementType etc.
So far the behavior presented here pretty much ignores all of them but methods. methods is forwarded down the sealed hierarchy, and all leaves (non-sealed) implement all methods from all of their sealed super-rules.
This is not consistent with extends or mixin etc.
Also, if someone accidentally extends a sealed type, the sealed type semantics are dropped. (there's an inspection for this, see org.intellij.grammar.BnfSealedRuleInspectionsTest#testSealedRulesMayNotBeExtendedTo)
Any thoughts on this, and are there any assumptions that are broken by this approach?