You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preamble: I've read the docs and searched the issues regarding this topic beforehand and I'm actually kind of surprised it didn't come up yet. So excuse me if I overlooked something here.
Is there a dedicated grammar syntax for unordered groups in lark?
Say I want to define a DSL in Lark grammar and I have a set of qualifiers similar to C/C++ which can precede the declaration of a variable in any order, e.g.
private static int a;
static private int b;
Is there a dedicated syntax for this in lark grammar? At the moment, I am solving it by creating an additional terminal which includes all possible combinations of the unordered elements:
This gets pretty clumsy as soon as you have more than three elements. If not already implemented, I would suggest a solution similar to the syntax in xText, where unordered groups can be defined by combining them using the "&" operator like this:
decl: ("private"? & "static"?) "int" ID ("=" INTEGER)? ";"
The text was updated successfully, but these errors were encountered:
Oh, lol! I thought you meant group theory. As we all know that usually finite groups come without any possible ordering that is compatible with the group law. 😂🤓
Preamble: I've read the docs and searched the issues regarding this topic beforehand and I'm actually kind of surprised it didn't come up yet. So excuse me if I overlooked something here.
Is there a dedicated grammar syntax for unordered groups in lark?
Say I want to define a DSL in Lark grammar and I have a set of qualifiers similar to C/C++ which can precede the declaration of a variable in any order, e.g.
Is there a dedicated syntax for this in lark grammar? At the moment, I am solving it by creating an additional terminal which includes all possible combinations of the unordered elements:
This gets pretty clumsy as soon as you have more than three elements. If not already implemented, I would suggest a solution similar to the syntax in xText, where unordered groups can be defined by combining them using the "&" operator like this:
The text was updated successfully, but these errors were encountered: