(1 × 15)
(1) | ⋖ | (2) | ⋖ | (3) | ⋖ | (4) | ⋗ | (5) | ⋖ |
(6) | ⋗ | (7) | ⋗ | (8) | ⋖ | (9) | ⋗ | (10) | ✘ |
(11) | ⋖ | (12) | ⋖ | (13) | ⋗ |
(2 × 4, 6, 3, 4, 4, 4, 8, 8)
(1-ⅰ) | { id ! id : id , id : id } など |
(1-ⅱ) | { id ! id : { id ! id : id } } など |
(1-ⅲ) | ✘ | (1-ⅳ) | ✘ |
(2) | \(\begin{array}{lcll} E & \rightarrow & {\color{red}\textbf{id}\ E'} & {\color{red}\cdots ①}\\ & | & {\color{red}\texttt{\{}\ E\ \texttt{!}\ L\ \texttt{\}}\ E'} & {\color{red}\cdots ②}\\ \\ E' & \rightarrow & {\color{red}\texttt{(}\ E\ \texttt{)}\ E'} & {\color{red}\cdots ③}\\ & | & {\color{red}\varepsilon} & {\color{red}\cdots ④}\\ \\ \\ L & \rightarrow & {\color{red}S\ L'} & {\color{red}\cdots ⑤} \\ \\ L' & \rightarrow & {\color{red}\texttt{,}\ S\ L'}& {\color{red}\cdots ⑥} \\ \ & | & {\color{red}\varepsilon} & {\color{red}\cdots ⑦} \\ \\ \end{array}\) |
(3) | \(\textbf{id}\) |
(4) | “\(\texttt{\}}\)” |
(5) | $, “\(\texttt{!}\)”, “\(\texttt{)}\)”, “\(\texttt{\}}\)”, “\(\texttt{,}\)” |
(6) |
|
||||||||||||||||||||||||||||||||||||||||||||||||||
(7) |
|
(8) |
void L(void) { switch (token) { case ID: S(); L1(); break; default: reportError(); } } void L1(void) { switch (token) { case ',': eat(','); S(); L1(); break; case '}': break; default: reportError(); } } |
(5 × 4)
(1) | (A) | (2) | (C) | (3) | (A) | (4) | (C) |