FAQ
Hi everyone,

I know that Go has a built-in ast package for parsing Go source files, but
I was wondering if there is a way to parse the AST for other languages.
Specifically, I would like to use Go to parse the AST for Java source files.

Any help would be appreciated.

Thanks!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Andrewchamberss at May 28, 2015 at 2:11 am
    If google didn't turn anything up, you will probably need to write it
    yourself.

    You can handwrite one using this technique
    http://en.wikipedia.org/wiki/Recursive_descent_parser or you could use
    something like https://github.com/PuerkitoBio/pigeon or
    https://golang.org/cmd/yacc/

    I am working on parsing C with handwritten recursive descent code here
    https://github.com/andrewchambers/cc/blob/master/parse/parse.go, if you
    wan't to see what it requires.

    On Thursday, May 28, 2015 at 1:06:45 PM UTC+12, Jeremy S wrote:

    Hi everyone,

    I know that Go has a built-in ast package for parsing Go source files, but
    I was wondering if there is a way to parse the AST for other languages.
    Specifically, I would like to use Go to parse the AST for Java source
    files.

    Any help would be appreciated.

    Thanks!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Gerald Stanje at May 28, 2015 at 6:14 am
    You could look my toy compiler (to be continued) which uses yacc https://github.com/geraldstanje/toycompiler

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 28, '15 at 1:06a
activeMay 28, '15 at 6:14a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase