Application of Syntax Directed Translation Last Updated : 15 Jul, 2025 Comments Improve Suggest changes 10 Likes Like Report In this article, we are going to cover the application of Syntax Directed Translation where we will also see real example and how can solve the problem with these applications. let's discuss one by one. Pre-requisite : Introduction to Syntax Directed Translation Syntax Directed Translation : It is used for semantic analysis and SDT is basically used to construct the parse tree with Grammar and Semantic action. In Grammar, need to decide who has the highest priority will be done first and In semantic action, will decide what type of action done by grammar. Example : SDT = Grammar+Semantic Action Grammar = E -> E1+E2 Semantic action= if (E1.type != E2.type) then print "type mismatching" Application of Syntax Directed Translation : SDT is used for Executing Arithmetic Expression. In the conversion from infix to postfix expression. In the conversion from infix to prefix expression. It is also used for Binary to decimal conversion. In counting number of Reduction. In creating a Syntax tree. SDT is used to generate intermediate code. In storing information into symbol table. SDT is commonly used for type checking also. Example : Here, we are going to cover an example of application of SDT for better understanding the SDT application uses. let's consider an example of arithmetic expression and then you will see how SDT will be constructed. Let's consider Arithmetic Expression is given. Input : 2+3*4 output: 14 SDT for the above example. SDT for 2+3*4 Semantic Action is given as following. E -> E+T { E.val = E.val + T.val then print (E.val)} |T { E.val = T.val} T -> T*F { T.val = T.val * F.val} |F { T.val = F.val} F -> Id {F.val = id} Create Quiz Comment A Ashish_rana Follow 10 Improve A Ashish_rana Follow 10 Improve Article Tags : Compiler Design GATE CS Explore Compiler Design BasicsIntroduction of Compiler Design5 min readCompiler Construction Tools1 min readPhases of a Compiler8 min readSymbol Table in Compiler3 min readError Handling in Compiler Design3 min readLanguage Processors: Assembler, Compiler and Interpreter5 min readGenerations of Programming Languages3 min readLexical AnalysisIntroduction of Lexical Analysis4 min readFlex (Fast Lexical Analyzer Generator)5 min readIntroduction of Finite Automata3 min readClassification of Context Free Grammars4 min readAmbiguous Grammar7 min readSyntax Analysis & ParsersIntroduction to Syntax Analysis in Compiler Design5 min readFIRST and FOLLOW in Compiler Design6 min readParsing - Introduction to Parsers6 min readConstruction of LL(1) Parsing Table6 min readSyntax Directed Translation & Intermediate Code GenerationSyntax Directed Translation in Compiler Design8 min readS - Attributed and L - Attributed SDTs in Syntax Directed Translation4 min readParse Tree and Syntax Tree4 min readIntermediate Code Generation in Compiler Design6 min readIssues in the design of a code generator7 min readThree address code in Compiler6 min readData flow analysis in Compiler6 min readCode Optimization & Runtime EnvironmentsCode Optimization in Compiler Design9 min readIntroduction of Object Code in Compiler Design6 min readStatic and Dynamic Scoping6 min readRuntime Environments in Compiler Design8 min readLinker8 min readLoader in C/C++3 min readPractice QuestionsLast Minute Notes - Compiler Design13 min readCompiler Design - GATE CSE Previous Year Questions1 min read Like