Chapter 9. Type Checking

In this chapter we will develop a small object-oriented DSL, which can be seen as a smaller version of Java that we call SmallJava. We will use this DSL to show some type checking techniques that deal with object-oriented features such as inheritance and subtyping (type conformance). This will also allow you to learn other features of Xtext grammars and to see some good practices in Xtext DSL implementations.

This chapter will cover the following topics:

  • A small object-oriented language implemented with Xtext
  • Some additional features of Xtext grammars
  • The type system for object-oriented languages
  • Some best practices for Xtext DSL implementation

SmallJava

The language we develop in this chapter is a simplified version of Java, ...

Get Implementing Domain-Specific Languages with Xtext and Xtend - 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.