Up Next
This pattern concludes our discussion of static type checking. As a learning tool, we broke down this problem into three pieces: type computation, type promotion, and type checking. The third and fourth patterns demonstrated type checking for non-object-oriented and object-oriented languages. Once you understand the entire picture, you would pick either Pattern 22, Enforcing Static Type Safety or this pattern to implement your own static type checker. The other patterns are components of the type checkers.
So far, we’ve learned how to write code to recognize sentences, construct AST intermediate representations, walk ASTs, populate symbol tables, manage nested scopes, construct class hierarchies, and enforce semantic type rules. In ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access