SlideShare a Scribd company logo
1 of 4
Syntax Directed Translation
Background: -
Parser uses a CFG(Context-free-Grammar) to validate the input string and produce output for next
phase of the compiler. Output could be either a parse tree or abstract syntax tree. Now to interleave
semantic analysis with syntax analysis phase of the compiler, we use Syntax Directed Translation.
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.
Associate attributes with each grammar symbol that describes its properties. An attribute has a
name and an associated value with each production in a grammar, give semantic rules or
actions. The general approach to syntax-directed translation is to construct a parse tree or syntax
tree and compute the values of attributes at the nodes of the tree by visiting them in some order.
Terminology: -
A common method of syntax-directed translation is translating a string into a sequence of actions
by attaching one such action to each rule of a grammar.
Formula: -
Grammar + semantic rule = SDT (syntax directed translation)
Syntax DirectedTranslationScheme
 The Syntax directed translation scheme is a context -free grammar.
 The syntax directed translation scheme is used to evaluate the order of semantic rules.
 In translation scheme, the semantic rules are embedded within the right side of the
productions.
 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: -
Why Syntax directed translation is used?
The syntax directed translation scheme is used to evaluate the order of semantic rules.
In translation scheme, the semantic rules are embedded within the right side of the productions.
The position at which an action is to be executed is shown by enclosed between braces.
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.
a. Symbol table.
b. Labels for GOTO’s.
c. Forwarded declarations.

More Related Content

What's hot

Scope rules : local and global variables
Scope rules : local and global variablesScope rules : local and global variables
Scope rules : local and global variablessangrampatil81
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testingABHISHEK KUMAR
 
Introduction to programming using mat ab
Introduction to programming using mat abIntroduction to programming using mat ab
Introduction to programming using mat abAhmed Hisham
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07uShubham Sharma
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
 
FIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programFIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programraksharao
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
 
recursive problem_solving
recursive problem_solvingrecursive problem_solving
recursive problem_solvingRajendran
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Adam Mukharil Bachtiar
 
Calculation of Cyclomatic complexity
Calculation of Cyclomatic complexityCalculation of Cyclomatic complexity
Calculation of Cyclomatic complexitynikshaikh786
 
Algorithm and flowchart2010
Algorithm and flowchart2010Algorithm and flowchart2010
Algorithm and flowchart2010Jordan Delacruz
 
Database testing for beginners
Database testing for beginnersDatabase testing for beginners
Database testing for beginnersSEEDInfotech1
 
program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigmskasenerd
 
Hybrid Knowledge Bases for Real-Time Robotic Reasoning
Hybrid Knowledge Bases for Real-Time Robotic ReasoningHybrid Knowledge Bases for Real-Time Robotic Reasoning
Hybrid Knowledge Bases for Real-Time Robotic ReasoningHassan Rifky
 
20100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture0220100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture02Computer Science Club
 
SP_Homework_3
SP_Homework_3SP_Homework_3
SP_Homework_3adios
 

What's hot (16)

Scope rules : local and global variables
Scope rules : local and global variablesScope rules : local and global variables
Scope rules : local and global variables
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
 
Introduction to programming using mat ab
Introduction to programming using mat abIntroduction to programming using mat ab
Introduction to programming using mat ab
 
Qat09 presentations dxw07u
Qat09 presentations dxw07uQat09 presentations dxw07u
Qat09 presentations dxw07u
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
FIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programFIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer program
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
recursive problem_solving
recursive problem_solvingrecursive problem_solving
recursive problem_solving
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)
 
Calculation of Cyclomatic complexity
Calculation of Cyclomatic complexityCalculation of Cyclomatic complexity
Calculation of Cyclomatic complexity
 
Algorithm and flowchart2010
Algorithm and flowchart2010Algorithm and flowchart2010
Algorithm and flowchart2010
 
Database testing for beginners
Database testing for beginnersDatabase testing for beginners
Database testing for beginners
 
program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigms
 
