1. The Intermediate code generated below is for a given statement M-p*q+r/s is as follows: TI = id5 T2 = ida/T1 T3 = id3+T2 T4 = idz*T3 M = T4 Write the output for code optimization and Code generation.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
1. The Intermediate code generated below is for a given statement M=p*q+r/s is as follows:
T1 = id5
T2 = id4 / T1
T3 = id3+T2
T4 = id2*T3
M= T4
Write the output for code optimization and Code generation.
Transcribed Image Text:1. The Intermediate code generated below is for a given statement M=p*q+r/s is as follows: T1 = id5 T2 = id4 / T1 T3 = id3+T2 T4 = id2*T3 M= T4 Write the output for code optimization and Code generation.
2. a) Write the language for the regular expression: (a/b)*(a/a* b)cd
b) Find the DFA transition table for the given language: M=[ {0,1,2,3,4,5} , (a,b), ô, 0, {5} ] and
the transition function is given by:
States/Input
b
a
1
1
1
1, 2
1
2
3
3
4
4
5
5
5
3. Construct NFA for the regular Expression: ab*(a*/b*)ed
4. Consider the grammar:
S-E
Transcribed Image Text:2. a) Write the language for the regular expression: (a/b)*(a/a* b)cd b) Find the DFA transition table for the given language: M=[ {0,1,2,3,4,5} , (a,b), ô, 0, {5} ] and the transition function is given by: States/Input b a 1 1 1 1, 2 1 2 3 3 4 4 5 5 5 3. Construct NFA for the regular Expression: ab*(a*/b*)ed 4. Consider the grammar: S-E
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr