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 ...

Get Language Implementation Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.