Give a left-most derivation of
A = A * (B + (C * A))
for the grammar:
Rule Number Rule
1 <assign> -> <id> '=' <expr>
2,3,4 <id> -> 'A' | 'B' | 'C'
5 <expr> -> <id> '+' <expr>
6 | <id> '*' <expr>
7 | '(' <expr> ')'
8 | <id>
Left most derivation:
Rule used
1 <assign> => id = <expr> 1
2 => A = <expr> 2
3 => A = id * <expr> 6
4 => A = A * <expr> 2
5 => A = A * ( <expr> ) 7
6 => A = A * (id + <expr>) 5
7 => A = A * (B + <expr>) 3
8 => A = A * (B + (<expr>)) 7
9 => A = A * (B + (id * <expr>)) 6
10 => A = A * (B + (C * <expr>)) 4
11 => A = A * (B + (C * id)) 8
12 => A = A * (B + (C * A)) 2