Compiler Construction: Assignment 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

qwertyuiopasdfghjklzxcvbnmqw

ertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyui
Compiler Construction
opasdfghjklzxcvbnmqwertyuiopa
Assignment 1

sdfghjklzxcvbnmqwertyuiopasdf
Rida Nadeem

ghjklzxcvbnmqwertyuiopasdfghj
Iqra Ahmed
Bilal Ahmed
Zeeshan Aslam

klzxcvbnmqwertyuiopasdfghjklzx
cvbnmqwertyuiopasdfghjklzxcvb
nmqwertyuiopasdfghjklzxcvbnm
qwertyuiopasdfghjklzxcvbnmqw
ertyuiopasdfghjklzxcvbnmqwert
yuiopasdfghjklzxcvbnmqwertyui
opasdfghjklzxcvbnmqwertyuiopa
sdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghj
klzxcvbnmqwertyuiopasdfghjklzx
Write an regular expression for all the string that start with a.

Regular expression:

a(a+b)*

Write an regular expression for all the string that does not contain null
but start with a.

Regular expression:

a(a+b)^+

Write an regular expression for all the string that start and end with a.

Regular Expression:

a(a+b)* a

D.F.A

a,b
Write an regular expression for all the string that start and end with a but
does not accept null.

Regular Expression:

a (a+b)^+ a

D.F.A:

*(aa+bb)+
* ab *

* a * c * + *c * a *
* a * a *

1+ 01 + 11 + 100 + 101 + 110 + 111


+ a + b + aa + ab + ba + bb

a ( a + b + c )*
a +b + c + a ( * a + b * b + c * c )

0 * ( 1 + 2 ) + * ( 0 + 2 ) + 2 * ( 0 + 2 )
1 + ( 1 + 2 ) * 1

1 * 0
Write an RE for all strings that do not contain double
letter anywhere.
(+b)(ab)+(a+)

Write an RE for all the strings that contain at every


place double letters. Single letter is not allowed.
(aa+ + bb+)+

You might also like