Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged ullman
0
votes
0
answers
91
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 8 (Page No. 126 - 127)
In Lex, a complemented character class represents any character except the ones listed in the character class. We denote a complemented class by using ^ as the first character; this ... expression with complemented character classes, there is an equivalent regular expression without complemented character classes.
In Lex, a complemented character class represents any character except the ones listed in the character class. We denote a complemented class by using ^ as the first char...
admin
820
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
regular-expression
descriptive
+
–
0
votes
0
answers
92
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 7 (Page No. 126)
Note that these regular expressions give all of the following symbols (operator characters) a special meaning: \ " . ^ ... the regular expression \*\* also matches the string **. Write a regular expression that matches the string "\.
Note that these regular expressions give all of the followingsymbols (operator characters) a special meaning:\ " . ^ $ [] * + ? {} | /Their special meaning must be turned...
admin
294
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
regular-expression
descriptive
+
–
0
votes
0
answers
93
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 6 (Page No. 126)
Write character classes for the following sets of characters: The first ten letters (up to "j" ) in either upper or lower case. The lowercase consonants. The "digits" in a hexadecimal number (choose either ... we shall discuss extensively in Section $3.5)$. The extended notation is listed in Fig.$3.8$.
Write character classes for the following sets of characters:The first ten letters (up to "j" ) in either upper or lower case.The lowercase consonants.The "digits" in a h...
admin
1.2k
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
regular-expression
descriptive
+
–
3
votes
0
answers
94
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 5 (Page No. 125 - 126)
Write regular definitions for the following languages: All strings of lowercase letters that contain the five vowels in order. All strings of lowercase letters in which the letters are in ascending lexicographic order. ... substring abb. All strings of a's and b's that do not contain the subsequence abb.
Write regular definitions for the following languages:All strings of lowercase letters that contain the five vowels in order.All strings of lowercase letters in which the...
admin
2.5k
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
descriptive
regular-expression
+
–
1
votes
0
answers
95
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 4 (Page No. 125)
Most languages are case sensitive, so keywords can be written only one way, and the regular expressions describing their lexeme is very simple. However, some languages, like SQL, are case insensitive, so a keyword ... in a case-insensitive language. Illustrate the idea by writing the expression for "select" in SQL.
Most languages are case sensitive, so keywords can be written only one way, and the regular expressions describing their lexeme is very simple. However, some languages, l...
admin
1.1k
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
regular-expression
compiler-tokenization
descriptive
+
–
3
votes
1
answer
96
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 3 (Page No. 125)
In a string of length $n$, how many of the following are there? Prefixes. Suffixes. Proper prefixes. Substrings. Subsequences.
In a string of length $n$, how many of the following are there? Prefixes. Suffixes. Proper prefixes. Substrings. Subsequences.
admin
1.9k
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
strings
descriptive
+
–
2
votes
1
answer
97
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 2 (Page No. 125)
Describe the languages denoted by the following regular expressions: $a(a\mid b)^{\ast}a.$ $((\epsilon\mid a)b^{\ast})^{\ast}.$ $(a\mid b)^{\ast}a(a\mid b)(a\mid b).$ $a^{\ast}ba^{\ast}ba^{\ast}ba^{\ast}.$ $(aa\mid bb)^{\ast}((ab\mid ba)(aa\mid bb)^{\ast}(ab\mid ba)(aa\mid bb)^{\ast})^{\ast}.$
Describe the languages denoted by the following regular expressions:$a(a\mid b)^{\ast}a.$$((\epsilon\mid a)b^{\ast})^{\ast}.$$(a\mid b)^{\ast}a(a\mid b)(a\mid b).$$a^{\as...
admin
2.3k
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
regular-expression
descriptive
+
–
3
votes
0
answers
98
Ullman (Compiler Design) Edition 2 Exercise 3.3 Question 1 (Page No. 125)
Consult the language reference manuals to determine the sets of characters that form the input alphabet (excluding those that may only appear in character strings or comments), the lexical form of numerical constants, and the lexical form of identifiers, for each of the following languages: C C++ C# Fortran Java Lisp SQL
Consult the language reference manuals to determinethe sets of characters that form the input alphabet (excluding those that may only appear in character strings or comme...
admin
1.2k
views
admin
asked
Aug 5, 2019
Compiler Design
ullman
compiler-design
lexical-analysis
compiler-tokenization
descriptive
+
–
0
votes
1
answer
99
Ullman (Compiler Design) Edition 2 Exercise 3.1 Question 2 (Page No. 114 - 115)
Tagged languages like HTML or XML are different from conventional programming languages in that the punctuation (tags) are either very numerous (as in HTML) or a user-definable set (as in XML). Further ... P> into appropriate lexemes. Which lexemes should get associated lexical values,and what should those values be?
Tagged languages like HTML or XML are different from conventional programming languages in that the punctuation (tags) are either very numerous (as in HTML) or a user-def...
admin
1.1k
views
admin
asked
Jul 27, 2019
Compiler Design
ullman
compiler-design
lexical-analysis
compiler-tokenization
+
–
0
votes
0
answers
100
Ullman (Compiler Design) Edition 2 Exercise 3.1 Question 1 (Page No. 114)
Divide the following C + + program: float limitedSquare(x) float x { /* returns x-squared, but never more than 100 */ return (x<=-10.0 || x>=10.0)?100:x*x; } into appropriate lexemes, using the discussion of Section $3.1.2$ as a guide. Which lexemes should get associated lexical values? What should those values be?
Divide the following C + + program:float limitedSquare(x) float x { /* returns x-squared, but never more than 100 */ return (x<=-10.0 || x>=10.0)?100:x*x; }into appropria...
admin
1.4k
views
admin
asked
Jul 27, 2019
Compiler Design
ullman
compiler-design
lexical-analysis
compiler-tokenization
+
–
0
votes
1
answer
101
Ullman (Compiler Design) Edition 2 Exercise 2.8 Question 2 (Page No. 105)
The programming language C does not have a boolean type. Show how a C compiler might translate an if-statement into three-address code.
The programming language C does not have a boolean type. Show how a C compiler might translate an if-statement into three-address code.
admin
337
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
three-address-code
+
–
0
votes
0
answers
102
Ullman (Compiler Design) Edition 2 Exercise 2.8 Question 1 (Page No. 105)
For-statements in C and Java have the form: for $( expr_l ; expr_2 ; expr_3 ) stmt$ The first expression is executed before the loop; it is typically used for initializing the loop index. The second expression is a test made before ... $2.43$ .
For-statements in C and Java have the form:for $( expr_l ; expr_2 ; expr_3 ) stmt$The first expression is executed before the loop; it is typically used for initializing ...
admin
296
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
three-address-code
+
–
0
votes
0
answers
103
Ullman (Compiler Design) Edition 2 Exercise 2.6 Question 3 (Page No. 85)
Extend the lexical analyzer in Section $2.6.5$ to recognize floating point numbers such as $2. , 3.14$, and $.5$.
Extend the lexical analyzer in Section $2.6.5$ to recognize floating point numbers such as $2. , 3.14$, and $.5$.
admin
232
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
lexical-analyzer
+
–
0
votes
0
answers
104
Ullman (Compiler Design) Edition 2 Exercise 2.6 Question 2 (Page No. 85)
Extend the lexical analyzer in Section $2.6.5$ to recognize the relational operators $<, <=, ==, !=, >=, >$.
Extend the lexical analyzer in Section $2.6.5$ to recognize the relational operators $<, <=, ==, !=, >=, >$.
admin
298
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
lexical-analyzer
+
–
0
votes
0
answers
105
Ullman (Compiler Design) Edition 2 Exercise 2.6 Question 1 (Page No. 84 - 85)
Extend the lexical analyzer in Section $2.6.5$ to remove comments, defined as follows: A comment begins with $//$ and includes all characters until the end of that line. A comment begins with $/\ast$ and includes all characters through the next occurrence of the character sequence $\ast/$.
Extend the lexical analyzer in Section $2.6.5$ to remove comments, defined as follows:A comment begins with $//$ and includes all characters until the end of that line.A ...
admin
289
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
lexical-analyzer
+
–
0
votes
1
answer
106
Ullman (Compiler Design) Edition 2 Exercise 2.4 Question 1 (Page No. 68)
Construct recursive-descent parsers, starting with the following grammars: $S\rightarrow +SS \mid -SS \mid a$ $S\rightarrow S(S)S \mid \epsilon$ $S\rightarrow 0S1 \mid 01$
Construct recursive-descent parsers, starting with the following grammars:$S\rightarrow +SS \mid -SS \mid a$$S\rightarrow S(S)S \mid \epsilon$$S\rightarrow 0S1 \mid 01$
admin
579
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
recursive-descent-parser
+
–
0
votes
0
answers
107
Ullman (Compiler Design) Edition 2 Exercise 2.3 Question 5 (Page No. 60)
Construct a syntax-directed translation scheme that translates postfix arithmetic expressions into equivalent infix arithmetic expressions.
Construct a syntax-directed translation scheme that translates postfix arithmetic expressions into equivalent infix arithmetic expressions.
admin
651
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
+
–
0
votes
0
answers
108
Ullman (Compiler Design) Edition 2 Exercise 2.3 Question 4 (Page No. 60)
Construct a syntax-directed translation scheme that translates roman numerals into integers.
Construct a syntax-directed translation scheme that translates roman numerals into integers.
admin
545
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
+
–
0
votes
0
answers
109
Ullman (Compiler Design) Edition 2 Exercise 2.3 Question 3 (Page No. 60)
Construct a syntax-directed translation scheme that translates integers into roman numerals.
Construct a syntax-directed translation scheme that translates integers into roman numerals.
admin
319
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
+
–
1
votes
0
answers
110
Ullman (Compiler Design) Edition 2 Exercise 2.3 Question 2 (Page No. 60)
Construct a syntax-directed translation scheme that translates arithmetic expressions from postfix notation into infix notation. Give annotated parse trees for the inputs $95-2*$ and $952*-$.
Construct a syntax-directed translation scheme that translates arithmetic expressions from postfix notation into infix notation. Give annotated parse trees for the inputs...
admin
1.3k
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
parsing
+
–
1
votes
1
answer
111
Ullman (Compiler Design) Edition 2 Exercise 2.3 Question 1 (Page No. 60)
Construct a syntax-directed translation scheme that translates arithmetic expressions from infix notation into prefix notation in which an operator appears before its operands; e.g., $-xy$ is the prefix notation for $x - y$. Give annotated parse trees for the inputs $9-5+2$ and $9-5*2$.
Construct a syntax-directed translation scheme that translates arithmetic expressions from infix notation into prefix notation in which an operator appears before its ope...
admin
3.5k
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
syntax-directed-translation
parsing
+
–
1
votes
0
answers
112
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 6 (Page No. 52)
Construct a context-free grammar for roman numerals.
Construct a context-free grammar for roman numerals.
admin
284
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
context-free-grammar
+
–
0
votes
0
answers
113
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 5 (Page No. 52)
Show that all binary strings generated by the following grammar have values divisible by $3$. Hint. Use induction on the number of nodes in a parse tree. $num\rightarrow 11 \mid 1001 \mid num \ 0 \mid num \ num$ Does the grammar generate all binary strings with values divisible by $3$?
Show that all binary strings generated by the following grammar havevalues divisible by $3$. Hint. Use induction on the number of nodes in a parse tree. $$num\rightarrow ...
admin
505
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
grammar
+
–
0
votes
0
answers
114
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 4 (Page No. 51 - 52)
Construct unambiguous context-free grammars for each of the following languages. In each case show that your grammar is correct. Arithmetic expressions in postfix notation. Left-associative lists of identifiers separated by commas. Right- ... $(d)$.
Construct unambiguous context-free grammars for each of the following languages. In each case show that your grammar is correct. Arithmetic expressions in postfix notatio...
admin
659
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
context-free-grammar
+
–
1
votes
2
answers
115
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 3 (Page No. 51)
Which of the grammars are ambiguous? $S\rightarrow 0S1 \mid 01$ $S\rightarrow +SS \mid -SS \mid a$ $S\rightarrow S(S)S \mid \epsilon$ $S\rightarrow aSbS \mid bSaS \mid \epsilon$ $S\rightarrow a \mid S+S \mid SS \mid S^{\ast} \mid (S)$
Which of the grammars are ambiguous? $S\rightarrow 0S1 \mid 01$$S\rightarrow +SS \mid -SS \mid a$$S\rightarrow S(S)S \mid \epsilon$$S\rightarrow aSbS \mid bSaS \mid \epsi...
admin
1.2k
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
context-free-grammar
ambiguous
+
–
0
votes
0
answers
116
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 2 (Page No. 51)
What language is generated by the following grammars? In each case justify your answer. $S\rightarrow 0S1 \mid 01$ $S\rightarrow +SS \mid -SS \mid a$ $S\rightarrow S(S)S \mid \epsilon$ $S\rightarrow aSbS \mid bSaS \mid \epsilon$ $S\rightarrow a \mid S+S \mid SS \mid S^{\ast} \mid (S)$
What language is generated by the following grammars? In each case justify your answer. $S\rightarrow 0S1 \mid 01$$S\rightarrow +SS \mid -SS \mid a$$S\rightarrow S(S)S \m...
admin
333
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
context-free-grammar
+
–
0
votes
0
answers
117
Ullman (Compiler Design) Edition 2 Exercise 2.2 Question 1 (Page No. 51)
Consider the context-free grammar $S\rightarrow SS+\mid SS^{\ast}\mid a$ Show how the string $aa+a^{\ast}$ can be generated by this grammar. Construct a parse tree for this string. What language does this grammar generate? Justify your answer.
Consider the context-free grammar$S\rightarrow SS+\mid SS^{\ast}\mid a$Show how the string $aa+a^{\ast}$ can be generated by this grammar.Construct a parse tree for this ...
admin
176
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
context-free-grammar
+
–
0
votes
1
answer
118
Ullman (Compiler Design) Edition 2 Exercise 1.6 Question 4 (Page No. 36)
What is printed by the following C code? #define a (x+1) int x = 2; void b() {x = a; printf("%d\n",x);} void c() {int x = 1; printf("%d\n"),a;} void main() {b(); c();}
What is printed by the following C code?#define a (x+1) int x = 2; void b() {x = a; printf("%d\n",x);} void c() {int x = 1; printf("%d\n"),a;} void main() {b(); c();}
admin
211
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
+
–
0
votes
0
answers
119
Ullman (Compiler Design) Edition 2 Exercise 1.6 Question 3 (Page No. 35 - 36)
For the block-structured code, assuming the usual static scoping of declarations, give the scope for each of the twelve declarations. { int w,x,y,z; /* Block B1 */ { int x,z; /* Block B2 */ { int w,x; /* Block B3 */ } } { int w,x; /* Block B4 */ { int y,z; /* Block B5 */ } } }
For the block-structured code, assuming the usual static scoping of declarations, give the scope for each of the twelve declarations.{ int w,x,y,z; /* Block B1 */ { int x...
admin
185
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
+
–
0
votes
0
answers
120
Ullman (Compiler Design) Edition 2 Exercise 1.6 Question 2 (Page No. 35 - 36)
For the block-structured C code, indicate the values assigned to $w,x,y$ and $z$. int w,x,y,z; int i = 3; int j = 4; { int i = 5; w = i + j; } x = i + j; { int j = 6; i = 7; y = i + j; } z = i + j;
For the block-structured C code, indicate the values assigned to $w,x,y$ and $z$.int w,x,y,z; int i = 3; int j = 4; { int i = 5; w = i + j; } x = i + j; { int j = 6; i =...
admin
128
views
admin
asked
Jul 26, 2019
Compiler Design
ullman
compiler-design
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
...
11
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register