grammar To NFA