/* Generated By:JJTree&JavaCC: Do not edit this line. PremonJJTParser.java */
import java.io.*;

/**
 * The class of parsers for the Premon language.
 * This parser is created using Sun's JJTree AST generator.
 */

public class PremonJJTParser/*@bgen(jjtree)*/implements PremonJJTParserTreeConstants, PremonJJTParserConstants {/*@bgen(jjtree)*/
  protected JJTPremonJJTParserState jjtree = new JJTPremonJJTParserState();
  /**
   * Parse an expression.
   * @return an expression parsed from the input stream.
   * @exception ParseException thrown if there is a parse error.
   */
  public PremonJJTExp parseExp () throws ParseException {
    return getExp ();
  }

  /**
   * Parse a context.
   * @return an expression parsed from the input stream.
   * @exception ParseException thrown if there is a parse error.
   */
  public PremonJJTCon parseCon () throws ParseException {
    return getCon ();
  }

  /**
   * Create a new parser.
   * @param s the string to parse.
   */
  public PremonJJTParser (String s) {
    this (new StringBufferInputStream (s));
  }

/* 
 * There are two top-level functions to parse an expression
 * or a context.
 */
  final public PremonJJTExp getExp() throws ParseException {
     PremonJJTExpTopLevel jjtn001 = new PremonJJTExpTopLevel(JJTEXPTOPLEVEL);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
    try {
      Exp();
    } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
    } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001,  1);
     }
    }
    jj_consume_token(0);
                  {if (true) return (PremonJJTExp)(jjtree.popNode());}
    throw new Error("Missing return statement in function");
  }

  final public PremonJJTCon getCon() throws ParseException {
    Con();
    jj_consume_token(0);
                  {if (true) return (PremonJJTCon)(jjtree.popNode());}
    throw new Error("Missing return statement in function");
  }

/*
 * Categories.
 *
 *    C ::= val | central | proc 
 */
  final public void Cat() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case VAL:
     PremonJJTCatVal jjtn001 = new PremonJJTCatVal(JJTCATVAL);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(VAL);
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case CENTRAL:
     PremonJJTCatCentral jjtn002 = new PremonJJTCatCentral(JJTCATCENTRAL);
     boolean jjtc002 = true;
     jjtree.openNodeScope(jjtn002);
      try {
        jj_consume_token(CENTRAL);
      } finally {
     if (jjtc002) {
       jjtree.closeNodeScope(jjtn002, true);
     }
      }
      break;
    case PROC:
     PremonJJTCatProc jjtn003 = new PremonJJTCatProc(JJTCATPROC);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        jj_consume_token(PROC);
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    default:
      jj_la1[0] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

/*
 * Types.
 *
 *    T ::= B | C T1...Tn [: T] | (T1,...,Tn) | (T "..." T)
 */
  final public void Type() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ID:
     PremonJJTTypeVar jjtn001 = new PremonJJTTypeVar(JJTTYPEVAR);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        Id();
      } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case VAL:
    case CENTRAL:
    case PROC:
     PremonJJTTypeFunCurried jjtn003 = new PremonJJTTypeFunCurried(JJTTYPEFUNCURRIED);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        Cat();
        label_1:
        while (true) {
          TypeTuple();
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case LPAREN:
            ;
            break;
          default:
            jj_la1[1] = jj_gen;
            break label_1;
          }
        }
        PremonJJTTypeResult jjtn002 = new PremonJJTTypeResult(JJTTYPERESULT);
        boolean jjtc002 = true;
        jjtree.openNodeScope(jjtn002);
        try {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COLON:
            jj_consume_token(COLON);
            Type();
            break;
          default:
            jj_la1[2] = jj_gen;
            ;
          }
        } catch (Throwable jjte002) {
        if (jjtc002) {
          jjtree.clearNodeScope(jjtn002);
          jjtc002 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte002 instanceof ParseException) {
          {if (true) throw (ParseException)jjte002;}
        }
        if (jjte002 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte002;}
        }
        {if (true) throw (Error)jjte002;}
        } finally {
        if (jjtc002) {
          jjtree.closeNodeScope(jjtn002, true);
        }
        }
      } catch (Throwable jjte003) {
     if (jjtc003) {
       jjtree.clearNodeScope(jjtn003);
       jjtc003 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte003 instanceof ParseException) {
       {if (true) throw (ParseException)jjte003;}
     }
     if (jjte003 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte003;}
     }
     {if (true) throw (Error)jjte003;}
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    case LPAREN:
      TypeTuple();
      break;
    default:
      jj_la1[3] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void TypeTuple() throws ParseException {
    jj_consume_token(LPAREN);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case RPAREN:
        PremonJJTTypeTuple jjtn001 = new PremonJJTTypeTuple(JJTTYPETUPLE);
        boolean jjtc001 = true;
        jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(RPAREN);
      } finally {
        if (jjtc001) {
          jjtree.closeNodeScope(jjtn001, true);
        }
      }
      break;
    case LPAREN:
    case VAL:
    case CENTRAL:
    case PROC:
    case ID:
        PremonJJTTypeTuple jjtn003 = new PremonJJTTypeTuple(JJTTYPETUPLE);
        boolean jjtc003 = true;
        jjtree.openNodeScope(jjtn003);
      try {
        Type();
        label_2:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
          case DOTS:
            ;
            break;
          default:
            jj_la1[4] = jj_gen;
            break label_2;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            jj_consume_token(COMMA);
            Type();
            break;
          case DOTS:
            jj_consume_token(DOTS);
                      PremonJJTTypeDots jjtn002 = new PremonJJTTypeDots(JJTTYPEDOTS);
                      boolean jjtc002 = true;
                      jjtree.openNodeScope(jjtn002);
            try {
              Type();
            } catch (Throwable jjte002) {
                      if (jjtc002) {
                        jjtree.clearNodeScope(jjtn002);
                        jjtc002 = false;
                      } else {
                        jjtree.popNode();
                      }
                      if (jjte002 instanceof ParseException) {
                        {if (true) throw (ParseException)jjte002;}
                      }
                      if (jjte002 instanceof RuntimeException) {
                        {if (true) throw (RuntimeException)jjte002;}
                      }
                      {if (true) throw (Error)jjte002;}
            } finally {
                      if (jjtc002) {
                        jjtree.closeNodeScope(jjtn002,  2);
                      }
            }
            break;
          default:
            jj_la1[5] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        jj_consume_token(RPAREN);
      } catch (Throwable jjte003) {
        if (jjtc003) {
          jjtree.clearNodeScope(jjtn003);
          jjtc003 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte003 instanceof ParseException) {
          {if (true) throw (ParseException)jjte003;}
        }
        if (jjte003 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte003;}
        }
        {if (true) throw (Error)jjte003;}
      } finally {
        if (jjtc003) {
          jjtree.closeNodeScope(jjtn003, jjtree.nodeArity() > 1);
        }
      }
      break;
    default:
      jj_la1[6] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

