aboutsummaryrefslogtreecommitdiff
path: root/grammar/semantic_error.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-07-30 23:41:24 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-07-30 23:56:01 +0900
commita80538426fc6df3385e9567064d32b4b45a81669 (patch)
treec5049134d8e9011e0b7a0175fc4a64e52a7d5fd0 /grammar/semantic_error.go
parentAdd a token position and detailed info to a lexical error message (diff)
downloadurubu-a80538426fc6df3385e9567064d32b4b45a81669.tar.gz
urubu-a80538426fc6df3385e9567064d32b4b45a81669.tar.xz
Detect unused-symbol error
When there are productions and terminals that are cannot be reached from the start symbol, the compiler reports an error.
Diffstat (limited to 'grammar/semantic_error.go')
-rw-r--r--grammar/semantic_error.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/grammar/semantic_error.go b/grammar/semantic_error.go
index ca84cf0..9006124 100644
--- a/grammar/semantic_error.go
+++ b/grammar/semantic_error.go
@@ -15,6 +15,8 @@ func (e *SemanticError) Error() string {
}
var (
+ semErrUnusedProduction = newSemanticError("unused production")
+ semErrUnusedTerminal = newSemanticError("unused terminal")
semErrNoProduction = newSemanticError("a grammar needs at least one production")
semErrUndefinedSym = newSemanticError("undefined symbol")
semErrDuplicateProduction = newSemanticError("duplicate production")