SlideShare a Scribd company logo
7
Most read
8
Most read
9
Most read
SYNTAX Directed
Translation
Compiler Construction
SYNTAX Directed Translation PPT || Compiler Construction
National College of Business
Administration & Economics
Group Members
Wamiq Ali
Programmer
Sarmad Shuja
Programmer
Zain Abid
Programmer
Background
Parser uses a CFG(Context-free-Grammar) to validate the input
string and produce output for next phase of the compiler.
Introduction
Syntax-directed translation (SDT) refers to a method of compiler implementation
where the source language translation is completely driven by the parser.
The parsing process and parse trees are used to direct semantic analysis and the
translation of the source program. We can augment grammar with information to
control the semantic analysis and translation. Such grammars are called attribute
grammars.
Terminology
A common method of syntax-directed translation is translating a string in
to a sequence of actions by attaching one such action to each rule of a
grammar.
Formula
Grammar + semantic rule = SDT (syntax directed translation)
Syntax Directed Translation Scheme
1 The Syntax directed translation scheme is a context -free grammar.
2 The syntax directed translation scheme is used to evaluate the
order of semantic rules.
3 In translation scheme, the semantic rules are embedded within the
right side of the productions.
4
The position at which an action is to be executed is shown by
enclosed between braces. It is written within the right side of the
production.
Implementation of Syntax directed Translation
Syntax direct translation is implemented by constructing a parse tree and
performing the actions in a left to right depth first order.
SDT is implementing by parse the input and produce a parse tree as a
result.
Top Down
Bottom Up
Limitation
Without using global data to create side effects, some of the semantic
actions cannot be performed.
Example
Checking whether a variable is defined before its usage.
Checking the type and storage address of a variable.
Checking whether a variable is used or not.
Common Approach
A program with too many global variables is difficult to understand and
maintain.
Restrict the usage of global variables to essential items and use them
as objects.
Thank You

More Related Content

DOCX
SYNTAX Directed Translation Report || Compiler Construction
DOCX
Which is not a step in the problem
PDF
Basics of Algorithm Unit 1 part 1 algorithm
PPT
Problem solving using Computer
PPTX
Code Smells and Refactoring - Satyajit Dey & Ashif Iqbal
PPT
evaluation rules
PPT
Fundamental of Algorithms
PPTX
Introduction To Algorithms
SYNTAX Directed Translation Report || Compiler Construction
Which is not a step in the problem
Basics of Algorithm Unit 1 part 1 algorithm
Problem solving using Computer
Code Smells and Refactoring - Satyajit Dey & Ashif Iqbal
evaluation rules
Fundamental of Algorithms
Introduction To Algorithms

What's hot (17)

PPTX
LISP: Scope and extent in lisp
PPT
evaluating recursive_applications
PPTX
Introduction to formal methods
PDF
Algorithmic problem solving
PDF
Irrf Presentation
PPSX
DISE - Programming Concepts
PPS
Mca se chapter_9_formal_methods
PDF
3 statements and operators
PDF
Bt0066 database management system2
PPT
Designing A Syntax Based Retrieval System03
PDF
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
PPT
Introduction to problem solving in c++
PPTX
XII Computer Science- Chapter 1-Function
PPTX
Microsoft Tech Club Cairo University "MSTC'16 Builders and Developers " Secon...
PPT
PPTX
Lecture 6-cs648 Randomized Algorithms
LISP: Scope and extent in lisp
evaluating recursive_applications
Introduction to formal methods
Algorithmic problem solving
Irrf Presentation
DISE - Programming Concepts
Mca se chapter_9_formal_methods
3 statements and operators
Bt0066 database management system2
Designing A Syntax Based Retrieval System03
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Introduction to problem solving in c++
XII Computer Science- Chapter 1-Function
Microsoft Tech Club Cairo University "MSTC'16 Builders and Developers " Secon...
Lecture 6-cs648 Randomized Algorithms
Ad

Similar to SYNTAX Directed Translation PPT || Compiler Construction (20)

PDF
Overlapping optimization with parsing through metagrammars
PPTX
TOPDOWN-PREDICTIVE.pptx TOP-DOWN PARSING & PREDICTIVE PARSING
PDF
Regular Expression to Deterministic Finite Automata
PPTX
Parsers: Shift reduce parsing and operator precedence parsing
PPT
Component Based Testing Using Finite Automata
PDF
IRJET - Pseudocode to Python Translation using Machine Learning
PPTX
Principles of Compiler Design - Introduction
PDF
PDF
Cohesive Software Design
PPTX
Parsers Techniques:Shift reduce parsers and Operator precedence parsing
PDF
A NEURAL MACHINE LANGUAGE TRANSLATION SYSTEM FROM GERMAN TO ENGLISH
PDF
A Novel Approach for Rule Based Translation of English to Marathi
PDF
A Novel Approach for Rule Based Translation of English to Marathi
PDF
A Novel Approach for Rule Based Translation of English to Marathi
PDF
A Novel Approach for Rule Based Translation of English to Marathi
PDF
Design and Development of a Malayalam to English Translator- A Transfer Based...
PDF
An Efficient Approach to Produce Source Code by Interpreting Algorithm
PPTX
Constructing LALR parsing tables and syntax directed translation schemes
PDF
50120140503001
PDF
50120140503001
Overlapping optimization with parsing through metagrammars
TOPDOWN-PREDICTIVE.pptx TOP-DOWN PARSING & PREDICTIVE PARSING
Regular Expression to Deterministic Finite Automata
Parsers: Shift reduce parsing and operator precedence parsing
Component Based Testing Using Finite Automata
IRJET - Pseudocode to Python Translation using Machine Learning
Principles of Compiler Design - Introduction
Cohesive Software Design
Parsers Techniques:Shift reduce parsers and Operator precedence parsing
A NEURAL MACHINE LANGUAGE TRANSLATION SYSTEM FROM GERMAN TO ENGLISH
A Novel Approach for Rule Based Translation of English to Marathi
A Novel Approach for Rule Based Translation of English to Marathi
A Novel Approach for Rule Based Translation of English to Marathi
A Novel Approach for Rule Based Translation of English to Marathi
Design and Development of a Malayalam to English Translator- A Transfer Based...
An Efficient Approach to Produce Source Code by Interpreting Algorithm
Constructing LALR parsing tables and syntax directed translation schemes
50120140503001
50120140503001
Ad

