dmg
dmg

Reputation: 4481

Is there an open source lexer (parser) for the go language?

For the go language, is there a tool that would parse it into lexical elements? I am looking for a filter that would take go source code and output a tokenized version of it. It does not need to do full semantic compilation.

thank you in advance,

Upvotes: 1

Views: 177

Answers (1)

jmaloney
jmaloney

Reputation: 12300

Standard Lib:

https://golang.org/pkg/go/

You can start with the scanner package, it will tokenize Go source code.

Example

Upvotes: 3

Related Questions