aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--cmd/vartan-go/generate.go2
-rw-r--r--cmd/vartan/compile.go2
-rw-r--r--cmd/vartan/parse.go2
-rw-r--r--cmd/vartan/show.go2
-rw-r--r--driver/conflict_test.go2
-rw-r--r--driver/lac_test.go2
-rw-r--r--driver/parser_test.go2
-rw-r--r--driver/semantic_action_test.go2
-rw-r--r--driver/spec.go2
-rw-r--r--driver/syntax_error_test.go2
-rw-r--r--driver/template.go2
-rw-r--r--driver/token_stream.go2
-rw-r--r--grammar/first_test.go2
-rw-r--r--grammar/grammar.go2
-rw-r--r--grammar/grammar_test.go2
-rw-r--r--grammar/lalr1_test.go2
-rw-r--r--grammar/lr0_test.go2
-rw-r--r--grammar/parsing_table.go2
-rw-r--r--grammar/parsing_table_test.go2
-rw-r--r--spec/grammar/description.go (renamed from spec/description.go)2
-rw-r--r--spec/grammar/grammar.go (renamed from spec/grammar.go)2
-rw-r--r--spec/grammar/lexer.go (renamed from spec/lexer.go)4
-rw-r--r--spec/grammar/lexer_test.go (renamed from spec/lexer_test.go)2
-rw-r--r--spec/grammar/lexspec.json (renamed from spec/lexspec.json)0
-rw-r--r--spec/grammar/parser.go (renamed from spec/parser.go)2
-rw-r--r--spec/grammar/parser_test.go (renamed from spec/parser_test.go)2
-rw-r--r--spec/grammar/syntax_error.go (renamed from spec/syntax_error.go)2
-rw-r--r--spec/grammar/vartan_lexer.go (renamed from spec/vartan_lexer.go)2
29 files changed, 29 insertions, 29 deletions
diff --git a/.gitignore b/.gitignore
index 36543eb..47b3d13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-spec/clexspec.json
+spec/grammar/clexspec.json
diff --git a/cmd/vartan-go/generate.go b/cmd/vartan-go/generate.go
index 1aabb26..8ae4db5 100644
--- a/cmd/vartan-go/generate.go
+++ b/cmd/vartan-go/generate.go
@@ -8,7 +8,7 @@ import (
mldriver "github.com/nihei9/maleeni/driver"
"github.com/nihei9/vartan/driver"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)
diff --git a/cmd/vartan/compile.go b/cmd/vartan/compile.go
index b8b97b1..eb25374 100644
--- a/cmd/vartan/compile.go
+++ b/cmd/vartan/compile.go
@@ -10,7 +10,7 @@ import (
verr "github.com/nihei9/vartan/error"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)
diff --git a/cmd/vartan/parse.go b/cmd/vartan/parse.go
index 192a9ab..2f06732 100644
--- a/cmd/vartan/parse.go
+++ b/cmd/vartan/parse.go
@@ -8,7 +8,7 @@ import (
"strings"
"github.com/nihei9/vartan/driver"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)
diff --git a/cmd/vartan/show.go b/cmd/vartan/show.go
index 7c2482c..547facf 100644
--- a/cmd/vartan/show.go
+++ b/cmd/vartan/show.go
@@ -10,7 +10,7 @@ import (
"text/template"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)
diff --git a/driver/conflict_test.go b/driver/conflict_test.go
index 93a8111..3b0c5fb 100644
--- a/driver/conflict_test.go
+++ b/driver/conflict_test.go
@@ -5,7 +5,7 @@ import (
"testing"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
func TestParserWithConflicts(t *testing.T) {
diff --git a/driver/lac_test.go b/driver/lac_test.go
index d850e9b..2274583 100644
--- a/driver/lac_test.go
+++ b/driver/lac_test.go
@@ -5,7 +5,7 @@ import (
"testing"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
func TestParserWithLAC(t *testing.T) {
diff --git a/driver/parser_test.go b/driver/parser_test.go
index bec6a51..5c7addd 100644
--- a/driver/parser_test.go
+++ b/driver/parser_test.go
@@ -6,7 +6,7 @@ import (
"testing"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
func termNode(kind string, text string, children ...*Node) *Node {
diff --git a/driver/semantic_action_test.go b/driver/semantic_action_test.go
index d480a0a..3d5f711 100644
--- a/driver/semantic_action_test.go
+++ b/driver/semantic_action_test.go
@@ -6,7 +6,7 @@ import (
"testing"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type testSemAct struct {
diff --git a/driver/spec.go b/driver/spec.go
index 195cb8c..dda1251 100644
--- a/driver/spec.go
+++ b/driver/spec.go
@@ -1,6 +1,6 @@
package driver
-import "github.com/nihei9/vartan/spec"
+import spec "github.com/nihei9/vartan/spec/grammar"
type grammarImpl struct {
g *spec.CompiledGrammar
diff --git a/driver/syntax_error_test.go b/driver/syntax_error_test.go
index a004a44..1480390 100644
--- a/driver/syntax_error_test.go
+++ b/driver/syntax_error_test.go
@@ -6,7 +6,7 @@ import (
"testing"
"github.com/nihei9/vartan/grammar"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
func TestParserWithSyntaxErrors(t *testing.T) {
diff --git a/driver/template.go b/driver/template.go
index 459b6e0..5ff3aa5 100644
--- a/driver/template.go
+++ b/driver/template.go
@@ -13,7 +13,7 @@ import (
"strings"
"text/template"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
//go:embed parser.go
diff --git a/driver/token_stream.go b/driver/token_stream.go
index 97c9f1f..dd2c482 100644
--- a/driver/token_stream.go
+++ b/driver/token_stream.go
@@ -4,7 +4,7 @@ import (
"io"
mldriver "github.com/nihei9/maleeni/driver"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type vToken struct {
diff --git a/grammar/first_test.go b/grammar/first_test.go
index 134f4bd..5f128cc 100644
--- a/grammar/first_test.go
+++ b/grammar/first_test.go
@@ -4,7 +4,7 @@ import (
"strings"
"testing"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type first struct {
diff --git a/grammar/grammar.go b/grammar/grammar.go
index 2e0c8f4..65d232d 100644
--- a/grammar/grammar.go
+++ b/grammar/grammar.go
@@ -8,7 +8,7 @@ import (
mlcompiler "github.com/nihei9/maleeni/compiler"
mlspec "github.com/nihei9/maleeni/spec"
verr "github.com/nihei9/vartan/error"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type astActionEntry struct {
diff --git a/grammar/grammar_test.go b/grammar/grammar_test.go
index aeeffac..52c7fb8 100644
--- a/grammar/grammar_test.go
+++ b/grammar/grammar_test.go
@@ -5,7 +5,7 @@ import (
"testing"
verr "github.com/nihei9/vartan/error"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
func TestGrammarBuilderOK(t *testing.T) {
diff --git a/grammar/lalr1_test.go b/grammar/lalr1_test.go
index 2f8074b..d6d0371 100644
--- a/grammar/lalr1_test.go
+++ b/grammar/lalr1_test.go
@@ -4,7 +4,7 @@ import (
"strings"
"testing"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
func TestGenLALR1Automaton(t *testing.T) {
diff --git a/grammar/lr0_test.go b/grammar/lr0_test.go
index b31126e..0d0b134 100644
--- a/grammar/lr0_test.go
+++ b/grammar/lr0_test.go
@@ -5,7 +5,7 @@ import (
"strings"
"testing"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type expectedLRState struct {
diff --git a/grammar/parsing_table.go b/grammar/parsing_table.go
index fd490b0..e2ba5d0 100644
--- a/grammar/parsing_table.go
+++ b/grammar/parsing_table.go
@@ -4,7 +4,7 @@ import (
"fmt"
"sort"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type ActionType string
diff --git a/grammar/parsing_table_test.go b/grammar/parsing_table_test.go
index a699728..fe56722 100644
--- a/grammar/parsing_table_test.go
+++ b/grammar/parsing_table_test.go
@@ -5,7 +5,7 @@ import (
"strings"
"testing"
- "github.com/nihei9/vartan/spec"
+ spec "github.com/nihei9/vartan/spec/grammar"
)
type expectedState struct {
diff --git a/spec/description.go b/spec/grammar/description.go
index 552840a..dd66950 100644
--- a/spec/description.go
+++ b/spec/grammar/description.go
@@ -1,4 +1,4 @@
-package spec
+package grammar
type Terminal struct {
Number int `json:"number"`
diff --git a/spec/grammar.go b/spec/grammar/grammar.go
index e3c87d1..25266e5 100644
--- a/spec/grammar.go
+++ b/spec/grammar/grammar.go
@@ -1,4 +1,4 @@
-package spec
+package grammar
import mlspec "github.com/nihei9/maleeni/spec"
diff --git a/spec/lexer.go b/spec/grammar/lexer.go
index 03ba72b..4bb5353 100644
--- a/spec/lexer.go
+++ b/spec/grammar/lexer.go
@@ -1,7 +1,7 @@
//go:generate maleeni compile lexspec.json -o clexspec.json
-//go:generate maleeni-go clexspec.json --package spec
+//go:generate maleeni-go clexspec.json --package grammar
-package spec
+package grammar
import (
_ "embed"
diff --git a/spec/lexer_test.go b/spec/grammar/lexer_test.go
index d822de2..20dfccc 100644
--- a/spec/lexer_test.go
+++ b/spec/grammar/lexer_test.go
@@ -1,4 +1,4 @@
-package spec
+package grammar
import (
"strings"
diff --git a/spec/lexspec.json b/spec/grammar/lexspec.json
index caf1f0e..caf1f0e 100644
--- a/spec/lexspec.json
+++ b/spec/grammar/lexspec.json
diff --git a/spec/parser.go b/spec/grammar/parser.go
index efbd072..2bb6a4a 100644
--- a/spec/parser.go
+++ b/spec/grammar/parser.go
@@ -1,4 +1,4 @@
-package spec
+package grammar
import (
"fmt"
diff --git a/spec/parser_test.go b/spec/grammar/parser_test.go
index c7d43de..dcacd7d 100644
--- a/spec/parser_test.go
+++ b/spec/grammar/parser_test.go
@@ -1,4 +1,4 @@
-package spec
+package grammar
import (
"strings"
diff --git a/spec/syntax_error.go b/spec/grammar/syntax_error.go
index db4c381..1fec801 100644
--- a/spec/syntax_error.go
+++ b/spec/grammar/syntax_error.go
@@ -1,4 +1,4 @@
-package spec
+package grammar
type SyntaxError struct {
message string
diff --git a/spec/vartan_lexer.go b/spec/grammar/vartan_lexer.go
index b892c43..cc80554 100644
--- a/spec/vartan_lexer.go
+++ b/spec/grammar/vartan_lexer.go
@@ -1,5 +1,5 @@
// Code generated by maleeni-go. DO NOT EDIT.
-package spec
+package grammar
import (
"fmt"