Könyv Compiler Construction Jan Willem Haaring

Compiler Construction

A Practical Approach

Nyelv: Angol
Kötés: Puha kötésű
Elérhetőség: Várható készletfeltöltés
Küldés 08. 11. 2026
7 202 Ft
Learn how a compiler really works by building one, from the first character of source code to runnin...

Információk a könyvről

Nyelv
Angol
Kötés
Könyv - Puha kötésű
Kiadva
2026
oldal
262
EAN
9798166649058
Enbook ID
54397276
Súly
462
Méretek
178 x 254 x 14

Teljes leírás

Learn how a compiler really works by building one, from the first character of source code to running x86 assembly.

Many books on compiler construction either cover only the basics or are written for academics. This book takes the practical route. It designs a small but complete programming language, Inger, and shows step by step how to write a working compiler for it. It pays particular attention to code generation, the part most other books cover least.

Every phase of the compiler is explained in turn, with practical advice on how to approach each one:

  • Language design: the Inger language, defined with syntax diagrams and a full BNF grammar
  • Lexical analysis: regular expressions, and scanners built with flex
  • Grammars and parsing: context-free grammars, LL(1) grammars and recursive descent parsing
  • Preprocessing and error recovery: handling imports, and reporting and recovering from syntax errors
  • Semantic analysis: symbol tables, type checking and coercion, and other semantic checks
  • Code generation: generating 32-bit x86 assembly from the abstract syntax tree using code templates, including the templates for every statement and operator in the language
This second edition has been thoroughly revised:
  • The text has been corrected throughout.
  • All figures have been redrawn.
  • Every code listing and sample program has been checked against the real compiler, and the output shown in the book is the output the programs actually produce.
  • The Inger compiler itself has been completed and modernized. It now builds with current, free tools (GCC, flex, CMake, Docker), and its source code is freely available at gitlab.com/henck/inger, so you can read, build and extend the compiler as you read the book.
This book is for computer science students, for programmers who want to understand what happens inside the tools they use every day, and for anyone who has wanted to write their own programming language. A working knowledge of C is useful; no prior knowledge of compilers is needed.