Allow the generator to be a little more declarative

This commit is contained in:
John Doty 2024-06-01 05:57:16 -07:00
parent e203e27407
commit 03937e62e6
2 changed files with 16 additions and 4 deletions

View file

@ -54,10 +54,11 @@ RSQUARE = Terminal("RightBracket")
class FineGrammar(Grammar):
generator = GenerateLALR
start = "File"
def __init__(self):
super().__init__(
start="File",
precedence=[
(Assoc.RIGHT, [EQUAL]),
(Assoc.LEFT, [OR]),
@ -81,7 +82,6 @@ class FineGrammar(Grammar):
#
(Assoc.NONE, [self.is_expression]),
],
generator=GenerateLALR,
)
@rule("File")