Re:The language of languages
by aaronblohowiak on Monday January 14, 2013 @08:12PM
(#5057836)
>You need to pass info up the parse tree so that after parsing, you have a new data structure with everything nicely structured ready to ACT UPON.
I (and many others) prefer to keep these passes relatively distinct. Parse tree -> AST -> Internal Representation -> (Generation of Output / Interpretation)
The other understanding you need to be able to put them to use is having a mental model of how a bottom up parser processes the tokens. You need to be able to insert actions for each grammar rule at appropriate places, which allows the information to flow bottom up too, and be processed appropriately at the same time. I have found this second bit to language processing is actually the harder bit, and its worth rewriting your grammar to make it simpler.