December 2009
Intermediate to advanced
380 pages
9h 2m
English
The previous chapters gave us three critical language implementation skills. We can now write parsers for input sentences, we can make parsers build abstract syntax trees, and we can build tree walkers that visit or rewrite those trees. That means we’re almost ready to tackle semantic analysis. Semantic analysis is just a fancy way to say we’re “sniffing a program to see whether it makes sense.” The term semantics is synonymous with “meaning.”
We’ll explore semantic analysis in Chapter 8, Enforcing Static Typing Rules, but we need to build some infrastructure before we get there. To enforce language semantics, we need to track symbol definitions and be able to identify those symbols later. ...
Read now
Unlock full access