Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged ullman
0
votes
0
answers
31
Ullman (Compiler Design) Edition 2 Exercise 5.3 Question 1 (Page No. 323)
Below is a grammar for expressions involving operator $+$ and integer or floating-point operands. Floating-point numbers are distinguished by having a decimal point. $E\rightarrow E+T\mid T$ ... translate expressions into postfix notation.Use the unary operator intToFloat to turn an integer into an equivalent float.
Below is a grammar for expressions involving operator $+$ and integer or floating-point operands. Floating-point numbers are distinguished by having a decimal point.$E\ri...
admin
1.4k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
postfix-notation
+
–
0
votes
0
answers
32
Ullman (Compiler Design) Edition 2 Exercise 5.2 Question 6 (Page No. 317)
Implement Algorithm $3.23$, which converts a regular expression into a nondeterministic finite automaton, by an L-attributed SDD on a top-down parsable grammar. Assume that there is a token char representing any ... never before returned by this function. Use any convenient notation to specify the transitions of the $NFA$.
Implement Algorithm $3.23$, which converts a regular expression into a nondeterministic finite automaton, by an L-attributed SDD on a top-down parsable grammar. Assume th...
admin
837
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
regular-expression
finite-automata
parsing
+
–
0
votes
1
answer
33
Ullman (Compiler Design) Edition 2 Exercise 5.2 Question 5 (Page No. 317)
This grammar generates binary numbers with a "decimal" point: $S\rightarrow L.L\mid L$ $L\rightarrow LB\mid B$ $B\rightarrow 0\mid 1$ Design an S-attributed SDD to compute $S.val$, the decimal-number value of an input string. For example, the translation of string $101.101$ should be the decimal number $5.625$.
This grammar generates binary numbers with a "decimal" point:$S\rightarrow L.L\mid L$$L\rightarrow LB\mid B$$B\rightarrow 0\mid 1$ Design an S-attributed SDD to compute $...
admin
5.5k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
parsing
+
–
0
votes
0
answers
34
Ullman (Compiler Design) Edition 2 Exercise 5.2 Question 4 (Page No. 317)
This grammar generates binary numbers with a "decimal" point: $S\rightarrow L.L\mid L$ $L\rightarrow LB\mid B$ $B\rightarrow 0\mid 1$ Design an L-attributed SDD to compute $S.val$, the decimal-number value of ... $L.side$ that tells which side of the decimal point a bit is on.
This grammar generates binary numbers with a "decimal" point:$S\rightarrow L.L\mid L$$L\rightarrow LB\mid B$$B\rightarrow 0\mid 1$ Design an L-attributed SDD to compute $...
admin
1.6k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
grammar
parsing
+
–
1
votes
2
answers
35
Ullman (Compiler Design) Edition 2 Exercise 5.2 Question 3 (Page No. 317)
Suppose that we have a production $A\rightarrow BCD$. Each of the four nonterminals $A, B, C,$ and $D$ have two attributes: $s$ is a synthesized attribute, and $i$ is an inherited attribute. For each of the sets of rules below, tell whether the rules are consistent ... $A.s=D.i,B.i=A.s+C.s,C.i=B.s,$ and $D.i=B.i+C.i.$
Suppose that we have a production $A\rightarrow BCD$. Each of the four nonterminals $A, B, C,$ and $D$ have two attributes: $s$ is a synthesized attribute, and $i$ is an ...
admin
8.2k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
+
–
0
votes
0
answers
36
Ullman (Compiler Design) Edition 2 Exercise 5.2 Question 2 (Page No. 317)
For the SDD of Fig. $5.8$, give annotated parse trees for the following expressions: int a,b,c. float w,x,y,z.
For the SDD of Fig. $5.8$, give annotated parse trees for the following expressions:int a,b,c.float w,x,y,z.
admin
1.8k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
parsing
+
–
0
votes
1
answer
37
Ullman (Compiler Design) Edition 2 Exercise 5.2 Question 1 (Page No. 317)
What are all the topological sorts for the dependency graph of Fig. $5.7$?
What are all the topological sorts for the dependency graph of Fig. $5.7$?
admin
1.2k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
dependency-graph
topological-sort
+
–
2
votes
0
answers
38
Ullman (Compiler Design) Edition 2 Exercise 5.1 Question 3 (Page No. 310)
For the SDD(SYNTAX-DIRECTED DEFINITIONS ) of Fig. $5.4$, give annotated parse trees for the following expressions: $(3+4)\ast(5+6)n.$ $1\ast2\ast3\ast(4+5)n.$ $(9+8\ast(7+6)+5)\ast 4n.$
For the SDD(SYNTAX-DIRECTED DEFINITIONS ) of Fig. $5.4$, give annotated parse trees for the following expressions:$(3+4)\ast(5+6)n.$$1\ast2\ast3\ast(4+5)n.$$(9+8\ast(7+6)...
admin
2.0k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
parsing
syntax-directed-translation
+
–
0
votes
1
answer
39
Ullman (Compiler Design) Edition 2 Exercise 5.1 Question 2 (Page No. 310)
Extend the SDD of Fig. $5.4$ to handle expressions as in Fig. $5.1$.
Extend the SDD of Fig. $5.4$ to handle expressions as in Fig. $5.1$.
admin
1.9k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
parsing
+
–
5
votes
1
answer
40
Ullman (Compiler Design) Edition 2 Exercise 5.1 Question 1 (Page No. 309 - 310)
For the SDD(SYNTAX-DIRECTED DEFINITIONS ) of Fig. $5.1$, give annotated parse trees for the following expressions: $(3+4)\ast(5+6)n.$ $1\ast2\ast3\ast(4+5)n.$ $(9+8\ast(7+6)+5)\ast 4n.$
For the SDD(SYNTAX-DIRECTED DEFINITIONS ) of Fig. $5.1$, give annotated parse trees for the following expressions:$(3+4)\ast(5+6)n.$$1\ast2\ast3\ast(4+5)n.$$(9+8\ast(7+6)...
admin
41.7k
views
admin
asked
Sep 6, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
parsing
+
–
3
votes
0
answers
41
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
589
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
1
votes
0
answers
42
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
487
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
0
votes
0
answers
43
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
304
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
0
votes
0
answers
44
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
437
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
yacc
descriptive
+
–
2
votes
0
answers
45
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
582
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
lr-parser
descriptive
+
–
0
votes
0
answers
46
Ullman (Compiler Design) Edition 2 Exercise 4.8 Question 1 (Page No. 285 - 286)
The following is an ambiguous grammar for expressions with $n$ binary, infix operators, at $n$ ... ambiguous and unambiguous) grammars compare? What does that comparison tell you about the use of ambiguous expression grammars?
The following is an ambiguous grammar for expressions with $n$ binary, infix operators, at $n$ different levels of precedence: $E\rightarrow E\theta_{1}E\mid E\theta_{2}E...
admin
702
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
ambiguous
parsing
+
–
0
votes
1
answer
47
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
762
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
descriptive
+
–
0
votes
1
answer
48
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
49
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
281
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
descriptive
+
–
0
votes
0
answers
50
Ullman (Compiler Design) Edition 2 Exercise 4.7 Question 2 (Page No. 278)
Repeat Exercise $4.7.1$ for each of the (augmented) grammars of Exercise $4.2.2(a)-(g)$.
Repeat Exercise $4.7.1$ for each of the (augmented) grammars of Exercise $4.2.2(a)-(g)$.
admin
314
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
descriptive
+
–
0
votes
0
answers
51
Ullman (Compiler Design) Edition 2 Exercise 4.7 Question 1 (Page No. 278)
Construct the canonical LR, and LALR sets of items for the grammar $S\rightarrow S S + \mid S S \ast \mid a$ of Question $4.2.1$.
Construct thecanonical LR, andLALR sets of items for the grammar $S\rightarrow S S + \mid S S \ast \mid a$ of Question $4.2.1$.
admin
365
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
lr-parser
descriptive
+
–
0
votes
0
answers
52
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 9 (Page No. 259)
The following is an ambiguous grammar: $S\rightarrow AS\mid b$ $A\rightarrow SA\mid a$ Construct for this grammar its collection of sets of $LR(0)$ items. If we try to build an LR-parsing table for ... choosing a possible action whenever there is a conflict. Show all the possible sequences of actions on input $abab$.
The following is an ambiguous grammar:$S\rightarrow AS\mid b$$A\rightarrow SA\mid a$Construct for this grammar its collection of sets of $LR(0)$ items. If we try to build...
admin
474
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
ambiguous-grammar
lr-parser
descriptive
+
–
0
votes
0
answers
53
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 8 (Page No. 259)
We suggested that individual items could be regarded as states of a nondeterministic finite automaton, while sets of valid items are the states of a deterministic finite automaton (see the box on "Items as States of an NFA" ... the NFA that comes from the valid items for a grammar produces the $LR(0)$ sets of items.
We suggested that individual items could be regarded as states of a nondeterministic finite automaton, while sets of valid items are the states of a deterministic finite ...
admin
273
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
finite-automata
grammar
lr-parser
descriptive
+
–
0
votes
0
answers
54
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 7 (Page No. 258)
Consider the family of grammars $G_{n}$, defined by: $S\rightarrow A_{i}b_{i}$ for $1\leq i\leq n$ $A_{i} \rightarrow a_{j} A_{i}\mid a_{j}$ for $1\leq i,j\leq n$ and $i\neq j$ Show that: $G_{n}$ ... $LR(0)$ items. $G_{n}$ is $SLR(1)$. What does this analysis say about how large $LR$ parsers can get?
Consider the family of grammars $G_{n}$, defined by:$S\rightarrow A_{i}b_{i}$ for $1\leq i\leq n$$A_{i} \rightarrow a_{j} A_{i}\mid a_{j}$ for $1\leq i,j\leq n$ and $i\ne...
admin
1.1k
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
lr-parser
descriptive
+
–
0
votes
0
answers
55
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 6 (Page No. 258)
Show that the following grammar: $S\rightarrow SA\mid A$ $A\rightarrow a$ is SLR(1) but not LL(1).
Show that the following grammar:$S\rightarrow SA\mid A$$A\rightarrow a$is SLR(1) but not LL(1).
admin
467
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
ll-parser
descriptive
+
–
2
votes
0
answers
56
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 5 (Page No. 258)
Show that the following grammar: $S\rightarrow AaAb\mid BbBa$ $A\rightarrow \epsilon$ $A\rightarrow\epsilon$ is LL(1) but not SLR(1).
Show that the following grammar:$S\rightarrow AaAb\mid BbBa$$A\rightarrow \epsilon$$A\rightarrow\epsilon$is LL(1) but not SLR(1).
admin
370
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
parsing
ll-parser
descriptive
+
–
0
votes
0
answers
57
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 4 (Page No. 258)
For each of the (augmented) grammars of Question $4.2.2(a)-(g)$ : Construct the SLR sets of items and their GOTO function. Indicate any action conflicts in your sets of items. Construct the SLR-parsing table, if one exists.
For each of the (augmented) grammars of Question $4.2.2(a)-(g)$ :Construct the SLR sets of items and their GOTO function.Indicate any action conflicts in your sets of ite...
admin
313
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
parsing
slr-item
goto-function
descriptive
+
–
0
votes
0
answers
58
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 3 (Page No. 258)
Show the actions of your parsing table from Question $4.6.2$ on the input $aa \ast a+$.
Show the actions of your parsing table from Question $4.6.2$ on the input $aa \ast a+$.
admin
175
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
parsing
descriptive
+
–
0
votes
0
answers
59
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 2 (Page No. 258)
Construct the SLR sets of items for the (augmented) grammar of Question $4.2.1$. Compute the GOTO function for these sets of items. Show the parsing table for this grammar. Is the grammar SLR?
Construct the SLR sets of items for the (augmented) grammar of Question $4.2.1$. Compute the GOTO function for these sets of items. Show the parsing table for this gramma...
admin
269
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
slr-item
goto-function
descriptive
+
–
5
votes
0
answers
60
Ullman (Compiler Design) Edition 2 Exercise 4.6 Question 1 (Page No. 257 - 258)
Describe all the viable prefixes for the following grammars: The grammar $S\rightarrow 0S1\mid 01$ of Question $4.2.2(a)$. The grammar $S\rightarrow SS+\mid SS\ast\mid a$ of Question $4.2.1$. The grammar $S\rightarrow S(S)\mid \epsilon$ of Question $4.2.2(c)$.
Describe all the viable prefixes for the following grammars:The grammar $S\rightarrow 0S1\mid 01$ of Question $4.2.2(a)$.The grammar $S\rightarrow SS+\mid SS\ast\mid a$ o...
admin
811
views
admin
asked
Aug 20, 2019
Compiler Design
ullman
compiler-design
grammar
viable-prefix
descriptive
+
–
Page:
« prev
1
2
3
4
5
6
7
...
11
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register