Fall 2013 Example of LL(1) Parse table for grammars with direct Left-recursion 1. Original grammar: E ---> E + T E ---> T T ---> T * F T ---> F F ---> ( E ) F ---> id 2. Resulting grammar after left-recursions have been eliminated: (without introducing Common prefixes) 1. E ---> T E' 2. E' ---> + T E' 3. E' ---> Lambda 4. T ---> F T' 5. T' ---> * F T' 6. T' ---> Lambda 7. F ---> ( E ) 8. F ---> id 3. Predict sets of all rules: numbered 1 through 8 1. ( id 2. + 3. $ ) 4. ( id 5. * 6. + $ ) 7. ( 8. id 4. LL(1) parse table: + * ( ) id $ ------------------------------------------------ E : 1 1 E': 2 3 3 T : 4 4 T': 6 5 6 6 F : 7 8 NOTE: Above table has no element with more than one entry, and hence it is an LL(1) parse table ensuring that the revised grammar is, in fact, LL(1) Note that every blank entry represents a SYNTAX error.