Theory of Computation & Compiler Design (CSE2002) : - Nitin Singh Rajput
Theory of Computation & Compiler Design (CSE2002) : - Nitin Singh Rajput
Design (CSE2002)
Introduction to Compilers, Analysis of Source
Program & Phases of Compiler
L* = L0 U L1 U L2 U L3 … …
L+ = L* - {ε}
L* = L0 U L1 U L2 U L3 … …
L+ = L* - {ε}
L = {00, 10},
Now,
L* = L0 U L1 U L2 U L3 … …
L* = {ε} U {00, 10} U {0000, 0010, 1000, 1010} , …
L* = {ε, 00, 10, 0000, 0010, 1000, 1010 , …}
Some Problem Solving -4
Let L1 = {01} than find out the strings for another
language L2 such that L2 = 0. L1*
Some Problem Solving -4
Let L1= {01} than find out the strings for another
language L2 such that L2 = 0.L1*
L* = L0 U L1 U L2 U L3 … …
L1* = {ε} U {01} U {0101} U {010101}… …
L1* = {ε, 01, 0101, 010101… …}
L2 = 0.L1*
L2 = 0. {ε, 01,0101,010101… …}
L2 = {0, 001, 00101, 0010101… ….}
Defining Automata
The Relationship between
(Input)
Alphabet
Computational Models
(Automaton) & Related Grammar
Source Target
Code
Compiler Code
What is the difference between
Compiler & Interpreter
Parts of Compilation
There are two parts of Compilation:
1. Analysis
2. Synthesis
Source Code
Analysis
Intermediate Code
Synthesis
Target Code
Analysis of Source Program
Source Code
Parts of Analysis
Lexical Syntax Semantic
Analysis Analysis Analysis Analysis
Intermediate Code
Synthesis
Target Code
Lexical Analysis
Syntax Analysis
Semantic Analysis
Phases of Compiler
Compiler operates in phases
Target Code
Lexical Analysis
Syntax Analysis
Semantic Analysis
Intermediate Code Generation
Code Optimization
Code Generation
Symbol Table
Error Handling
Any Query ???
Thank you