
//----------------------------------------------------
// The following code was generated by CUP v0.10k
// Thu Jul 27 15:24:16 CEST 2006
//----------------------------------------------------

package GenRGenS.ratexpr;

import java_cup.runtime.*;
import java.util.*;
import java.math.*;
import GenRGenS.*;

/** CUP v0.10k generated parser.
  * @version Thu Jul 27 15:24:16 CEST 2006
  */
public class parser extends java_cup.runtime.lr_parser {

  /** Default constructor. */
  public parser() {super();}

  /** Constructor which sets the default scanner. */
  public parser(java_cup.runtime.Scanner s) {super(s);}

  /** Production table. */
  protected static final short _production_table[][] = 
    unpackFromStrings(new String[] {
    "\000\053\000\002\002\004\000\002\003\004\000\002\005" +
    "\005\000\002\004\007\000\002\004\007\000\002\006\005" +
    "\000\002\007\005\000\002\010\005\000\002\010\005\000" +
    "\002\010\002\000\002\011\005\000\002\011\004\000\002" +
    "\011\002\000\002\020\005\000\002\020\005\000\002\020" +
    "\004\000\002\020\004\000\002\020\007\000\002\020\011" +
    "\000\002\020\005\000\002\020\003\000\002\012\005\000" +
    "\002\012\004\000\002\012\002\000\002\021\003\000\002" +
    "\021\005\000\002\021\005\000\002\021\006\000\002\021" +
    "\010\000\002\021\005\000\002\021\005\000\002\017\003" +
    "\000\002\017\003\000\002\013\005\000\002\013\002\000" +
    "\002\014\005\000\002\014\002\000\002\015\005\000\002" +
    "\015\002\000\002\016\006\000\002\016\005\000\002\016" +
    "\006\000\002\016\005" });

  /** Access to production table. */
  public short[][] production_table() {return _production_table;}

