Question
1. Using the Integer grammar (pg. 27), develop a rightmost derivation for the integer 4520. 2. Using the following grammar: Expr -> Term + Expr
1. Using the Integer grammar (pg. 27), develop a rightmost derivation for the integer 4520.
2. Using the following grammar:
Expr -> Term + Expr | Term * Expr | Term
Term -> 0| ... | 9 | ( Expr )
draw a parse tree for each of the following
(a) 5 + 4 * 3
(b) 5 * 4 + 3
3. Consider the following grammar:
=> ac||b
Which of the following strings is/are in the language generated by this grammar?
a. abcd
b. acccbd
c. acccbcc
d. accd
e. abccc
(Bonus) Page 82 Problem: 3.3
4. Draw a DFSA for identifiers that contain only letters and digits, where the identifier must have at least one letter, but it need not be the first character. Hint: everything to the left of the leftmost letter must be a digit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started