8
votes

I am looking for a Go library providing CFG parsing (preferably not in Chomsky Normal Form). Has anybody heard of anything, or should I write it ? :)

2
Is it parsing for a CFG you specify, or for the Go language itself, or something else (parsing of arbitrary grammars to be specified at runtime) that you want?hardmath
@hardmath For a CFG I specify (NLP application)Blacksad

2 Answers

4
votes

Do you know about goyacc?. Although it's not a library, but a code generator. Anyway it supports CFGs and it's IMO a pretty standard way to handle such tasks. (?)

2
votes

I cannot help you specifically with CFGs, but the Go Dashboard is a good central list of Go libraries.

Looking over it for parsers, two look helpful at first glace:

  • go-parse, modeled after Haskell's Parsec, and
  • peg for Parsing Expression Grammars.