/*
 * Expressions.
 *
 *    M ::= x | fn C P1...Pn {M} | fn C P1...Pn {}
 *        | {M} | {} | (M1,...,Mn) | <int> | <double> | <string>
 *        | M M | M x M | D M | M; [M] | return M; | (M "..." M)
 */
  final public void ExpAtom() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ID:
     PremonJJTExpVar jjtn001 = new PremonJJTExpVar(JJTEXPVAR);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        Id();
      } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case FN:
     PremonJJTExpFunCurried jjtn002 = new PremonJJTExpFunCurried(JJTEXPFUNCURRIED);
     boolean jjtc002 = true;
     jjtree.openNodeScope(jjtn002);
      try {
        jj_consume_token(FN);
        Cat();
        label_3:
        while (true) {
          PatTuple();
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case LPAREN:
            ;
            break;
          default:
            jj_la1[7] = jj_gen;
            break label_3;
          }
        }
        ExpBlock();
      } catch (Throwable jjte002) {
     if (jjtc002) {
       jjtree.clearNodeScope(jjtn002);
       jjtc002 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte002 instanceof ParseException) {
       {if (true) throw (ParseException)jjte002;}
     }
     if (jjte002 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte002;}
     }
     {if (true) throw (Error)jjte002;}
      } finally {
     if (jjtc002) {
       jjtree.closeNodeScope(jjtn002, true);
     }
      }
      break;
    case LBRACE:
     PremonJJTExpFunThunk jjtn003 = new PremonJJTExpFunThunk(JJTEXPFUNTHUNK);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        ExpBlock();
      } catch (Throwable jjte003) {
     if (jjtc003) {
       jjtree.clearNodeScope(jjtn003);
       jjtc003 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte003 instanceof ParseException) {
       {if (true) throw (ParseException)jjte003;}
     }
     if (jjte003 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte003;}
     }
     {if (true) throw (Error)jjte003;}
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    case RETURN:
     PremonJJTExpReturn jjtn004 = new PremonJJTExpReturn(JJTEXPRETURN);
     boolean jjtc004 = true;
     jjtree.openNodeScope(jjtn004);
      try {
        jj_consume_token(RETURN);
        ExpAppInfix();
        jj_consume_token(SEMI);
      } catch (Throwable jjte004) {
     if (jjtc004) {
       jjtree.clearNodeScope(jjtn004);
       jjtc004 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte004 instanceof ParseException) {
       {if (true) throw (ParseException)jjte004;}
     }
     if (jjte004 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte004;}
     }
     {if (true) throw (Error)jjte004;}
      } finally {
     if (jjtc004) {
       jjtree.closeNodeScope(jjtn004, true);
     }
      }
      break;
    case LPAREN:
      ExpTuple();
      break;
    case INT:
    case DOUBLE:
    case STRING:
      ExpLiteral();
      break;
    default:
      jj_la1[8] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void ExpTuple() throws ParseException {
    jj_consume_token(LPAREN);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case RPAREN:
        PremonJJTExpTuple jjtn001 = new PremonJJTExpTuple(JJTEXPTUPLE);
        boolean jjtc001 = true;
        jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(RPAREN);
      } finally {
        if (jjtc001) {
          jjtree.closeNodeScope(jjtn001, true);
        }
      }
      break;
    case LPAREN:
    case LBRACE:
    case FN:
    case LET:
    case REC:
    case VAL:
    case CENTRAL:
    case PROC:
    case LOCAL:
    case RETURN:
    case INT:
    case DOUBLE:
    case STRING:
    case ID:
        PremonJJTExpTuple jjtn003 = new PremonJJTExpTuple(JJTEXPTUPLE);
        boolean jjtc003 = true;
        jjtree.openNodeScope(jjtn003);
      try {
        Exp();
        label_4:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
          case DOTS:
            ;
            break;
          default:
            jj_la1[9] = jj_gen;
            break label_4;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            jj_consume_token(COMMA);
            Exp();
            break;
          case DOTS:
            jj_consume_token(DOTS);
                    PremonJJTExpDots jjtn002 = new PremonJJTExpDots(JJTEXPDOTS);
                    boolean jjtc002 = true;
                    jjtree.openNodeScope(jjtn002);
            try {
              Exp();
            } catch (Throwable jjte002) {
                    if (jjtc002) {
                      jjtree.clearNodeScope(jjtn002);
                      jjtc002 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte002 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte002;}
                    }
                    if (jjte002 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte002;}
                    }
                    {if (true) throw (Error)jjte002;}
            } finally {
                    if (jjtc002) {
                      jjtree.closeNodeScope(jjtn002,  2);
                    }
            }
            break;
          default:
            jj_la1[10] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        jj_consume_token(RPAREN);
      } catch (Throwable jjte003) {
        if (jjtc003) {
          jjtree.clearNodeScope(jjtn003);
          jjtc003 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte003 instanceof ParseException) {
          {if (true) throw (ParseException)jjte003;}
        }
        if (jjte003 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte003;}
        }
        {if (true) throw (Error)jjte003;}
      } finally {
        if (jjtc003) {
          jjtree.closeNodeScope(jjtn003, jjtree.nodeArity() > 1);
        }
      }
      break;
    default:
      jj_la1[11] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void ExpLiteral() throws ParseException {
                      Token t;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INT:
     PremonJJTExpInt jjtn001 = new PremonJJTExpInt(JJTEXPINT);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        t = jj_consume_token(INT);
               jjtree.closeNodeScope(jjtn001, true);
               jjtc001 = false;
               jjtn001.setValue(Integer.parseInt(t.image));
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case DOUBLE:
     PremonJJTExpDouble jjtn002 = new PremonJJTExpDouble(JJTEXPDOUBLE);
     boolean jjtc002 = true;
     jjtree.openNodeScope(jjtn002);
      try {
        t = jj_consume_token(DOUBLE);
                  jjtree.closeNodeScope(jjtn002, true);
                  jjtc002 = false;
                  jjtn002.setValue(Double.valueOf(t.image).doubleValue());
      } finally {
     if (jjtc002) {
       jjtree.closeNodeScope(jjtn002, true);
     }
      }
      break;
    case STRING:
     PremonJJTExpString jjtn003 = new PremonJJTExpString(JJTEXPSTRING);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        t = jj_consume_token(STRING);
                  jjtree.closeNodeScope(jjtn003, true);
                  jjtc003 = false;
                  jjtn003.setValue(t.image);
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    default:
      jj_la1[12] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void ExpApp() throws ParseException {
    ExpAtom();
    label_5:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LPAREN:
      case LBRACE:
        ;
        break;
      default:
        jj_la1[13] = jj_gen;
        break label_5;
      }
                   PremonJJTExpApp jjtn002 = new PremonJJTExpApp(JJTEXPAPP);
                   boolean jjtc002 = true;
                   jjtree.openNodeScope(jjtn002);
      try {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LPAREN:
          ExpTuple();
          break;
        case LBRACE:
                                  PremonJJTExpFunThunk jjtn001 = new PremonJJTExpFunThunk(JJTEXPFUNTHUNK);
                                  boolean jjtc001 = true;
                                  jjtree.openNodeScope(jjtn001);
          try {
            ExpBlock();
          } catch (Throwable jjte001) {
                                  if (jjtc001) {
                                    jjtree.clearNodeScope(jjtn001);
                                    jjtc001 = false;
                                  } else {
                                    jjtree.popNode();
                                  }
                                  if (jjte001 instanceof ParseException) {
                                    {if (true) throw (ParseException)jjte001;}
                                  }
                                  if (jjte001 instanceof RuntimeException) {
                                    {if (true) throw (RuntimeException)jjte001;}
                                  }
                                  {if (true) throw (Error)jjte001;}
          } finally {
                                  if (jjtc001) {
                                    jjtree.closeNodeScope(jjtn001, true);
                                  }
          }
          break;
        default:
          jj_la1[14] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      } catch (Throwable jjte002) {
                   if (jjtc002) {
                     jjtree.clearNodeScope(jjtn002);
                     jjtc002 = false;
                   } else {
                     jjtree.popNode();
                   }
                   if (jjte002 instanceof ParseException) {
                     {if (true) throw (ParseException)jjte002;}
                   }
                   if (jjte002 instanceof RuntimeException) {
                     {if (true) throw (RuntimeException)jjte002;}
                   }
                   {if (true) throw (Error)jjte002;}
      } finally {
                   if (jjtc002) {
                     jjtree.closeNodeScope(jjtn002,  2);
                   }
      }
    }
  }

  final public void ExpAppInfix() throws ParseException {
    ExpApp();
    label_6:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case ID:
        ;
        break;
      default:
        jj_la1[15] = jj_gen;
        break label_6;
      }
      Id();
                       PremonJJTExpAppInfix jjtn001 = new PremonJJTExpAppInfix(JJTEXPAPPINFIX);
                       boolean jjtc001 = true;
                       jjtree.openNodeScope(jjtn001);
      try {
        ExpApp();
      } catch (Throwable jjte001) {
                       if (jjtc001) {
                         jjtree.clearNodeScope(jjtn001);
                         jjtc001 = false;
                       } else {
                         jjtree.popNode();
                       }
                       if (jjte001 instanceof ParseException) {
                         {if (true) throw (ParseException)jjte001;}
                       }
                       if (jjte001 instanceof RuntimeException) {
                         {if (true) throw (RuntimeException)jjte001;}
                       }
                       {if (true) throw (Error)jjte001;}
      } finally {
                       if (jjtc001) {
                         jjtree.closeNodeScope(jjtn001,  3);
                       }
      }
    }
  }

  final public void ExpComp() throws ParseException {
     PremonJJTExpComp jjtn002 = new PremonJJTExpComp(JJTEXPCOMP);
     boolean jjtc002 = true;
     jjtree.openNodeScope(jjtn002);
    try {
      ExpAppInfix();
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SEMI:
                       PremonJJTExpOptional jjtn001 = new PremonJJTExpOptional(JJTEXPOPTIONAL);
                       boolean jjtc001 = true;
                       jjtree.openNodeScope(jjtn001);
        try {
          jj_consume_token(SEMI);
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case LPAREN:
          case LBRACE:
          case FN:
          case LET:
          case REC:
          case VAL:
          case CENTRAL:
          case PROC:
          case LOCAL:
          case RETURN:
          case INT:
          case DOUBLE:
          case STRING:
          case ID:
            Exp();
            break;
          default:
            jj_la1[16] = jj_gen;
            ;
          }
        } catch (Throwable jjte001) {
                       if (jjtc001) {
                         jjtree.clearNodeScope(jjtn001);
                         jjtc001 = false;
                       } else {
                         jjtree.popNode();
                       }
                       if (jjte001 instanceof ParseException) {
                         {if (true) throw (ParseException)jjte001;}
                       }
                       if (jjte001 instanceof RuntimeException) {
                         {if (true) throw (RuntimeException)jjte001;}
                       }
                       {if (true) throw (Error)jjte001;}
        } finally {
                       if (jjtc001) {
                         jjtree.closeNodeScope(jjtn001, true);
                       }
        }
        break;
      default:
        jj_la1[17] = jj_gen;
        ;
      }
    } catch (Throwable jjte002) {
     if (jjtc002) {
       jjtree.clearNodeScope(jjtn002);
       jjtc002 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte002 instanceof ParseException) {
       {if (true) throw (ParseException)jjte002;}
     }
     if (jjte002 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte002;}
     }
     {if (true) throw (Error)jjte002;}
    } finally {
     if (jjtc002) {
       jjtree.closeNodeScope(jjtn002, jjtree.nodeArity() > 1);
     }
    }
  }

  final public void Exp() throws ParseException {
     PremonJJTExpDec jjtn001 = new PremonJJTExpDec(JJTEXPDEC);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LET:
      case REC:
      case VAL:
      case CENTRAL:
      case PROC:
      case LOCAL:
        Dec();
        break;
      default:
        jj_la1[18] = jj_gen;
        ;
      }
      ExpComp();
    } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
    } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1);
     }
    }
  }

  final public void ExpBlock() throws ParseException {
    jj_consume_token(LBRACE);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case RBRACE:
          PremonJJTExpTuple jjtn001 = new PremonJJTExpTuple(JJTEXPTUPLE);
          boolean jjtc001 = true;
          jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(RBRACE);
      } finally {
          if (jjtc001) {
            jjtree.closeNodeScope(jjtn001,  0);
          }
      }
      break;
    case LPAREN:
    case LBRACE:
    case FN:
    case LET:
    case REC:
    case VAL:
    case CENTRAL:
    case PROC:
    case LOCAL:
    case RETURN:
    case INT:
    case DOUBLE:
    case STRING:
    case ID:
      Exp();
      jj_consume_token(RBRACE);
      break;
    default:
      jj_la1[19] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

