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 53d444e295..d6574475ad 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 @@ -14,8 +14,12 @@ package parser // import ( "fmt" "strconv" - "sync" + "sync" + + // Grammar author supplied additional includes + + "github.com/antlr/antlr4/runtime/Go/antlr/v4" ) @@ -147,6 +151,10 @@ func (v *BaseVisitor) Visit(ctx * struct { + + // Grammar author supplied members of the instance struct + + } var ParserStaticData struct { @@ -214,7 +222,8 @@ func New(input antlr.TokenStream) * { } - +// Note that '@members' cannot be changed now, but this should have been 'globals' +// If you are looking to have variables for each instance, use '@structmembers' @@ -1440,13 +1449,15 @@ package parser import ( "fmt" - "sync" + "sync" "unicode" - + + // Grammar author supplied additional includes + + "github.com/antlr/antlr4/runtime/Go/antlr/v4" ) - @@ -1467,6 +1478,10 @@ type struct { *antlr.BaseLexer channelNames []string modeNames []string + + // Grammar author supplied members of the instance struct + + // TODO: EOF string }