8

Checking Types on Arrays, Method Calls, and Structure Accesses

This is the second of two chapters regarding type checking. The previous chapter introduced type checking for built-in atomic types. In comparison, this chapter will cover more complex type-checking operations.

This chapter will show you how to perform type checks for the arrays, parameters, and return types of method calls in the Jzero subset of Java. Additionally, it covers the type checking of structured types such as classes.

In this chapter, we will cover the following main topics:

  • Type-checking arrays
  • Checking method calls
  • Checking structured type accesses

By the end of the chapter, you will be able to write more sophisticated tree traversals to check types that themselves ...

Get Build Your Own Programming Language - Second Edition 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.