/* 
 * Patterns.
 *
 *    P ::= x : T | C x T1...Tn [: T] | (P1,...,Pn) | (P "..." P)
 */
  final public void Pat() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ID:
     PremonJJTPatBind jjtn001 = new PremonJJTPatBind(JJTPATBIND);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        Id();
        jj_consume_token(COLON);
        Type();
      } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case VAL:
    case CENTRAL:
    case PROC:
     PremonJJTPatBindFunCurried jjtn003 = new PremonJJTPatBindFunCurried(JJTPATBINDFUNCURRIED);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        Cat();
        Id();
        label_7:
        while (true) {
          TypeTuple();
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case LPAREN:
            ;
            break;
          default:
            jj_la1[20] = jj_gen;
            break label_7;
          }
        }
        PremonJJTTypeResult jjtn002 = new PremonJJTTypeResult(JJTTYPERESULT);
        boolean jjtc002 = true;
        jjtree.openNodeScope(jjtn002);
        try {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COLON:
            jj_consume_token(COLON);
            Type();
            break;
          default:
            jj_la1[21] = jj_gen;
            ;
          }
        } catch (Throwable jjte002) {
        if (jjtc002) {
          jjtree.clearNodeScope(jjtn002);
          jjtc002 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte002 instanceof ParseException) {
          {if (true) throw (ParseException)jjte002;}
        }
        if (jjte002 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte002;}
        }
        {if (true) throw (Error)jjte002;}
        } finally {
        if (jjtc002) {
          jjtree.closeNodeScope(jjtn002, true);
        }
        }
      } catch (Throwable jjte003) {
     if (jjtc003) {
       jjtree.clearNodeScope(jjtn003);
       jjtc003 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte003 instanceof ParseException) {
       {if (true) throw (ParseException)jjte003;}
     }
     if (jjte003 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte003;}
     }
     {if (true) throw (Error)jjte003;}
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    case LPAREN:
      PatTuple();
      break;
    default:
      jj_la1[22] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void PatTuple() throws ParseException {
    jj_consume_token(LPAREN);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case RPAREN:
        PremonJJTPatTuple jjtn001 = new PremonJJTPatTuple(JJTPATTUPLE);
        boolean jjtc001 = true;
        jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(RPAREN);
      } finally {
        if (jjtc001) {
          jjtree.closeNodeScope(jjtn001, true);
        }
      }
      break;
    case LPAREN:
    case VAL:
    case CENTRAL:
    case PROC:
    case ID:
        PremonJJTPatTuple jjtn003 = new PremonJJTPatTuple(JJTPATTUPLE);
        boolean jjtc003 = true;
        jjtree.openNodeScope(jjtn003);
      try {
        Pat();
        label_8:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
          case DOTS:
            ;
            break;
          default:
            jj_la1[23] = jj_gen;
            break label_8;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            jj_consume_token(COMMA);
            Pat();
            break;
          case DOTS:
            jj_consume_token(DOTS);
                    PremonJJTPatDots jjtn002 = new PremonJJTPatDots(JJTPATDOTS);
                    boolean jjtc002 = true;
                    jjtree.openNodeScope(jjtn002);
            try {
              Pat();
            } catch (Throwable jjte002) {
                    if (jjtc002) {
                      jjtree.clearNodeScope(jjtn002);
                      jjtc002 = false;
                    } else {
                      jjtree.popNode();
                    }
                    if (jjte002 instanceof ParseException) {
                      {if (true) throw (ParseException)jjte002;}
                    }
                    if (jjte002 instanceof RuntimeException) {
                      {if (true) throw (RuntimeException)jjte002;}
                    }
                    {if (true) throw (Error)jjte002;}
            } finally {
                    if (jjtc002) {
                      jjtree.closeNodeScope(jjtn002,  2);
                    }
            }
            break;
          default:
            jj_la1[24] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        jj_consume_token(RPAREN);
      } catch (Throwable jjte003) {
        if (jjtc003) {
          jjtree.clearNodeScope(jjtn003);
          jjtc003 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte003 instanceof ParseException) {
          {if (true) throw (ParseException)jjte003;}
        }
        if (jjte003 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte003;}
        }
        {if (true) throw (Error)jjte003;}
      } finally {
        if (jjtc003) {
          jjtree.closeNodeScope(jjtn003, jjtree.nodeArity() > 1);
        }
      }
      break;
    default:
      jj_la1[25] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