  /** Parse-action table. */
  protected static final short[][] _action_table = 
    unpackFromStrings(new String[] {
    "\000\126\000\004\004\006\001\002\000\004\002\130\001" +
    "\002\000\004\005\013\001\002\000\004\016\007\001\002" +
    "\000\004\010\010\001\002\000\004\005\uffff\001\002\000" +
    "\004\002\000\001\002\000\014\002\ufff8\013\016\023\ufff8" +
    "\032\ufff8\042\ufff8\001\002\000\004\016\075\001\002\000" +
    "\014\002\ufff8\013\016\023\ufff8\032\ufff8\042\ufff8\001\002" +
    "\000\012\002\uffea\023\uffea\032\022\042\uffea\001\002\000" +
    "\004\016\017\001\002\000\006\014\021\015\020\001\002" +
    "\000\012\002\ufff9\023\ufff9\032\ufff9\042\ufff9\001\002\000" +
    "\012\002\ufffa\023\ufffa\032\ufffa\042\ufffa\001\002\000\004" +
    "\016\051\001\002\000\010\002\uffdf\023\uffdf\042\024\001" +
    "\002\000\004\016\042\001\002\000\006\002\uffdb\023\027" +
    "\001\002\000\004\002\ufffd\001\002\000\004\016\030\001" +
    "\002\000\004\054\032\001\002\000\006\002\uffdc\054\036" +
    "\001\002\000\004\016\033\001\002\000\006\054\035\055" +
    "\034\001\002\000\006\002\uffd7\054\uffd7\001\002\000\006" +
    "\002\uffd9\054\uffd9\001\002\000\004\016\037\001\002\000" +
    "\006\054\041\055\040\001\002\000\006\002\uffd8\054\uffd8" +
    "\001\002\000\006\002\uffda\054\uffda\001\002\000\010\002" +
    "\uffdd\023\uffdd\054\044\001\002\000\006\002\uffe0\023\uffe0" +
    "\001\002\000\006\052\047\053\045\001\002\000\014\002" +
    "\uffe2\020\uffe2\023\uffe2\034\uffe2\054\uffe2\001\002\000\010" +
    "\002\uffdd\023\uffdd\054\044\001\002\000\014\002\uffe1\020" +
    "\uffe1\023\uffe1\034\uffe1\054\uffe1\001\002\000\006\002\uffde" +
    "\023\uffde\001\002\000\020\002\uffeb\023\uffeb\033\056\035" +
    "\053\037\055\042\uffeb\054\054\001\002\000\014\002\uffec" +
    "\023\uffec\026\061\033\062\042\uffec\001\002\000\004\054" +
    "\073\001\002\000\016\002\uffe9\023\uffe9\026\uffe9\033\uffe9" +
    "\034\uffe9\042\uffe9\001\002\000\004\054\071\001\002\000" +
    "\012\033\056\035\053\037\055\054\054\001\002\000\010" +
    "\026\061\033\062\034\060\001\002\000\016\002\uffe3\023" +
    "\uffe3\026\uffe3\033\uffe3\034\uffe3\042\uffe3\001\002\000\012" +
    "\033\056\035\053\037\055\054\054\001\002\000\006\052" +
    "\047\053\045\001\002\000\006\020\065\034\064\001\002" +
    "\000\016\002\uffe6\023\uffe6\026\uffe6\033\uffe6\034\uffe6\042" +
    "\uffe6\001\002\000\006\052\047\053\045\001\002\000\004" +
    "\034\067\001\002\000\016\002\uffe5\023\uffe5\026\uffe5\033" +
    "\uffe5\034\uffe5\042\uffe5\001\002\000\016\002\uffe4\023\uffe4" +
    "\026\uffe4\033\062\034\uffe4\042\uffe4\001\002\000\004\040" +
    "\072\001\002\000\016\002\uffe8\023\uffe8\026\uffe8\033\uffe8" +
    "\034\uffe8\042\uffe8\001\002\000\004\036\074\001\002\000" +
    "\016\002\uffe7\023\uffe7\026\uffe7\033\uffe7\034\uffe7\042\uffe7" +
    "\001\002\000\006\010\076\011\077\001\002\000\014\002" +
    "\ufffc\013\ufffc\023\ufffc\032\ufffc\042\ufffc\001\002\000\014" +
    "\002\ufffb\013\ufffb\023\ufffb\032\ufffb\042\ufffb\001\002\000" +
    "\012\002\ufff5\023\ufff5\032\101\042\ufff5\001\002\000\004" +
    "\016\105\001\002\000\010\002\uffdf\023\uffdf\042\024\001" +
    "\002\000\006\002\uffdb\023\027\001\002\000\004\002\ufffe" +
    "\001\002\000\014\002\ufff6\023\ufff6\033\110\042\ufff6\054" +
    "\107\001\002\000\022\002\ufff7\023\ufff7\024\116\025\112" +
    "\027\115\030\117\031\114\042\ufff7\001\002\000\024\002" +
    "\uffed\023\uffed\024\uffed\025\uffed\027\uffed\030\uffed\031\uffed" +
    "\034\uffed\042\uffed\001\002\000\006\033\110\054\107\001" +
    "\002\000\016\024\116\025\112\027\115\030\117\031\114" +
    "\034\113\001\002\000\006\033\110\054\107\001\002\000" +
    "\024\002\uffee\023\uffee\024\uffee\025\uffee\027\uffee\030\uffee" +
    "\031\uffee\034\uffee\042\uffee\001\002\000\004\033\121\001" +
    "\002\000\024\002\ufff1\023\ufff1\024\ufff1\025\ufff1\027\ufff1" +
    "\030\ufff1\031\ufff1\034\ufff1\042\ufff1\001\002\000\006\033" +
    "\110\054\107\001\002\000\024\002\ufff2\023\ufff2\024\ufff2" +
    "\025\ufff2\027\ufff2\030\ufff2\031\ufff2\034\ufff2\042\ufff2\001" +
    "\002\000\024\002\ufff4\023\ufff4\024\ufff4\025\112\027\115" +
    "\030\117\031\114\034\ufff4\042\ufff4\001\002\000\006\052" +
    "\047\053\045\001\002\000\006\020\124\034\123\001\002" +
    "\000\024\002\ufff0\023\ufff0\024\ufff0\025\ufff0\027\ufff0\030" +
    "\ufff0\031\ufff0\034\ufff0\042\ufff0\001\002\000\006\052\047" +
    "\053\045\001\002\000\004\034\126\001\002\000\024\002" +
    "\uffef\023\uffef\024\uffef\025\uffef\027\uffef\030\uffef\031\uffef" +
    "\034\uffef\042\uffef\001\002\000\024\002\ufff3\023\ufff3\024" +
    "\ufff3\025\ufff3\027\115\030\117\031\114\034\ufff3\042\ufff3" +
    "\001\002\000\004\002\001\001\002" });

  /** Access to parse-action table. */
  public short[][] action_table() {return _action_table;}

