我有这个问题的答案,但我仍然无法得到步骤和规则的步骤:
G = ({S,A}, {a, ( , ) , ”,” })
P =
S -> ()
S -> a
S -> ( A )
A -> S
A -> A , S
左递归:
S -> ()
S -> a
S -> ( A )
A -> SA’
A’ -> , S A
A’ -> eps
现在使用左分解:
(1) S -> (S’
(2) S’ -> )
(3) S’ -> A )
(4) S -> a
(5) A -> SA’
(6) A’ -> , S A
(7) A’ -> eps