dongshetao1814 2017-05-26 17:37
浏览 221
已采纳

Go语言是否有开源词法分析器(解析器)?

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,

  • 写回答

1条回答 默认 最新

  • douguadao3883 2017-05-26 18:02
    关注

    Standard Lib:

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

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

    Example

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?