From 7958571cef889ffd03c9555d40a8b21d5947d01f Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Tue, 20 Jul 2021 23:03:10 +0900 Subject: Detect multiple conflicts --- grammar/slr_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'grammar/slr_test.go') diff --git a/grammar/slr_test.go b/grammar/slr_test.go index 1ebb02d..15f58c1 100644 --- a/grammar/slr_test.go +++ b/grammar/slr_test.go @@ -68,7 +68,15 @@ id: "[A-Za-z_][0-9A-Za-z_]*"; nonTermCount = len(nonTermTexts) termCount = len(termTexts) - ptab, err = genSLRParsingTable(automaton, gram.productionSet, follow, termCount, nonTermCount) + slr := &slrTableBuilder{ + automaton: automaton, + prods: gram.productionSet, + follow: follow, + termCount: termCount, + nonTermCount: nonTermCount, + symTab: gram.symbolTable, + } + ptab, err = slr.build() if err != nil { t.Fatalf("failed to create a SLR parsing table: %v", err) } -- cgit v1.2.3