aboutsummaryrefslogtreecommitdiff
path: root/grammar/slr_test.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-07-20 23:03:10 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-07-20 23:11:00 +0900
commit7958571cef889ffd03c9555d40a8b21d5947d01f (patch)
treedd8c04448a6a6c449f1d752d3537ae484752c77e /grammar/slr_test.go
parentDetect duplicate definitions of terminal symbols and fragments in advance (diff)
downloadcotia-7958571cef889ffd03c9555d40a8b21d5947d01f.tar.gz
cotia-7958571cef889ffd03c9555d40a8b21d5947d01f.tar.xz
Detect multiple conflicts
Diffstat (limited to 'grammar/slr_test.go')
-rw-r--r--grammar/slr_test.go10
1 files changed, 9 insertions, 1 deletions
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)
}