# 编译原理作业5

## Exercise 5.1

Given the following grammar ：
$$S → ( L ) | a\ L → L , S | S$$

• Construct an LL(1) parsing table for the grammar
• Draw the detailed process of the parsing of the sentence (a, (a, a)), follow the style in the previous slides.

$$S → ( L ) | a\ L → SL’\ L’ → ,SL’ | \epsilon$$
$FIRST(L’) = {\textbf{,}\ ,\ \epsilon }$

$FIRST(L) = FIRST(S) = {\ ( \ ,\ a}$

$FOLLOW(S) = {\psi ,\ ),\ \textbf{,}}$

$FOLLOW(L) = {\ )}$

$FOLLOW(L’) = {\ )}$