<commit_before>#include "Etats.h"
#include "../Automate.h"
#include "../symboles/ID_Symboles.h"

/* --------------- ETAT 0 ------------------
 *
 * -----------------------------------------
 */
bool E0::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_P:
			a.decalage(s, new E1);
			break;
		case I_LD:
			a.decalage(s, new E2);
			break;
		case I_const:
			a.reductionEmpile(4, new E2);
			break;
		case I_VAR:
			a.reductionEmpile(4, new E2);
			break;
		case I_ID:
			a.reductionEmpile(4, new E2);
			break;
		case I_lire:
			a.reductionEmpile(4, new E2);
			break;
		case I_ecrire:
			a.reductionEmpile(4, new E2);
			break;
		case I_DOLLAR:
			a.reductionEmpile(4, new E2);
			break;
		default:
			break;
	}

	return false;
}

E0::~E0()
{

}

/* --------------- ETAT 1 ------------------
 *
 * -----------------------------------------
 */

bool E1::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_DOLLAR:
			return true;
			break;
		default:
			break;
	}
	
	return false;
}

E1::~E1()
{

}

/* --------------- ETAT 2 ------------------
 *
 * -----------------------------------------
 */
bool E2::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_const:
			a.decalage(s, new E3);
			break;
		case I_VAR:
			a.decalage(s, new E4);
			break;
		case I_ID:
			a.reduction(12);
			break;
		case I_lire:
			a.reduction(12);
			break;
		case I_ecrire:
			a.reduction(12);
			break;
		case I_Li:
			a.decalage(s, new E17);
			break;
		case I_D:
			a.decalage(s, new E38);
			break;
		default:
			break;
	}
	
	return false;
}

E2::~E2()
{

}
/* --------------- ETAT 3 ------------------
 *
 * -----------------------------------------
 */
bool E3::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_ID:
			a.decalage(s, new E14);<commit_msg>Correction de l'Etat 2<commit_after>#include "Etats.h"
#include "../Automate.h"
#include "../symboles/ID_Symboles.h"

/* --------------- ETAT 0 ------------------
 *
 * -----------------------------------------
 */
bool E0::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_P:
			a.decalage(s, new E1);
			break;
		case I_LD:
			a.decalage(s, new E2);
			break;
		case I_const:
			a.reductionEmpile(4, new E2);
			break;
		case I_VAR:
			a.reductionEmpile(4, new E2);
			break;
		case I_ID:
			a.reductionEmpile(4, new E2);
			break;
		case I_lire:
			a.reductionEmpile(4, new E2);
			break;
		case I_ecrire:
			a.reductionEmpile(4, new E2);
			break;
		case I_DOLLAR:
			a.reductionEmpile(4, new E2);
			break;
		default:
			break;
	}

	return false;
}

E0::~E0()
{

}

/* --------------- ETAT 1 ------------------
 *
 * -----------------------------------------
 */

bool E1::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_DOLLAR:
			return true;
			break;
		default:
			break;
	}
	
	return false;
}

E1::~E1()
{

}

/* --------------- ETAT 2 ------------------
 *
 * -----------------------------------------
 */
bool E2::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_const:
			a.decalage(s, new E3);
			break;
		case I_VAR:
			a.decalage(s, new E4);
			break;
		case I_ID:
			a.reductionEmpile(12, new E17);
			break;
		case I_lire:
			a.reductionEmpile(12, new E17);
			break;
		case I_ecrire:
			a.reductionEmpile(12, new E17);
			break;
		case I_Li:
			a.decalage(s, new E17);
			break;
		case I_D:
			a.decalage(s, new E38);
			break;
		default:
			break;
	}
	
	return false;
}

E2::~E2()
{

}
/* --------------- ETAT 3 ------------------
 *
 * -----------------------------------------
 */
bool E3::transition(Automate &a, Symbole* s)
{
	switch(s->getIdSymbole())
	 {
		case I_ID:
			a.decalage(s, new E14);
{'fraction_non_alphanumeric': 0.29308510638297874, 'fraction_numerical': 0.02420212765957447, 'mean_word_length': 1.590220385674931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6851020', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1499, 'n_words': 302}