文件名称:parser
介绍说明--下载内容均来自于网络,请自行研究使用
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.
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.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
parser.docx