...
Compiler-Design
October 8, 2023
Operating-Systems
October 8, 2023
Compiler-Design
October 8, 2023
Operating-Systems
October 8, 2023

Compiler-Design

Question 50

Consider the following translation scheme.

   S → ER 
   R → *E{print("*");}R|ε 
   E → F + E {print("+");}|F 
   F → (S)|id {print(id.value);} 

Here id is a token that represents an integer and id.value represents the corresponding integer value. For an input ‘2 * 3 + 4’, this translation scheme prints

A
2 * 3 + 4
B
2 * +3 4
C
2 3 * 4 +
D
2 3 4+*
Question 50 Explanation: 

Now perform post order evaluation, you will get output as,
2 3 4 + *
Correct Answer: D
Question 50 Explanation: 

Now perform post order evaluation, you will get output as,
2 3 4 + *
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!