diff --git a/.travis.yml b/.travis.yml index af4788a4..688429f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,4 @@ before_install: - sudo curl -O https://www.antlr.org/download/antlr-4.7.1-complete.jar - export CLASSPATH=".:/usr/local/lib/antlr-4.7.1-complete.jar:$CLASSPATH" - alias antlr4='java -jar /usr/local/lib/antlr-4.7.1-complete.jar' - - alias grun='java org.antlr.v4.gui.TestRig' - - type antlr4 \ No newline at end of file + - alias grun='java org.antlr.v4.gui.TestRig' \ No newline at end of file diff --git a/Makefile b/Makefile index fd91d3d2..6bfb38f1 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ VERSION ?= $(shell git describe --tags --always --dirty) DIR_BIN = ./bin DIR_PKG = ./pkg DIR_CMD = ./cmd +DIR_PKG_PARSER = ${PWD}/pkg/parser default: build @@ -23,7 +24,13 @@ test: go test ${DIR_PKG}/... generate: - go generate ${DIR_PKG}/... + antlr4 -Xexact-output-dir \ + -o ${DIR_PKG_PARSER}/fql \ + -package fql \ + -visitor \ + -Dlanguage=Go \ + ${DIR_PKG_PARSER}/antlr/FqlLexer.g4 \ + ${DIR_PKG_PARSER}/antlr/FqlParser.g4 doc: godoc -http=:6060 -index diff --git a/pkg/parser/fql/fql_lexer.go b/pkg/parser/fql/fql_lexer.go index 22f422b9..1e9dbc19 100644 --- a/pkg/parser/fql/fql_lexer.go +++ b/pkg/parser/fql/fql_lexer.go @@ -1,4 +1,4 @@ -// Code generated from antlr/FqlLexer.g4 by ANTLR 4.7.1. DO NOT EDIT. +// Code generated from /Users/timofei.voronov/Work/src/github.com/MontFerret/ferret/pkg/parser/antlr/FqlLexer.g4 by ANTLR 4.7.1. DO NOT EDIT. package fql diff --git a/pkg/parser/fql/fql_parser.go b/pkg/parser/fql/fql_parser.go index 85deebf1..a8d3c6a5 100644 --- a/pkg/parser/fql/fql_parser.go +++ b/pkg/parser/fql/fql_parser.go @@ -1,4 +1,4 @@ -// Code generated from antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. +// Code generated from /Users/timofei.voronov/Work/src/github.com/MontFerret/ferret/pkg/parser/antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. package fql // FqlParser import ( diff --git a/pkg/parser/fql/fqlparser_base_listener.go b/pkg/parser/fql/fqlparser_base_listener.go index 6ccfb2a4..ab25808b 100644 --- a/pkg/parser/fql/fqlparser_base_listener.go +++ b/pkg/parser/fql/fqlparser_base_listener.go @@ -1,4 +1,4 @@ -// Code generated from antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. +// Code generated from /Users/timofei.voronov/Work/src/github.com/MontFerret/ferret/pkg/parser/antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. package fql // FqlParser import "github.com/antlr/antlr4/runtime/Go/antlr" diff --git a/pkg/parser/fql/fqlparser_base_visitor.go b/pkg/parser/fql/fqlparser_base_visitor.go index 00519fc9..d9451a87 100644 --- a/pkg/parser/fql/fqlparser_base_visitor.go +++ b/pkg/parser/fql/fqlparser_base_visitor.go @@ -1,4 +1,4 @@ -// Code generated from antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. +// Code generated from /Users/timofei.voronov/Work/src/github.com/MontFerret/ferret/pkg/parser/antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. package fql // FqlParser import "github.com/antlr/antlr4/runtime/Go/antlr" diff --git a/pkg/parser/fql/fqlparser_listener.go b/pkg/parser/fql/fqlparser_listener.go index e80d8410..99967f80 100644 --- a/pkg/parser/fql/fqlparser_listener.go +++ b/pkg/parser/fql/fqlparser_listener.go @@ -1,4 +1,4 @@ -// Code generated from antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. +// Code generated from /Users/timofei.voronov/Work/src/github.com/MontFerret/ferret/pkg/parser/antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. package fql // FqlParser import "github.com/antlr/antlr4/runtime/Go/antlr" diff --git a/pkg/parser/fql/fqlparser_visitor.go b/pkg/parser/fql/fqlparser_visitor.go index ed280f28..3ca4f577 100644 --- a/pkg/parser/fql/fqlparser_visitor.go +++ b/pkg/parser/fql/fqlparser_visitor.go @@ -1,4 +1,4 @@ -// Code generated from antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. +// Code generated from /Users/timofei.voronov/Work/src/github.com/MontFerret/ferret/pkg/parser/antlr/FqlParser.g4 by ANTLR 4.7.1. DO NOT EDIT. package fql // FqlParser import "github.com/antlr/antlr4/runtime/Go/antlr" diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 85acf559..a2856471 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -1,4 +1,3 @@ -//go:generate antlr4 -Xexact-output-dir -o fql -package fql -visitor -Dlanguage=Go antlr/FqlLexer.g4 antlr/FqlParser.g4 package parser import (