Hybrid Knowledge Bases for Real-Time Robotic Reasoning
Hybrid Knowledge Bases for Real-Time Robotic ReasoningHybrid Knowledge Bases for Real-Time Robotic Reasoning
Hybrid Knowledge Bases for Real-Time Robotic Reasoning
 
20100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture0220100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture02
 
SP_Homework_3
SP_Homework_3SP_Homework_3
SP_Homework_3
 

Similar to SYNTAX Directed Translation Report || Compiler Construction

Chapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptxChapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptxArebuMaruf
 
Overlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammarsOverlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammarsIAEME Publication
 
Regular Expression to Deterministic Finite Automata
Regular Expression to Deterministic Finite AutomataRegular Expression to Deterministic Finite Automata
Regular Expression to Deterministic Finite AutomataIRJET Journal
 
Switch case and looping statement
Switch case and looping statementSwitch case and looping statement
Switch case and looping statement_jenica
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A ReviewFernando Torres
 
Design Patterns
Design PatternsDesign Patterns
Design Patternssoms_1
 
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT SystemHua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT SystemAssociation for Computational Linguistics
 
IRJET - Pseudocode to Python Translation using Machine Learning
IRJET - Pseudocode to Python Translation using Machine LearningIRJET - Pseudocode to Python Translation using Machine Learning
IRJET - Pseudocode to Python Translation using Machine LearningIRJET Journal
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diarySHARDA SHARAN
 
RDBMS
RDBMSRDBMS
RDBMSsowfi
 
Lecture: Refactoring
Lecture: RefactoringLecture: Refactoring
Lecture: RefactoringMarcus Denker
 
Cohesive Software Design
Cohesive Software DesignCohesive Software Design
Cohesive Software Designijtsrd
 
Maximizing SAP ABAP Performance
Maximizing SAP ABAP PerformanceMaximizing SAP ABAP Performance
Maximizing SAP ABAP PerformancePeterHBrown
 
Component Based Testing Using Finite Automata
Component Based Testing Using Finite AutomataComponent Based Testing Using Finite Automata
Component Based Testing Using Finite AutomataSanjoy Kumar Das
 
Class Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP TechniquesClass Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP Techniquesiosrjce
 
Generative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlowGenerative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlowGene Leybzon
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming languageVasavi College of Engg
 

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

Chapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptxChapter _4_Semantic Analysis .pptx
Chapter _4_Semantic Analysis .pptx
 
Overlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammarsOverlapping optimization with parsing through metagrammars
Overlapping optimization with parsing through metagrammars
 
Regular Expression to Deterministic Finite Automata
Regular Expression to Deterministic Finite AutomataRegular Expression to Deterministic Finite Automata
Regular Expression to Deterministic Finite Automata
 
C question
C questionC question
C question
 
Switch case and looping statement
Switch case and looping statementSwitch case and looping statement
Switch case and looping statement
 
Query processing System
Query processing SystemQuery processing System
Query processing System
 
GUI Programming in JAVA (Using Netbeans) - A Review
GUI Programming in JAVA (Using Netbeans) -  A ReviewGUI Programming in JAVA (Using Netbeans) -  A Review
GUI Programming in JAVA (Using Netbeans) - A Review
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT SystemHua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
Hua Shan - 2015 - A Dependency-to-String Model for Chinese-Japanese SMT System
 
IRJET - Pseudocode to Python Translation using Machine Learning
IRJET - Pseudocode to Python Translation using Machine LearningIRJET - Pseudocode to Python Translation using Machine Learning
IRJET - Pseudocode to Python Translation using Machine Learning
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 
RDBMS
RDBMSRDBMS
RDBMS
 
Lecture: Refactoring
Lecture: RefactoringLecture: Refactoring
Lecture: Refactoring
 
Cohesive Software Design
Cohesive Software DesignCohesive Software Design
Cohesive Software Design
 
Maximizing SAP ABAP Performance
Maximizing SAP ABAP PerformanceMaximizing SAP ABAP Performance
Maximizing SAP ABAP Performance
 
