COMPILER DESIGN

SEMANTIC ANALYSIS

ATTRIBUTE GRAMMARS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Syntax directed translation scheme is desirable because
A
it is based on the syntax
B
its description is independent of any implementation
C
it is easy to modify
D
all of these
Explanation: 

Detailed explanation-1: -Syntax-directed translation refers to a method of compiler implementation where the source language translation is completely driven by the parser. 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.

Detailed explanation-2: -A TRANSLATION SCHEME is a context-free grammar in which semantic rules are embedded within the right sides of the productions. So a translation scheme is like a syntax-directed definition, except that the order of evaluation of the semantic rules is explicitly shown.

There is 1 question to complete.