0% found this document useful (0 votes)
13 views26 pages

Theory of Programming Languages Notes

The document appears to discuss various concepts related to regular expressions (RE), including their definitions, examples, and applications in describing patterns and combinations of characters. It also touches on the Extended Backus-Naur Form (EBNF) and the construction of grammars. The content is fragmented and contains numerous typographical errors, making it difficult to extract coherent information.

Uploaded by

maddy.mahad2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views26 pages

Theory of Programming Languages Notes

The document appears to discuss various concepts related to regular expressions (RE), including their definitions, examples, and applications in describing patterns and combinations of characters. It also touches on the Extended Backus-Naur Form (EBNF) and the construction of grammars. The content is fragmented and contains numerous typographical errors, making it difficult to extract coherent information.

Uploaded by

maddy.mahad2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

)

=>Rogula épsins

langge
wkenevet iylapoiliga
9eto chaacles
Desckipten
(standau)
)3) Machine derelop)

Sonplemertath
aljouikbm
oe
ekaaes
lck
allowed
()Sdaacti)-s
sondaeolway
can descuibe oue
we
in ohich
(*st)
$O kleen'star andplus

nstatiens ( Cion , Comcatenalicn


(t,).

4+89o8 8+4
Asomisia

a
and itg dewailn will be
. fa
TtIt wil acept all poube Gombirahim,
whad' token canbe?

(1) 2 = ia,ag;aaa, aag, aaaa,...f


OR
Vall Posibe vem langl of a

we -wal wute hequer upmin jou past 4

RE-at
Aoe PE will be

RE (ad)-1
+=» as aa powe
pouee (undefine lonp)
RE(at -t(á),3,4

)t:4i23
RE(a
Le foa, aoa,agooaa,
Poe kleen sta b)
chaeactee Cam move
we kowe 'a'mul
.wnkout chasacee
mull

Ts

RE (a)*
" kngugs; definel on- 2chatgcs

bexniglan: ail possibe combinlin o


a oi
de i9.ab,ba iag,abo,aaa
RE: (a+6)*,4
d fb,ab, bababbo,...
RE-(a+b)X%o,112,3
d- ]S,a, d b,ba...

Enomple

alpossible Combinan o a o

staet wnth a
d:
J: jaob.aa,aba,abb A
Esample
b
combinlon
allpossib/e
Sock that ifsactwrha
a a
. 3
L: jaab aa, 6, aba, aabb
RE a labK horeaty
a

C-E, ab, aabab Ea= a

|bSa=ba
ab
RE
A-E,ag, ab, 00

ab) a ard b
oh
ombkiothon
all pasibe
Suck that
the dength
foten should

eNen. aobbab
ab, abhb 6

KE = oB aumhe
can bepeene e
ke
•akand k shoald be inlapee ,enorbe
oill

eNen
8-2rl
a -axuS (e-4S)itk notavintgen

2 -4 O,4,2,3,1

RE-ja) (atb)

--- 1
baaa ,aababb,
de jE, ab,

RE -
e, bb,

ýs,ab,abab,
RE (aa- bbtabtba

X-2.
RE-(latb)otb))
(a4)(a+b
4
,abba,
{(a)oi)
RE -{(a?a
btab
b, ab
Sjab)
(ab)
ab' aHL)*
jzah,abab
ab E.a,ab,|
a

emal :abGinkocem
:

beangon aa a b,suck hat


Canbinilen ol
nl pessible
laot chaecke wod be '6')
{he ecod shosld

RE= (oBla+6)
1aba bbb

jbba,aabb/aoba
arfatbb

abt
a+b)*

bbybb
a,aa,caa, 6,
Q*+6L E,

(ahs)
ab, ba

Lasb
ko bb,aa
iE, a,bb)
lecbarc,

RE *s
(ab)

J iab,bas aabbsabaka, bbag,

Conteat Gearmee (CEG)


ee
Mone as it can nepresen bot RE
and-lhose Vlanguys hich can nt be resene

I am
Nau toens

Tam ncoed
Let sa

2-šayb-padutin
I
teemin
SP
Consanstt

tem

bnontemind
X ax CFo RE
X bX
a
.
QbX
->abe
ab
NT T NTT.T
NT NT NTNTNT
NT NT.T
NT TNT
NTS
Sva-pe

RE= a Sax
hoducley Tap Sast X aX
XE
Sas
S=>aX
->a S<ar
X+ a

=> aaaE
->aaa
CEG

Enaple

d- iab, aogb aagbh


n R Gbabababadd

wcab,nz1 a)*a
A:jwlwEa+6);
aabb\ aaa bbb ahb
Rroducto. aB-ab
SaSib) beivadin

SabJ
Deuralien
ab
-)Qaab bb aabbb

a abb

