COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which mapping is described by the implementation of the syntax-directed translator?
A
Parse table
B
Input
C
Output
D
Input-Output
Explanation: 

Detailed explanation-1: -Syntax-directed translation provides a method for describing an input-output mapping and that description is independent of implementation. To implement Syntax Directed Translation, It can use a stack that consists of a pair of arrays STATE & VAL.

Detailed explanation-2: -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.

Detailed explanation-3: -A technique of compiler execution, where the source code translation is totally conducted by the parser, is known as syntax-directed translation. The parser primarily uses a Context-free-Grammar to check the input sequence and deliver output for the compiler’s next stage.

Detailed explanation-4: -The syntax-directed translation scheme is beneficial because it allows the compiler designer to define the generation of intermediate code directly in terms of the syntactic structure of the source language.

Detailed explanation-5: -There can be two classes of syntax-directed translations S-attributed translation and L-attributed translation. An SDD is S-attributed if the attributes of the node are synthesized attributes.

There is 1 question to complete.