ey
opt mize ton of DFA-based peltern matchers
t) Ftrst olgerittom cowstancls a DEA {rom a vegan
expression, witheuk commtaactingy am intenmedsote NEA:
use ful in a lex Compiler. +
a) Second algo wunimizes He no of stodes of
omy, DEA by canmeb ins ng states thak have Ha Some
{dtr beba vioun °
2) sind algpittim produces more combact rebresemtatin
ck troustion table thaw que standard aD table-
tee 6 OTe denecthy Krom a rte, we constanct
AAs sywlan tee amd ten commpuke -four funcHons |
nullable, firstpes, Lastpes , ond Alisspos of febbos-
y nuoble (0) is tae ker a sywtay tree node 4 if & only,
he He subexpression represented by on faz € in its
he .
a fivsthes(n) 1s Pe set of bositions in Me subtree rested
ok un khek correspond to the frst symbol of oct Joost
one string in the Janrquegh 4 the subexpbres sion seoted at n-
. laxtbos(n) is the set of, pesitiowm in the subtree rooted ok
n dk corre spond tp Wa dose “saya bot of ok deat one
string in He hengunsge of, Hua. subexpression yooted abn.
4 Follewpos(p) for & position f, is He Stt of positions qin the
entire syntax tree anch Arok fhens is some string XE UR=
On in Lor dt) tach Het for rome ¢, thane ig a way f explacy
He wembenship of x in L(t) by matching G_ to position p of.
He, gyntax tee Ord aizy to foSition q- 3(al [b)* a bb tee 163 ®
hfe
8 18H 165
$1,233 [SR
3b 3
veal Joy ue?
$123 "4 Nope n nullable (ny
7 BLL 25 135 ;
Sf er. ae i
(ud pecuas eS tes
Jan Pu ovnode n= ¢,/¢, | nublable(Cr)or |-frstpes (c,)
nullable Co) U-firstps Ce)
A catnoda N= CC, [nublableccijend Eaubleble 6)
first Pos (G) 0
Aivst bos (G)
£3 as Pb L2s
\ ae
A stirnede ne ¢)*
follow tos —
itn is a cak-node with deft “chalel c aml sight
chihl G , Hon fpr even, pevtiew 7 Ton laatpos CC),
ell positions in Aerstpos (¢s) an2Q in fptlowpos (1) -
Q. sf n ig a Star-node, omd i is a positon an
Losrpos (M)> Hen att Dane! m first bes (0) ane in
Actors pes Uy) ee
iss
Cire rsd.
{4}.
iss
1%
positon onDirec ted pop fp« fell fos
inihalize Dsiwtes to contun only the unmarked state
fivstbos (mo) , where Mo is the root ok Hee sywhax tree,
i
aH tor vat ; t
while (there Is on
{
Unmarked state S in Dstates)
mark Sj
fox (each imbuk symbst &)
‘ Jat U be the union of Agsblerpes(p) bar oll b
in S thet. corres bead +o a;
1h, (U is net i” Dstates )
add Vos ow Unmarkod state ty Deletes 5
Darran ($4) = Uj