More from Zain Abid (10)

PPTX
Satellite Communication || Wireless Communication
PPTX
Cyber Security
DOCX
Factors Affecting the System Safety || Linux
PPTX
Laplace Transform || Multi Variable Calculus
DOC
Sequence and Series Word File || Discrete Structure
PPTX
Sequence and Series in Discrete Structure
PPT
Object Oriented Programming
PPTX
Disadvantages of Social Media
PPTX
Marketing Plan || Nano Navigation Chip
PPTX
Imam Bukhari life history || امام بخاری کی ذاتی زندگی || Bukhari Sharif
Satellite Communication || Wireless Communication
Cyber Security
Factors Affecting the System Safety || Linux
Laplace Transform || Multi Variable Calculus
Sequence and Series Word File || Discrete Structure
Sequence and Series in Discrete Structure
Object Oriented Programming
Disadvantages of Social Media
Marketing Plan || Nano Navigation Chip
Imam Bukhari life history || امام بخاری کی ذاتی زندگی || Bukhari Sharif

Recently uploaded (20)

PPTX
Leprosy and NLEP programme community medicine
PDF
Lecture1 pattern recognition............
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
Database Infoormation System (DBIS).pptx
PDF
Introduction to the R Programming Language
PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPT
Predictive modeling basics in data cleaning process
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PDF
Business Analytics and business intelligence.pdf
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
modul_python (1).pptx for professional and student
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
Computer network topology notes for revision
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
SAP 2 completion done . PRESENTATION.pptx
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PDF
Mega Projects Data Mega Projects Data
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
Leprosy and NLEP programme community medicine
Lecture1 pattern recognition............
Introduction to Knowledge Engineering Part 1
Database Infoormation System (DBIS).pptx
Introduction to the R Programming Language
ISS -ESG Data flows What is ESG and HowHow
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Predictive modeling basics in data cleaning process
oil_refinery_comprehensive_20250804084928 (1).pptx
Business Analytics and business intelligence.pdf
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
modul_python (1).pptx for professional and student
Galatica Smart Energy Infrastructure Startup Pitch Deck
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Computer network topology notes for revision
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
SAP 2 completion done . PRESENTATION.pptx
STERILIZATION AND DISINFECTION-1.ppthhhbx
Mega Projects Data Mega Projects Data
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx

SYNTAX Directed Translation PPT || Compiler Construction

  • 3. National College of Business Administration & Economics
  • 4. Group Members Wamiq Ali Programmer Sarmad Shuja Programmer Zain Abid Programmer
  • 5. Background Parser uses a CFG(Context-free-Grammar) to validate the input string and produce output for next phase of the compiler.
  • 6. Introduction Syntax-directed translation (SDT) refers to a method of compiler implementation where the source language translation is completely driven by the parser. The parsing process and parse trees are used to direct semantic analysis and the translation of the source program. We can augment grammar with information to control the semantic analysis and translation. Such grammars are called attribute grammars.
  • 7. Terminology A common method of syntax-directed translation is translating a string in to a sequence of actions by attaching one such action to each rule of a grammar. Formula Grammar + semantic rule = SDT (syntax directed translation)
  • 8. Syntax Directed Translation Scheme 1 The Syntax directed translation scheme is a context -free grammar. 2 The syntax directed translation scheme is used to evaluate the order of semantic rules. 3 In translation scheme, the semantic rules are embedded within the right side of the productions. 4 The position at which an action is to be executed is shown by enclosed between braces. It is written within the right side of the production.
  • 9. Implementation of Syntax directed Translation Syntax direct translation is implemented by constructing a parse tree and performing the actions in a left to right depth first order. SDT is implementing by parse the input and produce a parse tree as a result.
  • 12. Limitation Without using global data to create side effects, some of the semantic actions cannot be performed. Example Checking whether a variable is defined before its usage. Checking the type and storage address of a variable. Checking whether a variable is used or not.
  • 13. Common Approach A program with too many global variables is difficult to understand and maintain. Restrict the usage of global variables to essential items and use them as objects.