CHAPTER 12

Programming Language Semantics

Contributed by: Sorav Bansal, Indian Institute of Technology Delhi

12.1 Introduction

A precise specification of the semantics (meaning) of a programming language is necessary to reason about the correctness of a program written in that language. Further, a compiler requires these language semantics to determine the legal space of transformations for a given input program. For example, consider a simple declaration statement “int x = 0” in an imperative programming language like C—we understand that this statement introduces a new integer variable “x” in the current scope; a memory region is allocated and the variable “x” refers to this memory region; this memory region is initialized with the zero ...

Get Compilers: Principles, Techniques, and Tools, Updated 2nd Edition by Pearson 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.