CD Unit-1 Imp Question & Answers
CD Unit-1 Imp Question & Answers
construction tools
A llsrte
atte
shåt otes on aConpiles
Bootst
tsapping cc0ss compiler ?
i) Sconhe
a ieqular expreseion.
fro prduces suntax
t Outornatically
C:) Povger genetatol
-
qramatica descsiptior).
analyze1S fom a
hat produce
engines
drected tsansloation
Syntax
-
AutornatiC code
Code generaloi tool collection ules.
Code generato) frpn a
podduces
itfactlitates the
CV Data- flow oanalysis engines
gathering of tnfimation an
an
t prDvídees
Comptler congtruction tool K vai Ous
outines fo) constructing
integrated set
phasès Compiler
c) Cxoss CornpieX
a Compiler that Tuns on one
is
AA crosS
CrOSS compile8
code fo anuther machine.
machine
achine & pmduces ohject
The caoss Compi ler is usecd o mplemert the compiler
e
tohteh fes characterized b Jonguages
ihe Sourcearguage
) he taxget Janguage
uhich t s wten Ccompiler)
i h e ianguage 'in
ls
LSN
Cornpilex
Conpiler Ptonguage
oritten in
longun
onquoe
machine Code N.
thot prnduce olp language
machine code M.
similar Jdeniter
dertifterS are .
identitterS
* Install eseöved uwords n Sunbol table inttially
iitially 1:,
i.e,
3a Keywords are installed ulhen an dentitier is
identifter
Create sepoate tvansithon dtagrarn each keyodd.
SentinelS
advancees one
step ahead,
When Foward pointer
buffer is loaded
t t bufer ts completed hen econd
fouard
M eofc* 2 ieofeo
lexeme begn
Sentinel is spl chaacter that can't' be post The
of input*
tesmnate lexical analysi5
break
Source
exical token
Program Analyzer kk Sntar SematHc
8etnet Tokent)halyzer Analyze
Identifier
Symbot
e t Next Tokend Table
ead characters Comand cauges the
Cauges he lexical
lexical analyzer p
he next lexeme
frorn t s ilp utl
P untl 1t
anayze
it can identify
& pmduce
fS 1t the next idenit
token
lexicoal analyzex also
pefdms othe tasks
eliminating whtte spaces taskstketke
blank
Comment ines. Spaces and
anc
ulhot iS Compiler and explain about
Variou9
phases oP
Compiler with an
example?
A * Compiler is a translator First t idertifies
the essos & f there are no eszoss then
only it convestS high-evet lanquoges to low
level languages
t translateS the Complete rogram).
SOurce prpgiam ( c
Compile
LextcodAnalyze |
Tokens
Syntax Analuzer
parse tree / Syrta tree
Semanti c -Analyzer
Modifed syrox tree
optimized code
Code Generatð)
Target onquonee
ig Compilation Prpcess Structure
.exicol -Arotyres
s also coalted Scanner.
exical Analyre
tis he sphase of the front end pror ess 1he
iS tu e a d
be
Tbe
main t0sk of he leticol onalyzer
2 Suntox Anatuzex
t S knowor a s ar Ses
he nd phase the
front end prce
tis syntazes
accept tokens Vesrfy h e the
*Syntax -Anayzex cosectt
tokens ohelfer 1hey are Syrtactically
he
not
3 Semanttic Analyzes -
I the d phase of a compiler
neaning off
o the Syntax
Suntax
&is used to vesity the
to another data type
*tt Convests one data type
5 Code ptimizer
*It S the d phase bacE - end prDce SS
of the
Syntax
Analyzer
a1>
b,3
Sem antic
Ahalyzer
a2
b,3 5.0
Jnteirnediat
Code Generator
t int to float (5:0)
b3tt
t3 Ott
Code Optimizer
ADD Q2b3
St C