Allow the grammar to specify a preference for a generator
Overridable, like start production
This commit is contained in:
parent
55c4675fe5
commit
e203e27407
3 changed files with 16 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# This is an example grammar.
|
||||
import re
|
||||
|
||||
from parser import Assoc, Grammar, Nothing, Terminal, rule, seq, Rule
|
||||
from parser import Assoc, GenerateLALR, GenerateLR1, Grammar, Nothing, Terminal, rule, seq, Rule
|
||||
|
||||
ARROW = Terminal("Arrow")
|
||||
AS = Terminal("As")
|
||||
|
|
@ -81,6 +81,7 @@ class FineGrammar(Grammar):
|
|||
#
|
||||
(Assoc.NONE, [self.is_expression]),
|
||||
],
|
||||
generator=GenerateLALR,
|
||||
)
|
||||
|
||||
@rule("File")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue