/  319
 
Basics of Compiler Design
Anniversary edition
Torben Ægidius Mogensen
DEPARTMENT OF COMPUTER SCIENCEUNIVERSITY OF COPENHAGEN
 
Published through
lulu.com
.c
Torben Ægidius Mogensen 2000 – 2010
torbenm@diku.dk
Department of Computer ScienceUniversity of CopenhagenUniversitetsparken 1DK-2100 CopenhagenDENMARKBook homepage:
http://www.diku.dk/
torbenm/Basics
First published 2000This edition: August 20, 2010ISBN 978-87-993154-0-6
 
Contents
1.1 What is a compiler?. . . . . . . . . . . . . . . . . . . . . . . . . 11.2 The phases of a compiler. . . . . . . . . . . . . . . . . . . . . . 21.3 Interpreters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4 Why learn about compilers?. . . . . . . . . . . . . . . . . . . . 41.5 The structure of this boo. . . . . . . . . . . . . . . . . . . . . . 51.6 To the lecturer. . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.7 Acknowledgements. . . . . . . . . . . . . . . . . . . . . . . . . 71.8 Permission to use. . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Regular expressions. . . . . . . . . . . . . . . . . . . . . . . . . 102.2.1 Shorthands. . . . . . . . . . . . . . . . . . . . . . . . . 132.2.2 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . 142.3 Nondeterministic finite automata. . . . . . . . . . . . . . . . . . 152.4 Converting a regular expression to an NFA. . . . . . . . . . . . . 182.4.1 Optimisations. . . . . . . . . . . . . . . . . . . . . . . . 202.5 Deterministic finite automata. . . . . . . . . . . . . . . . . . . . 222.6 Converting an NFA to a DFA. . . . . . . . . . . . . . . . . . . . 232.6.1 Solving set equations. . . . . . . . . . . . . . . . . . . . 232.6.2 The subset construction. . . . . . . . . . . . . . . . . . . 262.7 Size versus speed. . . . . . . . . . . . . . . . . . . . . . . . . . 292.8 Minimisation of DFAs. . . . . . . . . . . . . . . . . . . . . . . 302.8.1 Example. . . . . . . . . . . . . . . . . . . . . . . . . . 322.8.2 Dead states. . . . . . . . . . . . . . . . . . . . . . . . . 342.9 Lexers and lexer generators. . . . . . . . . . . . . . . . . . . . . 352.9.1 Lexer generators. . . . . . . . . . . . . . . . . . . . . . 412.10 Properties of regular languages. . . . . . . . . . . . . . . . . . . 422.10.1 Relative expressive power. . . . . . . . . . . . . . . . . 422.10.2 Limits to expressive power. . . . . . . . . . . . . . . . . 44i

Share & Embed

More from this user

Recent Readcasters

Add a Comment

Characters: ...