(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 など |
(1-ⅱ) | ✘ |
(1-ⅲ) | id & ( id ) など |
(1-ⅳ) | ✘ |
(2) | \(\begin{array}{lcll} L & \rightarrow & {\color{red}A\ L'} & {\color{red}\cdots ①}\\ \\ L' & \rightarrow & {\color{red}\texttt{!}\ A\ L'} & {\color{red}\cdots ②}\\ & | & {\color{red}\varepsilon} & {\color{red}\cdots ③}\\ \\ \\ A & \rightarrow & {\color{red}N\ A'} & {\color{red}\cdots ④} \\ \\ A' & \rightarrow & {\color{red}\texttt{&}\ N\ A'}& {\color{red}\cdots ⑤} \\ & | & {\color{red}\texttt{#}\ N\ A'}& {\color{red}\cdots ⑥} \\ \ & | & {\color{red}\varepsilon} & {\color{red}\cdots ⑦} \\ \\ \end{array}\) |
(3) | id, ( |
(4) | $, ) |
(5) | $, ! , ) |
(6) |
|
||||||||||||||||||||||||||||||||||||||||
(7) |
|
(8) |
void A(void) { switch (token) { case ID: case '(': N(); A1(); break; default: reportError(); break; } } void A1(void) { switch (token) { case '&': eat('&'); N(); A1(); break; case '#': eat('#'); N(); A1(); break; case ')': case '!': case '\n': break; default: reportError(); break; } } |
(5 × 4)
(1) | (B) | (2) | (J) | (3) | (L) | (4) | (B) |