Q7Compiler Design
Question
2 marks
Define Syntax-Directed Translation.
Answer
SDT attaches semantic rules to grammar productions to evaluate and translate syntax.
Syntax-Directed Translation (SDT) is an advanced compiler mechanism that physically attaches operational semantic rules directly to the abstract productions of a Context-Free Grammar. As the parser constructs the parse tree, these embedded rules are aggressively evaluated simultaneously, allowing the compiler to perform type checking or immediately generate intermediate code during the parsing phase.