asb
ab S
aaxbb
aaEbb
X
aabb
o (a4)*aa(a +b)

alinchonebaabb

add falichone: bad þaab


Sasalb<blasi
both even ad
S bsb v
odl
Sa
S b eNen Palidnoe
o we have mullas

oe eren
bbaabb No ol oill

=)bs b
=> bbsbb
bbasabb albcblalbi
=) bbaabb
=) bba abb
BNE Bockaus nauw fpom
Descrbe slabwmen
yrlox amd

BNF Consit

Non- telmonals Valiàbas ): Enclaco n 2


Ceriston >
- Teminals aa/
ele, t, *
an teemna Cam
be hef
The seel

ypnbol
mntemial
Cocl) BNE
cdelaialen>:;
=Llype >idenlihee
atle
'int "|Jlod'|'chat

ideniyjet >:; =2letec > letlec> lligdoi


Lleller'>:: lzlfAe
'ao..
cdigit ::='ol.(a"
dafinadao
"4"|"2 ""3 |"4"

|>oR
chae"|'doobk
nt|oad
Recusse Rules
thal an
Conshuct
s
Recwisicrn allous cehnig
rupeal
t zEeem>
Leesin>:;tem> ersion)
BNE tem >

< tem::- laztar tem>


factou

)
cnombe>::

atbc a+(bc)
atcteem)

So ancd
ctegsn>
inbelver.

Ceplbton?
derna )
ctesy)
lesdb)
Lctes(e)
C Coda

=10;

dentyos

andy ocng avithsndle

pusien
Z0rmnd>::
tteemslloêh > (l-)esm)
2epesson)i: = zteim>e
ctem> ("Iy")faatoe>
<Jactos> |ktem)

Lnumbe >

EBNF (Exlended Baclso Naua fom)(BN

-oplemd pat
aefllions
i
.42)
else

j:0;

"";
<slatemond>;="i(ccondilen>")
"slatemento]
slalemonds"'Te"
opsalols> expwo
Lcondilen >:=Lenpuoson >Laelalonal

=""|"1-"l'S|2|2-b"
alaliemal epalos,>;:
4slalemens >:sadement>csledemont>
slidemend>tt -<aniymontlei- slatemont
Glendad Bakus Noufm(E&NF)

BnE Cn

EBNE ja

letlee'
"O'..
teminab
("o"..
chasada nags
Oolional Element

» Moe comt tho, BNF


O charactel anges ("o!.z")'
leem

hetou'=
) Cosis

)
f could be a numbec ol en

inpaa,dkesiyi

teem
-lem

into
erprnk into
ctemm>4ztem
Cexpsicn>
'a,which

Pauser
Esample

teen

te
9 sx(2-)=>

> =2numbees
factu fem
>
6items:;acTol
ctelm>
tem
faclas
tems 4)
m0mbee

S*(3-1)
ctecm:tetelms tjaclo
Ste
totm
s)
chetasenomba
pta cam be errem in paanlosis

(eemestony)

(a-1)
zteem
Cengreoions!"L9ysin

eteen
eson> cepsiom>t

(a)
falous ixoncnbecs

2tem) : 2nombe>
(s)

-eteesn)

tems -teen)
<eylison):"
Ltems
nomhe()

cbacte 2umbe 4)
kesnin
<tems
temaa>leeniomtferm>
Fafetarylkeomeacto>

:
(teem)* faclos,leten
nombee l(ennession?)
atkibut Gaas
2Alkibues (Patentis

Lohesedatleibuleicidpect
M )
b depontant

3) emanle beloho) allubueg


ae

Deune
245 300
34S
sbabatnabaolt
onub udzib»lBnbedi
dyt oa2ls14|s1618A

nombe posilen
2
.q
<nombee>
calgrbolenmbedgits

Semaile ule t
Nombee().nalue momher 2Jat x.to+ decl ahe

Cnmheesval

ciin2)-3x\0= 30o
30t 4- 34
Nom bee
+
bt tis t
Cist
bit O|1
101 Deie
Nomba

PoS! 2
ist.vala5

Pose1
brt
ictVal 1
Val:(tr2) 2 Pos =o
1 Pos

bivds0-trte Vat-1
0)
vde(ox. Pos4

1)
bit-1 (4xs
Pos:0

(1)Pes ition
bit
elue lo lis
(wo woill

and posilio
to ist
le nalaer

Cist (Pas) L(os)


Siqn ist (Paoduslon aule PO

femaale
then onse.n-lit.a
lese
Nombeal- list.vali

Biqn +e
P.R

Gnaike
ust
list
bit

pos Bitpos
Bitpos ,
, lit wabe
bit. val

[Cistaval bit a + ist val


Semai
fos = bit.pos

ebitolt (PR)valr2
Somont bit val - bit.len

You might also like