Purpose of FIRST and FOLLOW sets in LL(1) parsers?
问题 Can anyone explain to me how FIRST and FOLLOW should be used in LL(1) grammar? I understand that they are used for syntax table construction, but I don't understand how. 回答1: In an LL(1) parser, the parser works by maintaining a workspace initially seeded to the start symbol followed by the end-of-string marker (usually denoted $). At each step, it does one of the following: If the first symbol of the workspace is a terminal, it matches it against the next token of input (or reports an error