Mise en commun pour même base

This commit is contained in:
SylvanCourtiol
2021-05-08 19:42:09 +02:00
parent 8993389bfd
commit 14d39af284
36 changed files with 471 additions and 420 deletions
@@ -0,0 +1,46 @@
/*
* IdentificateurChaine.java, 08/05/2021
* IUT Rodez 2020-2021, info1
* pas de copyright, aucun droits
*/
package interpreteurlir.donnees;
/**
* Identificateur de chaîne
* @author Nicolas Caminade
* @author Sylvan Courtiol
* @author Pierre Debas
* @author Heia Dexter
* @author Lucas Vabre
*/
public class IdentificateurChaine extends Identificateur {
/**
* Instantiation d'identificateur de chaîne
* @param identificateur a instancier
* @throws IllegalAccessException si l'identificateur est invalide
*/
public IdentificateurChaine(String identificateur) {
super(identificateur);
if(!isIdentificateurChaine(identificateur)) {
throw new IllegalArgumentException(identificateur
+ " n'est pas un identificateur"
+ " de chaine");
}
}
/**
* Prédicat attestant la validité de l'identificateur
* @param identificateur à tester
* @return true si l'identificateur est bien un identificateur d'entier
* false sinon
*/
private static boolean isIdentificateurChaine(String identificateur) {
return identificateur.length() >= 2
&& identificateur.charAt(0) == '$'
&& isLettre(identificateur.charAt(1));
}
}