  /** <code>reduce_goto</code> table. */
  protected static final short[][] _reduce_table = 
    unpackFromStrings(new String[] {
    "\000\126\000\006\003\003\005\004\001\001\000\002\001" +
    "\001\000\010\004\010\006\011\007\013\001\001\000\002" +
    "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
    "\001\000\004\010\077\001\001\000\002\001\001\000\004" +
    "\010\014\001\001\000\004\012\022\001\001\000\002\001" +
    "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
    "\000\002\001\001\000\004\013\024\001\001\000\002\001" +
    "\001\000\004\015\025\001\001\000\002\001\001\000\002" +
    "\001\001\000\004\016\030\001\001\000\002\001\001\000" +
    "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
    "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
    "\001\000\002\001\001\000\004\014\042\001\001\000\002" +
    "\001\001\000\004\017\045\001\001\000\002\001\001\000" +
    "\004\014\047\001\001\000\002\001\001\000\002\001\001" +
    "\000\004\021\051\001\001\000\002\001\001\000\002\001" +
    "\001\000\002\001\001\000\002\001\001\000\004\021\056" +
    "\001\001\000\002\001\001\000\002\001\001\000\004\021" +
    "\067\001\001\000\004\017\062\001\001\000\002\001\001" +
    "\000\002\001\001\000\004\017\065\001\001\000\002\001" +
    "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
    "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
    "\002\001\001\000\002\001\001\000\002\001\001\000\004" +
    "\011\101\001\001\000\002\001\001\000\004\013\102\001" +
    "\001\000\004\015\103\001\001\000\002\001\001\000\004" +
    "\020\105\001\001\000\002\001\001\000\002\001\001\000" +
    "\004\020\110\001\001\000\002\001\001\000\004\020\126" +
    "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
    "\001\000\004\020\117\001\001\000\002\001\001\000\002" +
    "\001\001\000\004\017\121\001\001\000\002\001\001\000" +
    "\002\001\001\000\004\017\124\001\001\000\002\001\001" +
    "\000\002\001\001\000\002\001\001\000\002\001\001" });

  /** Access to <code>reduce_goto</code> table. */
  public short[][] reduce_table() {return _reduce_table;}

  /** Instance of action encapsulation class. */
  protected CUP$parser$actions action_obj;

  /** Action encapsulation object initializer. */
  protected void init_actions()
    {
      action_obj = new CUP$parser$actions(this);
    }

  /** Invoke a user supplied parse action. */
  public java_cup.runtime.Symbol do_action(
    int                        act_num,
    java_cup.runtime.lr_parser parser,
    java.util.Stack            stack,
    int                        top)
    throws java.lang.Exception
  {
    /* call code in generated class */
    return action_obj.CUP$parser$do_action(act_num, parser, stack, top);
  }

  /** Indicates start state. */
  public int start_state() {return 0;}
  /** Indicates start production. */
  public int start_production() {return 0;}

  /** <code>EOF</code> Symbol index. */
  public int EOF_sym() {return 0;}

  /** <code>error</code> Symbol index. */
  public int error_sym() {return 1;}




  private boolean _parseError = false;

  public boolean isParseError()
  { return _parseError; }

  public boolean isWord()
  { return action_obj.isWord(); }
  
  public RatExpr getRatExpr() {
  	return action_obj.getRatExpr();
  }

  public boolean isProsite() {
  	return action_obj.isProsite();
  }

  public String[] getLexique() {
  	return action_obj.getLexique();
  }

  public BigDecimal[] getPoids()
  { return action_obj.getPoids(); }

  public BigDecimal getPoids(Object o)
  { return action_obj.getPoids(o); }


