|
![]() |
4.3 Generating LL(1) Parsing TablesConstructing LL(1) parsing tables is relatively easy (compared to constructing the tables for lexical analysis). The table is constructed using the following algorithm: Algorithm LL(1) Table Generation
1. If Table [A, a] = A 2. If Table [A,b] = A Undefined entries are set to error, and, if any entry is defined more than once, then the grammar is not LL(1). EXAMPLE 5 Constructing an LL(1) parse table entry using rule 1 Consider the production E EXAMPLE 6 Constructing an LL(1) parse table entry using rule 2 Consider the production E' LL(1) parsing tables may be generated automatically by writing procedures for FIRST ( |