|
![]() |
4.2 LL(1) Parser DriverTop-down parsing proceeds by expanding productions, beginning with the start symbol. The grammar must be LL(1) In order to define LL(1), we need two preliminary definitions: FIRST and FOLLOW. FIRST is defined for a sentential form; FOLLOW is defined for a nonterminal. FIRST( For a nonterminal A in a sentential form, say FOLLOW(A) = FIRST( That is, FOLLOW(A) is the set of terminals that can appear to the right of A in a sentential form. A grammar is LL(1) if and only if given any two productions A (a) FIRST ( (b) If one of
|