CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - left factoring
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - left factoring - List
[
Software Engineering
]
parser
DL : 0
Elimination of left factoring in the given grammar For each nonterminal A find the longest prefix (alpha) common to two or more of its alternatives.If alpha is not equal epsilon,i.e..,there is a nontrivial common prefix,replace all the A productions Aàalpha beta1|alpha beta2|…|alpha betan|gamma where gamma represents all alternatives that donot begin with alpha by AàalphaA’|gamma A’àbeta1|beta2|…..|betan Here A’ is the new terminal.. Repeatedly apply this transformation until no two alternatives for a nonterminal have a common prefix.-Elimination of left factoring in the given grammar For each nonterminal A find the longest prefix (alpha) common to two or more of its alternatives.If alpha is not equal epsilon,i.e..,there is a nontrivial common prefix,replace all the A productions Aàalpha beta1|alpha beta2|…|alpha betan|gamma where gamma represents all alternatives that donot begin with alpha by AàalphaA’|gamma A’àbeta1|beta2|…..|betan Here A’ is the new terminal.. Repeatedly apply this transformation until no two alternatives for a nonterminal have a common prefix.
Date
: 2026-01-09
Size
: 8kb
User
:
mahi
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.