  public void report_error(String message, Object info)
  {
    _parseError = true;
    if (info instanceof Symbol)
    {
      Symbol cur_token = (Symbol) info;
      if (cur_token.left != -1)
      {
      
        int[] coord_left = ((GenRGenSScanner) getScanner()).getRelativePos(
        	cur_token.left);
        int[] coord_right = ((GenRGenSScanner) getScanner()).getRelativePos(
        	cur_token.right);
        if (coord_left[0] == coord_right[0])
        { 
          GenRGenS.err.println("Syntax Error at line "+coord_right[0]+" chars "+
           coord_left[1] +"-" + coord_right[1]);
        }
        else
        {
          GenRGenS.err.println("Syntax Error from line "+coord_left[0]+" char "+
          coord_left[1] + " to line "+coord_right[0]+" char " + coord_right[1]);
        }
      }
      else
      {
        GenRGenS.err.println(
        	"Syntax Error, possibly because of a malformed clause !");
      }
    }
    else
    {
        GenRGenS.err.println(message);
    }
  }
  public void report_fatal_error(String message, Object info) 
  throws java.lang.Exception
  {
    _parseError = true;
    
   if (info instanceof Symbol)
    {
      Symbol cur_token = (Symbol) info;
      if (cur_token.left != -1)
      {
        int[] coord_left = ((GenRGenSScanner) getScanner()).getRelativePos(
        	cur_token.left);
        int[] coord_right = ((GenRGenSScanner) getScanner()).getRelativePos(
        	cur_token.right);
        if (coord_left[0] == coord_right[0])
        {
          GenRGenS.err.println("Couldn't repair and continue parse at line "+
          coord_right[0]+".");
        }
        else
        {
          GenRGenS.err.println("Couldn't repair and continue parse at line "+
          coord_right[0]+".");
        }
      }
      else
      {
        GenRGenS.err.println("Couldn't repair and continue parse.");
      }
    }
    else
    {
      Symbol current_token = cur_token;
      int[] coord_right = ((GenRGenSScanner) getScanner()).getRelativePos(
      	current_token.right);
        GenRGenS.err.println("Couldn't repair and continue parse at line "+
        coord_right[0]+".");
    }
    throw new Exception("Can't recover from previous error(s)");
  }

  public void syntax_error(Symbol cur_token) 
  {
    report_error("Syntax error", cur_token);  
  }
  public void unrecovered_syntax_error(Symbol cur_token)
  throws java.lang.Exception
  {
    report_fatal_error("Couldn't repair and continue parse", cur_token);  
  }



}

/** Cup generated class to encapsulate user supplied action code.*/
class CUP$parser$actions {


  //Contient toutes les lettres du langage associees a un numero unique
  private HashMap _lettre2int = new HashMap();
  private int _index = 0;

  //Tableau contenant toutes les lettres du langage
  private String[] _lexique;

  private boolean _isWord = true;

  // représentation de l'expression rationelle
  RatExpr _rat;

  //Vaut true ssi le langage utilise est Prosite
  private boolean _isProsite;

  // Variables relatives au stockage des poids lus
  private BigDecimal[] _poids;

  private final String[] LEXIQUE_PROSITE = 
  {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S",
  "T","U","V","W","X","Y","Z"};
  private RatExpr _caractere_indifferent = null;

  public boolean isWord()
  { return _isWord; }

  public String[] getLexique()
  { if (_lexique == null) {
  		initLexique();
  	}
  	return _lexique;
  }
  
  public void initLexique() {
  	_lexique = new String[_index];
  	for(Iterator it = _lettre2int.keySet().iterator(); it.hasNext();) {
  		String lettre = (String) it.next();
  		_lexique[((Integer)_lettre2int.get(lettre)).intValue()] = lettre;
  	}
  }
  
  public RatExpr getRatExpr()
  { return _rat; }

  public boolean isProsite() { return _isProsite; }

  public BigDecimal[] getPoids()
  { return _poids; }
  
  public BigDecimal getPoids(Object o) {
  	if (o instanceof String) {
  		if (_lettre2int.containsKey(o.toString())) {
  			if ((Integer) _lettre2int.get(o.toString()) != null) {
  				Integer i = (Integer) _lettre2int.get(o.toString());
  				int ii = i.intValue();
  				BigDecimal b = _poids[ii];
  				return b;
	  		}
	  		else
	  			System.out.println((Integer) _lettre2int.get(o.toString()));
	  	}
	  	else
	  	{
        //System.out.println(o+" pas dans les poids");
        return new BigDecimal(1);
      }
	}
	if (o instanceof Integer) {
  		int i = ((Integer) o).intValue();
  		if (i < _poids.length && i >= 0)
  			return _poids[i];
  		else
  			if (i != -1) 
        {
  	//i == 1 correspond au cas de la lettre inutile en debut de mot (prosite)
  			//	System.out.println(o+" pas dans les poids");
          return new BigDecimal(1);
        }
	  }
    return new BigDecimal(1);
  }

  //initialise le tableau des poids
	private void initPoids() {
  		_poids = new BigDecimal[_index];
  		for(int i = 0 ; i < _index ; i++)
  			_poids[i] = new BigDecimal(1);
  	}

  /*
    Procedure d'ajout d'un poids.
  */