/*
 * Declarations.
 *
 *    D ::= let P = M; [D] 
 *        | C x P1...Pn [: T] {M}; [D]
 *        | local rec x1,...,xn; D 
 *        | rec x1,...,xn; D
 *        |
 */
  final public void Dec() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LET:
    case VAL:
    case CENTRAL:
    case PROC:
      DecAtom();
      label_9:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case LET:
        case VAL:
        case CENTRAL:
        case PROC:
          ;
          break;
        default:
          jj_la1[26] = jj_gen;
          break label_9;
        }
                 PremonJJTDecComp jjtn001 = new PremonJJTDecComp(JJTDECCOMP);
                 boolean jjtc001 = true;
                 jjtree.openNodeScope(jjtn001);
        try {
          DecAtom();
        } catch (Throwable jjte001) {
                 if (jjtc001) {
                   jjtree.clearNodeScope(jjtn001);
                   jjtc001 = false;
                 } else {
                   jjtree.popNode();
                 }
                 if (jjte001 instanceof ParseException) {
                   {if (true) throw (ParseException)jjte001;}
                 }
                 if (jjte001 instanceof RuntimeException) {
                   {if (true) throw (RuntimeException)jjte001;}
                 }
                 {if (true) throw (Error)jjte001;}
        } finally {
                 if (jjtc001) {
                   jjtree.closeNodeScope(jjtn001,  2);
                 }
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case REC:
      case LOCAL:
                                            PremonJJTDecComp jjtn002 = new PremonJJTDecComp(JJTDECCOMP);
                                            boolean jjtc002 = true;
                                            jjtree.openNodeScope(jjtn002);
        try {
          DecNonAtom();
        } catch (Throwable jjte002) {
                                            if (jjtc002) {
                                              jjtree.clearNodeScope(jjtn002);
                                              jjtc002 = false;
                                            } else {
                                              jjtree.popNode();
                                            }
                                            if (jjte002 instanceof ParseException) {
                                              {if (true) throw (ParseException)jjte002;}
                                            }
                                            if (jjte002 instanceof RuntimeException) {
                                              {if (true) throw (RuntimeException)jjte002;}
                                            }
                                            {if (true) throw (Error)jjte002;}
        } finally {
                                            if (jjtc002) {
                                              jjtree.closeNodeScope(jjtn002,  2);
                                            }
        }
        break;
      default:
        jj_la1[27] = jj_gen;
        ;
      }
      break;
    case REC:
    case LOCAL:
      DecNonAtom();
      break;
    default:
      jj_la1[28] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void DecAtom() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LET:
     PremonJJTDecBind jjtn001 = new PremonJJTDecBind(JJTDECBIND);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(LET);
        Pat();
        jj_consume_token(EQ);
        ExpAppInfix();
        jj_consume_token(SEMI);
      } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case VAL:
    case CENTRAL:
    case PROC:
     PremonJJTDecBindFunCurried jjtn003 = new PremonJJTDecBindFunCurried(JJTDECBINDFUNCURRIED);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        Cat();
        Id();
        label_10:
        while (true) {
          PatTuple();
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case LPAREN:
            ;
            break;
          default:
            jj_la1[29] = jj_gen;
            break label_10;
          }
        }
        PremonJJTTypeResult jjtn002 = new PremonJJTTypeResult(JJTTYPERESULT);
        boolean jjtc002 = true;
        jjtree.openNodeScope(jjtn002);
        try {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COLON:
            jj_consume_token(COLON);
            Type();
            break;
          default:
            jj_la1[30] = jj_gen;
            ;
          }
        } catch (Throwable jjte002) {
        if (jjtc002) {
          jjtree.clearNodeScope(jjtn002);
          jjtc002 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte002 instanceof ParseException) {
          {if (true) throw (ParseException)jjte002;}
        }
        if (jjte002 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte002;}
        }
        {if (true) throw (Error)jjte002;}
        } finally {
        if (jjtc002) {
          jjtree.closeNodeScope(jjtn002, true);
        }
        }
        ExpBlock();
      } catch (Throwable jjte003) {
     if (jjtc003) {
       jjtree.clearNodeScope(jjtn003);
       jjtc003 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte003 instanceof ParseException) {
       {if (true) throw (ParseException)jjte003;}
     }
     if (jjte003 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte003;}
     }
     {if (true) throw (Error)jjte003;}
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    default:
      jj_la1[31] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

  final public void DecNonAtom() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case LOCAL:
     PremonJJTDecLocalRecMany jjtn001 = new PremonJJTDecLocalRecMany(JJTDECLOCALRECMANY);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        jj_consume_token(LOCAL);
        jj_consume_token(REC);
        Id();
        label_11:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            ;
            break;
          default:
            jj_la1[32] = jj_gen;
            break label_11;
          }
          jj_consume_token(COMMA);
          Id();
        }
        jj_consume_token(SEMI);
        Dec();
      } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case REC:
     PremonJJTDecRecMany jjtn002 = new PremonJJTDecRecMany(JJTDECRECMANY);
     boolean jjtc002 = true;
     jjtree.openNodeScope(jjtn002);
      try {
        jj_consume_token(REC);
        Id();
        label_12:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            ;
            break;
          default:
            jj_la1[33] = jj_gen;
            break label_12;
          }
          jj_consume_token(COMMA);
          Id();
        }
        jj_consume_token(SEMI);
        Dec();
      } catch (Throwable jjte002) {
     if (jjtc002) {
       jjtree.clearNodeScope(jjtn002);
       jjtc002 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte002 instanceof ParseException) {
       {if (true) throw (ParseException)jjte002;}
     }
     if (jjte002 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte002;}
     }
     {if (true) throw (Error)jjte002;}
      } finally {
     if (jjtc002) {
       jjtree.closeNodeScope(jjtn002, true);
     }
      }
      break;
    default:
      jj_la1[34] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

