Open LENSHOOD opened 4 years ago
Disadvantages:
if we wanted to switch parser generators from go-yacc (LALR(1)), we should also consider PEG and GLR/GLL. and in the end a benchmark should dictate which parser generator should be used. perhaps, as the first step, we could make the parser backend switchable to simplify experimentation.
Found a Bison to ANTLR converter written in C#. Maybe useful? https://github.com/kaby76/AntlrExamples/tree/master/Bison
The implementation is not complicated. Maybe it can be extended to generate a listener class to output AST? Its license is unclear though.
mysql workbench use ANTLR
Feature Request
Recently when I was doing tpc-c testing and profiling by using go-tpc with go-pprof, I've found that the Parser component takes significant CPU usage and heap space.
The flame graph illustrates the
parser.yyParse
function occupied the most CPU usage at tpcc prepare stage (many INSERT operations).Maybe it is not an easy job to optimize
parser.yyParse
since the wholeparser.go
was generated by go-yacc.Therefore, I'm wondering is there any possibility to introduce ANTLR as a replacement of go-yacc ?
Here is some advantages of ANTLR:
Disadvantages: