sdt
GATE CSE & IT · Semantic Analysis · 1995-2025
Study anchor
Hopcroft-Ullman / Dragon Book
Automata, languages, parsing, syntax-directed translation
Practice action
Start latest PYQPYQs in this concept
All concepts →Given the following syntax directed translation rules : Rule 1 : $R \rightarrow A B\{B . i=R . i-1 ; A . i=B . i R . i=A . i+1 ;\}$ Rule 2 : $P \rightarrow C D\{P . i=C . i+D . i ;...
Consider the following grammar along with translation rules. S $$\to$$ S 1 # T {S.val = S 1 .val * T.val} S $$\to$$ T {S.val = T.val} T $$\to$$ T 1 %R {T.val = T 1 .val $$ \div $$...
Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code: P...
Consider the productions A $$ \to $$ PQ and A $$ \to $$ XY. Each of the five non-terminals A, P, Q, X, and Y has two attributes: s is a synthesized attribute, and i is an inherited...
Consider the following translation scheme. $$\eqalign{ & S \to ER \cr & R \to *E\left\{ {pr{\mathop{\rm int}} ('*');} \right\}R\,|\,\varepsilon \cr & E \to F + E\left\{ {pr{\mathop...
Consider the grammar with the following translation rules and E as the start symbol. $$\eqalign{ & E \to {E_1}\# T\,\,\left\{ {E.value = {E_1}.value*T.value} \right\} \cr & \,\,\,\...
Consider the translation scheme shown below $$\eqalign{ & S \to TR \cr & R \to + T\left\{ {pr{\mathop{\rm int}} (' + ');} \right\}\,R\,|\,\varepsilon \cr & T \to num\,\left\{ {pr{\...
A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar. $$\eqalign{ & S \to xxW\,\left\{ {pr{\matho...