Creating a lezer-based parser with multiple entry points

I have a lezer-based grammar written for a domain specific language (cf. GitHub).

Technically speaking that language has two entry points and a long list of shared grammar rules:

@Top[name=Expressions] {
  Expression+
}

@Top[name=UnaryTests] {
  Expression+,
  "not" "(" Expression+ ")",
  "-"
}

/* ... long list of shared grammar definitions */

I was playing around with nested grammars trying to support this but no avail. Is there a good way to support this?

Not currently, no. I haven’t looked into whether there’d be any complications in generating the parse tables in such a way that multiple top rules can be parsed, but it might be unproblematic. Feel free to open an issue to track adding this feature (through I don’t know when I’d get around to working on it) and to discuss possible implementation strategies.

Created the feature request: