Allow the generator to be a little more declarative
This commit is contained in:
parent
e203e27407
commit
03937e62e6
2 changed files with 16 additions and 4 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue