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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.