  private void addWeight(String s, BigDecimal b)
  {
    if (b.compareTo(new BigDecimal(0)) <= 0)
    {
      parser.done_parsing();
      parser.report_error("Attempting to assign a negative "+
      b+" weight to symbol "+ s +" !",null);
    }
    if (_lettre2int.containsKey(s))
    {
      Integer i = (Integer) _lettre2int.get(s);
      if (_poids == null)
      	initPoids();
      _poids[i.intValue()] = b;
    }
    else
    {
      parser.done_parsing();
      parser.report_error("Couldn't assign a weight to symbol \""+s+
      "\" : symbol is unknown !","");
    }
  }


	/*
	  Modifie la representation en String (ah ah ah ...) d'un token :
	  un token de representation src prendra comme representation dest.
	*/
	private void replace(String src, String dest) {
		if (_lettre2int.containsKey(src)) {
			Integer i = (Integer) _lettre2int.get(src);
			if (_lexique == null)
				initLexique();
			_lexique[i.intValue()] = dest;
		}
		else {
			parser.done_parsing();
			parser.report_error("Attempting to alias an undefined \""+
			src +"\" symbol !","");
    	}
	}
	
/** initialise les attributs pour Prosite */
private void initProsite() {
	_isProsite = true;
	_lexique = new String[LEXIQUE_PROSITE.length];
	for(int i = 0 ; i < LEXIQUE_PROSITE.length ; i++) {
		_lexique[_index] = LEXIQUE_PROSITE[i];
		_lettre2int.put(LEXIQUE_PROSITE[i],new Integer(_index));
		_index++;
	}
}

/** Creation de l'expression rationnelle associee a une lettre */
private RatExpr lettre(String s) {

	//Mode WORDS avec un mot de plus de 1 caractere, donc s ne peut pas etre
	//un symbole valide.
	if (_isWord && s.length()!=1){
		parser.done_parsing();
		parser.report_error(s + " is not a letter","");
		return (new RatExprTerm(null));
	}

	//Mode LETTERS : s est une concatenation de symboles.
	if (!_isWord) {
		if(s.compareTo("x") == 0)
			return(caractere_indifferent());
		RatExpr res;
		String lettre = s.substring(0,1);
		if (_lettre2int.containsKey(lettre)) {
			//System.out.println(lettre);
			res = new RatExprTerm(_lettre2int.get(lettre));
			for(int i = 1 ; i < s.length() ; i++) {
				//System.out.println(lettre);
				lettre = s.substring(i,i+1);
				if (_lettre2int.containsKey(lettre))
					res = new RatExprPoint(res,new RatExprTerm(
						_lettre2int.get(lettre)));
				else {
					parser.done_parsing();
					parser.report_error(s.charAt(i) + " is not a letter","");
					res = new RatExprTerm(null);	
				}
			}
		}
		else {
			parser.done_parsing();
			parser.report_error(s.charAt(0) + " is not a letter","");
			res = new RatExprTerm(null);	
		}
		return res;
	}
	
	//Mode WORDS : s est de taille 1.
	if(s.compareTo("x") == 0)
		return(caractere_indifferent());
	else {
		if (_lettre2int.containsKey(s))
			return (new RatExprTerm(_lettre2int.get(s)));
		else {
			parser.done_parsing();
			parser.report_error(s + " is not a letter","");
			return (new RatExprTerm(null));
		}
	}
}

private RatExpr ambiguite_inclusive(String s) {
	RatExpr e;
	if (_lettre2int.containsKey(s.substring(0,1))) {
		e = new RatExprTerm(_lettre2int.get(s.substring(0,1)));
		for(int i=1; i<s.length(); i++){
			if (_lettre2int.containsKey(s.substring(i,i+1)))
				e = new RatExprOu(e, new RatExprTerm(_lettre2int.get(
					s.substring(i,i+1))));
			else {
				parser.done_parsing();
				parser.report_error(s.charAt(i) + " is not a letter","");
				return (new RatExprTerm(null));
			}
		}
	}
	else {
		parser.done_parsing();
		parser.report_error(s.charAt(0) + " is not a letter","");
		e = new RatExprTerm(null);
	}
	return e;
}


private RatExpr ambiguite_exclusive(String s) {
	//verification de l'integrite de s
	for(int i = 0 ; i < s.length() ; i++) {
		if (!_lettre2int.containsKey(s.substring(i,i+1))) {
			parser.done_parsing();
			parser.report_error(s.charAt(i) + " is not a letter","");
			return (new RatExprTerm(null));
		}
	}
	
	RatExpr e = null;
	for(int i=0; i<LEXIQUE_PROSITE.length; i++){
		if(s.indexOf(LEXIQUE_PROSITE[i])==-1) {
			if (e == null)
				e = new RatExprTerm(_lettre2int.get(LEXIQUE_PROSITE[i]));
			else
				e = new RatExprOu(e, new RatExprTerm(_lettre2int.get(
					LEXIQUE_PROSITE[i])));
		}
	}

	return e;
}

private RatExpr caractere_indifferent() {
	if (_caractere_indifferent == null) {
		_caractere_indifferent = new RatExprTerm(_lettre2int.get(
			LEXIQUE_PROSITE[0]));
		for(int i=1; i<LEXIQUE_PROSITE.length; i++)
			_caractere_indifferent = new RatExprOu(_caractere_indifferent,
				new RatExprTerm(_lettre2int.get(LEXIQUE_PROSITE[i])));
	}
		
	return _caractere_indifferent;
}

private RatExpr insertions_min_max(RatExpr e, BigDecimal b1, BigDecimal b2) {
	if (b1.compareTo(b2)==1)
		return(new RatExprTerm(null));
	
	RatExpr res = new RatExprPuiss(e, b1);
	for(int i=b1.intValue()+1; i<= b2.intValue(); i++)
		res = new RatExprOu(res, new RatExprPuiss(e, i));
	return res;
}


