Recent questions tagged syntax-directed-translation

8 8 votes
2 2 answers
1.4k
1.4k views
​​​​​​Consider the following two syntax-directed definitions $\text{SDD1}$ and $\text{SDD2}$ for type declarations. SDD1Grammar (G1)Semantic Rules$D \rightarrow T\ V$$D.t...
2 2 votes
1 answers 1 answer
719
719 views
Consider the following SDT:S - T RR - {printf("*")} + T {printf("*")} R {printf("+")}T - num {printf("*")}R - ε {printf("+")}How many * will be printed before the first +...
0 0 votes
2 2 answers
389
389 views
Please please please help me Answer thisQ1. Given RE to DFA: (0+1)*10*10*Q2. Write the regular expression for: “All strings of {a,b}containing atleast two b’s.” 
1 1 vote
1 1 answer
406
406 views
0 0 votes
0 0 answers
264
264 views
Hi my dear Please help me to Answer This Questions  Q1. Answer the following a) Check the ambiguity for the string “aaa” in the given grammar:S → aB | bAA → aS | bAA | aB...
0 0 votes
2 2 answers
357
357 views
Consider the following Three Address code sample for solving the questions:$\begin{array}{l}100: \text { t } 1=y+2 \\101: \text { initial }=x / t 1 \\102: \text { limit }...
0 0 votes
2 2 answers
341
341 views
Match the $\textbf{LIST-I}$ with $\textbf{LIST-II}$$\begin{array}{|l|l|l|l|} \hline & \textbf{ LIST-I } & & \textbf{ LIST-II } \\ \hline \text{A.} & \text{Conflict Resol...
1 1 vote
1 1 answer
286
286 views
Which of the following tasks could be attained using syntax trees in compiler design?Type CheckingCode GenerationCode OptimizationError HandlingChoose the correct answer ...
1 1 vote
0 0 answers
231
231 views
Match List - I with List - II according to input to the compiler phase that process it:$$\begin{array}{lll} & \text{List - I} & \text{List - II} \\\text{(A)} & \text...
0 0 votes
0 0 answers
450
450 views
23 23 votes
8 8 answers
9.4k
9.4k views
​​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 . ...
0 0 votes
1 1 answer
480
480 views
0 0 votes
0 0 answers
468
468 views
Q4. Check the ambiguity for the string id[id]in the given grammar:E → E+T | TT → id | id[ ] | id[X]X → E , E | E Please answer like example in this page link https://ww...
0 0 votes
1 1 answer
1.1k
1.1k views
Q1. a) Convert the given NFA to DFA. (Show the steps)    b) Write the regular expression for “ String starts with 1 and has an even length.”        
0 0 votes
1 1 answer
316
316 views
5. Convert the following:a) Given FA to RE  b) Given RE to DFA : (a|b)*(abb|a+ b)       
0 0 votes
0 0 answers
596
596 views
In this question I believe as there is no evaluation taking place as you can see the Translation part of the production ruleonly printing is taking place nothing is given...
1 1 vote
0 0 answers
315
315 views
1. Generate intermediate code for the following code segment. a) (x<y) and (y>z) and not z b) if(i%2==0)evensum=evensum+elseoddsum=oddsum+i;
38 38 votes
3 3 answers
17.8k
17.8k views
​​​​​Which of the following statements is/are FALSE?An attribute grammar is a syntax-directed definition $\text{(SDD)}$ in which the functions in the semantic rules have ...
15 15 votes
4 answers 4 answers
14.1k
14.1k views
​Consider the following syntax-directed definition $\text{(SDD)}$.$$\begin{array}{|l|l|} \hline \text{$S \rightarrow D H T U$} & \text{$ \left\{S.v a l = D.val + H.val +...
3 3 votes
0 0 answers
1.7k
1.7k views
0 0 votes
2 2 answers
783
783 views
6. Generate code for the following C program using any code generation algorithm. [3 Marks] main() { int x, a, b, c, d, e; ...
0 0 votes
0 0 answers
444
444 views
0 0 votes
0 0 answers
368
368 views
Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b