Closed emicklei closed 8 years ago
goyacc
does not support bison
locations. It's probably possible to somehow support this.
However, I suggest to use yy. It will automatically generate a lot of yacc code, AST node types and also compute proper Pos()
methods for all of the AST nodes, provided the lexer hands tokens having a .Pos() token.Pos
method. For example.
Thank you for helping me out. I will proceed with yy instead.
@emicklei Glad to hear that. The documentation for yy
is a bit brief so please feel free to ask for help if you would need some.
i am trying to consume a large grammer file (postgresql) which is in Bison format. Bison is supposed to be the GNU implementation/extension of Yacc but I think it has some differences since I got a syntax error. I have not spent time to find out the differences between Yacc/Bison related to this. Maybe you can comment on that.
The section that cause the error is
The
@$
causes:strconv.ParseInt: parsing "": invalid syntax: