fixed typo and extra comment
introduced clone function
expose debug flag in yacc