program => massive AST??

Jul 13, 2020 at 11:16pm
really quick question. If im in the middle of parsing code, do I eventually just make the entire program into a massive abstract syntax tree??? I think I've confused my self :/
Jul 13, 2020 at 11:49pm
It depends on the structure of your language. C, for example, could be compiled by individually parsing each function and generating its code, without ever having the AST for the entire translation unit at once in memory.
But, having the entire AST at once does allow certain program transformations that are otherwise basically impossible. In particular I'm talking about optimizations.
Jul 14, 2020 at 12:02am
ok. thank you :)
Aug 25, 2020 at 4:51am
Can you say clearer
Topic archived. No new replies allowed.