Appetizer #4 Before Parsing: Left Factoring
Why factor?Permalink
Left factoring is a way to rewrite a CFG which further enables easier implementation of top-down parsing.
In general, if
Left factoring rewrites the two
and if we can choose between
That is to say, left factoring transforms a grammar into one more suitable for
AlgorithmPermalink
For each variable
留下评论