Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged descriptive
0
votes
0
answers
1021
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 7 (Page No. 386)
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.
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 starti...
admin
905
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
1
answer
1022
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 6 (Page No. 386)
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]$
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 starti...
admin
549
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
0
answers
1023
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 5 (Page No. 385 - 386)
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 ... $h_{j}$.The same as $(c)$ but with the array stored in column-major form.
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 case...
admin
353
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
0
answers
1024
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 4 (Page No. 385)
Revise the translation of Fig. $6.22$ for array references of the Fortran style, that is, $id[E_{1}, E_{2},\cdot\cdot\cdot,E_{n}]$ for an $n-$dimensional array.
Revise the translation of Fig. $6.22$ for array references of the Fortran style, that is, $id[E_{1}, E_{2},\cdot\cdot\cdot,E_{n}]$ for an $n-$dimensional array.
admin
383
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
0
answers
1025
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 3 (Page No. 385)
Use the translation of Fig. $6.22$ to translate the following assignments: $x=a[i]+b[j]$ $x=a[i][j]+b[i][j]$ $x=a[b[i][j]][c[[k]]$
Use the translation of Fig. $6.22$ to translate the following assignments: $x=a[i]+b[j]$$x=a[i][j]+b[i][j]$$x=a[b[i][j]][c[[k]]$
admin
706
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
0
answers
1026
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 2 (Page No. 384)
Add to the translation of Fig. $6.19$ rules for the following productions: $E\rightarrow E_{1}\ast E_{2}$ $E\rightarrow + E_{1}\:$(unary plus)
Add to the translation of Fig. $6.19$ rules for the following productions:$E\rightarrow E_{1}\ast E_{2}$$E\rightarrow + E_{1}\:$(unary plus)
admin
441
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
0
answers
1027
Ullman (Compiler Design) Edition 2 Exercise 6.4 Question 1 (Page No. 384)
Add to the translation of Fig. $6.19$ rules for the following productions: $E\rightarrow E_{1}\ast E_{2}$ $E\rightarrow + E_{1}\:$(unary plus)
Add to the translation of Fig. $6.19$ rules for the following productions:$E\rightarrow E_{1}\ast E_{2}$$E\rightarrow + E_{1}\:$(unary plus)
admin
594
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
intermediate-code
three-address-code
descriptive
+
–
0
votes
0
answers
1028
Ullman (Compiler Design) Edition 2 Exercise 6.3 Question 2 (Page No. 378)
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 ... inherited fields. Inherited fields must maintain the relative addresses they were assigned in the layout for the superclass.
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 tab...
admin
482
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
intermediate-code
descriptive
+
–
0
votes
0
answers
1029
Ullman (Compiler Design) Edition 2 Exercise 6.3 Question 1 (Page No. 378)
Determine the types and relative addresses for the identifiers in the following sequence of declarations: float x; record { float x; float y; } p; record { int tag; float x; float y; } q;
Determine the types and relative addresses for the identifiers in the following sequence of declarations:float x; record { float x; float y; } p; record { int tag; float ...
admin
1.2k
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
intermediate-code
descriptive
+
–
0
votes
1
answer
1030
Ullman (Compiler Design) Edition 2 Exercise 6.2 Question 3 (Page No. 370)
Show how to transform a three-address code sequence into one in which each defined variable gets a unique variable name.
Show how to transform a three-address code sequence into one in which each defined variable gets a unique variable name.
admin
1.7k
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
intermediate-code
descriptive
+
–
1
votes
1
answer
1031
Ullman (Compiler Design) Edition 2 Exercise 6.2 Question 2 (Page No. 370)
Translate the following arithmetic expression into: $a=b[i]+c[j]$ $a[i]=b\ast c-b\ast d$ $x=f(y+1)+2$ $x=\ast p + \&y$ A Syntax tree Quadruples Triples Indirect triples
Translate the following arithmetic expression into:$a=b[i]+c[j]$$a[i]=b\ast c-b\ast d$$x=f(y+1)+2$$x=\ast p + \&y$ A Syntax treeQuadruplesTriplesIndirect triples
admin
8.1k
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
intermediate-code
descriptive
+
–
0
votes
1
answer
1032
Ullman (Compiler Design) Edition 2 Exercise 6.2 Question 1 (Page No. 370)
Translate the arithmetic expression $a + -(b + c)$ into: A syntax tree. Quadruples. Triples. Indirect triples
Translate the arithmetic expression $a + -(b + c)$ into:A syntax tree.Quadruples.Triples.Indirect triples
admin
11.2k
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
intermediate-code
descriptive
+
–
0
votes
1
answer
1033
Ullman (Compiler Design) Edition 2 Exercise 6.1 Question 2 (Page No. 363)
Construct the DAG and identify the value numbers for the subexpressions of the following expressions, assuming $+$ associates from the left. $a+b+(a+b)$ $a+b+a+b$ $a+a+((a+a+a+(a+a+a+a))$
Construct the DAG and identify the value numbers for the subexpressions of the following expressions, assuming $+$ associates from the left.$a+b+(a+b)$$a+b+a+b$$a+a+((a+a...
admin
4.9k
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
directed-acyclic-graph
descriptive
+
–
1
votes
2
answers
1034
Ullman (Compiler Design) Edition 2 Exercise 6.1 Question 1 (Page No. 362)
Construct the DAG for the expression $((x + y)-((x + y)\ast(x -y))) + ((x+y)\ast(x-y))$
Construct the DAG for the expression$((x + y)-((x + y)\ast(x -y))) + ((x+y)\ast(x-y))$
admin
2.6k
views
admin
asked
Sep 7, 2019
Compiler Design
ullman
compiler-design
three-address-code
directed-acyclic-graph
descriptive
+
–
0
votes
0
answers
1035
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 7 (Page No. 337)
Modify the SDD of Fig. $5.25$ to include superscripts denoted by operator sup between boxes. If box $B_{2}$ is a superscript of box $B_{1}$, then position the baseline of $B_{2}\:0.6$ times the point size of $B_{1}$ above the baseline of $B_{1}.\text{Add}$ the new production and rules to the SDT of Fig. $5.26$.
Modify the SDD of Fig. $5.25$ to include superscripts denoted by operator sup between boxes. If box $B_{2}$ is a superscript of box $B_{1}$, then position the baseline of...
admin
609
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
descriptive
+
–
0
votes
0
answers
1036
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 6 (Page No. 337)
Modify the SDD of Fig. $5.25$ to include a synthesized attribute $B.le$, the length of a box. The length of the concatenation of two boxes is the sum of the lengths of each. Then add your new rules to the proper positions in the SDT of Fig. $5.26$.
Modify the SDD of Fig. $5.25$ to include a synthesized attribute $B.le$, the length of a box. The length of the concatenation of two boxes is the sum of the lengths of ea...
admin
637
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
descriptive
+
–
0
votes
0
answers
1037
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 5 (Page No. 337)
Write L-attributed SDT's analogous to that of Example $5.19$ for the following productions, each of which represents a familiar flow-of-control construct, as in the programming language C. You may need to ... middle to the next statement, so it is not sufficient simply to generate code for each statement in order.
Write L-attributed SDT's analogous to that of Example $5.19$ for the following productions, each of which represents a familiar flow-of-control construct, as in the progr...
admin
485
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
descriptive
+
–
0
votes
0
answers
1038
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 4 (Page No. 337)
Write L-attributed SDD's analogous to that of Example $5.19$ for the following productions, each of which represents a familiar flow-of-control construct, as in the programming language C. You may need to ... middle to the next statement, so it is not sufficient simply to generate code for each statement in order.
Write L-attributed SDD's analogous to that of Example $5.19$ for the following productions, each of which represents a familiar flow-of-control construct, as in the progr...
admin
454
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
descriptive
+
–
1
votes
1
answer
1039
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 3 (Page No. 337)
The following SDT computes the value of a string of $0's$ and $1's$ ... so the underlying grammar is not left recursive, and yet the same value of $B.val$ is computed for the entire input string.
The following SDT computes the value of a string of $0's$ and $1's$ interpreted as a positive, binary integer.$B\rightarrow B_{1}0\:\{B.val=2\times B_{1}.val\}\mid B_{1}1...
admin
2.2k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
left-recursion
descriptive
+
–
1
votes
1
answer
1040
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 2 (Page No. 336 - 337)
Rewrite the following SDT: $A\rightarrow A\{a\}B\mid AB\{b\}\mid 0$ $B\rightarrow B\{c\}A\mid BA\{d\}\mid 1$ so that the underlying grammar becomes non-left-recursive. Here, $a, b, c$, and $d$ are actions, and $0$ and $1$ are terminals.
Rewrite the following SDT:$A\rightarrow A\{a\}B\mid AB\{b\}\mid 0$$B\rightarrow B\{c\}A\mid BA\{d\}\mid 1$ so that the underlying grammar becomes non-left-recursive. Here...
admin
795
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
descriptive
+
–
0
votes
0
answers
1041
Ullman (Compiler Design) Edition 2 Exercise 5.4 Question 1 (Page No. 336)
We mentioned in Section $5.4.2$ that it is possible to deduce, from the LR state on the parsing stack, what grammar symbol is represented by the state. How would we discover this information?
We mentioned in Section $5.4.2$ that it is possible to deduce, from the LR state on the parsing stack, what grammar symbol is represented by the state. How would we disco...
admin
512
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
descriptive
+
–
0
votes
1
answer
1042
IIIT BLR TEST 1 : ALGORITHMS 2
A 3 way (ternary) min heap is a 3 way ( ternary - each node as atmost three children nodes, left, mid, right ) complete tree with min heap property ( value of the parent is less than the value of the children ) satisfied at every node ... c) In Heapsort, binary heap is preferred over ternary heap. State if this statement is true or false, you must justify your answer.
A 3 way (ternary) min heap is a 3 way ( ternary – each node as atmost three children nodes, left, mid, right ) complete tree with min heap property ( value of the paren...
Shaik Masthan
765
views
Shaik Masthan
asked
Aug 27, 2019
Programming in C
iiit-blr
data-structures
binary-heap
descriptive
+
–
3
votes
0
answers
1043
Ullman (Compiler Design) Edition 2 Exercise 4.9 Question 4 (Page No. 297)
Write a $Yacc$ program that takes regular expressions (as defined by the grammar of Question $4.2.2(d)$, but with any single character as an argument, not just a) and produces as output a transition table for a nondeterministic finite automaton recognizing the same language.
Write a $Yacc$ program that takes regular expressions (as defined by the grammar of Question $4.2.2(d)$, but with any single character as an argument, not just a) and p...
admin
594
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
1
votes
0
answers
1044
Ullman (Compiler Design) Edition 2 Exercise 4.9 Question 2 (Page No. 297)
Write a $Yacc$ program that takes lists (as defined by the grammar of Question $4.2.2(e)$, but with any single character as an element, not just $a$) and produces as output a linear representation of the same list; i.e., a single list of the elements, in the same order that they appear in the input.
Write a $Yacc$ program that takes lists (as defined by the grammar of Question $4.2.2(e)$, but with any single character as an element, not just $a$) and produces as outp...
admin
496
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
0
votes
0
answers
1045
Ullman (Compiler Design) Edition 2 Exercise 4.9 Question 3 (Page No. 297)
Write a $Yacc$ program that tells whether its input is a palindrome (sequence of characters that read the same forward and backward).
Write a $Yacc$ program that tells whether its input is a palindrome (sequence of characters that read the same forward and backward).
admin
308
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
0
votes
0
answers
1046
Ullman (Compiler Design) Edition 2 Exercise 4.9 Question 1 (Page No. 297)
Write a $Yacc$ program that takes boolean expressions as input [as given by the grammar of Question $4.2.2(g)$] and produces the truth value of the expressions.
Write a $Yacc$ program that takes boolean expressions as input [as given by the grammar of Question $4.2.2(g)$] and produces the truth value of the expressions.
admin
442
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
2
votes
0
answers
1047
Ullman (Compiler Design) Edition 2 Exercise 4.8 Question 2 (Page No. 286 - 287)
In Fig. $4.56$ is a grammar for certain statements, similar to that discussed in Question $4.4.12$. Again, $e$ and $s$ are terminals standing for conditional expressions and "other statements," respectively. Build an LR parsing ... inputs: if e then s ; if e then s end while e do begin s ; if e then s ; end
In Fig. $4.56$ is a grammar for certain statements, similar to that discussed in Question $4.4.12$. Again, $e$ and $s$ are terminals standing for conditional expressions ...
admin
595
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
lr-parser
descriptive
+
–
0
votes
1
answer
1048
Ullman (Compiler Design) Edition 2 Exercise 4.7 Question 5 (Page No. 278)
Show that the following grammar $S\rightarrow Aa\mid bAc\mid Bc\mid bBa$ $A\rightarrow d$ $B\rightarrow d$ is LR(1) but not LALR(1).
Show that the following grammar$S\rightarrow Aa\mid bAc\mid Bc\mid bBa$$A\rightarrow d$$B\rightarrow d$is LR(1) but not LALR(1).
admin
770
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
descriptive
+
–
0
votes
1
answer
1049
Ullman (Compiler Design) Edition 2 Exercise 4.7 Question 4 (Page No. 278)
Show that the following grammar $S\rightarrow Aa\mid bAc\mid dc\mid bda$ $A\rightarrow d$ is LALR(1) but not SLR(1).
Show that the following grammar$S\rightarrow Aa\mid bAc\mid dc\mid bda$$A\rightarrow d$is LALR(1) but not SLR(1).
admin
1.5k
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
descriptive
+
–
0
votes
0
answers
1050
Ullman (Compiler Design) Edition 2 Exercise 4.7 Question 3 (Page No. 278)
For the grammar of Exercise $4.7.1$, use Algorithm $4.63$ to compute the collection of LALR sets of items from the kernels of the $LR(0)$ sets of items.
For the grammar of Exercise $4.7.1$, use Algorithm $4.63$ to compute the collection of LALR sets of items from the kernels of the $LR(0)$ sets of items.
admin
287
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
descriptive
+
–
Page:
« prev
1
...
30
31
32
33
34
35
36
37
38
39
40
...
91
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register