/*
 * Contexts.
 *
 *    Gamma ::= x:T; | C x T1...Tn [: T]; | | Gamma Gamma
 */
  final public void Con() throws ParseException {
     PremonJJTConOptional jjtn002 = new PremonJJTConOptional(JJTCONOPTIONAL);
     boolean jjtc002 = true;
     jjtree.openNodeScope(jjtn002);
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case VAL:
      case CENTRAL:
      case PROC:
      case ID:
        ConAtom();
        label_13:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case VAL:
          case CENTRAL:
          case PROC:
          case ID:
            ;
            break;
          default:
            jj_la1[35] = jj_gen;
            break label_13;
          }
                     PremonJJTConComp jjtn001 = new PremonJJTConComp(JJTCONCOMP);
                     boolean jjtc001 = true;
                     jjtree.openNodeScope(jjtn001);
          try {
            ConAtom();
          } catch (Throwable jjte001) {
                     if (jjtc001) {
                       jjtree.clearNodeScope(jjtn001);
                       jjtc001 = false;
                     } else {
                       jjtree.popNode();
                     }
                     if (jjte001 instanceof ParseException) {
                       {if (true) throw (ParseException)jjte001;}
                     }
                     if (jjte001 instanceof RuntimeException) {
                       {if (true) throw (RuntimeException)jjte001;}
                     }
                     {if (true) throw (Error)jjte001;}
          } finally {
                     if (jjtc001) {
                       jjtree.closeNodeScope(jjtn001,  2);
                     }
          }
        }
        break;
      default:
        jj_la1[36] = jj_gen;
        ;
      }
    } catch (Throwable jjte002) {
     if (jjtc002) {
       jjtree.clearNodeScope(jjtn002);
       jjtc002 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte002 instanceof ParseException) {
       {if (true) throw (ParseException)jjte002;}
     }
     if (jjte002 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte002;}
     }
     {if (true) throw (Error)jjte002;}
    } finally {
     if (jjtc002) {
       jjtree.closeNodeScope(jjtn002, true);
     }
    }
  }

  final public void ConAtom() throws ParseException {
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case ID:
     PremonJJTConBind jjtn001 = new PremonJJTConBind(JJTCONBIND);
     boolean jjtc001 = true;
     jjtree.openNodeScope(jjtn001);
      try {
        Id();
        jj_consume_token(COLON);
        Type();
        jj_consume_token(SEMI);
      } catch (Throwable jjte001) {
     if (jjtc001) {
       jjtree.clearNodeScope(jjtn001);
       jjtc001 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte001 instanceof ParseException) {
       {if (true) throw (ParseException)jjte001;}
     }
     if (jjte001 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte001;}
     }
     {if (true) throw (Error)jjte001;}
      } finally {
     if (jjtc001) {
       jjtree.closeNodeScope(jjtn001, true);
     }
      }
      break;
    case VAL:
    case CENTRAL:
    case PROC:
     PremonJJTConBindFunCurried jjtn003 = new PremonJJTConBindFunCurried(JJTCONBINDFUNCURRIED);
     boolean jjtc003 = true;
     jjtree.openNodeScope(jjtn003);
      try {
        Cat();
        Id();
        label_14:
        while (true) {
          TypeTuple();
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case LPAREN:
            ;
            break;
          default:
            jj_la1[37] = jj_gen;
            break label_14;
          }
        }
        PremonJJTTypeResult jjtn002 = new PremonJJTTypeResult(JJTTYPERESULT);
        boolean jjtc002 = true;
        jjtree.openNodeScope(jjtn002);
        try {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COLON:
            jj_consume_token(COLON);
            Type();
            break;
          default:
            jj_la1[38] = jj_gen;
            ;
          }
        } catch (Throwable jjte002) {
        if (jjtc002) {
          jjtree.clearNodeScope(jjtn002);
          jjtc002 = false;
        } else {
          jjtree.popNode();
        }
        if (jjte002 instanceof ParseException) {
          {if (true) throw (ParseException)jjte002;}
        }
        if (jjte002 instanceof RuntimeException) {
          {if (true) throw (RuntimeException)jjte002;}
        }
        {if (true) throw (Error)jjte002;}
        } finally {
        if (jjtc002) {
          jjtree.closeNodeScope(jjtn002, true);
        }
        }
        jj_consume_token(SEMI);
      } catch (Throwable jjte003) {
     if (jjtc003) {
       jjtree.clearNodeScope(jjtn003);
       jjtc003 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte003 instanceof ParseException) {
       {if (true) throw (ParseException)jjte003;}
     }
     if (jjte003 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte003;}
     }
     {if (true) throw (Error)jjte003;}
      } finally {
     if (jjtc003) {
       jjtree.closeNodeScope(jjtn003, true);
     }
      }
      break;
    default:
      jj_la1[39] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
  }

