golang-samples / yacc Goto Github PK
View Code? Open in Web Editor NEWsamples of go tool yacc
samples of go tool yacc
I suspect there are slight differences between yacc languages, but I see no way to get numbers to work (the first error) in:
https://github.com/sqljs/node-sqljs/blob/master/doc/ref/savage/sql-92.yacc
This produces an error on the first non-comment line:
%token 0
It appears numbers are not allowed. Nothing from the calc example appears to help.
hello,
i have goyacc
comment.
but want install go tool yacc
on go 1.8
how can do this?
after make also say error :
go fmt
go test
PASS
ok github.com/cznic/goyacc 0.002s
go install
go tool vet -printfuncs "Log:0,Logf:1" *.go
golint .
make todo
make[1]: Entering directory '/home/guest/go/src/github.com/cznic/goyacc'
main.go:554: _ = yyerrok
main.go:706: _ = yypt // guard against "declared and not used"
main.go:791: _ = oNoLines //TODO Ignored for now
all_test.go:37:func TODO(...interface{}) string {
all_test.go:39: return fmt.Sprintf("TODO: %s:%d:\n", path.Base(fn), fl)
main.go:791: _ = oNoLines //TODO Ignored for now
make[1]: Leaving directory '/home/guest/go/src/github.com/cznic/goyacc'
~/$ go tool: no such tool "yacc"
help me.
Please add Readme or MakeFile explaing the programs .Even comments would do
Could you make a makefile like:
all:
go tool yacc -p Calc -o simple/calc.go simple/calc.y
go fmt
go build simple
test:
go test
clean:
rm -rf simple/calc.go
Which will give an example of how to actually do this?
Also could you structure the project in the proper sturcture?
Othewise, THANKS!
hi all... this example is awesome thank you very much.
i have only a problem. After of run $GOPATH/bin/goyacc -o calc.go calc.y
to generate golang code, the functions called CalcParse and CalcSymType are not generate into calc.go file.
Maybe this function must be added manually? or, Is something missing from my command?
Thank you for your attention. I'm learning with this example to make other parsers with other purposes
๐ ๐ฏ :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.