12 ms·
Create Your Own Expression Parser
- dastx 7y agoI've been looking to write a basic system that can parse documents of HTML protocol in go but it seems no such project exists. So I set out to write my own, and I come across a whole lot of projects that help you write your own parser. However, they're usually allowing to write an already popular method (ebnf, bison, yacc) but for whatever reason, I'm struggling to find any documentation on writing these things. Like, where is the a documentation for writing yacc (go) files? Or EBNF? Or whatever else.
- notduncansmith 7y agoNot sure if this meets your needs but there’s a library for parsing HTML in Go: https://godoc.org/golang.org/x/net/html https://godoc.org/golang.org/x/net/html
- dastx 7y agoMy bad. I meant to say HTTP protocol. Not sure where my mind was at the time.
- notduncansmith 7y agoNo worries! Incidentally, Go has something for that too (which I used semi-recently): https://golang.org/pkg/net/http/#ReadRequest https://golang.org/pkg/net/http/#ReadRequest
- dastx 7y agoFor whatever reason I never seen this before. Thanks for this!