def clicouEpsilonLivre(self): try: glc = self.__obterGLC() glc = util.transformar_em_epsilon_livre_glc(glc) self.__setarGLC(glc) except Exception as excecao: self._error.showMessage(str(excecao))
def testDadaUmaGLCEpsilonLivreSeTransformarEmEpsilonLivreRetornaAMesmaGramatica(self): self.assertEqual(construirGLCComABOndeNumAsEhIgualNumBsEpsilonLivre(), util.transformar_em_epsilon_livre_glc(construirGLCComABOndeNumAsEhIgualNumBsEpsilonLivre())) self.assertEqual(construirGLCExpAritmeticaComRecEsquerdaDireta(), util.transformar_em_epsilon_livre_glc(construirGLCExpAritmeticaComRecEsquerdaDireta()))
def testDadaUmaGLCNaoEpsilonLivrePodeRetornarUmaGLCEpsilonLivre(self): glc_ok = construirGLCComABOndeNumAsEhIgualNumBsEpsilonLivre() glc_nok = construirGLCComABOndeNumAsEhIgualNumBsComEpsilon() self.assertNotEqual(glc_ok, glc_nok) self.assertEqual(glc_ok, util.transformar_em_epsilon_livre_glc(glc_nok))