1.1 Compilers:
• A compiler is a program that reads a program
written in one language –– the source
language –– and translates it into an
equivalent program in another language ––
the target language
1
, 1.3 The Phases of a Compiler:
• A compiler operates in phases.
• Each of which transforms the source program
from one representation to another.
• A typical decomposition of a compiler is
shown in fig given below
2
,1.3 The Phases of a Compiler:
3
, 1.3 The Phases of a Compiler:
• Linear Analysis:
– In which the stream of characters making up the
source program is read from left-to-right and
grouped into tokens that are sequences of
characters having a collective meaning.
4
• A compiler is a program that reads a program
written in one language –– the source
language –– and translates it into an
equivalent program in another language ––
the target language
1
, 1.3 The Phases of a Compiler:
• A compiler operates in phases.
• Each of which transforms the source program
from one representation to another.
• A typical decomposition of a compiler is
shown in fig given below
2
,1.3 The Phases of a Compiler:
3
, 1.3 The Phases of a Compiler:
• Linear Analysis:
– In which the stream of characters making up the
source program is read from left-to-right and
grouped into tokens that are sequences of
characters having a collective meaning.
4