From a20b1abb9701ddc948133faea6c0c507995386d4 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Wed, 25 May 2016 20:10:32 -0700 Subject: [PATCH] Change generated Go code to import Go runtime from github.com --- .../org/antlr/v4/tool/templates/codegen/Go/Go.stg | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg index 01dcb4f04..10e4be7e4 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg @@ -7,10 +7,11 @@ ParserFile(file, parser, namedActions) ::= << package parser // import ( - "antlr4" "reflect" "fmt" "strconv" + + "github.com/pboyer/antlr4/runtime/Go/antlr" ) // Stopgap to suppress unused import error. We aren't certain @@ -30,7 +31,7 @@ ListenerFile(file, header) ::= << package parser // -import "antlr4" +import "github.com/pboyer/antlr4/runtime/Go/antlr" // A complete listener for a parse tree produced by @@ -49,7 +50,7 @@ BaseListenerFile(file, header) ::= << package parser // -import "antlr4" +import "github.com/pboyer/antlr4/runtime/Go/antlr" // A complete base listener for a parse tree produced by @@ -77,7 +78,7 @@ VisitorFile(file, header) ::= << package parser // -import "antlr4" +import "github.com/pboyer/antlr4/runtime/Go/antlr"
@@ -97,7 +98,7 @@ BaseVisitorFile(file, header) ::= << package parser // -import "antlr4" +import "github.com/pboyer/antlr4/runtime/Go/antlr" type BaseVisitor struct { *antlr4.BaseParseTreeVisitor @@ -894,8 +895,9 @@ LexerFile(lexerFile, lexer, namedActions) ::= << package parser import ( - "antlr4" "fmt" + + "github.com/pboyer/antlr4/runtime/Go/antlr" ) // suppress unused import error, many tests