Cool Reference Manual

Reference manual describing the syntax, semantics, and type system of the Cool programming language.


Cool Reference Manual - cover page
Category
Other
Document type
Other
Language
English
Pages
30
File format
PDF
File size
219 KB
Published
28 September, 2026
Updated
28 September, 2026
MD5 checksum
13406BC239957839D3658249D7DA154B

About this manual

The Cool Reference Manual provides a complete description of the Classroom Object‑Oriented Language (Cool). It covers language constructs such as classes, inheritance, types, attributes, methods, and expressions, and explains the static type system and operational semantics.

The manual also includes practical information on compiling and running Cool programs, including command‑line usage of the coolc compiler and the SPIM MIPS simulator.

What's inside

  • Introduction
  • Getting Started
  • Classes
  • Types
  • Attributes
  • Methods
  • Expressions
  • Lexical Structure
  • Type Rules
  • Operational Semantics

Frequently asked questions

How do you compile a Cool program?

Use the coolc command, e.g., `coolc [ -o fileout ] file1.cl file2.cl … filen.cl`.

How do you run a compiled Cool program?

Load the generated assembly file into the SPIM simulator with `spim -file file.s` and run it.

What is the purpose of SELF_TYPE in Cool?

SELF_TYPE refers to the type of the `self` variable, allowing methods to return the dynamic type of the receiving object.

Download PDF (219 KB)

Also Manuals