0 ratings0% found this document useful (0 votes) 52 views43 pagesCN Lab File
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
5 huBiak, 204
Date
Al tae _ : i
|__|lpfntte Avlomata are alsbratt magclimes sed bo
lrevoqnine patcerea Sa obrfvgts Tai tematst of 5
specific Mare stake be |
I ¢ eta
|__lenpot symdook mere tse wothir stakes |
| oo
| |wete op Soe eb ae rine a lebsnn ear nterts
Bip a rae ak g _|
states Gwol __|
| omg tt@un Llu fae ee on wabolss A DEA |
[qe a pea, tu aaa RULE stele svat
t
Idk o ¥, joing Jol staka according jb tre brawitbier
fre machine ends tm ur accept ~ rere after
[tk ip ~ reflected» _
L
wicling “Me entre: tupot sbrtng , the ching 4s accenbed , oMlubutee
Sooo Ta i
\__| eeaeere ere—— peste wt ee = |
H ee if 1 srabhmatehad) |
J tovt 4¢“Pirsb 1 waebad se edly
_fisst{Matebed ~ brut;
i _| eiikee (a LES ae _ sell
pokes
i
Sa grec WEST ESET
| —cewrafen ton anal norackee”
| 1 Le eudls
yelorn |; _s
| ir
| | eCsCn-tp ind i
| aa pea nr ee 2
| : tource “snteg_ setcont es aa 2etuall;
o
‘coop wart Teacher's Signature:
‘hast GalaL HY
a
2 ho “a a
ourput
This sign is not acceptable as it contains an invalid cheracter
ns= Code Exited with Errors ==
—
: . | Output
First 1 Watched |
Last 1 watcheg 7
String successfully acceptedAYE AN
| Be. 2
| Expl No. Page No.
| 4 xpectoasaal Zs
Hie E a
+ Aton
i} | Write O pregramn to Chadd whale 0. seabkence $a cludia
} lerjesordy or_nok.
Al code
| |
1 artrcluds < Wle/etde eter
| osey neces std,
|| [ )reamog
Se aertng ste Sha Ts wy daw fellow tetera end todo
ance q
- we'll ii sock togeter |“;
rea Pick Chane san pero words Ce] - eer
Finer at aa a” ap
V vewplauke” pean, Seoe", * pete’, *t
venteen
Raare public’ te +
HOITSEPI RS ol,
tows”, “goto”,
Nstort", “unsigned " Weowkuvel, *
i tryGe fe Ekerefonlsiceesctuyieas
—,—— Ymee rae * word +
santa 2 ea fot pos),
~ find (word) «
see. me found » |
_tovt <<“ pcevranse of reserved word \*
22 word 4 *\" je ak ty ¢é found
ee endl;
BE elie cat" xin ence, eal foal: 3]
weber Os |
EE fae te = it
—| Resole
Codt_exewked success fullyOutput
sin being si
be
no reserved nord found above :
‘ode Execution Successful ===
‘GOOD wi
‘KMart of|e qretole rules) ¢
__productionputes s clear (2;
Teacher's Signature:
crfer Lovie vole 2 rolu)§
producttongules » push back (rule)
. 5
= zi
Veckor gerrsle 0 2
ve ro duck Avles,
a void add Role
__psodect
Hes eid _prrurPule (4 __ i
sheing boPetw ke = oe
AbPER f= howe
aan
$ __tePiuk te * “as t* [ty
a bace Cy ———|
< bo Prink 26 endl;ips Ca =
= (Jat) 3 _
Lae “news Non Terminal (par,
L soysbadt (uwengr
Ferusabt),
- Cont seeo9 a
won Terwinats. Lace Oo add Rate Gp__vofcl mou Data ()
I
add pele
void delve Mon Tyns ecleare LA Con terminal 2A
—__46)5
Biring none A As gohan J
String noes 6 oe garhawmeC):
Vector stning >ryles fr, rules ® now Roles -
vo lg > A, get Ryle
a rule 2
aia) . A -
(Lp, nownt « size 0)» >naa8)f
ayteole| & vole8)}
Ralf. puskback Crete lt roles
Comets stee (2)
2h PylesO)+
oon were Teacher's Signature:void solvednemedtare LAC poorctermdval LA) 6
Sing mamnt he goth aune 0
oe $ fnmabinwe * nai t
Vector shiny? alphas, bibas
pe Neils TR eigep Auten tr
voles, naw hules®, wuwtiole Aly
+
| er Cato yule 4 ruler) 3 :
1£ Crote- substr(o. =si2eC)) vrnome)$ |
| ae 2tplinr - pusk-back L rule: spbth~ Cnet: stag
nent fe = ton oh ra
dor Covke alpha alps) 7
wap Puiles Bl + pur bac Latin + newNane) +
| fi. cer Rules CnuwRules Aa)» a2
WuspalesAle puslobatk (uO OG"),
Teparina nsuionT ondnal Cru Ron),!
|
a
Teacher's Signature:Expt. No,
S==
Page No.
fu DonTernainal » rebfules
hack
WI LermaireA sp
thin C) %
for Cinkjre y
| solve NOWInm edtare LR CronTernntnalal
mas newton mateols O71 >
salve Immucktate LA Cnrenterncnals (7) )-
void paint Rules On
for Canto panerssiork Tt monterasnals)§
hey Aérninaly »orfuk Rule O).
| ao ines os
|
iw
|
ae apply catgn ot tom ——
yr ao 7 a
sebvrnO, ¥
Rust % cods executed cel
Pee iy)a AM Sep tembar 2041
_llwrtte @ pagan to
7] Code
= ch
le tects ¢ ceria ss ss
AFndode < vector > = fF
word Left Factor (wpp & Uw, vector ¢ shing > > gen |
ern _Laulrok, production 34 coer) $
Entiat paternal > produetfon fist,
ro —vecsorEstetyaa rales = _productiee. sttond, _|
rg ale aries (i, cll
pie niter = volta Lt gee thwT TFPI? Bi
f RAS ¥
lol tonst mop hee
Lemstok produ
__covk << produchitw
Puree eeege No. Date
—_____ fevt << role Ze * ;
3 7: taal
| tout <¢ endl,
| v
| Cay im L)
U
Wap ®e chou veckor EShring >> qromusry
; fet Eh por tabs"
out ca * Original Grebe ra IS evel
poakGoe Cgrenese) +
[| Lett Pexetee Caranneur) »
l i ee Wy Let fattore® grunasn i" £6 enull
prtak Gua l greiner .
return 0
|| Roavlt
Ws Cody ewewlhed Succes
“BNateof Quay Teacher's SignaturExpt. No.
Lod. crostrooun >
| 4 Cop >> n=)
| ueee
eke 3
Ouauspace std
rack (100 J ms 122
id_posle Cink val) +
* stode
bop =
U Fe -
IuMOchober 2014.
Date
ex fine * ce endly
__ tent e= “stock
edt 3 |
else
je peak ee He pojpad elt 3 st se state Crop'|
Fai
tep =
t
Teacher's Signature:
i (ooowarel‘GOOD WRITE]Output
1) Push in
Stack
2) Pop from stack
3) Display stack
4) Exit
Enter choice: 4
Enter value to be Pushed: 2
Enter choice: 4
Enter value to be pushed: 5,
Enter choice: 1
Enter value to be
Enter choice: 1
Enter value to bé“pushed: 7
Enter choice
The popped element is 7
| Enter choice: 3
| Stack elements are:8 6 2 |
Enter choice: 5
Invalid Choice
Enter choice: 4
Exit—_|vecker char? a,
wid Stacknip lr?
ae .
for Couto ws st)
ere
routes Hes
fey Cautelx 4a)aks popalback()-
fhe a Lace)
suave capes fae
| : eal TS
a c a a [pS et
a aT) |
Lamia cook «.* $\t" ¢« “aed
| I 7 ae ee
[akan a
r | pat 42 WG aanabh 3st \W EP ELE \n PIE EE Weal
Meont 2¢ * ewer supul strny 2
00. o
| = ashy
pin >> 5,
stevie Ch,
i
| Teacher's Signaturestfally tote= = oH Moved Dor.
Expt. No. Page No. Date
voutte, Greve ¥ feud nok tha Piast sf tt Mom
1
easel Kia goauatate: |
Cods _
lB qrclodks
Le factods Smee?
|| erewolt Cser>
4E Orn clds < vetbor> ai!
ae fuclodlu
| mp dod ce + LS
usr Komuspaces stay
toa lane, me hour >> FIRST»
—— verkor C5 king 57 prodec kona A
tee FieWr Comer syrstool)F
Do a (demst ‘
spkorn FIRST E ool] »
2
Jeord Anti > dfrskSeks
for Cormsie sivivy prod $ proclye Hews C swatbsl Jf
J f og
i Meer ch $ f od)
—— Teacher's Signature.......
“A Maek of Qy—Date
jj __gersir Sok. tseet” Ce
imal = = break: =
J
iy}
Usolola Cok) 3
a
=f
i (. bof trst find 1H") # = cobhiests end)?
break;
A gacis rn
§
2
Fiast Feuahal| + fircbSek~
v J
reborn fe ESeks
J
Gof wae 1) 7
qk ny
— [tour ee te ae taf produchovs "+
tim >> ny
sal Ce Stauttr peaducdiven Co, 5 aBon) 2 \n*.
\_| eon
y
Teacher's SIGN GtUt:nnnnnnnnFIRST(D) =
FIRST(E) =
FIRSTS) iu
FIRST(|) =
ni
i
t
Code Execurer Page No.
=> =
( (__ for Ltwe zO ; Tow
—chatree arm Te
—_aitig cca, pred
es
spuest )$
eee
i tour 2é"\wFibst ce
| fox Ceol auto Ven a
ee eee
xe Cohn ts Ow poral) ee
f __ cpt 26 ane, . a
ae: ssan_succu filly Siete
‘Rvarcof Qaes
Vi
Enter the number of productions: 6
Enter productions (e.g.. 5 -> aBph):
-> aBDh
ce
BBC I #
>glée
ELF IB
<> fT B | #5 > aBDh
7 OMA wu
=
G
3
a
2
G
3
m™
FIRST(D) =
FIRST(F) ~
=== Code ti
| : Pxecution Success fyz 4lla Pncluche
|. anclodle. “ste
rn ocle cca
ust nomuspace stds
bo tele pla teen |
cewsk vector ¢
pho non terminal ~p
bool SoOperater h ee ans Ce
a ae in, aes rade W283) 2
as bot horépcilen > aa
fe Comat: outob panodwe bees lucky
av rode kts
fr sy
J
__sivén
wle 2 _procdcky
oe Stcomah
Sa
“4 Coole =
9)
nom terutush |= produch’d» ons fo] jl
2 duc fovna tee Wo
tok ce” Ensilon
“stant spaleh 2°
‘GOOD WRITE]
Ia Narco Qs
Teacher's Signature.
JSoa tienes
Cope 2e% Zuker Yor WO- pre duc due |
f
(_|_ er i ee a
| rook 22 enter produc ou( vst te far ensilen, 2:
A seers, a
_prsclo bong,
‘6000 WRITE]
Teacher's Signature:...
Reto Qanee £64 Tre. f= $< MOT au. 9
| pia west :
[za
‘ANarcof ali —es
Output
Enter the number of productions: =
enter productions (use # for epsilon, €.g., E -> Eyt),
E -> ET
E -> E*T
E->T
T -> (E)
T -> idE -> E+T
The grammar is an operator-precedence grammar. fi
from / using :
Pun Ee
Bo
T -> (E)
T -> id
=== Code Execution Successfulae ee ee
We 5 ietcaL taal nd pacts
__ lle fae creak on OF G
teuiglids tasks xelated "to ttuts
Py 4 tn rie
Tl Lex Pe pul rs fe eta bon Tee
pn Bacal putters ( repler
ifteit
i + re
ett— Oasis. & “pace te LempMt Lied
E taker! eee
ee the
“ae porte
rh Nu heron elsteal
ily niente
Sir velyee oF frp
Gener k spate gnc
| (ois ss =
| On
| we
| jee} Le
wsorks Lo ease bt
Suck fohuna « 2 oss ep
pales of cbfpecsut >
ew pren Perm ate cpus
ws of foku qu tux sourte
ae [Ppa
5 Gucdchs dictadions
hap tabaTeacher's Signature:q
‘ho
7TS ipinatten a
LEX owl Paces f |
ver
Tacs tal mek rego res Leaage pacer’
Ruol&
z
Comes 20. S x
| Ley & Yace. |
cot Wes Nesigameh_¢ D& |
© Bybtrpebers
2 Date. pansy
2 peeves OLIN
2 Ove
L fools fu. Cowipiler Lonstruction
pace L
qe sti? fi
Pasir
map lthying fh ces lexfcal | seal
Cet rez ere nappa J
sat a ae te ora _Wigle -Lewel
par tow Level al of lepteal
es ESC t