ANTLR4 generates Go target source code that contain undefined symbol "_input"

50 views
Skip to first unread message

Yi

unread,
Jun 2, 2019, 3:47:09 PM6/2/19
to antlr-discussion
I described this issue in https://github.com/antlr/antlr4/issues/2566.


I noticed two problems.  I solve the first one, but for the completeness of the description of this issue, I am recording it here -- there is a grammar rule target named `string` which conflicts with the name of Go type string. My solution is to rename the grammar rule target from `string` into `char_string` as in [this pull request](https://github.com/apache/hive/pull/654), which passed HIve's CI.

What is bothering me now is the second issue. When I run `go build` with the generated code, it complains that 

```
./hplsql_parser.go:4467:8: undefined: _input
./hplsql_parser.go:24587:9: undefined: _input
./hplsql_parser.go:26203:8: undefined: _input
./hplsql_parser.go:26204:4: undefined: _input
./hplsql_parser.go:26205:4: undefined: _input
./hplsql_parser.go:26206:4: undefined: _input
./hplsql_parser.go:26207:4: undefined: _input
./hplsql_parser.go:26208:4: undefined: _input
./hplsql_parser.go:34592:8: undefined: _input
./hplsql_parser.go:37616:11: undefined: _input
./hplsql_parser.go:37616:11: too many errors
```

I searched over Go source files in https://github.com/antlr/antlr4/blob/master/runtime/Go/antlr/ and found no symbol "_input" defined there too.
Reply all
Reply to author
Forward
0 new messages