Compiler-solution for First set, Follow set and LL(1) Parsing table
To compute FIRST(X) for all grammar symbols X, apply the following rules until no more terminals or ε can be added to any FIRST set.
If X is a terminal, then
If X is a nonterminal and
If
Now, we can compute
To compute
Place $ in
If there is a production
If there is a production
(
Suppose the parsing table
The entry
For each production
流程:
遍历两次 Production Rule
第一次遍历,对每个 Production Rule 检查 Rule-1
第二次遍历,对每个 Production Rule 检查 Rule-2
查看Production Rule 中所有可以产生
对这些非终结符把