  private final parser parser;

  /** Constructor */
  CUP$parser$actions(parser parser) {
    this.parser = parser;
  }

  /** Method with the actual generated action code. */
  public final java_cup.runtime.Symbol CUP$parser$do_action(
    int                        CUP$parser$act_num,
    java_cup.runtime.lr_parser CUP$parser$parser,
    java.util.Stack            CUP$parser$stack,
    int                        CUP$parser$top)
    throws java.lang.Exception
    {
      /* Symbol object for return from actions */
      java_cup.runtime.Symbol CUP$parser$result;

      /* select the action based on the action number */
      switch (CUP$parser$act_num)
        {
          /*. . . . . . . . . . . . . . . . . . . .*/
          case 42: // AliasesList ::= IDENT EQUALS STRING 
            {
              Object RESULT = null;
		int i_srcleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int i_srcright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		String i_src = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int i_destleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int i_destright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String i_dest = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 replace(i_src,i_dest); 
              CUP$parser$result = new java_cup.runtime.Symbol(12/*AliasesList*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 41: // AliasesList ::= AliasesList IDENT EQUALS STRING 
            {
              Object RESULT = null;
		int i_srcleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int i_srcright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		String i_src = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int i_destleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int i_destright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String i_dest = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 replace(i_src,i_dest); 
              CUP$parser$result = new java_cup.runtime.Symbol(12/*AliasesList*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 40: // AliasesList ::= IDENT EQUALS IDENT 
            {
              Object RESULT = null;
		int i_srcleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int i_srcright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		String i_src = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int i_destleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int i_destright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String i_dest = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 replace(i_src,i_dest); 
              CUP$parser$result = new java_cup.runtime.Symbol(12/*AliasesList*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 39: // AliasesList ::= AliasesList IDENT EQUALS IDENT 
            {
              Object RESULT = null;
		int i_srcleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int i_srcright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		String i_src = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int i_destleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int i_destright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String i_dest = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 replace(i_src,i_dest); 
              CUP$parser$result = new java_cup.runtime.Symbol(12/*AliasesList*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 38: // AliasesDeclaration ::= 
            {
              Object RESULT = null;
		  
              CUP$parser$result = new java_cup.runtime.Symbol(11/*AliasesDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 37: // AliasesDeclaration ::= ALIASES EQUALS AliasesList 
            {
              Object RESULT = null;
		  
              CUP$parser$result = new java_cup.runtime.Symbol(11/*AliasesDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 36: // WeightsList ::= 
            {
              Object RESULT = null;
		 
              CUP$parser$result = new java_cup.runtime.Symbol(10/*WeightsList*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 35: // WeightsList ::= IDENT Real WeightsList 
            {
              Object RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int bleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int bright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		BigDecimal b = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 addWeight(s,b);                  
              CUP$parser$result = new java_cup.runtime.Symbol(10/*WeightsList*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 34: // WeightsDeclaration ::= 
            {
              Object RESULT = null;
		 initPoids();                     
              CUP$parser$result = new java_cup.runtime.Symbol(9/*WeightsDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 33: // WeightsDeclaration ::= WEIGHTS EQUALS WeightsList 
            {
              Object RESULT = null;
		 if (_poids == null) initPoids(); 
              CUP$parser$result = new java_cup.runtime.Symbol(9/*WeightsDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 32: // Real ::= ENTIER 
            {
              BigDecimal RESULT = null;
		int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Integer n = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BigDecimal(n.intValue()); 
              CUP$parser$result = new java_cup.runtime.Symbol(13/*Real*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 31: // Real ::= REEL 
            {
              BigDecimal RESULT = null;
		int fleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int fright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		Float f = (Float)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new BigDecimal(f.floatValue()); 
              CUP$parser$result = new java_cup.runtime.Symbol(13/*Real*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 30: // ExpressionProsite ::= PARG ExpressionProsite PARD 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = e;                          
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 29: // ExpressionProsite ::= ExpressionProsite TIRET ExpressionProsite 
            {
              RatExpr RESULT = null;
		int e1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int e1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		RatExpr e1 = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int e2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int e2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		RatExpr e2 = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new RatExprPoint(e1,e2);    
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 28: // ExpressionProsite ::= ExpressionProsite PARG Real VIRG Real PARD 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-5)).value;
		int b1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int b1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		BigDecimal b1 = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int b2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int b2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		BigDecimal b2 = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = insertions_min_max(e,b1,b2);
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 27: // ExpressionProsite ::= ExpressionProsite PARG Real PARD 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int bleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int bright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		BigDecimal b = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 if (b.intValue() != 0)
                                              RESULT = new RatExprPuiss(e,b);
                                            else
                                              RESULT = new RatExprTerm(null);
                                          
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 26: // ExpressionProsite ::= ACCG IDENT ACCD 
            {
              RatExpr RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = ambiguite_exclusive(s);  
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 25: // ExpressionProsite ::= CROG IDENT CROD 
            {
              RatExpr RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = ambiguite_inclusive(s);  
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 24: // ExpressionProsite ::= IDENT 
            {
              RatExpr RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = lettre(s);               
              CUP$parser$result = new java_cup.runtime.Symbol(15/*ExpressionProsite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 23: // PrositeDeclaration ::= 
            {
              Object RESULT = null;
		
             parser.done_parsing();
             parser.report_error("You must define a prosite expression !","");
                      
              CUP$parser$result = new java_cup.runtime.Symbol(8/*PrositeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 22: // PrositeDeclaration ::= EXPRESSION EQUALS 
            {
              Object RESULT = null;
		
             parser.done_parsing();
             parser.report_error("You must define a rational expression !","");
                      
              CUP$parser$result = new java_cup.runtime.Symbol(8/*PrositeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 21: // PrositeDeclaration ::= EXPRESSION EQUALS ExpressionProsite 
            {
              Object RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 _rat = e; 
              CUP$parser$result = new java_cup.runtime.Symbol(8/*PrositeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 20: // Expression ::= IDENT 
            {
              RatExpr RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
			
  		    if (_isWord) {
  				if (!_lettre2int.containsKey(s)) {
  					_lettre2int.put(s,new Integer(_index));
  					_index++;
  				}
  				RESULT = new RatExprTerm(_lettre2int.get(s));
  			}
  			else {
  				if (!_lettre2int.containsKey(s.substring(0,1))) {
  					_lettre2int.put(s.substring(0,1),new Integer(_index));
  					_index++;
  				}
  				RatExpr res = new RatExprTerm(_lettre2int.get(
  					s.substring(0,1)));
  				for(int i = 1 ; i < s.length() ; i++) {
  					String lettre = s.substring(i,i+1);
  					if (!_lettre2int.containsKey(lettre)) {
  						_lettre2int.put(lettre,new Integer(_index));
  						_index++;
  					}
  					res = new RatExprPoint(res,new RatExprTerm(
  						_lettre2int.get(lettre)));
  				}
  				RESULT = res;
  			}
  		
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 19: // Expression ::= PARG Expression PARD 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = e;                       
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 18: // Expression ::= Expression PUISS PARG Real VIRG Real PARD 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-6)).value;
		int b1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
		int b1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
		BigDecimal b1 = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
		int b2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int b2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		BigDecimal b2 = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		  RatExpr rat = new RatExprPuiss(e,b1.intValue());
				for(int i = b1.intValue()+1;i<=b2.intValue();i++) {
					rat = new RatExprOu(rat,new RatExprPuiss(e,i));
				}
				if (b2.intValue()<b1.intValue())
					RESULT = new RatExprTerm(null);
				else
					RESULT = rat;
			
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 17: // Expression ::= Expression PUISS PARG Real PARD 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
		int bleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int bright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		BigDecimal b = (BigDecimal)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 if (b.intValue() != 0)
                                             RESULT = new RatExprPuiss(e,b);
                                           else
                                             RESULT = new RatExprTerm(null);
                                        
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 16: // Expression ::= Expression PLUS 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new RatExprPlus(e);      
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 15: // Expression ::= Expression ETOILE 
            {
              RatExpr RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		 RESULT = new RatExprEtoile(e);    
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 14: // Expression ::= Expression POINT Expression 
            {
              RatExpr RESULT = null;
		int e1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int e1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		RatExpr e1 = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int e2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int e2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		RatExpr e2 = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new RatExprPoint(e1,e2); 
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 13: // Expression ::= Expression OU Expression 
            {
              RatExpr RESULT = null;
		int e1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
		int e1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
		RatExpr e1 = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
		int e2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int e2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		RatExpr e2 = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 RESULT = new RatExprOu(e1,e2);    
              CUP$parser$result = new java_cup.runtime.Symbol(14/*Expression*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 12: // RationalDeclaration ::= 
            {
              Object RESULT = null;
		
              parser.done_parsing();
              parser.report_error("You must define a rational expression !","");
                      
              CUP$parser$result = new java_cup.runtime.Symbol(7/*RationalDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 11: // RationalDeclaration ::= EXPRESSION EQUALS 
            {
              Object RESULT = null;
		
              parser.done_parsing();
              parser.report_error("You must define a rational expression !","");
                      
              CUP$parser$result = new java_cup.runtime.Symbol(7/*RationalDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 10: // RationalDeclaration ::= EXPRESSION EQUALS Expression 
            {
              Object RESULT = null;
		int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
		int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
		RatExpr e = (RatExpr)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
		 _rat = e; 
              CUP$parser$result = new java_cup.runtime.Symbol(7/*RationalDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 9: // SymbolTypeDeclaration ::= 
            {
              Object RESULT = null;
		 _isWord = true; 
              CUP$parser$result = new java_cup.runtime.Symbol(6/*SymbolTypeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 8: // SymbolTypeDeclaration ::= SYMBOLS EQUALS LETTERS 
            {
              Object RESULT = null;
		 _isWord = false; 
              CUP$parser$result = new java_cup.runtime.Symbol(6/*SymbolTypeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 7: // SymbolTypeDeclaration ::= SYMBOLS EQUALS WORDS 
            {
              Object RESULT = null;
		 _isWord = true; 
              CUP$parser$result = new java_cup.runtime.Symbol(6/*SymbolTypeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 6: // LangagePrositeDeclaration ::= LANGUAGE EQUALS PROSITE 
            {
              Object RESULT = null;
		 initProsite(); 
              CUP$parser$result = new java_cup.runtime.Symbol(5/*LangagePrositeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 5: // LangageRationalDeclaration ::= LANGUAGE EQUALS RATIONAL 
            {
              Object RESULT = null;
		 
              CUP$parser$result = new java_cup.runtime.Symbol(4/*LangageRationalDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 4: // RationalDescriptionSuite ::= LangagePrositeDeclaration SymbolTypeDeclaration PrositeDeclaration WeightsDeclaration AliasesDeclaration 
            {
              Object RESULT = null;
		 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*RationalDescriptionSuite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 3: // RationalDescriptionSuite ::= LangageRationalDeclaration SymbolTypeDeclaration RationalDeclaration WeightsDeclaration AliasesDeclaration 
            {
              Object RESULT = null;
		 
              CUP$parser$result = new java_cup.runtime.Symbol(2/*RationalDescriptionSuite*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 2: // TypeDeclaration ::= TYPE EQUALS RATIONAL 
            {
              Object RESULT = null;
		 
              CUP$parser$result = new java_cup.runtime.Symbol(3/*TypeDeclaration*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 1: // RationalDescription ::= TypeDeclaration RationalDescriptionSuite 
            {
              Object RESULT = null;
		 
              CUP$parser$result = new java_cup.runtime.Symbol(1/*RationalDescription*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 0: // $START ::= RationalDescription EOF 
            {
              Object RESULT = null;
		int start_valleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
		int start_valright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
		Object start_val = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
		RESULT = start_val;
              CUP$parser$result = new java_cup.runtime.Symbol(0/*$START*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
            }
          /* ACCEPT */
          CUP$parser$parser.done_parsing();
          return CUP$parser$result;

          /* . . . . . .*/
          default:
            throw new Exception(
               "Invalid action number found in internal parse table");

        }
    }
}

