55 55 votes Type checking is normally done during lexical analysis syntax analysis syntax directed translation code optimization Compiler Design gate1998 compiler-design parsing easy + – Kathleen 18.9k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 98 98 votes The answer is c . The use of syntax analyser is used to create parse Tree. But along with Grammar as input to Syntax Analyser we add even semantic rules which form the basis of Syntax Directed Translation That help us in Evaluation of Expression .Remember that Syntax Directed Translation is used in following cases Conversion of infix to Postfix Calculation of infix expression For creating a Acyclic graph Type Checking Conversion of Binary number to Decimal Counting the numbers of bits (0 or 1 ) in a binary number Creation of syntax tree To generate Intermediate code Storing the data into Symbol table spriti1991 answered Mar 18, 2015 • edited Dec 7, 2017 by kenzou spriti1991 comment Share Follow See all 12 Comments 12 12 Comments reply Show 9 previous comments Nirmalbbll commented Feb 1, 2020 reply Follow flag is syntax directed translation is done semantic analyser phase? third phase of compiler. 0 0 replyShare anon1 commented Dec 26, 2021 reply Follow flag Yes. @Nirmalbbll . But not only semantic phase. It used during Intermediate code generation also. 0 0 replyShare Miss cache commented Sep 10 reply Follow flag Type checking is done during the semantic analysis phase, and Syntax-Directed Translation (SDT) is the tool or method used to implement and perform those semantic checks. Relationship Between Semantic Analysis and SDT Semantic Analysis: This is a major semantic analysis phase of a compiler. Its job is to check the meaning of a program ensuring things like type consistency, variable declarations, and scope rules are correct. Syntax-Directed Translation (SDT): This is the underlying mechanism or formal technique (using semantic rules attached to grammar productions) that the compiler uses to carry out these checks during parsing or tree traversal. 0 0 replyShare Please log in or register to add a comment.