Component Based Testing Using Finite Automata
Component Based Testing Using Finite AutomataComponent Based Testing Using Finite Automata
Component Based Testing Using Finite Automata
 
Class Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP TechniquesClass Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP Techniques
 
D017232729
D017232729D017232729
D017232729
 
Generative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlowGenerative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlow
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
 

More from Zain Abid

Satellite Communication || Wireless Communication
Satellite Communication || Wireless CommunicationSatellite Communication || Wireless Communication
Satellite Communication || Wireless CommunicationZain Abid
 
Cyber Security
Cyber SecurityCyber Security
Cyber SecurityZain Abid
 
Factors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxFactors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxZain Abid
 
Laplace Transform || Multi Variable Calculus
Laplace Transform || Multi Variable Calculus Laplace Transform || Multi Variable Calculus
Laplace Transform || Multi Variable Calculus Zain Abid
 
Sequence and Series Word File || Discrete Structure
Sequence and Series Word File || Discrete StructureSequence and Series Word File || Discrete Structure
Sequence and Series Word File || Discrete StructureZain Abid
 
Sequence and Series in Discrete Structure
Sequence and Series in Discrete Structure Sequence and Series in Discrete Structure
Sequence and Series in Discrete Structure Zain Abid
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingZain Abid
 
Disadvantages of Social Media
Disadvantages of Social MediaDisadvantages of Social Media
Disadvantages of Social MediaZain Abid
 
Marketing Plan || Nano Navigation Chip
Marketing Plan || Nano Navigation ChipMarketing Plan || Nano Navigation Chip
Marketing Plan || Nano Navigation ChipZain Abid
 
Imam Bukhari life history || امام بخاری کی ذاتی زندگی || Bukhari Sharif
Imam Bukhari life history || امام بخاری کی ذاتی زندگی || Bukhari SharifImam Bukhari life history || امام بخاری کی ذاتی زندگی || Bukhari Sharif
Imam Bukhari life history || امام بخاری کی ذاتی زندگی || Bukhari SharifZain Abid
 

More from Zain Abid (10)

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

Recently uploaded

Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationBoston Institute of Analytics
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxTanveerAhmed817946
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 

Recently uploaded (20)

Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project PresentationPredicting Employee Churn: A Data-Driven Approach Project Presentation
Predicting Employee Churn: A Data-Driven Approach Project Presentation
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Digi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptxDigi Khata Problem along complete plan.pptx
Digi Khata Problem along complete plan.pptx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 

SYNTAX Directed Translation Report || Compiler Construction

  • 1. Syntax Directed Translation Background: - Parser uses a CFG(Context-free-Grammar) to validate the input string and produce output for next phase of the compiler. Output could be either a parse tree or abstract syntax tree. Now to interleave semantic analysis with syntax analysis phase of the compiler, we use Syntax Directed Translation. 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. Associate attributes with each grammar symbol that describes its properties. An attribute has a name and an associated value with each production in a grammar, give semantic rules or actions. The general approach to syntax-directed translation is to construct a parse tree or syntax tree and compute the values of attributes at the nodes of the tree by visiting them in some order. Terminology: - A common method of syntax-directed translation is translating a string into a sequence of actions by attaching one such action to each rule of a grammar. Formula: - Grammar + semantic rule = SDT (syntax directed translation)
  • 2. Syntax DirectedTranslationScheme  The Syntax directed translation scheme is a context -free grammar.  The syntax directed translation scheme is used to evaluate the order of semantic rules.  In translation scheme, the semantic rules are embedded within the right side of the productions.  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.
  • 4. Why Syntax directed translation is used? The syntax directed translation scheme is used to evaluate the order of semantic rules. In translation scheme, the semantic rules are embedded within the right side of the productions. The position at which an action is to be executed is shown by enclosed between braces. 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. a. Symbol table. b. Labels for GOTO’s. c. Forwarded declarations.