Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Sanjay Ghodawat: Lexicalanalyzee The Hole

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

SGU Establshed asa State PrivaleUnhversityunder Govt.ofMaharashtra Act no.

XLdated 3rd May 2017


Empowering Lhves Globalty !
Continuous Assessment Test - I

Name ofStudent e a s Tabyaso Patil


PRN: 8STII4 28 O53
Sanjay
Course with Code:CST305 R
School: School of lech. Department: Codputep SC.
Program: B-Teeh. Year /Sem: ard/y Engg.
Date and Time: g19|2020
.1 Ghodawat
b

In bhe Followfng ero gram


their are 6
phase of Coropiea
University,
aee OoTk 113t
St
is exiea ena9
z e linear analysis This involve
Koltapur
scanning phase ohere the give
OTOgram Contains Stream of
eharateas aRe Tead Frorg /eft
60 siqht. Tbs bh en qrouped
in to Various 6okens havinq
Collective meaning
Lexicalanalyzee the hole
forOqTa0o)sScanned. Tttakes
Sanjay Ghodawat University Kolhapur Page
TELCKy Page Na.
Date

eLutpa from aoeesiað a the ingui


O bere 6he OQLut aDbicb is_pu re hith
leNel lanauage
T rea ds the proama m gOLRLO DOAran.
aNd aroupsinth them_lexemes
Nowin
in_this rtgram kinere is No an
LOhite Space ComDens_ne s
there Thai 1Dby e can'i remoye
any Jine rermaiy en_ oamam.

SNEAntax Analyze T also_Called


las panser TE qfves Che lexemes
rom_roqcam aeneaaie_he osoam
andCooveteo bN the AO21e tree
The bmbe 10 i s iDcluded bich
qivenin varfable "len"
Thoer e is addilion opeeation pep formo
eo in_this OTOaam-
Ttdos' ot haNe an
ntax theeefor it_cdort aemedaie the
SuntaxorO)
Symantic_anayzed Narfes the panse
eree Whethe ifs Meaninefull er not
H urther More Ddu rERIffe
PaR Se_hree
TotepMideate _e0de genecak)
T convezts h e hfab leve
Language pogTam O 0achine lanquage
To build aoeD_compiled _clont nee
o bud Pt_rem scrach.
2
TlyPag lo:
Date

code epbimireD
6_4tes the boog6 orUD_
and aeneeote bhe code Asto) Tt
CateqoTizOfnto 2 p e S 1 s
a chine _dependent macbine indepari

eonStant
Turbo C compilee Qdvartaaeg
)constant folding-
this FeaBuwee allome ae
urb0 LOmpilep o_ON aluOkO onstanE
eeTeSS*OD_ diirin4 Compiletime.
Ttis eaSY 6o ocate LOTreet
h e er roe8
i) Speeo D gie eptiMIZaHm
Tt could be confa ure o
r duOe an ex[cutable SrOqceam that
203 efhe Fast @no gmal siLe
iv)tPs easfea to undeRShand Ro
thee t lanquge co Mpilaion
Java LoMpilee adxanta4e-

The TONA coMpilee is beDiffeial_


becous Ahuge hrrary of ao eoeh
oE brezies
3
acky Pang No.
Dafe /

21 s otithreaded envfronrment
has allow3 lo tO DeR fon0 Ma/n_
askat_bAe ame tfoeio farcarzim
lange pool of 3kileodevelocoe
aNailable
Tb_aives s excelent OofM=
aNceetloe than_Dther comDple2.
be func 1ike a t h - a n y f u n
aRe NOs aNailalbl o in 0the c0moilen
Easy D naniaote braies
7HiaRevelconto L Flan Dfth IDoes
uGky PageNo.
Date

2
The lexical analyzeD perfomD he
he

Ollowing steps
T rermovescomDento Dhitspac
om the pTOqaaO
2)Tt remove pet2 i n e , tabspaco3s
Aroo_bhe
3 RemOV ES 0OYe thaD 1 blank Spare
compQch them inbni sfngle
A the tas k_obich ate en
nbove aeplete the t _e
TOaam:

includelstdfo. h
int main)
I1a6b Noeables are declored asint
int a=10 b=20 C d
C a++
b C
d ++ b

eturn O

Lexica Anal zep)


i
ckyPage No:
Datre

GcaTni Procce3s

inelude stdio:b
iot maiot)_

in a= 10, b=20 Cd
C a+1
b=C
d 4tb
printf ("\D CE/d",d, d='.d", C,d);
return 0

Q.2
b
Eo Limitotions of 2N uffey Pair
Techoiaue
£or acb iDerement of foroRepoin-
ter,, Lexical analyzer pez fOros OO
condit
icons
DIEcbeelaS the cco22 emf_chomace
pftb_LOOK abead bo match_the
HpatteeD

2 Ttcheek also h e Ond_Of


the poe of buffe ( first hal

6
TACyPageNo
Date
L

or seconol PoRt to Loao h e


yequire e PORk e f h e buffeAto
avofd 2 sentinel cha/egat2 s
used
Sentipels--
AD extra EOP e h a m a c t e p
addedat bhe ene of coch pO2Í 0 f
buffe,this EOF chazacten t he
end of each_pazk of he bu££e
Ehis GOF eharaci e s called ce Hne
SentiDels.
Algorithm
Switch Forword ++)
Case eof
1F (forocvd Rs end of 1st
buFfep)relpad 2nd buffea
forword= begîning of 2no
buffe
else ff (forworol is at the end oDf
o0dbuffep)

eloadfirst buffe
forDord= begîning of 15t buffee,

else/* eof
terminale exicalanalusiss
breal0
Tuciy PegeN.
Date:
-

.3
C

iecoase_of the feft recrsive def_


his_qramrw eÐ_LOntains NO An
OEth0d_of pezsin paPse e
ecuS*ve_ desce otont'par 9inq method
We can eXand the arOaraMME
eusing 6he O duetipn To efofnate
thfs Left cecumsfon 10 add anothez
noD-tepmina Sumboll, G 6 pOducton=
aS Lalloas L

EfeST (S) =Sa,b1Cde} Folloun= 5


FTeST (A) =Sabichd.b 1£OUDUOA= 6 ,
ETeST (B)=4bE Follow ()= C$
f I RST CB)=S bEt FOLLoW(E)= S c, $
FIRST CC) = c,e FOLOD(c)= S
ET eST (O)= a dj

8
cky Page to.
Date:

Given
E E+ T T
EF
F (E)fd

E+T
t E + T * PF
E E+TX id
EE+FAid
E E+ id*id
E T+id* id
> E F+id id
Eidtid*id

id + d fdd

id) (id

9
uckyPat

g2
Select- EeLElcT

eenee

You might also like