iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐡
Building a Calculator with goyacc in Go
goyacc is a parser generator that generates parsers. It can be installed with the following command:
go install golang.org/x/tools/cmd/goyacc@master
Download parser.go.y from the following Gist
Next, compile and try running the generated code:
goyacc parser.go.y
go run y.go "1 + 2"
A detailed explanation article for the code is published on the Mynavi site.
Discussion