Algorithm: * WARNING: LR(1) may take considerable time to execute for large/ambigous grammars.