/// <summary> /// /// </summary> /// <param name="typeCarat"></param> private void Avancer(EnCaract typeCarat) { EnCaract typeCaractCourant = LitCaractere(mPhraseCourante[mPosCourant]); while (LitCaractere(mPhraseCourante[mPosCourant]) == typeCarat) { mPosCourant++; typeCaractCourant = LitCaractere(mPhraseCourante[mPosCourant]); } }
// --------------------------------------------------------------------------- // | Analyse lexicale : évaluation d'une variable ou d'une constante | // --------------------------------------------------------------------------- private IElementCalcul LitValeur() { IElementCalcul retour; EnCaract typCaractCourant = LitCaractere(mTokenCourant[0]); if (typCaractCourant == EnCaract.enCHIFFRE) { // C'est un nombre retour = new ElementCalculValeur(mTokenCourant); // convertion en float LitToken(); } else if (typCaractCourant == EnCaract.enLETTRE) //gestion des variables { retour = LitVariable(); } else { // Erreur de syntaxe throw (new Exception("Erreur de syntaxe")); } return(retour); }