
Compiler Design Overview and Phases
Learn about the introduction to compilers, their functions, compiler phases, finite state machines, deterministic finite automata (DFA), and non-deterministic finite automata (NDFA), essential concepts in compiler design.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
COMPILER DESIGN COMPILER DESIGN BCA 5thSemester 2020 Topic: Introduction to Compiler Topic: Introduction to Compiler Sakhi Bandyopadhyay Department of Computer Science and BCA Kharagpur College
Introduction to Compiler A compiler is a translator that converts the high- level language into the machine language. Fig: Execution process of source program in Compiler
Finite state machine Finite state machine is used to recognize patterns. A finite automata consists of following: Q: finite set of states : finite set of input symbol q0: initial state F: final state : Transition function Transition function can be define as : Q x Q
FA is characterized into two ways: 1.DFA (finite automata) 2.NDFA (non deterministic finite automata) DFA DFA stands for Deterministic Finite Automata. In DFA, the input character goes to one state only.
DFA DFA has five tuples {Q, , q0, F, } Q: set of all states : finite set of input symbol where : Q x Q q0: initial state F: final state : Transition function Example See an example of deterministic finite automata: 1.Q = {q0, q1, q2} 2. = {0, 1} 3.q0 = {q0} 4.F = {q3}
NDFA NDFA refer to the Non Deterministic Finite Automata. It is used to transit the any number of states for a particular input. NDFA accepts the NULL move that means it can change state without reading the symbols. Transition function of NDFA can be defined as: : Q x 2Q Example 1.Q = {q0, q1, q2} 2. = {0, 1} 3.q0 = {q0} 4.F = {q3}