Package yakimusic.analyzer

Source Code of yakimusic.analyzer.CUP$parser$actions

//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
// Fri May 13 02:31:42 CEST 2011
//----------------------------------------------------

package yakimusic.analyzer;

import java_cup.runtime.*;
import java.util.HashMap;
import java.util.LinkedList;
import yakimusic.sound.YMLRhythm;
import yakimusic.sound.YMLSong;
import yakimusic.sound.YMLInstrument;
import org.jfugue.Player;
import java.util.*;

/** CUP v0.11a beta 20060608 generated parser.
  * @version Fri May 13 02:31:42 CEST 2011
  */
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);}

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

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

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

  /** Parse-action table. */
  protected static final short[][] _action_table =
    unpackFromStrings(new String[] {
    "\000\117\000\012\003\013\006\005\014\011\017\006\001" +
    "\002\000\006\003\116\004\117\001\002\000\004\032\115" +
    "\001\002\000\004\032\042\001\002\000\004\002\041\001" +
    "\002\000\012\003\016\006\005\014\011\017\ufffd\001\002" +
    "\000\006\003\021\032\022\001\002\000\004\017\006\001" +
    "\002\000\010\002\ufffe\003\ufff6\004\ufff6\001\002\000\012" +
    "\003\016\006\005\014\011\017\ufffc\001\002\000\004\002" +
    "\uffff\001\002\000\016\003\ufff6\004\ufff6\005\ufff6\006\ufff6" +
    "\020\ufff6\024\ufff6\001\002\000\004\017\ufffa\001\002\000" +
    "\004\002\001\001\002\000\012\003\uffec\006\uffec\014\uffec" +
    "\017\uffec\001\002\000\004\007\023\001\002\000\004\015" +
    "\026\001\002\000\006\010\uffeb\015\026\001\002\000\004" +
    "\010\036\001\002\000\004\011\027\001\002\000\004\031" +
    "\030\001\002\000\004\012\031\001\002\000\004\032\032" +
    "\001\002\000\004\013\033\001\002\000\004\026\034\001" +
    "\002\000\004\005\035\001\002\000\006\010\uffe9\015\uffe9" +
    "\001\002\000\012\003\uffed\006\uffed\014\uffed\017\uffed\001" +
    "\002\000\004\010\uffea\001\002\000\004\017\ufffb\001\002" +
    "\000\004\002\000\001\002\000\004\027\043\001\002\000" +
    "\004\007\044\001\002\000\010\010\050\014\047\016\045" +
    "\001\002\000\006\003\067\011\070\001\002\000\006\010" +
    "\064\016\045\001\002\000\010\003\055\030\057\032\056" +
    "\001\002\000\004\002\uffe5\001\002\000\004\010\054\001" +
    "\002\000\006\010\uffde\016\045\001\002\000\004\010\uffdf" +
    "\001\002\000\004\002\uffe7\001\002\000\006\010\uffe0\016" +
    "\uffe0\001\002\000\004\005\062\001\002\000\004\005\060" +
    "\001\002\000\010\010\uffe1\014\047\016\uffe1\001\002\000" +
    "\006\010\uffe3\016\uffe3\001\002\000\010\010\uffe2\014\047" +
    "\016\uffe2\001\002\000\006\010\uffe4\016\uffe4\001\002\000" +
    "\004\002\uffe6\001\002\000\004\010\066\001\002\000\004" +
    "\002\uffe8\001\002\000\006\010\uffdb\016\uffdb\001\002\000" +
    "\004\031\071\001\002\000\004\012\072\001\002\000\004" +
    "\032\073\001\002\000\004\013\074\001\002\000\014\003" +
    "\016\005\100\006\005\020\101\024\103\001\002\000\014" +
    "\003\ufff1\005\ufff1\006\ufff1\020\ufff1\024\ufff1\001\002\000" +
    "\014\003\016\005\ufff5\006\005\020\101\024\103\001\002" +
    "\000\004\005\113\001\002\000\006\010\uffdc\016\uffdc\001" +
    "\002\000\004\025\112\001\002\000\014\003\ufff0\005\ufff0" +
    "\006\ufff0\020\ufff0\024\ufff0\001\002\000\010\021\104\022" +
    "\106\023\105\001\002\000\014\003\uffee\005\uffee\006\uffee" +
    "\020\uffee\024\uffee\001\002\000\004\022\110\001\002\000" +
    "\004\025\107\001\002\000\014\003\ufff2\005\ufff2\006\ufff2" +
    "\020\ufff2\024\ufff2\001\002\000\004\025\111\001\002\000" +
    "\014\003\ufff3\005\ufff3\006\ufff3\020\ufff3\024\ufff3\001\002" +
    "\000\014\003\uffef\005\uffef\006\uffef\020\uffef\024\uffef\001" +
    "\002\000\006\010\uffdd\016\uffdd\001\002\000\004\005\ufff4" +
    "\001\002\000\016\003\ufff7\004\ufff7\005\ufff7\006\ufff7\020" +
    "\ufff7\024\ufff7\001\002\000\012\003\ufff8\006\ufff8\014\ufff8" +
    "\017\ufff8\001\002\000\012\003\016\006\005\020\101\024" +
    "\103\001\002\000\004\005\121\001\002\000\012\003\ufff9" +
    "\006\ufff9\014\ufff9\017\ufff9\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\117\000\016\004\014\010\013\014\003\015\007\016" +
    "\006\017\011\001\001\000\002\001\001\000\002\001\001" +
    "\000\002\001\001\000\002\001\001\000\012\010\013\014" +
    "\003\015\007\017\037\001\001\000\002\001\001\000\004" +
    "\004\017\001\001\000\002\001\001\000\012\010\013\014" +
    "\003\015\007\017\016\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\006\006\023\007\024\001\001" +
    "\000\006\006\023\007\036\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\002\001\001" +
    "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
    "\002\001\001\000\010\002\050\003\045\005\051\001\001" +
    "\000\002\001\001\000\006\002\064\005\051\001\001\000" +
    "\002\001\001\000\002\001\001\000\002\001\001\000\006" +
    "\002\052\005\051\001\001\000\002\001\001\000\002\001" +
    "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
    "\000\004\003\060\001\001\000\002\001\001\000\004\003" +
    "\062\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\012\011\101\012\075\013\076\014\074\001\001\000" +
    "\002\001\001\000\012\011\101\012\075\013\113\014\074" +
    "\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\002\001\001\000\002\001\001\000\002" +
    "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
    "\001\000\012\011\101\012\075\013\117\014\074\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 1;}

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

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




    HashMap<Integer, String> ids = new HashMap<Integer, String>();
 
    public static LexLog imprime = null;
 
    public parser(LexAnalyzer an, LexLog log) {
  this(an);
  this.imprime = log;
  ids.put(sym.DURACION, "DURACION");
  ids.put(sym.BPM, "BPM");
  ids.put(sym.llave_i, "LLAVE IZQUIERDA");
  ids.put(sym.OCTAVA, "OCTAVA");
  ids.put(sym.llave_d, "LLAVE DERECHA");
  ids.put(sym.MODIF, "MODIF");
  ids.put(sym.parentesis_i, "PARENTESIS IZQUIERDO");
  ids.put(sym.parentesis_d, "PARENTESIS DERECHO");
  ids.put(sym.IDENTIF, "IDENTIF");
  ids.put(sym.rhythm, "RYTHM");
  ids.put(sym.PULSOS, "PULSOS");
  ids.put(sym.NOTA, "NOTA");
  ids.put(sym.igual, "IGUAL")
  ids.put(sym.EOF, "EOF");
  ids.put(sym.dolar, "DOLAR");
  ids.put(sym.track, "TRACK");
  ids.put(sym.MODO, "MODO");
  ids.put(sym.puntocoma, "PUNTO Y COMA");
  ids.put(sym.error, "ERROR");
  ids.put(sym.song, "SONG");
  ids.put(sym.RITMOPRED, "RITMO PREDETERMINADO");
  ids.put(sym.dospuntos, "DOS PUNTOS");
  ids.put(sym.channel, "CHANNEL");
    }
    public void syntax_error(Symbol s) {
  if(Integer.parseInt(s.toString().substring(1)) == 1){
      //Es un "ERROR" léxico de token no existente. No hace falta que mostremos un error sintáctico
      //imprime.error("Encontrada cadena incorrecta", s.left, s.right);
  }else{
      String tipo = ids.get(Integer.parseInt(s.toString().substring(1)));
      imprime.error("Encontrado un token del tipo " + tipo + " fuera de lugar.", s.left, s.right, 'S');
  }
    }
    public void report_fatal_error(String s, Object o){
  //report_error("Error fatal: " + s, o);
    }
    public void report_error(String s, Object o){
  if(o instanceof Symbol){
      int col, fil;
      col = ((Symbol)o).right;
      fil = ((Symbol)o).left;
      imprime.error(s, fil, col, 'S');
  }else{
      System.err.println(s);
  }
    }

   
}

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

    boolean continuar = true; /*variable que comprobara si seguimos con el analisis semantico*/
    LinkedList<String> identificadores = new LinkedList<String>(); /*lista para comprobar que no se repita ningun identificador*/
    HashMap<String, String> sonidosMap =new HashMap <String,String>();
    HashMap<String, YMLRhythm> ritmosMap =new HashMap<String,YMLRhythm>();

    public boolean existeRitmo(String ide)
  {
      return ritmosMap.containsKey(ide);
  }

    public boolean existeVar(String ide){
      return sonidosMap.containsKey(ide);
    }

    public boolean comprobarIdentificador(String ide)
    {
  boolean ok = true;
  if(identificadores.contains(ide)){
      continuar = false;
      ok = false;
  }
  else{
      identificadores.add(ide);
      ok = true;
  }
  return ok;
    }
   
    public String preprocesarListaSonidos(String lista){
  String[] sonidos = lista.split(" ");
  String cadena = "";
  for(String s: sonidos){
      if(s.startsWith("$")){
    if(sonidosMap.containsKey(s.replace("$",""))){
        cadena+=" "+sonidosMap.get(s.replace("$",""));
    }else{
        parser.imprime.error("ERROR: La variable " +s+ " no ha sido declarada.",'M');
        continuar = false;
    }
      }else{
    cadena += " " + s;
      }
  }
  return cadena;
    }
 
   
  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 38: // PISTA ::= track error
            {
              String[] RESULT =null;
    continuar = false;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("PISTA",3, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 37: // PISTA ::= track parentesis_i INSTRUM parentesis_d IDENTIF dospuntos puntocoma
            {
              String[] RESULT =null;
    int insleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
    int insright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
    String ins = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
   
    String[] p = new String[2];
    if(continuar){ 
  p[0]= ins;
  p[1] ="";
    }
    RESULT = p;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("PISTA",3, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 36: // PISTA ::= track parentesis_i INSTRUM parentesis_d IDENTIF dospuntos SONIDOS puntocoma
            {
              String[] RESULT =null;
    int insleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left;
    int insright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).right;
    String ins = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-5)).value;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int sonleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int sonright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String son = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
String[] p = new String[2];
if(continuar){
     p[0] = ins;
     p[1] = son;   
}
RESULT = p;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("PISTA",3, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-7)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 35: // PISTAS ::= PISTA
            {
              LinkedList<String[]> RESULT =null;
    int pleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int pright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String[] p = (String[])((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
    LinkedList<String[]> list = new LinkedList<String[]>();
    if(continuar){
  list.add(p);
    }
    RESULT = list;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("PISTAS",0, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 34: // PISTAS ::= PISTA PISTAS
            {
              LinkedList<String[]> RESULT =null;
    int pleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int pright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String[] p = (String[])((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    LinkedList<String[]> l = (LinkedList<String[]>)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
LinkedList<String[]> list = new LinkedList<String[]>();
if(continuar){
     list.add(p);
     list.addAll(l);
}
RESULT = list;

              CUP$parser$result = parser.getSymbolFactory().newSymbol("PISTAS",0, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 33: // RITMOCAN ::= rhythm error
            {
              LinkedList<YMLRhythm> RESULT =null;
    continuar = false;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMOCAN",1, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 32: // RITMOCAN ::= rhythm RITMOPRED puntocoma
            {
              LinkedList<YMLRhythm> RESULT =null;
    int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String r = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
    LinkedList<YMLRhythm> list = new LinkedList<YMLRhythm>();
    list.add(YMLRhythm.getDefault(r));
    RESULT = list;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMOCAN",1, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 31: // RITMOCAN ::= rhythm IDENTIF puntocoma
            {
              LinkedList<YMLRhythm> RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
    LinkedList<YMLRhythm> l=new LinkedList<YMLRhythm>();
    if(existeRitmo(ide)){
  l.add(ritmosMap.get(ide));
    }else{
  parser.imprime.error("El ritmo "+ide+" no existe",'M');
  continuar=false;
    }
    RESULT=l;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMOCAN",1, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 30: // RITMOCAN ::= rhythm RITMOPRED puntocoma RITMOCAN
            {
              LinkedList<YMLRhythm> RESULT =null;
    int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    String r = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
    int rileft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int riright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    LinkedList<YMLRhythm> ri = (LinkedList<YMLRhythm>)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   

    LinkedList<YMLRhythm> list = new LinkedList<YMLRhythm>();
    if(continuar){
  list.add(YMLRhythm.getDefault(r));
  list.addAll(ri);
    }
    RESULT = list;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMOCAN",1, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 29: // RITMOCAN ::= rhythm IDENTIF puntocoma RITMOCAN
            {
              LinkedList<YMLRhythm> RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
    int rileft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int riright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    LinkedList<YMLRhythm> ri = (LinkedList<YMLRhythm>)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
LinkedList<YMLRhythm> lista = new LinkedList<YMLRhythm>();
if(continuar){
     if(existeRitmo(ide)){
   lista.add(ritmosMap.get(ide));
   lista.addAll(ri);  
     }else{
   parser.imprime.error("El ritmo "+ide+" no existe",'M');
   continuar=false;
     }
}
RESULT=lista;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMOCAN",1, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 28: // CANCION ::= song IDENTIF BPM llave_i llave_d
            {
              YMLSong RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int bpmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int bpmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    Integer bpm = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
   
    YMLSong s = new YMLSong(bpm);
    RESULT =s;  
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANCION",2, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 27: // CANCION ::= song IDENTIF BPM llave_i RITMOCAN llave_d
            {
              YMLSong RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
    int bpmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int bpmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    Integer bpm = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    LinkedList<YMLRhythm> r = (LinkedList<YMLRhythm>)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
    YMLSong s = null;
    if(continuar)
  {
      s = new YMLSong(bpm);
      for(YMLRhythm ritmo: r) s.addRhythm(ritmo, 1);
  }
    RESULT = s; 
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANCION",2, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 26: // CANCION ::= song IDENTIF BPM llave_i PISTAS llave_d
            {
              YMLSong RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
    int bpmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int bpmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    Integer bpm = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int listleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int listright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    LinkedList<String[]> list = (LinkedList<String[]>)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
    YMLSong s = null;
    if(continuar)
  {
      s = new YMLSong(bpm);
      for(String[] p: list) s.addTrack(p[0],p[1]);
  }
    RESULT = s;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANCION",2, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 25: // CANCION ::= song IDENTIF BPM llave_i RITMOCAN PISTAS llave_d
            {
              YMLSong RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-5)).value;
    int bpmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
    int bpmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
    Integer bpm = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
    int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    LinkedList<YMLRhythm> r = (LinkedList<YMLRhythm>)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
    int listleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int listright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    LinkedList<String[]> list = (LinkedList<String[]>)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
YMLSong s = null;
if(continuar)
     {
   s = new YMLSong(bpm);
   for(YMLRhythm ritmo: r) s.addRhythm(ritmo);
   for(String[] p: list) s.addTrack(p[0],p[1]);
     }
RESULT = s;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANCION",2, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 24: // CANAL ::= channel parentesis_i INSTRUM parentesis_d IDENTIF dospuntos PULSOS puntocoma
            {
              String[] RESULT =null;
    int insleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left;
    int insright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).right;
    String ins = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-5)).value;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int pulsosleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int pulsosright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String pulsos = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
String[] canal=null;
if(continuar)
     {  
   String instrumento = YMLInstrument.getInstrumentRealName(ins);
   canal = new String[]{instrumento,pulsos};
     }
RESULT = canal;  
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANAL",4, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-7)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 23: // CANALES ::= CANAL CANALES
            {
              LinkedList<String[]> RESULT =null;
    int canalleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int canalright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String[] canal = (String[])((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    int canalesleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int canalesright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    LinkedList<String[]> canales = (LinkedList<String[]>)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
    LinkedList<String[]> lista = new LinkedList<String[]>();
    if(continuar)
  {
      lista.add(canal);
      lista.addAll(canales);
  }
    RESULT =  lista;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANALES",5, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 22: // CANALES ::= CANAL
            {
              LinkedList<String[]> RESULT =null;
    int canalleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int canalright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String[] canal = (String[])((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
LinkedList< String[]> lista = new LinkedList<String[]>();
if(continuar)
     {
   lista.add(canal);
     }
RESULT =  lista;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("CANALES",5, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 21: // RITMO ::= rhythm error
            {
              YMLRhythm RESULT =null;
    continuar = false;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMO",6, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 20: // RITMO ::= rhythm IDENTIF llave_i CANALES llave_d
            {
              YMLRhythm RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int canalesleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int canalesright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    LinkedList<String[]> canales = (LinkedList<String[]>)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    YMLRhythm ritmo = new YMLRhythm();
if(continuar){
    
     for(String[] canal: canales){
   ritmo.addRhythmTrack(canal[0], canal[1]);
     }
     if(!existeRitmo(ide)){
   ritmosMap.put(ide,ritmo);
    
     }else{
   ritmosMap.remove(ide);  
   ritmosMap.put(ide, ritmo);
   parser.imprime.error("WARNING: Sobreescritura del ritmo " + ide,'M');
     }
}
RESULT = ritmo;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("RITMO",6, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 19: // ACORDE ::= NOTA MODO
            {
              String RESULT =null;
    int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String n = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    int mleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int mright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String m = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
String acorde=n+m;
RESULT = acorde;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("ACORDE",7, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 18: // SONIDO ::= SILENCIO DURACION
            {
              String RESULT =null;
    int sileft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int siright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    Object si = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    int dleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int dright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String d = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
    String sonido = si+d;
    RESULT = sonido;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDO",8, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 17: // SONIDO ::= ACORDE
            {
              String RESULT =null;
    int aleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int aright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String a = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
    RESULT = a;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDO",8, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 16: // SONIDO ::= VARID
            {
              String RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
if(continuar){
    if(existeVar(ide)){
  RESULT = sonidosMap.get(ide);
    }else{
  parser.imprime.error("ERROR: No existe la variable $"+ide,'M');
  continuar=false;
    }
}
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDO",8, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 15: // SONIDO ::= NOTA OCTAVA DURACION
            {
              String RESULT =null;
    int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    String n = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
    int oleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int oright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    Integer o = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    int dleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int dright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String d = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
    String sonido = n+o+d;
    RESULT = sonido;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDO",8, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 14: // SONIDO ::= NOTA MODIF OCTAVA DURACION
            {
              String RESULT =null;
    int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    String n = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int moleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
    int moright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
    String mo = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
    int oleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int oright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    Integer o = (Integer)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
    int dleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int dright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String d = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
//System.out.println("Nota: "+n+" Modif: "+mo+" Octava: "+o + " Duracion: " + d);
String sonido = n+mo+o+d;
RESULT = sonido;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDO",8, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 13: // SONIDOS ::= SONIDO SONIDOS
            {
              String 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;
    int listasonidosleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int listasonidosright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String listasonidos = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
    String sonidos = s+" "+listasonidos;
    RESULT = sonidos;
   
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDOS",9, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 12: // SONIDOS ::= SONIDO
            {
              String RESULT =null;
    int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String s = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
RESULT = s;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("SONIDOS",9, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 11: // VARID ::= error
            {
              String RESULT =null;
    continuar=false;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("VARID",10, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 10: // VARID ::= dolar IDENTIF
            {
              String RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
RESULT = ide;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("VARID",10, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 9: // VARIABLE ::= VARID error
            {
              String RESULT =null;
    continuar = false;
              CUP$parser$result = parser.getSymbolFactory().newSymbol("VARIABLE",11, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 8: // VARIABLE ::= VARID igual SONIDOS puntocoma
            {
              String RESULT =null;
    int ideleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
    int ideright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
    String ide = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
    int listasonidosleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
    int listasonidosright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
    String listasonidos = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
   
sonidosMap.put(ide,preprocesarListaSonidos(listasonidos));
RESULT = sonidosMap.get(ide);
              CUP$parser$result = parser.getSymbolFactory().newSymbol("VARIABLE",11, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 7: // CABECERA ::= RITMO CABECERA
            {
              Object RESULT =null;

              CUP$parser$result = parser.getSymbolFactory().newSymbol("CABECERA",13, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 6: // CABECERA ::= VARIABLE CABECERA
            {
              Object RESULT =null;

              CUP$parser$result = parser.getSymbolFactory().newSymbol("CABECERA",13, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 5: // CABECERA ::= RITMO
            {
              Object RESULT =null;

              CUP$parser$result = parser.getSymbolFactory().newSymbol("CABECERA",13, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 4: // CABECERA ::= VARIABLE
            {
              Object RESULT =null;

              CUP$parser$result = parser.getSymbolFactory().newSymbol("CABECERA",13, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 3: // COMP ::= error
            {
              Object RESULT =null;
   
    parser.imprime.error("Canción irreproducible",'S');

              CUP$parser$result = parser.getSymbolFactory().newSymbol("COMP",12, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 2: // COMP ::= CANCION
            {
              Object RESULT =null;
    int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    YMLSong s = (YMLSong)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
if(continuar) s.testPlay();
else parser.imprime.error("Canción irreproducible",'M');
              CUP$parser$result = parser.getSymbolFactory().newSymbol("COMP",12, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 1: // $START ::= COMP 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 = parser.getSymbolFactory().newSymbol("$START",0, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          /* ACCEPT */
          CUP$parser$parser.done_parsing();
          return CUP$parser$result;

          /*. . . . . . . . . . . . . . . . . . . .*/
          case 0: // COMP ::= CABECERA CANCION
            {
              Object RESULT =null;
    int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
    int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
    YMLSong s = (YMLSong)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
   
if(continuar) s.testPlay();
else parser.imprime.error("Canción irreproducible",'M');
              CUP$parser$result = parser.getSymbolFactory().newSymbol("COMP",12, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
            }
          return CUP$parser$result;

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

        }
    }
}
TOP

Related Classes of yakimusic.analyzer.CUP$parser$actions

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.