
What you will learn in this chapter
Key Words
Lexical Analyzer
3
c
The basic functions of a Scanner
c
The relationship between a Scanner and the rest of the phases of a compiler
c
How to implement ad hoc Scanners
c
How to implement Scanners based on FSM theory
c
Relationships between Regular Expressions, FSMs and Scanners
c
Scanner writing tools – Lex and Flex
c
Example Scanner for a C-like language
c
Some initial treatment of the Symbol Table
In this chapter, we discuss the first phase of a compiler – the lexical analyzer or Scanner.
Parsing is a general term meaning analyzing a sentence to arrive at its syntactic structure. From
theoretical viewpoint, ...