According to the rule:
A -> A a
| b
Should be:
A -> b A'
A' -> a A'
| e
Where e is epsilon. So, in your case:
S -> S S
| ( S )
| ()
It should be:
S -> ( b ) S'
S' -> S S'
| e
b -> S
| e
質問
I've read lots of things but can't apply the rule to the following grammar
S -> SS
S -> (S)
S -> ()
解決
According to the rule:
A -> A a
| b
Should be:
A -> b A'
A' -> a A'
| e
Where e is epsilon. So, in your case:
S -> S S
| ( S )
| ()
It should be:
S -> ( b ) S'
S' -> S S'
| e
b -> S
| e