Chapter 6. Types

Table of Contents

6.1. Type Affixes and Type Letters
6.2. Intersection Types

The Java programming language defines types and divides them into two categories, the primitive types boolean, byte, short, char, int, long, float, double, and the reference types, which are class types, interface types, array types, and the null type. The types of the XL programming language are those types of the Java programming language, plus intersection types.

Types
[1]Type::=ReferenceType | PrimitiveType  
[2]PrimitiveType::=boolean | byte | short | char | int | long | float | double  
[3]ReferenceType::=Name | ArrayType  
[4]ArrayType::=Type '[' ']'  

6.1. Type Affixes and Type Letters

This specification sometimes refers to type affixes. They are used to form names with a common prefix or suffix for different types. The type affix of a type T is defined as follows:

  • If T is a primitive type, then the type affix is the name of that type, but having the first letter capitalized. E.g, the type affix of the type int is Int.

  • Otherwise, T is a reference type. Then its type affix is Object.

In addition, for each type a type letter is defined. The type letter is

  • a for reference types,

  • d for double,

  • f for float,

  • l for long,

  • i for the other types.