Bottom-Up Parsing I: Predictive Parsing07-01-predictive-parsing.mp407-01-q13
block2x2-1
407-01-q1.pngRemember, left factoring will result in at most a single valid production for any token of input. If multiple valid productions exist, the grammar is not left factored. As an aside, note that by requiring curly braces around EXPR, we eliminate the previously mentioned ambiguity of a dangling else.07-01-q23
vertLeft2
207-01-q2.pngYou should be able to work through the parse states from the initial string (as was done on the preceding slide) and reach the given input. This will help you determine what state comes next. Note that expanding non-terminals and consuming terminals are separate steps.