Skip to content

Grain AST #2115

Closed Answered by ospencer
vereym asked this question in Help
Jun 10, 2024 · 1 comment
Discussion options

You must be logged in to vote

Hey @vereym! There isn't really a clean way to do it because it's mostly for debugging, but if you compile with --verbose it'll dump all of the intermediate IRs, the first of which being the AST for the input program. It's quite a lot of output, so I'd recommend dumping it to a file. If you're willing to make some minor modifications to the compiler it's pretty easy to get it as JSON/write it to a file. I'll also mention that we have this doc (https://github.com/grain-lang/grain/blob/main/docs/contributor/compiler_walkthrough.md) which is a little outdated but explains the compilation process. There's an open PR to update it, though. #2092

Have fun!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ospencer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants