search
Log In

Recent questions tagged intermediate-code

0 votes
3 answers
1
In the context of compilers, which of the following is/are $\text{NOT}$ an intermediate representation of the source program? Three address code Abstract Syntax Tree $\text{(AST)}$ Control Flow Graph $\text{(CFG)}$ Symbol table
asked Feb 18 in Compiler Design Arjun 1.3k views
2 votes
1 answer
2
Which of the following is not an intermediate code form? Syntax trees Three address codes Quadrupules Post fix Notation
asked Nov 20, 2020 in Compiler Design jothee 2.2k views
1 vote
0 answers
3
As in Ada, suppose that each expression must have a unique type, but that from a subexpression, by itself, all we can deduce is a set of possible types. That is, the application of function $E_{1}$ to argument $E_{2}$ ... and, once the unique type of the overall expression is determined, proceeds top-down to determine attribute $unique$ for the type of each subexpression.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 493 views
0 votes
0 answers
4
Assuming that function $widen$ in Fig. $6.26$ can handle any of the types in the hierarchy of Fig. $6.25(a)$, translate the expressions below. Assume that c and d are characters, $s$ and $t$ are short integers, $i$ and $j$ are integers, and $x$ is a float. $x=s+c$ $i=s+c$ $x=(s+c)\ast(t+d)$
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 255 views
0 votes
0 answers
5
$A$ real array $A[i, j, k]$ has index $i$ ranging from $1$ to $4$, index $j$ ranging from $0$ to $4$, and index $k$ ranging from $5$ to $10$. Reals take $8$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[3,4,5]$ $A[1,2,7]$ $A[4,3,9]$ if $A$ is stored in column-major order.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 233 views
0 votes
1 answer
6
$A$ real array $A[i, j, k]$ has index $i$ ranging from $1$ to $4$, index $j$ ranging from $0$ to $4$, and index $k$ ranging from $5$ to $10$. Reals take $8$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[3,4,5]$ $A[1,2,7]$ $A[4,3,9]$
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 218 views
0 votes
0 answers
7
An integer array $A[i, j]$ has index $i$ ranging from $1$ to $10$ and index $j$ ranging from $1$ to $20$. Integers take $4$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[4,5]$ $A[10,8]$ $A[3,17]$ if A is stored in column-major order.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 544 views
0 votes
1 answer
8
An integer array $A[i, j]$ has index $i$ ranging from $1$ to $10$ and index $j$ ranging from $1$ to $20$. Integers take $4$ bytes each. Suppose array $A$ is stored starting at byte $0$. Find the location of: $A[4,5]$ $A[10,8]$ $A[3,17]$
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 218 views
0 votes
0 answers
9
Generalize formula $(6.7)$ to multidimensional arrays, and indicate what values can be stored in the symbol table and used to compute offsets. Consider the following cases: An array $A$ of two dimensions, in row-major form. The first dimension has indexes running from $l_{1}$ ... has indexes running from $l_{j}$ to $h_{j}$.The same as $(c)$ but with the array stored in column-major form.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 125 views
0 votes
0 answers
14
Extend the handling of field names in Fig. $6.18$ to classes and single-inheritance class hierarchies. Give an implementation of class $Enu$ that allows linked symbol tables, so that a subclass can either redefine a field name or refer directly to a ... in a class, including inherited fields. Inherited fields must maintain the relative addresses they were assigned in the layout for the superclass.
asked Sep 7, 2019 in Compiler Design Lakshman Patel RJIT 163 views
0 votes
0 answers
15
1 vote
1 answer
17
1 vote
1 answer
19
On translating the expression given below into quadruple representation, how many operations are required? $(i\ast j)+(e+f)\ast(a\ast b+c)$ $5$ $6$ $3$ $7$
asked Jul 2, 2019 in Compiler Design Arjun 1.6k views
0 votes
0 answers
20
Generate code for the following three-address statements assuming stack allocation where register SP points to the top of the stack x = 1 x=a x = a + 1 x = a+b The two statements x = b * c y = a + x
asked Apr 1, 2019 in Compiler Design aditi19 488 views
0 votes
1 answer
21
1 vote
1 answer
22
someone please share detailed rules for this along with solution- would be of great help. and we usually dont take start and end state- arent they extra here? coz count comes different
asked Jan 8, 2019 in Compiler Design Markzuck 323 views
0 votes
1 answer
23
A sequential search operation is performed on an array $A$ for the key value of $'x'$ (ignore quotes). Consider the following piece of assembly language code that uses back patching to perform the sequential search. i=0; P: if (i<A.length) goto ____; Q: goto ____; R: if (x==A[i] ... What should be the correct values in the blanks provided ordered from top to bottom? R T U P R U T P P U T R P T U R
asked Dec 27, 2018 in Algorithms Ruturaj Mohanty 223 views
0 votes
0 answers
24
what will be the three address code for x=A[i][j] Given A[M][N] and w is word size; t1=i*N; t2=t1+j; t3=t2*w; t4=base address of array A[M][N] t5=t4+t3; x=t5; My doubt here: Is there any need of t4 variable for storing the base address of arrary or we can directly do it as t4=A[t3]; x=t4;
asked Dec 22, 2018 in Compiler Design Shivam Kasat 204 views
0 votes
1 answer
25
Identify the correct nodes and edges in the given intermediate code $i=1$ $t1=5*i$ $t2=4*t1$ $t3=t2$ $a[t3]=0$ $i=i+1$ if $i<15$ goto(2) $33$ $44$ $43$ $34$
asked Dec 7, 2018 in Compiler Design Arjun 1.5k views
...