Professional Documents
Culture Documents
CS3005D - Compiler Design: Sheet 1 - Tutorial 1 Lexical Analysis
CS3005D - Compiler Design: Sheet 1 - Tutorial 1 Lexical Analysis
Sheet 1 — Tutorial 1
Lexical Analysis
1. Draw a transition diagram for recognizing whitespace in a language. Note that a whites-
pace can be a combination of spaces, tabs or newline characters. Which token should
the lexical analyzer return when it encounters a whitespace?
2. Draw the transition diagram for recognizing a floating point number in your favourite
programming language.
f actor → digit|(expr)
Page 1 of 1