diff options
Diffstat (limited to '')
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 25 | ||||
-rw-r--r-- | deps.mk | 58 | ||||
-rw-r--r-- | driver/lexer/lexer_test.go | 4 | ||||
-rw-r--r-- | driver/parser/conflict_test.go | 4 | ||||
-rw-r--r-- | driver/parser/lac_test.go | 4 | ||||
-rw-r--r-- | driver/parser/parser_test.go | 4 | ||||
-rw-r--r-- | driver/parser/semantic_action_test.go | 6 | ||||
-rw-r--r-- | driver/parser/syntax_error_test.go | 4 | ||||
-rw-r--r-- | grammar/first_test.go | 4 | ||||
-rw-r--r-- | grammar/grammar_test.go | 4 | ||||
-rw-r--r-- | grammar/lalr1_test.go | 4 | ||||
-rw-r--r-- | grammar/lexical/compiler_test.go | 2 | ||||
-rw-r--r-- | grammar/lexical/dfa/dfa_test.go | 4 | ||||
-rw-r--r-- | grammar/lexical/dfa/tree_test.go | 4 | ||||
-rw-r--r-- | grammar/lexical/parser/parser_test.go | 4 | ||||
-rw-r--r-- | grammar/lr0_test.go | 4 | ||||
-rw-r--r-- | grammar/parsing_table_test.go | 4 | ||||
-rw-r--r-- | grammar/test_helper_test.go | 2 | ||||
-rw-r--r-- | spec/grammar/parser/lexer_test.go | 2 | ||||
-rw-r--r-- | spec/grammar/parser/parser_test.go | 2 | ||||
-rw-r--r-- | tester/tester_test.go | 6 |
22 files changed, 109 insertions, 47 deletions
@@ -17,6 +17,7 @@ /tests/fuzz/corpus/ *.a +*.ta /cmd/*.bin @@ -24,7 +24,7 @@ GOLDFLAGS = -L $(GOLIBDIR) .SUFFIXES: -.SUFFIXES: .go .a .bin .bin-check +.SUFFIXES: .go .a .ta .bin .bin-check .go.a: go tool compile -I $(@D) $(GOCFLAGS) -o $@ -p $(*F) \ @@ -64,6 +64,20 @@ existing = \ driver/parser \ tester \ +xtests = \ + compressor \ + grammar/symbol \ + spec/test \ + utf8 \ + spec/grammar/parser \ + grammar \ + tester \ + grammar/lexical/dfa \ + grammar/lexical/parser \ + grammar/lexical \ + driver/lexer \ + driver/parser \ + xmains = \ cmd/ucdgen \ cmd/vartan \ @@ -71,7 +85,9 @@ xmains = \ existing.a = $(existing:=.a) xmains.a = $(xmains:=.a) +xtests.ta = $(xtests:=.ta) xmains.bin = $(xmains:=.bin) +_xtests.bin = $(xtests:=.bin) sources = \ @@ -89,6 +105,8 @@ derived-assets = \ $(existing.a) \ $(xmains.a) \ $(xmains.bin) \ + $(xtests.ta) \ + $(xtest.bin) \ side-assets = \ tests/fuzz/corpus/ \ @@ -109,10 +127,13 @@ $(libs.a): src/$(NAME).go src/version.go $(existing.a): go tool compile -I . -o $@ -p $* `find $*/*.go | grep -v _test` +$(xtests.ta): + go tool compile -I . -o $@ -p $* $*/*.go + $(xmains.a): go tool compile -I . -o $@ -p main $*/*.go -$(xmains.bin): +$(xmains.bin) $(xtests.bin): go tool link -L . -o $@ --extldflags '$(LDLIBS)' $*.a $(fuzz-targets/lib.a): @@ -75,15 +75,18 @@ tests/fuzz/generated-parser-check/main.a: tests/fuzz/generated-parser-check/$(NA tests/main.a: tests/$(NAME).a -spec/grammar/parser.a: error.a spec/grammar.a -grammar.a: grammar/symbol.a spec/grammar/parser.a error.a grammar/lexical.a -tester.a: spec/test.a -grammar/lexical/dfa.a: grammar/lexical/parser.a utf8.a -grammar/lexical/parser.a: ucd.a spec/grammar.a -grammar/lexical.a: compressor.a grammar/lexical/dfa.a grammar/lexical/parser.a -driver/lexer.a: grammar/lexical.a -driver/parser.a: spec/grammar.a driver/lexer.a -tester.a: driver/parser.a spec/grammar.a +spec/grammar/parser.a spec/grammar/parser.ta: error.a spec/grammar.a +grammar.a grammar.ta: grammar/symbol.a spec/grammar/parser.a error.a grammar/lexical.a +tester.a tester.ta: spec/test.a driver/parser.a spec/grammar.a +grammar/lexical/dfa.a grammar/lexical/dfa.ta: grammar/lexical/parser.a utf8.a +grammar/lexical/parser.a grammar/lexical/parser.ta: ucd.a spec/grammar.a +grammar/lexical.a grammar/lexical.ta: compressor.a grammar/lexical/dfa.a grammar/lexical/parser.a +driver/lexer.a driver/lexer.ta: grammar/lexical.a +driver/parser.a driver/parser.ta: spec/grammar.a driver/lexer.a + +driver/parser.ta: grammar.a spec/grammar/parser.a +tester.ta: grammar.a spec/grammar/parser.a + cmd/ucdgen.a: ucd.a cmd/vartan.a: error.a grammar.a spec/grammar.a spec/grammar/parser.a driver/parser.a tester.a @@ -94,3 +97,40 @@ cmd/vartan-go.a: spec/grammar.a cmd/ucdgen.bin: cmd/ucdgen.a cmd/vartan.bin: cmd/vartan.a cmd/vartan-go.bin: cmd/vartan-go.a + + + +compressor.a: compressor/compressor.go +error.a: error/error.go +grammar/symbol.a: grammar/symbol/symbol.go +spec/grammar.a: spec/grammar/description.go spec/grammar/grammar.go spec/grammar/util.go +spec/test.a: spec/test/parser.go spec/test/tree_lexer.go spec/test/tree_parser.go spec/test/tree_semantic_action.go +ucd.a: ucd/api.go ucd/codepoint.go ucd/parser.go ucd/property.go ucd/property_value_aliases.go ucd/prop_list.go ucd/scripts.go ucd/unicode_data.go +utf8.a: utf8/utf8.go +spec/grammar/parser.a: spec/grammar/parser/lexer.go spec/grammar/parser/parser.go spec/grammar/parser/syntax_error.go spec/grammar/parser/vartan_lexer.go +grammar.a: grammar/first.go grammar/grammar.go grammar/item.go grammar/lalr1.go grammar/lr0.go grammar/parsing_table.go grammar/production.go grammar/semantic_error.go +tester.a: tester/tester.go +grammar/lexical/dfa.a: grammar/lexical/dfa/dfa.go grammar/lexical/dfa/symbol_position.go grammar/lexical/dfa/tree.go +grammar/lexical/parser.a: grammar/lexical/parser/error.go grammar/lexical/parser/fragment.go grammar/lexical/parser/lexer.go grammar/lexical/parser/parser.go grammar/lexical/parser/tree.go +grammar/lexical.a: grammar/lexical/compiler.go grammar/lexical/entry.go +driver/lexer.a: driver/lexer/lexer.go driver/lexer/spec.go driver/lexer/spec.go +driver/parser.a: driver/parser/parser.go driver/parser/semantic_action.go driver/parser/spec.go driver/parser/template.go driver/parser/token_stream.go + +cmd/ucdgen.a: cmd/ucdgen/main.go +cmd/vartan.a: cmd/vartan/compile.go cmd/vartan/main.go cmd/vartan/parse.go cmd/vartan/root.go cmd/vartan/show.go cmd/vartan/test.go +cmd/vartan-go.a: cmd/vartan-go/generate.go cmd/vartan-go/main.go + + + +compressor.ta: compressor/compressor.go compressor/compressor_test.go +grammar/symbol.ta: grammar/symbol/symbol.go grammar/symbol/symbol_test.go +spec/test.ta: spec/test/parser.go spec/test/tree_lexer.go spec/test/tree_parser.go spec/test/tree_semantic_action.go spec/test/parser_test.go +utf8.ta: utf8/utf8.go utf8/utf8_test.go +spec/grammar/parser.ta: spec/grammar/parser/lexer.go spec/grammar/parser/parser.go spec/grammar/parser/syntax_error.go spec/grammar/parser/vartan_lexer.go spec/grammar/parser/lexer_test.go spec/grammar/parser/parser_test.go +grammar.ta: grammar/first.go grammar/grammar.go grammar/item.go grammar/lalr1.go grammar/lr0.go grammar/parsing_table.go grammar/production.go grammar/semantic_error.go grammar/first_test.go grammar/grammar_test.go grammar/lalr1_test.go grammar/lr0_test.go grammar/parsing_table_test.go grammar/test_helper_test.go +tester.ta: tester/tester.go tester/tester_test.go +grammar/lexical/dfa.ta: grammar/lexical/dfa/dfa.go grammar/lexical/dfa/symbol_position.go grammar/lexical/dfa/tree.go grammar/lexical/dfa/dfa_test.go grammar/lexical/dfa/symbol_position_test.go grammar/lexical/dfa/tree_test.go +grammar/lexical/parser.ta: grammar/lexical/parser/error.go grammar/lexical/parser/fragment.go grammar/lexical/parser/lexer.go grammar/lexical/parser/parser.go grammar/lexical/parser/tree.go grammar/lexical/parser/lexer_test.go grammar/lexical/parser/parser_test.go +grammar/lexical.ta: grammar/lexical/compiler.go grammar/lexical/entry.go grammar/lexical/compiler_test.go +driver/lexer.ta: driver/lexer/lexer.go driver/lexer/spec.go driver/lexer/spec.go driver/lexer/lexer_test.go +driver/parser.a: driver/parser/parser.go driver/parser/semantic_action.go driver/parser/spec.go driver/parser/template.go driver/parser/token_stream.go driver/parser/conflict_test.go driver/parser/lac_test.go driver/parser/parser_test.go driver/parser/semantic_action_test.go driver/parser/syntax_error_test.go diff --git a/driver/lexer/lexer_test.go b/driver/lexer/lexer_test.go index edabd6d..d32b087 100644 --- a/driver/lexer/lexer_test.go +++ b/driver/lexer/lexer_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/lexical" - spec "github.com/nihei9/vartan/spec/grammar" + "grammar/lexical" + spec "spec/grammar" ) func newLexEntry(modes []string, kind string, pattern string, push string, pop bool) *lexical.LexEntry { diff --git a/driver/parser/conflict_test.go b/driver/parser/conflict_test.go index 21b829a..1a75483 100644 --- a/driver/parser/conflict_test.go +++ b/driver/parser/conflict_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar" + "spec/grammar/parser" ) func TestParserWithConflicts(t *testing.T) { diff --git a/driver/parser/lac_test.go b/driver/parser/lac_test.go index 14bd2cf..ed9a0b8 100644 --- a/driver/parser/lac_test.go +++ b/driver/parser/lac_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar" + "spec/grammar/parser" ) func TestParserWithLAC(t *testing.T) { diff --git a/driver/parser/parser_test.go b/driver/parser/parser_test.go index b1b9e4f..cdfd922 100644 --- a/driver/parser/parser_test.go +++ b/driver/parser/parser_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar" + "spec/grammar/parser" ) func termNode(kind string, text string, children ...*Node) *Node { diff --git a/driver/parser/semantic_action_test.go b/driver/parser/semantic_action_test.go index c98a12f..8c224e2 100644 --- a/driver/parser/semantic_action_test.go +++ b/driver/parser/semantic_action_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar" - spec "github.com/nihei9/vartan/spec/grammar" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar" + spec "spec/grammar" + "spec/grammar/parser" ) type testSemAct struct { diff --git a/driver/parser/syntax_error_test.go b/driver/parser/syntax_error_test.go index 71175be..c508be6 100644 --- a/driver/parser/syntax_error_test.go +++ b/driver/parser/syntax_error_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar" + "spec/grammar/parser" ) func TestParserWithSyntaxErrors(t *testing.T) { diff --git a/grammar/first_test.go b/grammar/first_test.go index 1eff309..ea1a61c 100644 --- a/grammar/first_test.go +++ b/grammar/first_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/symbol" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar/symbol" + "spec/grammar/parser" ) type first struct { diff --git a/grammar/grammar_test.go b/grammar/grammar_test.go index e3cf668..4a3c6a0 100644 --- a/grammar/grammar_test.go +++ b/grammar/grammar_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - verr "github.com/nihei9/vartan/error" - "github.com/nihei9/vartan/spec/grammar/parser" + verr "error" + "spec/grammar/parser" ) func TestGrammarBuilderOK(t *testing.T) { diff --git a/grammar/lalr1_test.go b/grammar/lalr1_test.go index c57dc5c..d08468d 100644 --- a/grammar/lalr1_test.go +++ b/grammar/lalr1_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/symbol" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar/symbol" + "spec/grammar/parser" ) func TestGenLALR1Automaton(t *testing.T) { diff --git a/grammar/lexical/compiler_test.go b/grammar/lexical/compiler_test.go index f2ef0f2..3336048 100644 --- a/grammar/lexical/compiler_test.go +++ b/grammar/lexical/compiler_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - spec "github.com/nihei9/vartan/spec/grammar" + spec "spec/grammar" ) func TestLexSpec_Validate(t *testing.T) { diff --git a/grammar/lexical/dfa/dfa_test.go b/grammar/lexical/dfa/dfa_test.go index ae71875..9af9aeb 100644 --- a/grammar/lexical/dfa/dfa_test.go +++ b/grammar/lexical/dfa/dfa_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/lexical/parser" - spec "github.com/nihei9/vartan/spec/grammar" + "grammar/lexical/parser" + spec "spec/grammar" ) func TestGenDFA(t *testing.T) { diff --git a/grammar/lexical/dfa/tree_test.go b/grammar/lexical/dfa/tree_test.go index e0abe64..188fe95 100644 --- a/grammar/lexical/dfa/tree_test.go +++ b/grammar/lexical/dfa/tree_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/lexical/parser" - spec "github.com/nihei9/vartan/spec/grammar" + "grammar/lexical/parser" + spec "spec/grammar" ) func TestByteTree(t *testing.T) { diff --git a/grammar/lexical/parser/parser_test.go b/grammar/lexical/parser/parser_test.go index d6cc4a8..e876d3b 100644 --- a/grammar/lexical/parser/parser_test.go +++ b/grammar/lexical/parser/parser_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - spec "github.com/nihei9/vartan/spec/grammar" - "github.com/nihei9/vartan/ucd" + spec "spec/grammar" + "ucd" ) func TestParse(t *testing.T) { diff --git a/grammar/lr0_test.go b/grammar/lr0_test.go index 99d4e5b..798c2fa 100644 --- a/grammar/lr0_test.go +++ b/grammar/lr0_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/symbol" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar/symbol" + "spec/grammar/parser" ) type expectedLRState struct { diff --git a/grammar/parsing_table_test.go b/grammar/parsing_table_test.go index ae829e6..098adf9 100644 --- a/grammar/parsing_table_test.go +++ b/grammar/parsing_table_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar/symbol" - "github.com/nihei9/vartan/spec/grammar/parser" + "grammar/symbol" + "spec/grammar/parser" ) type expectedState struct { diff --git a/grammar/test_helper_test.go b/grammar/test_helper_test.go index 297a9a3..63fcafb 100644 --- a/grammar/test_helper_test.go +++ b/grammar/test_helper_test.go @@ -3,7 +3,7 @@ package grammar import ( "testing" - "github.com/nihei9/vartan/grammar/symbol" + "grammar/symbol" ) type testSymbolGenerator func(text string) symbol.Symbol diff --git a/spec/grammar/parser/lexer_test.go b/spec/grammar/parser/lexer_test.go index 64c2aa2..c0beaf9 100644 --- a/spec/grammar/parser/lexer_test.go +++ b/spec/grammar/parser/lexer_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - verr "github.com/nihei9/vartan/error" + verr "error" ) func TestLexer_Run(t *testing.T) { diff --git a/spec/grammar/parser/parser_test.go b/spec/grammar/parser/parser_test.go index 498e7c6..77863e8 100644 --- a/spec/grammar/parser/parser_test.go +++ b/spec/grammar/parser/parser_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - verr "github.com/nihei9/vartan/error" + verr "error" ) func TestParse(t *testing.T) { diff --git a/tester/tester_test.go b/tester/tester_test.go index 1ea9e31..df5cb07 100644 --- a/tester/tester_test.go +++ b/tester/tester_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/nihei9/vartan/grammar" - "github.com/nihei9/vartan/spec/grammar/parser" - tspec "github.com/nihei9/vartan/spec/test" + "grammar" + "spec/grammar/parser" + tspec "spec/test" ) func TestTester_Run(t *testing.T) { |