21070122188-CCL-Assignment 1
21070122188-CCL-Assignment 1
EXPERIMENT:
Data
EXPERTIMENT - 1
AIM: Theor assiannert for hzitin detals abut
LEX and ACC Compilatien
* DESCRTP TION:
LEX stonds for leyical analu2er. LEX is a
utility rhich oneyates UNLX
tool lexical analzer.
gantratig Sanners LEX i a
Sanners aye proarams that recognize
tevt. These exical patterns are definedpattems Jn
in a farticulax
Syrtox t takes ingut one_ chotacter at atine and
atten method T on the other hardfho other
reguar expression can be matched, turther processing
segs an lex an eor essae
LAlex file is psed thosah the
roduces ovtgst files in c The Jex vhiht, nd
basically consists of a tran sifion diaramlex.uy.C
tromthe yequar onsthte
xpressions of irst
tEX SRECIFLCA TTONs
he structure of EX spec ificatioh corsists ot three
RaYts:
ODefinition Section:
The definition section incudes decaratioh cf Voriales,
Sart onditions raloy delinitims, and manéest
Cnstants
Adefintion is jery much ite #detine cEp drecte
tor example letter la-z f-2 Jia1ts o-olt
tarany Teschar's Sign
No Page No
EXPERIMENT
Data
) Rle Section:
Second Section is for tonslaton rules which
onsists C eqular exressions ond actions with
Tespect to iEThe transition rules of a EX
roarars are the
Q2 Saction 22
on action n
where Cach pS a
action iS a
reqular exoess lo n, and each.
togramfraament descibin what
Qction the exical anal2er should tate when a
pattern matches eveme
OAVxI LLEARY Section:
Third secton hods hhether ouxlfaxy
heeded be the actions. the
ocedures Cre
fex proaYams is to
be ysedon its Own this secticn contoins he
man program
int matn )3
Yetvrn O
In this section, we COn Yte aSe subroutine n
cftion to UseY aylex) s a tynction
atcmaticaly qet cale bu conpis at onptlation
ond exet otion ey proaYam ar we can call hat
unction, the Subrovtlne Secton.
Tngut
Stream O.out
tyarslation Yoles
fuilog forction's
EXPERIMENT:
4 ONCLUSTON
We have disussed how LEY o n d YAcc
os Well