Question # 1:
Consider the following Grammar and remove the left-factoring from it.
A xByA/xByAzA/a
B b
Question # 2:
Consider the following CFG.
statement--> variable ASSIGNOP expr
| procedure_call
| block
| IFTOK expr THENTOK statement ELSETOK statement
| WHILETOK expr DOTOK statement
Three of the productions for statement begin with non-terminals:
variable--> ID | ID LBRK expr RBRK
p…