0% found this document useful (0 votes)
14 views5 pages

21070122188-CCL-Assignment 1

U++388+ uu7+h hhjj j j j j j
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)
14 views5 pages

21070122188-CCL-Assignment 1

U++388+ uu7+h hhjj j j j j j
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/ 5

No Pago No

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.

Gundara Teacher's Sign.


F LEX WofY FL ow
Le St mn LE X
lex.1 CosI LER leryy

ley yyc C coppler aout

Tngut
Stream O.out

LEX CODE STR UCTURE


Dec bvotion

tyarslation Yoles

fuilog forction's
EXPERIMENT:

* YACC (Yet Anathey COpler Compler


Each tianslation ule imut to YACC as a strina
Sper tficotioh that YeSembes aprodution of a
ayomma It has a ron termial On the tS
oyd a few termirals ond non-tentrals an RHS
Tor simgicity he wll refer to a striq speciication
Saprodvctioh.
The parser hill operete as follos for ashtt actin,
t would inyoke the sanya to obtain the net
token Ond cantinye that
tot en
The seiontic associaled uth a produ ction con
access attribotes of hon-terminals Sumbals Used in
that production -a Sumbol$n in the semantie
action Where n s ah inteaer desanateds the
attribute ot a ron ter1ninal Synol$' destannte
he attibutes of the HS ron terniral of the
Qrolem.
A orser qererator IS a roaam that takes an
ihgut a sgecificotion O a suntay od praducer
outeut a ghocedu?re for nanaain
LEX

ngut file Rule art:


The roes gart centain aromnax definion In a
hodified

rqt fle : Defirat iorn gart


The definition gort nludes infornaloh nout
Gudara) Taachar's Sign
EXPERMENT

he tobers tsed he Gusten dention YPCC


dUtamatical
Con
asins hunber$ for totens but it
beOerrder toce, humber b
RC oso Yecaanizs Sihale chaxactes4s bkens
hereiore, aSlantd oten nynbeis Shold bo ASCT
Cdes, he detinition Can include C code to the
deinstlon c the Cser and yariabe declavatians.,
within A and 2 jn the trst colmh
agut file
deyned n the auxalliara
YOutnes sectioh then it Shodd be ineluded
Otput file.
The otput ACc s a fiale named utab C IEA
Coainsnain defintich,
othernise the ode
it mst xecuted
an be tema defintioh
for the unction into gatse) tA called the
-d ation the commard lihe Jf alled wth
cgtion YACc pradces osn output file yotpi
Containi ha atextal descxiptan ef the LÀLR (4)
Rarsira table ised be the arsedvs This is
seful for trackina dowh ha The rser salves
Coicts

4 ONCLUSTON
We have disussed how LEY o n d YAcc
os Well

Gndarnny Teacher's Sign

You might also like