
//----------------------------------------------------
// The following code was generated by CUP v0.10k
// Tue Feb 11 17:07:17 PST 2014
//----------------------------------------------------

package GenRGenS.grammar;

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

/** CUP v0.10k generated parser.
  * @version Tue Feb 11 17:07:17 PST 2014
  */
public class ParseGrammar extends java_cup.runtime.lr_parser {

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

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

  /** Production table. */
  protected static final short _production_table[][] = 
    unpackFromStrings(new String[] {
    "\000\037\000\002\002\004\000\002\003\010\000\002\004" +
    "\005\000\002\005\005\000\002\005\005\000\002\005\002" +
    "\000\002\006\005\000\002\006\002\000\002\007\005\000" +
    "\002\007\004\000\002\007\002\000\002\010\007\000\002" +
    "\010\006\000\002\016\004\000\002\016\002\000\002\015" +
    "\003\000\002\015\003\000\002\011\005\000\002\011\002" +
    "\000\002\012\005\000\002\012\002\000\002\013\005\000" +
    "\002\013\002\000\002\014\006\000\002\014\006\000\002" +
    "\014\005\000\002\014\005\000\002\014\006\000\002\014" +
    "\006\000\002\014\005\000\002\014\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\063\000\004\004\006\001\002\000\004\002\065\001" +
    "\002\000\016\002\ufffc\010\012\017\ufffc\020\ufffc\021\ufffc" +
    "\022\ufffc\001\002\000\004\013\007\001\002\000\004\005" +
    "\010\001\002\000\016\002\uffff\010\uffff\017\uffff\020\uffff" +
    "\021\uffff\022\uffff\001\002\000\014\002\ufffa\017\ufffa\020" +
    "\ufffa\021\ufffa\022\017\001\002\000\004\013\013\001\002" +
    "\000\006\011\015\012\014\001\002\000\014\002\ufffd\017" +
    "\ufffd\020\ufffd\021\ufffd\022\ufffd\001\002\000\014\002\ufffe" +
    "\017\ufffe\020\ufffe\021\ufffe\022\ufffe\001\002\000\012\002" +
    "\ufff7\017\ufff7\020\023\021\ufff7\001\002\000\004\013\020" +
    "\001\002\000\004\033\021\001\002\000\012\002\ufffb\017" +
    "\ufffb\020\ufffb\021\ufffb\001\002\000\010\002\uffef\017\uffef" +
    "\021\035\001\002\000\004\013\024\001\002\000\012\002" +
    "\ufff8\017\ufff8\021\ufff8\033\026\001\002\000\010\002\ufff9" +
    "\017\ufff9\021\ufff9\001\002\000\004\016\027\001\002\000" +
    "\006\014\ufff3\033\030\001\002\000\006\014\ufff3\033\030" +
    "\001\002\000\004\014\032\001\002\000\012\002\ufff5\017" +
    "\ufff5\021\ufff5\033\026\001\002\000\010\002\ufff6\017\ufff6" +
    "\021\ufff6\001\002\000\004\014\ufff4\001\002\000\004\013" +
    "\056\001\002\000\006\002\uffeb\017\040\001\002\000\004" +
    "\002\000\001\002\000\004\013\041\001\002\000\004\033" +
    "\043\001\002\000\004\002\uffec\001\002\000\006\013\044" +
    "\016\045\001\002\000\006\033\053\034\052\001\002\000" +
    "\006\033\047\034\046\001\002\000\006\002\uffe3\033\043" +
    "\001\002\000\006\002\uffe4\033\043\001\002\000\004\002" +
    "\uffe6\001\002\000\004\002\uffe5\001\002\000\006\002\uffe7" +
    "\033\043\001\002\000\006\002\uffe8\033\043\001\002\000" +
    "\004\002\uffea\001\002\000\004\002\uffe9\001\002\000\010" +
    "\002\uffed\017\uffed\033\060\001\002\000\006\002\ufff0\017" +
    "\ufff0\001\002\000\006\031\063\032\061\001\002\000\010" +
    "\002\ufff2\017\ufff2\033\ufff2\001\002\000\010\002\uffed\017" +
    "\uffed\033\060\001\002\000\010\002\ufff1\017\ufff1\033\ufff1" +
    "\001\002\000\006\002\uffee\017\uffee\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\063\000\006\003\003\004\004\001\001\000\002\001" +
    "\001\000\004\005\010\001\001\000\002\001\001\000\002" +
    "\001\001\000\002\001\001\000\004\006\015\001\001\000" +
    "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
    "\001\001\000\004\007\021\001\001\000\002\001\001\000" +
    "\002\001\001\000\002\001\001\000\004\011\035\001\001" +
    "\000\002\001\001\000\004\010\024\001\001\000\002\001" +
    "\001\000\002\001\001\000\004\016\030\001\001\000\004" +
    "\016\033\001\001\000\002\001\001\000\004\010\032\001" +
    "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
    "\000\004\013\036\001\001\000\002\001\001\000\002\001" +
    "\001\000\004\014\041\001\001\000\002\001\001\000\002" +
    "\001\001\000\002\001\001\000\002\001\001\000\004\014" +
    "\050\001\001\000\004\014\047\001\001\000\002\001\001" +
    "\000\002\001\001\000\004\014\054\001\001\000\004\014" +
    "\053\001\001\000\002\001\001\000\002\001\001\000\004" +
    "\012\056\001\001\000\002\001\001\000\004\015\061\001" +
    "\001\000\002\001\001\000\004\012\063\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$ParseGrammar$actions action_obj;

  /** Action encapsulation object initializer. */
  protected void init_actions()
    {
      action_obj = new CUP$ParseGrammar$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$ParseGrammar$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 String[] getTerminaux()
  { return action_obj.getTerminaux(); }

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

  public ContextFreeGrammarProduction[] getProductions()
  { return action_obj.getProductions(); }

  public int getSymbolStart()
  { return action_obj.getSymbolStart(); }

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



  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;
//    report_error(message,info);
    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$ParseGrammar$actions {


  private boolean _isWord = true;

//	private int numeroNouvelAuxiliaire=1;

	// index du symbol start
	private int symbolStart=0;
	private String _startName = "";


	// representation textuelle des symboles non-terminaux
	private String[] nonTerminaux;

  // representation textuelle des symboles terminaux
	private String[] terminaux;

	// representation des productions de la grammaire
  //  - une ligne par regle
  //  - le premier entier du tableau est le symbole productif (LHS)
  //  - les suivants sont les symboles produits (RHS)
	private ContextFreeGrammarProduction[] productions;


  private Hashtable _lexique = new Hashtable(31);
  private int _nextTokenID = 0;

  /* Variables relatives au stockage des règles lues */

  private Vector _tmpRules = new Vector();
  private Hashtable _nonTerminaux = new Hashtable();
  private Hashtable _indetermines = new Hashtable();


	/* Variables relatives au stockage des poids lus */
	private Vector tmpMasses = new Vector();
	private BigDecimal[] terminalsMasses = new BigDecimal[0];



  public boolean isWord()
  { return _isWord; }

  public String[] getTerminaux()
  { return terminaux; }

  public String[] getNonTerminaux()
  { return nonTerminaux; }

  public ContextFreeGrammarProduction[] getProductions()
  { return productions; }

  public int getSymbolStart()
  { return symbolStart;}

  public BigDecimal[] getTerminalsMasses()
  { return terminalsMasses; }


	private void setStartSymbolName(String s)
  {
    _startName = s;
  }

  /*
    Ajoute une règle ?la liste temporaire des règles "déj?lues".
    Met ?jour au passage les contenus des tables de Hashage _NonTerminaux
    et _Indetermines contenant respectivement les chaînes représentant les
    Non Terminaux avérés et les symboles de nature indeterminée.
  */
  private void addRule(String left, Stack right)
  {
    // On ajoute la partie gauche ?la liste des non terminaux
    if (!_nonTerminaux.containsKey(left))
    {
      _nonTerminaux.put(left,left);
    }
    if (_indetermines.containsKey(left))
    {
      _indetermines.remove(left);
    }

    // On ajoute les symboles de la partie droite ?la liste des indetermines
    for(int i=0; i<right.size() ; i++)
    {
      /*
        Une Stack dérive d'un Vector, on l'utilise ici comme
        tel. Cependant, on remarquera qu'ici, l'ordre des éléments
        tels qu'ils ont ét?rangés par l'opération "push" n'est pas
        important ...
        (on vérifie juste s'il ont déj?ét?rencontrés )
      */
      String s = (String) right.elementAt(i);
      if (!_nonTerminaux.containsKey(s))
      {
        if (!_indetermines.containsKey(s))
        {
          _indetermines.put(s,s);
        }
      }
    }

    // On ajoute la règle ?la liste des règles temporaires
    // La partie  gauche de la regle est la première rencontrée sur la pile
    right.push(left);
    /* Les règles sont ajoutées en dernière position dans l'ordre de rencontre
       => La règle ?l'adresse 0 est la première.
    */
    _tmpRules.add(0,right);
  }


    /*
      "Traduit" le nom d'un symbole en son index
      (<0 si terminal et >= 0 si non Terminal)
    */
		Hashtable lettre2int = new Hashtable();



  /*
    Met en forme les règle lues de façon ?ce qu'elle puisse être utilisées directement
    par la classe ContextFreeGrammar.
  */

  private void gatherRules()
  {
    // A ce niveau, les symboles indéterminés sont tous des terminaux ...
		int indexT = -1;
		int indexNT = 0;
		Stack tmpStack;
		String tmpString;
		Vector TokenisedRule;
		productions = new ContextFreeGrammarProduction[_tmpRules.size()];

		for(int i=0; i<_tmpRules.size(); i++)
		{
		  tmpStack = (Stack) _tmpRules.elementAt(i);
  		TokenisedRule = new Vector(tmpStack.size());

		  // On sait que la première chaine rencontrée est un non terminal ...
		  tmpString =  (String) tmpStack.pop();
      if (_startName.equals(""))
      {
        _startName = tmpString;
      }
		  // On lui affecte un numero si besoin est puis on l'ajoute au vecteur temporaire
		  if (! lettre2int.containsKey(tmpString))
		  {
		    lettre2int.put(tmpString,new Integer(indexNT));
		    TokenisedRule.add(new Integer(indexNT));
		    indexNT++;
		  }
		  else
		  {
		    TokenisedRule.add(lettre2int.get(tmpString));
		  }

		  while(!tmpStack.empty())
		  {
  		  tmpString =  (String) tmpStack.pop();

  		  if (! lettre2int.containsKey(tmpString))
		    {
		      if (_nonTerminaux.containsKey(tmpString))
		      {
		        lettre2int.put(tmpString,new Integer(indexNT));
		        TokenisedRule.add(new Integer(indexNT));
		        indexNT++;
		      }
		      if (_indetermines.containsKey(tmpString))
		      {
		        lettre2int.put(tmpString,new Integer(indexT));
		        TokenisedRule.add(new Integer(indexT));
		        indexT--;
		      }
		    }
		    else
		    {
		      TokenisedRule.add(lettre2int.get(tmpString));
		    }
		  }
 		  try
		  {
		    productions[i] = new ContextFreeGrammarProduction(TokenisedRule);
		  }
		  catch(BadGrammarException e)
		  {
        parser.done_parsing();
        parser.report_error("Internal error n?, please report this bug to the developing team !","");
		  }
		}
    //GenRGenS.err.println("Start = "+_startName);
    symbolStart = ((Integer) lettre2int.get(_startName)).intValue();

		/*
		  On remplit les tables contenant les representations en String
		  des terminaux et non terminaux
		*/
		terminaux = new String[_indetermines.size()];
		nonTerminaux = new String[_nonTerminaux.size()];
		Enumeration enu = lettre2int.keys();
    while(enu.hasMoreElements())
		{
		  String s = (String) enu.nextElement();
		  Integer i = (Integer) lettre2int.get(s);
		  if (i.intValue()<0)
		  { terminaux[-1-i.intValue()] = s; }
		  else
		  { nonTerminaux[i.intValue()] = s; }
		}

    /*
      On initialise la table des poids pour les terminaux
    */
    terminalsMasses = new BigDecimal[terminaux.length];
    BigDecimal one = new BigDecimal(1);
    for(int i=0;i<terminalsMasses.length;i++)
    {
      terminalsMasses[i] = one;
    }
  }

  /*
    Fonction puissance classique (définie pour des exposants positifs).
  */
  private int pow(int a, int b)
	{
		if (b==0)
		{
		  return 1;
		}
		else
		{
		  if (b%2==0)
		  {
				return(pow(a*a,b/2));
			}
			else
			{
				return(a*pow(a*a,b/2));
			}
		}
	}

  /*
    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 (i.intValue()<0)
      {
        terminalsMasses[-i.intValue()-1] = b;
      }
      else
      {
        parser.done_parsing();
        parser.report_error("Couldn't assign a weight to symbol \""+s+"\" : symbol is non-terminal !","");
      }

    }
    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 (i.intValue()<0)
      {
        terminaux[-i.intValue()-1] = dest;
      }
      else
      {
        parser.done_parsing();
        parser.report_error("Attempting to alias an non terminal \""+ src +"\" symbol !","");
      }

    }
    else
    {
      parser.done_parsing();
      parser.report_error("Attempting to alias an undefined \""+ src +"\" symbol !","");
    }
	}


  private final ParseGrammar parser;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 17: // WeightsDeclaration ::= WEIGHTS EQUALS WeightsList 
            {
              Object RESULT = null;
		  
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(7/*WeightsDeclaration*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-2)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

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

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 15: // Real ::= REEL 
            {
              BigDecimal RESULT = null;
		int fleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).left;
		int fright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right;
		Float f = (Float)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).value;
		

                                                   RESULT = new BigDecimal(f.floatValue());
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(11/*Real*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 14: // StringList ::= 
            {
              Stack RESULT = null;
		
                                                  Stack p = new Stack();
                                                  RESULT = p;
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(12/*StringList*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 13: // StringList ::= IDENT StringList 
            {
              Stack RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).value;
		int pleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).left;
		int pright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right;
		Stack p = (Stack)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).value;
		
                                                  p.push(s);
                                                  RESULT = p;
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(12/*StringList*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 12: // RulesList ::= IDENT ARROW StringList SEMI 
            {
              Object RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-3)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-3)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-3)).value;
		int lleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).right;
		Stack l = (Stack)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).value;
		
                                                  addRule(s,l);
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(6/*RulesList*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-3)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 11: // RulesList ::= IDENT ARROW StringList SEMI RulesList 
            {
              Object RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-4)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-4)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-4)).value;
		int lleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-2)).left;
		int lright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-2)).right;
		Stack l = (Stack)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-2)).value;
		
                                                  addRule(s,l);
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(6/*RulesList*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-4)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 10: // RulesDeclaration ::= 
            {
              Object RESULT = null;
		
                                                  parser.done_parsing();
                                                  parser.report_error("You must define at least ONE rule !","");
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(5/*RulesDeclaration*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 9: // RulesDeclaration ::= RULES EQUALS 
            {
              Object RESULT = null;
		
                                                  parser.done_parsing();
                                                  parser.report_error("You must define at least ONE rule !","");
                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(5/*RulesDeclaration*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-1)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 8: // RulesDeclaration ::= RULES EQUALS RulesList 
            {
              Object RESULT = null;
		 
                                                   gatherRules(); 

                                                
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(5/*RulesDeclaration*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-2)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 7: // StartNTDeclaration ::= 
            {
              Object RESULT = null;
		  
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(4/*StartNTDeclaration*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 6: // StartNTDeclaration ::= START EQUALS IDENT 
            {
              Object RESULT = null;
		int sleft = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).left;
		int sright = ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right;
		String s = (String)((java_cup.runtime.Symbol) CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).value;
		 setStartSymbolName(s); 
              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(4/*StartNTDeclaration*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-2)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

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

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

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

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

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 1: // GrammarDescription ::= TypeDeclaration SymbolTypeDeclaration StartNTDeclaration RulesDeclaration WeightsDeclaration AliasesDeclaration 
            {
              Object RESULT = null;

              CUP$ParseGrammar$result = new java_cup.runtime.Symbol(1/*GrammarDescription*/, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-5)).left, ((java_cup.runtime.Symbol)CUP$ParseGrammar$stack.elementAt(CUP$ParseGrammar$top-0)).right, RESULT);
            }
          return CUP$ParseGrammar$result;

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

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

        }
    }
}

