Consider the following translation scheme. [code] S -> ER R -> * E{print{’ * ’); R | f E -> F + E{print(’ + ’); | F F -> (S) | id{print(id.v

Consider the following translation scheme.
Code:
S -> ER 
R -> * E{print{’ * ’);
R | f 
E -> F + E{print(’ + ’); | F 
F -> (S) | id{print(id.value);}
Here id is a taken 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 + *
 

Tìm kiếm

Back
Top