package GenRGenS.ratexpr;

import GenRGenS.*;
import GenRGenS.IU.*;
import GenRGenS.utility.*;
import GenRGenS.utility.holder.*;

public class GeneratorRationalConfigFile implements GeneratorConfigFile{
	
	/**
	 * Variable Significative uniquement pour le langage prosite.
	 * TAILLE_INDIFFERENTE vaut true si et seulement si le langage utilise est 
	 * prosite et si on veut generer des mots de taille quelconque.
	 */
	public static boolean TAILLE_INDIFFERENTE = false;
	private static String TAILLE_INDIFFERENTE_OPTION_STRING = "-i";
	
	/** permet d'afficher les resultats intermediaires */
	public static boolean RESULAT_INTERMEDIAIRE = false;
	private static String RESULAT_INTERMEDIAIRE_OPTION_STRING = "-ri";
	
	public Class getGeneratorClass() {
		Class gen = null;
    	try {
			gen = Class.forName("GenRGenS.ratexpr.GeneratorRational");
		} catch (ClassNotFoundException e) {
			GenRGenS.err.println("Couldn't find class GenRGenS.ratexpr.GeneratorRational.");
		}
		return gen;
	}
	
	public Option[] getOptions() {
		Option[] opt = new Option[1];
		opt[0] = new Option(
			new BooleanHolder() {
				public void set(boolean b) {
					GeneratorRationalConfigFile.TAILLE_INDIFFERENTE = b;
				}
				public boolean get() {
					return GeneratorRationalConfigFile.TAILLE_INDIFFERENTE;
				}
			},
			"Ignore size",
			TAILLE_INDIFFERENTE_OPTION_STRING,
			"T: PROSITE words are generated regardless of the size.\n"+
			"F: Fixed size PROSITE words generation(default).",
			"This option acts only on PROSITE patterns.\n"+
			"As it is possible to bound the size of any word issued from a PROSITE pattern,"+
			" it is then possible to compute the maximal length of a word, "+
			"and to generate a word among the set of all words issued from a PROSITE pattern."+
			"The size parameter is then not considered"
		);/*
		opt[1] = new Option(
			new BooleanHolder() {
				public void set(boolean b) {
					GeneratorRationalConfigFile.RESULAT_INTERMEDIAIRE = b;
				}
				public boolean get() {
					return GeneratorRationalConfigFile.RESULAT_INTERMEDIAIRE;
				}
			},
			"Montrer les intermediaires",
			RESULAT_INTERMEDIAIRE_OPTION_STRING,
			"T: Les resultats intermediaires sont affiches.\n"+
			"F: aucun resultat n'est affiche.",
			"Durant la generation, on passe par differentes etapes. En particulier, "+
			"on genere un automate, puis une table annexe pour la generation ds mots. "+
			"Cette option permet de les afficher."
		);*/
		return opt;	
	}
	
	public String getDescriptionFileHeader() {
		return "RATIONAL";
	}
	
	public String getLitteralName() {
		return "Rational Expression constrained Generation";
	}
}