/* 
 * Identifiers.
 */
  final public void Id() throws ParseException {
                 /*@bgen(jjtree) Id */
                  PremonJJTId jjtn000 = new PremonJJTId(JJTID);
                  boolean jjtc000 = true;
                  jjtree.openNodeScope(jjtn000);Token t;
    try {
      t = jj_consume_token(ID);
           jjtree.closeNodeScope(jjtn000, true);
           jjtc000 = false;
           jjtn000.setName(t.image);
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
    }
    }
  }

  public PremonJJTParserTokenManager token_source;
  ASCII_CharStream jj_input_stream;
  public Token token, jj_nt;
  private int jj_ntk;
  private int jj_gen;
  final private int[] jj_la1 = new int[40];
  final private int[] jj_la1_0 = {0x380000,0x800,0x400,0x8380800,0x8200,0x8200,0x8381800,0x800,0xf812800,0x8200,0x8200,0xfff3800,0x7000000,0x2800,0x2800,0x8000000,0xfff2800,0x100,0x7e0000,0xfff6800,0x800,0x400,0x8380800,0x8200,0x8200,0x8381800,0x3a0000,0x440000,0x7e0000,0x800,0x400,0x3a0000,0x200,0x200,0x440000,0x8380000,0x8380000,0x800,0x400,0x8380000,};
  final private int[] jj_la1_1 = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};

  public PremonJJTParser(java.io.InputStream stream) {
    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
    token_source = new PremonJJTParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 40; i++) jj_la1[i] = -1;
  }

  public void ReInit(java.io.InputStream stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 40; i++) jj_la1[i] = -1;
  }

  public PremonJJTParser(java.io.Reader stream) {
    jj_input_stream = new ASCII_CharStream(stream, 1, 1);
    token_source = new PremonJJTParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 40; i++) jj_la1[i] = -1;
  }

  public void ReInit(java.io.Reader stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 40; i++) jj_la1[i] = -1;
  }

  public PremonJJTParser(PremonJJTParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 40; i++) jj_la1[i] = -1;
  }

  public void ReInit(PremonJJTParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 40; i++) jj_la1[i] = -1;
  }

  final private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken;
    if ((oldToken = token).next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    if (token.kind == kind) {
      jj_gen++;
      return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }

  final public Token getNextToken() {
    if (token.next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    jj_gen++;
    return token;
  }

  final public Token getToken(int index) {
    Token t = token;
    for (int i = 0; i < index; i++) {
      if (t.next != null) t = t.next;
      else t = t.next = token_source.getNextToken();
    }
    return t;
  }

  final private int jj_ntk() {
    if ((jj_nt=token.next) == null)
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    else
      return (jj_ntk = jj_nt.kind);
  }

  private java.util.Vector jj_expentries = new java.util.Vector();
  private int[] jj_expentry;
  private int jj_kind = -1;

  final public ParseException generateParseException() {
    jj_expentries.removeAllElements();
    boolean[] la1tokens = new boolean[33];
    for (int i = 0; i < 33; i++) {
      la1tokens[i] = false;
    }
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 40; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & (1<<j)) != 0) {
            la1tokens[j] = true;
          }
          if ((jj_la1_1[i] & (1<<j)) != 0) {
            la1tokens[32+j] = true;
          }
        }
      }
    }
    for (int i = 0; i < 33; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.addElement(jj_expentry);
      }
    }
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = (int[])jj_expentries.elementAt(i);
    }
    return new ParseException(token, exptokseq, tokenImage);
  }

  final public void enable_tracing() {
  }

  final public void disable_tracing() {
  }

}
