I have a context free grammar such as the following:
$E→E+T | T$
$T→T×F | F$
$F→(E) | a$
Using the left-most derivation, the following can be derived:
I know what the left most derivation is and I know what the grammar notation means but what I am trying to understand is how should I substitute the symbols in correct order? For example:
I start with:
I substitute 'E' first on the left and it becomes:
Then I need to substitute $T$ on the left and it becomes:
Why $T×F$ wasn't chosen to replace $T$ and why $F$ in this case?
Also, in the very next step $F$ was replaced by $a$ and why it wasn't replaced by $(E)$?