/* Generated By:JavaCC: Do not edit this line. TheParser.java */
package nwf;

import edu.neu.ccs.demeterf.lib.*;
import edu.neu.ccs.demeterf.lib.*;
import edu.neu.ccs.demeterf.lib.*;
import edu.neu.ccs.demeterf.lib.*;
import scg.*;
import edu.neu.ccs.demeterf.lib.*;
import edu.neu.ccs.demeterf.*;
import java.util.Iterator;
import edu.neu.ccs.demeterf.Fields;
import edu.neu.ccs.demeterf.lib.ident;
import edu.neu.ccs.demeterf.lib.verbatim;

  public class TheParser implements TheParserConstants {

   public static String unescape(String str){
      String retval = "";
      int index = 0;
      char ch, ch1;
      int ordinal = 0;
      while (index < str.length()) {
         if(str.charAt(index) != '\u005c\u005c') { retval += str.charAt(index++); continue; }
         ch = str.charAt(++index);
         if(ch == 'b') { retval += '\u005cb'; index++; continue; }
         if(ch == 't') { retval += '\u005ct'; index++; continue; }
         if(ch == 'n') { retval += '\u005cn'; index++; continue; }
         if(ch == 'f') { retval += '\u005cf'; index++; continue; }
         if(ch == 'r') { retval += '\u005cr'; index++; continue; }
         if(ch == '"') { retval += '\u005c"'; index++; continue; }
         if(ch == '\u005c'') { retval += '\u005c''; index++; continue; }
         if(ch == '\u005c\u005c') { retval += '\u005c\u005c'; index++; continue; }
         if(ch >= '0' && ch <= '7'){
            ordinal = ((int)ch) - ((int)'0'); index++;
            ch1 = str.charAt(index);
            if(ch1 >= '0' && ch1 <= '7'){
               ordinal = ordinal*8 + ((int)ch1) - ((int)'0'); index++;
               ch1 = str.charAt(index);
               if(ch <= '3' && ch1 >= '0' && ch1 <= '7'){
                  ordinal = ordinal*8 + ((int)ch1) - ((int)'0'); index++;
               }
            }
            retval += (char)ordinal;
            continue;
         }
         if(ch == 'u'){
            ordinal = 0;
            for(int i = 0; i < 4; i++){
               index++; ch = str.charAt(index);
               ordinal = ordinal*16+hexval(ch);
            }
            index++;
            retval += (char)ordinal;
            continue;
         }
      }
      return retval;
   }
   static int hexval(char c){
      int r = "0123456789ABCDEF".indexOf(Character.toUpperCase(c));
      if(r >= 0)return r;
      throw new RuntimeException(" ** Bad Escaped Character");
   }

  final public byte parse_byte() throws ParseException {
                    int i;
    i = parse_int();
                      {if (true) return (byte)i;}
    throw new Error("Missing return statement in function");
  }

  final public Byte parse_Byte() throws ParseException {
                    byte b;
    b = parse_byte();
                       {if (true) return b;}
    throw new Error("Missing return statement in function");
  }

  final public short parse_short() throws ParseException {
                      int i;
    i = parse_int();
                      {if (true) return (short)i;}
    throw new Error("Missing return statement in function");
  }

  final public Short parse_Short() throws ParseException {
                      short s;
    s = parse_short();
                        {if (true) return s;}
    throw new Error("Missing return statement in function");
  }

  final public int parse_int() throws ParseException {
                  Token t;
    t = jj_consume_token(INT);
      if(t.image.length() > 1 && Character.toLowerCase(t.image.charAt(1)) == 'x')
          {if (true) return Integer.parseInt(t.image.substring(2), 16);}
      {if (true) return Integer.parseInt(t.image);}
    throw new Error("Missing return statement in function");
  }

  final public Integer parse_Integer() throws ParseException {
                          int i;
    i = parse_int();
                      {if (true) return i;}
    throw new Error("Missing return statement in function");
  }

  final public long parse_long() throws ParseException {
                    Token t;
    t = jj_consume_token(INT);
      if(t.image.length() > 1 && Character.toLowerCase(t.image.charAt(1)) == 'x')
          {if (true) return Long.parseLong(t.image.substring(2), 16);}
    {if (true) return Long.parseLong(t.image);}
    throw new Error("Missing return statement in function");
  }

  final public Long parse_Long() throws ParseException {
                    long l;
    l = parse_long();
                       {if (true) return l;}
    throw new Error("Missing return statement in function");
  }

  final public double parse_double() throws ParseException {
                        Token t;
    t = jj_consume_token(DOUBLE);
      {if (true) return Double.parseDouble(t.image);}
    throw new Error("Missing return statement in function");
  }

  final public Double parse_Double() throws ParseException {
                        double d;
    d = parse_double();
                         {if (true) return d;}
    throw new Error("Missing return statement in function");
  }

  final public float parse_float() throws ParseException {
                      Token t;
    t = jj_consume_token(DOUBLE);
      {if (true) return Float.parseFloat(t.image);}
    throw new Error("Missing return statement in function");
  }

  final public Float parse_Float() throws ParseException {
                      float f;
    f = parse_float();
                        {if (true) return f;}
    throw new Error("Missing return statement in function");
  }

  final public String parse_String() throws ParseException {
                        Token t;
    t = jj_consume_token(STRING);
      {if (true) return unescape(t.image.substring(1,t.image.length()-1));}
    throw new Error("Missing return statement in function");
  }

  final public boolean parse_boolean() throws ParseException {
                          Token t;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case TRUE:
      t = jj_consume_token(TRUE);
                 {if (true) return true;}
      break;
    case FALSE:
      t = jj_consume_token(FALSE);
                  {if (true) return false;}
      break;
    default:
      jj_la1[0] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public Boolean parse_Boolean() throws ParseException {
                          boolean b;
    b = parse_boolean();
                          {if (true) return b;}
    throw new Error("Missing return statement in function");
  }

  final public char parse_char() throws ParseException {
                    Token t;
    t = jj_consume_token(CHAR);
      {if (true) return unescape(t.image.substring(1,t.image.length()-1)).charAt(0);}
    throw new Error("Missing return statement in function");
  }

  final public Character parse_Character() throws ParseException {
                              char c;
    c = parse_char();
                       {if (true) return c;}
    throw new Error("Missing return statement in function");
  }

  final public ident parse_ident() throws ParseException {
                      Token t;
    t = jj_consume_token(IDENT);
      {if (true) return new ident(t.image);}
    throw new Error("Missing return statement in function");
  }

  final public verbatim parse_verbatim() throws ParseException {
                            Token t;
    t = jj_consume_token(TEXT);
      {if (true) return new verbatim(t.image.substring(2,t.image.length()-2));}
    throw new Error("Missing return statement in function");
  }

  final public NWFInstance parse_NWFInstance() throws ParseException {
     EdgeLabeledGraph<Node,EdgeCapacity,EdgeFlow> g;
     Node source;
     Node sink;
    jj_consume_token(1);
    g = parse_EdgeLabeledGraph$Node$EdgeCapacity$EdgeFlow$();
    jj_consume_token(2);
    source = parse_Node();
    jj_consume_token(3);
    sink = parse_Node();
      {if (true) return new NWFInstance(g,source,sink);}
    throw new Error("Missing return statement in function");
  }

  final public Node parse_Node() throws ParseException {
     String v;
    v = parse_String();
      {if (true) return new Node(v);}
    throw new Error("Missing return statement in function");
  }

  final public EdgeCapacity parse_EdgeCapacity() throws ParseException {
     int v;
    jj_consume_token(4);
    v = parse_int();
      {if (true) return new EdgeCapacity(v);}
    throw new Error("Missing return statement in function");
  }

  final public NWFSolution parse_NWFSolution() throws ParseException {
     EdgeLabeledGraph<Node,EdgeCapacity,EdgeFlow> g;
     Node source;
     Node sink;
    jj_consume_token(5);
    g = parse_EdgeLabeledGraph$Node$EdgeCapacity$EdgeFlow$();
    jj_consume_token(2);
    source = parse_Node();
    jj_consume_token(3);
    sink = parse_Node();
      {if (true) return new NWFSolution(g,source,sink);}
    throw new Error("Missing return statement in function");
  }

  final public EdgeFlow parse_EdgeFlow() throws ParseException {
     int v;
    jj_consume_token(6);
    v = parse_int();
      {if (true) return new EdgeFlow(v);}
    throw new Error("Missing return statement in function");
  }

  final public NWFDomain parse_NWFDomain() throws ParseException {
      {if (true) return new NWFDomain();}
    throw new Error("Missing return statement in function");
  }

  final public NWFConfig parse_NWFConfig() throws ParseException {
     int maxN;
    jj_consume_token(7);
    jj_consume_token(8);
    maxN = parse_int();
    jj_consume_token(9);
      {if (true) return new NWFConfig(maxN);}
    throw new Error("Missing return statement in function");
  }

  final public NWFInstanceSet parse_NWFInstanceSet() throws ParseException {
     NWFInstance singleton;
    singleton = parse_NWFInstance();
      {if (true) return new NWFInstanceSet(singleton);}
    throw new Error("Missing return statement in function");
  }

  final public FullyQualifiedClassName parse_FullyQualifiedClassName() throws ParseException {
     ident name;
     DSLOI rest;
    name = parse_ident();
    rest = parse_DSLOI();
      {if (true) return new FullyQualifiedClassName(name,rest);}
    throw new Error("Missing return statement in function");
  }

  final public DSLOI parse_DSLOI() throws ParseException {
    DSLOI sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 10:
      sup = parse_DSCOI();
                          {if (true) return sup;}
      break;
    default:
      jj_la1[1] = jj_gen;
      sup = parse_DSEOI();
                          {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public DSCOI parse_DSCOI() throws ParseException {
     ident first;
     DSLOI rest;
    jj_consume_token(10);
    first = parse_ident();
    rest = parse_DSLOI();
      {if (true) return new DSCOI(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public DSEOI parse_DSEOI() throws ParseException {
      {if (true) return new DSEOI();}
    throw new Error("Missing return statement in function");
  }

  final public DomainI parse_DomainI() throws ParseException {
    DomainI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public InstanceI parse_InstanceI() throws ParseException {
    InstanceI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public SolutionI parse_SolutionI() throws ParseException {
    SolutionI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public InstanceSetI parse_InstanceSetI() throws ParseException {
    InstanceSetI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public Claim parse_Claim() throws ParseException {
     RWrap<InstanceSetI> instanceSetWrapper;
     RWrap<ProtocolI> protocolWrapper;
     double quality;
     double confidence;
    instanceSetWrapper = parse_RWrap$InstanceSetI$();
    protocolWrapper = parse_RWrap$ProtocolI$();
    quality = parse_double();
    confidence = parse_double();
      {if (true) return new Claim(instanceSetWrapper,protocolWrapper,quality,confidence);}
    throw new Error("Missing return statement in function");
  }

  final public ProtocolI parse_ProtocolI() throws ParseException {
    ProtocolI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public ProtocolSpec parse_ProtocolSpec() throws ParseException {
     List<Step> steps;
    steps = parse_List$Step$();
      {if (true) return new ProtocolSpec(steps);}
    throw new Error("Missing return statement in function");
  }

  final public Step parse_Step() throws ParseException {
     Action action;
     Role role;
    action = parse_Action();
    jj_consume_token(11);
    role = parse_Role();
      {if (true) return new Step(action,role);}
    throw new Error("Missing return statement in function");
  }

  final public Role parse_Role() throws ParseException {
    Role sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 12:
      sup = parse_Alice();
                          {if (true) return sup;}
      break;
    case 13:
      sup = parse_Bob();
                        {if (true) return sup;}
      break;
    default:
      jj_la1[2] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public Alice parse_Alice() throws ParseException {
    jj_consume_token(12);
      {if (true) return new Alice();}
    throw new Error("Missing return statement in function");
  }

  final public Bob parse_Bob() throws ParseException {
    jj_consume_token(13);
      {if (true) return new Bob();}
    throw new Error("Missing return statement in function");
  }

  final public Action parse_Action() throws ParseException {
    Action sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 1:
      sup = parse_ProvideAction();
                                  {if (true) return sup;}
      break;
    case 5:
      sup = parse_SolveAction();
                                {if (true) return sup;}
      break;
    default:
      jj_la1[3] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public ProvideAction parse_ProvideAction() throws ParseException {
    jj_consume_token(1);
      {if (true) return new ProvideAction();}
    throw new Error("Missing return statement in function");
  }

  final public SolveAction parse_SolveAction() throws ParseException {
     int stepNo;
    jj_consume_token(5);
    jj_consume_token(14);
    stepNo = parse_int();
      {if (true) return new SolveAction(stepNo);}
    throw new Error("Missing return statement in function");
  }

  final public Request parse_Request() throws ParseException {
     List<Claim> forbidden;
     List<Claim> claimsToOppose;
     List<ProtocolRequest> protocolRequests;
    jj_consume_token(15);
    forbidden = parse_List$Claim$();
    jj_consume_token(16);
    claimsToOppose = parse_List$Claim$();
    jj_consume_token(17);
    protocolRequests = parse_List$ProtocolRequest$();
      {if (true) return new Request(forbidden,claimsToOppose,protocolRequests);}
    throw new Error("Missing return statement in function");
  }

  final public ProtocolRequest parse_ProtocolRequest() throws ParseException {
    ProtocolRequest sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 18:
      sup = parse_ProvideRequest();
                                   {if (true) return sup;}
      break;
    case 19:
      sup = parse_SolveRequest();
                                 {if (true) return sup;}
      break;
    default:
      jj_la1[4] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public ProvideRequest parse_ProvideRequest() throws ParseException {
     Claim claimToBeProvided;
    jj_consume_token(18);
    claimToBeProvided = parse_Claim();
      {if (true) return new ProvideRequest(claimToBeProvided);}
    throw new Error("Missing return statement in function");
  }

  final public SolveRequest parse_SolveRequest() throws ParseException {
     RWrap<InstanceI> instanceWrapper;
     Option<Claim> claim;
    jj_consume_token(19);
    instanceWrapper = parse_RWrap$InstanceI$();
    claim = parse_Option$Claim$();
      {if (true) return new SolveRequest(instanceWrapper,claim);}
    throw new Error("Missing return statement in function");
  }

  final public Response parse_Response() throws ParseException {
     List<Claim> proposed;
     List<OpposeAction> oppositions;
     List<ProtocolResponse> protocolResponses;
    jj_consume_token(15);
    proposed = parse_List$Claim$();
    jj_consume_token(16);
    oppositions = parse_List$OpposeAction$();
    jj_consume_token(20);
    protocolResponses = parse_List$ProtocolResponse$();
      {if (true) return new Response(proposed,oppositions,protocolResponses);}
    throw new Error("Missing return statement in function");
  }

  final public OpposeAction parse_OpposeAction() throws ParseException {
    OpposeAction sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 22:
      sup = parse_Strengthening();
                                  {if (true) return sup;}
      break;
    case 23:
      sup = parse_Refuting();
                             {if (true) return sup;}
      break;
    case 21:
      sup = parse_Agreement();
                              {if (true) return sup;}
      break;
    default:
      jj_la1[5] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public Agreement parse_Agreement() throws ParseException {
    jj_consume_token(21);
      {if (true) return new Agreement();}
    throw new Error("Missing return statement in function");
  }

  final public Strengthening parse_Strengthening() throws ParseException {
     double newQuality;
    jj_consume_token(22);
    newQuality = parse_double();
      {if (true) return new Strengthening(newQuality);}
    throw new Error("Missing return statement in function");
  }

  final public Refuting parse_Refuting() throws ParseException {
    jj_consume_token(23);
      {if (true) return new Refuting();}
    throw new Error("Missing return statement in function");
  }

  final public ProtocolResponse parse_ProtocolResponse() throws ParseException {
    ProtocolResponse sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 18:
      sup = parse_ProvideResponse();
                                    {if (true) return sup;}
      break;
    case 19:
      sup = parse_SolveResponse();
                                  {if (true) return sup;}
      break;
    default:
      jj_la1[6] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public ProvideResponse parse_ProvideResponse() throws ParseException {
     RWrap<InstanceI> instanceWrapper;
    jj_consume_token(18);
    instanceWrapper = parse_RWrap$InstanceI$();
      {if (true) return new ProvideResponse(instanceWrapper);}
    throw new Error("Missing return statement in function");
  }

  final public SolveResponse parse_SolveResponse() throws ParseException {
     RWrap<SolutionI> solutionWrapper;
    jj_consume_token(19);
    solutionWrapper = parse_RWrap$SolutionI$();
      {if (true) return new SolveResponse(solutionWrapper);}
    throw new Error("Missing return statement in function");
  }

  final public SCGConfig parse_SCGConfig() throws ParseException {
     FullyQualifiedClassName domain;
     Cons<FullyQualifiedClassName> protocols;
     TournamentStyle tournamentStyle;
     int turnDuration;
     int maxNumAvatars;
     double minStrengthening;
     double initialReputation;
     double maxReputation;
     double reputationFactor;
     int minProposals;
     int maxProposals;
     int numRounds;
     boolean proposedClaimMustBeNew;
     double minConfidence;
    jj_consume_token(24);
    jj_consume_token(25);
    domain = parse_FullyQualifiedClassName();
    jj_consume_token(26);
    protocols = parse_Cons$FullyQualifiedClassName$();
    jj_consume_token(27);
    tournamentStyle = parse_TournamentStyle();
    jj_consume_token(28);
    turnDuration = parse_int();
    jj_consume_token(29);
    maxNumAvatars = parse_int();
    jj_consume_token(30);
    minStrengthening = parse_double();
    jj_consume_token(31);
    initialReputation = parse_double();
    jj_consume_token(32);
    maxReputation = parse_double();
    jj_consume_token(33);
    reputationFactor = parse_double();
    jj_consume_token(34);
    minProposals = parse_int();
    jj_consume_token(35);
    maxProposals = parse_int();
    jj_consume_token(36);
    numRounds = parse_int();
    jj_consume_token(37);
    proposedClaimMustBeNew = parse_boolean();
    jj_consume_token(38);
    minConfidence = parse_double();
    jj_consume_token(9);
      {if (true) return new SCGConfig(domain,protocols,tournamentStyle,turnDuration,maxNumAvatars,minStrengthening,initialReputation,maxReputation,reputationFactor,minProposals,maxProposals,numRounds,proposedClaimMustBeNew,minConfidence);}
    throw new Error("Missing return statement in function");
  }

  final public TournamentStyle parse_TournamentStyle() throws ParseException {
    TournamentStyle sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 39:
      sup = parse_FullRoundRobin();
                                   {if (true) return sup;}
      break;
    case 41:
      sup = parse_KnockOut();
                             {if (true) return sup;}
      break;
    case 42:
      sup = parse_SwissStyleTournament();
                                         {if (true) return sup;}
      break;
    default:
      jj_la1[7] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public FullRoundRobin parse_FullRoundRobin() throws ParseException {
    jj_consume_token(39);
    jj_consume_token(40);
      {if (true) return new FullRoundRobin();}
    throw new Error("Missing return statement in function");
  }

  final public KnockOut parse_KnockOut() throws ParseException {
    jj_consume_token(41);
      {if (true) return new KnockOut();}
    throw new Error("Missing return statement in function");
  }

  final public SwissStyleTournament parse_SwissStyleTournament() throws ParseException {
    jj_consume_token(42);
      {if (true) return new SwissStyleTournament();}
    throw new Error("Missing return statement in function");
  }

  final public DomainConfigI parse_DomainConfigI() throws ParseException {
    DomainConfigI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public Config parse_Config() throws ParseException {
     SCGConfig scgCfg;
     RWrap<DomainConfigI> domainConfigWrapper;
    scgCfg = parse_SCGConfig();
    domainConfigWrapper = parse_RWrap$DomainConfigI$();
      {if (true) return new Config(scgCfg,domainConfigWrapper);}
    throw new Error("Missing return statement in function");
  }

  final public AvatarI parse_AvatarI() throws ParseException {
    AvatarI sup = null;
     {if (true) return sup;}
    throw new Error("Missing return statement in function");
  }

  final public RBColor parse_RBColor() throws ParseException {
    RBColor sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 43:
      sup = parse_RED();
                        {if (true) return sup;}
      break;
    case 44:
      sup = parse_BLACK();
                          {if (true) return sup;}
      break;
    default:
      jj_la1[8] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public RED parse_RED() throws ParseException {
    jj_consume_token(43);
      {if (true) return new RED();}
    throw new Error("Missing return statement in function");
  }

  final public BLACK parse_BLACK() throws ParseException {
    jj_consume_token(44);
      {if (true) return new BLACK();}
    throw new Error("Missing return statement in function");
  }

  final public RWrap<DomainConfigI> parse_RWrap$DomainConfigI$() throws ParseException {
     FullyQualifiedClassName className;
     verbatim wrappee;
    className = parse_FullyQualifiedClassName();
    wrappee = parse_verbatim();
      {if (true) return new RWrap<DomainConfigI>(className,wrappee);}
    throw new Error("Missing return statement in function");
  }

  final public Cons<FullyQualifiedClassName> parse_Cons$FullyQualifiedClassName$() throws ParseException {
     FullyQualifiedClassName first;
     List<FullyQualifiedClassName> rest;
    first = parse_FullyQualifiedClassName();
    rest = parse_List$FullyQualifiedClassName$();
      {if (true) return new Cons<FullyQualifiedClassName>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public List<FullyQualifiedClassName> parse_List$FullyQualifiedClassName$() throws ParseException {
    List<FullyQualifiedClassName> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IDENT:
      sup = parse_Cons$FullyQualifiedClassName$();
                                                  {if (true) return sup;}
      break;
    default:
      jj_la1[9] = jj_gen;
      sup = parse_Empty$FullyQualifiedClassName$();
                                                   {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<FullyQualifiedClassName> parse_Empty$FullyQualifiedClassName$() throws ParseException {
      {if (true) return new Empty<FullyQualifiedClassName>();}
    throw new Error("Missing return statement in function");
  }

  final public RWrap<SolutionI> parse_RWrap$SolutionI$() throws ParseException {
     FullyQualifiedClassName className;
     verbatim wrappee;
    className = parse_FullyQualifiedClassName();
    wrappee = parse_verbatim();
      {if (true) return new RWrap<SolutionI>(className,wrappee);}
    throw new Error("Missing return statement in function");
  }

  final public RWrap<InstanceI> parse_RWrap$InstanceI$() throws ParseException {
     FullyQualifiedClassName className;
     verbatim wrappee;
    className = parse_FullyQualifiedClassName();
    wrappee = parse_verbatim();
      {if (true) return new RWrap<InstanceI>(className,wrappee);}
    throw new Error("Missing return statement in function");
  }

  final public List<ProtocolResponse> parse_List$ProtocolResponse$() throws ParseException {
    List<ProtocolResponse> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 18:
    case 19:
      sup = parse_Cons$ProtocolResponse$();
                                           {if (true) return sup;}
      break;
    default:
      jj_la1[10] = jj_gen;
      sup = parse_Empty$ProtocolResponse$();
                                            {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<ProtocolResponse> parse_Empty$ProtocolResponse$() throws ParseException {
      {if (true) return new Empty<ProtocolResponse>();}
    throw new Error("Missing return statement in function");
  }

  final public Cons<ProtocolResponse> parse_Cons$ProtocolResponse$() throws ParseException {
     ProtocolResponse first;
     List<ProtocolResponse> rest;
    first = parse_ProtocolResponse();
    rest = parse_List$ProtocolResponse$();
      {if (true) return new Cons<ProtocolResponse>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public List<OpposeAction> parse_List$OpposeAction$() throws ParseException {
    List<OpposeAction> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 21:
    case 22:
    case 23:
      sup = parse_Cons$OpposeAction$();
                                       {if (true) return sup;}
      break;
    default:
      jj_la1[11] = jj_gen;
      sup = parse_Empty$OpposeAction$();
                                        {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<OpposeAction> parse_Empty$OpposeAction$() throws ParseException {
      {if (true) return new Empty<OpposeAction>();}
    throw new Error("Missing return statement in function");
  }

  final public Cons<OpposeAction> parse_Cons$OpposeAction$() throws ParseException {
     OpposeAction first;
     List<OpposeAction> rest;
    first = parse_OpposeAction();
    rest = parse_List$OpposeAction$();
      {if (true) return new Cons<OpposeAction>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public List<Claim> parse_List$Claim$() throws ParseException {
    List<Claim> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IDENT:
      sup = parse_Cons$Claim$();
                                {if (true) return sup;}
      break;
    default:
      jj_la1[12] = jj_gen;
      sup = parse_Empty$Claim$();
                                 {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<Claim> parse_Empty$Claim$() throws ParseException {
      {if (true) return new Empty<Claim>();}
    throw new Error("Missing return statement in function");
  }

  final public Cons<Claim> parse_Cons$Claim$() throws ParseException {
     Claim first;
     List<Claim> rest;
    first = parse_Claim();
    rest = parse_List$Claim$();
      {if (true) return new Cons<Claim>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public Option<Claim> parse_Option$Claim$() throws ParseException {
    Option<Claim> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IDENT:
      sup = parse_Some$Claim$();
                                {if (true) return sup;}
      break;
    default:
      jj_la1[13] = jj_gen;
      sup = parse_None$Claim$();
                                {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public None<Claim> parse_None$Claim$() throws ParseException {
      {if (true) return new None<Claim>();}
    throw new Error("Missing return statement in function");
  }

  final public Some<Claim> parse_Some$Claim$() throws ParseException {
     Claim just;
    just = parse_Claim();
      {if (true) return new Some<Claim>(just);}
    throw new Error("Missing return statement in function");
  }

  final public List<ProtocolRequest> parse_List$ProtocolRequest$() throws ParseException {
    List<ProtocolRequest> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 18:
    case 19:
      sup = parse_Cons$ProtocolRequest$();
                                          {if (true) return sup;}
      break;
    default:
      jj_la1[14] = jj_gen;
      sup = parse_Empty$ProtocolRequest$();
                                           {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<ProtocolRequest> parse_Empty$ProtocolRequest$() throws ParseException {
      {if (true) return new Empty<ProtocolRequest>();}
    throw new Error("Missing return statement in function");
  }

  final public Cons<ProtocolRequest> parse_Cons$ProtocolRequest$() throws ParseException {
     ProtocolRequest first;
     List<ProtocolRequest> rest;
    first = parse_ProtocolRequest();
    rest = parse_List$ProtocolRequest$();
      {if (true) return new Cons<ProtocolRequest>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public List<Step> parse_List$Step$() throws ParseException {
    List<Step> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case 1:
    case 5:
      sup = parse_Cons$Step$();
                               {if (true) return sup;}
      break;
    default:
      jj_la1[15] = jj_gen;
      sup = parse_Empty$Step$();
                                {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<Step> parse_Empty$Step$() throws ParseException {
      {if (true) return new Empty<Step>();}
    throw new Error("Missing return statement in function");
  }

  final public Cons<Step> parse_Cons$Step$() throws ParseException {
     Step first;
     List<Step> rest;
    first = parse_Step();
    rest = parse_List$Step$();
      {if (true) return new Cons<Step>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public RWrap<ProtocolI> parse_RWrap$ProtocolI$() throws ParseException {
     FullyQualifiedClassName className;
     verbatim wrappee;
    className = parse_FullyQualifiedClassName();
    wrappee = parse_verbatim();
      {if (true) return new RWrap<ProtocolI>(className,wrappee);}
    throw new Error("Missing return statement in function");
  }

  final public RWrap<InstanceSetI> parse_RWrap$InstanceSetI$() throws ParseException {
     FullyQualifiedClassName className;
     verbatim wrappee;
    className = parse_FullyQualifiedClassName();
    wrappee = parse_verbatim();
      {if (true) return new RWrap<InstanceSetI>(className,wrappee);}
    throw new Error("Missing return statement in function");
  }

  final public EdgeLabeledGraph<Node,EdgeCapacity,EdgeFlow> parse_EdgeLabeledGraph$Node$EdgeCapacity$EdgeFlow$() throws ParseException {
     List<Adjacency<Node,EdgeCapacity,EdgeFlow>> adjs;
    adjs = parse_List$Adjacency$Node$EdgeCapacity$EdgeFlow$$();
      {if (true) return new EdgeLabeledGraph<Node,EdgeCapacity,EdgeFlow>(adjs);}
    throw new Error("Missing return statement in function");
  }

  final public List<Adjacency<Node, EdgeCapacity, EdgeFlow>> parse_List$Adjacency$Node$EdgeCapacity$EdgeFlow$$() throws ParseException {
    List<Adjacency<Node, EdgeCapacity, EdgeFlow>> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case STRING:
      sup = parse_Cons$Adjacency$Node$EdgeCapacity$EdgeFlow$$();
                                                                {if (true) return sup;}
      break;
    default:
      jj_la1[16] = jj_gen;
      sup = parse_Empty$Adjacency$Node$EdgeCapacity$EdgeFlow$$();
                                                                 {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<Adjacency<Node, EdgeCapacity, EdgeFlow>> parse_Empty$Adjacency$Node$EdgeCapacity$EdgeFlow$$() throws ParseException {
      {if (true) return new Empty<Adjacency<Node, EdgeCapacity, EdgeFlow>>();}
    throw new Error("Missing return statement in function");
  }

  final public Adjacency<Node,EdgeCapacity,EdgeFlow> parse_Adjacency$Node$EdgeCapacity$EdgeFlow$() throws ParseException {
     Node source;
     List<NodeAndLabel<Node,EdgeCapacity,EdgeFlow>> successors;
    source = parse_Node();
    jj_consume_token(45);
    jj_consume_token(46);
    successors = parse_List$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$();
    jj_consume_token(47);
      {if (true) return new Adjacency<Node,EdgeCapacity,EdgeFlow>(source,successors);}
    throw new Error("Missing return statement in function");
  }

  final public List<NodeAndLabel<Node, EdgeCapacity, EdgeFlow>> parse_List$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$() throws ParseException {
    List<NodeAndLabel<Node, EdgeCapacity, EdgeFlow>> sup = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case STRING:
      sup = parse_Cons$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$();
                                                                   {if (true) return sup;}
      break;
    default:
      jj_la1[17] = jj_gen;
      sup = parse_Empty$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$();
                                                                    {if (true) return sup;}
    }
    throw new Error("Missing return statement in function");
  }

  final public Empty<NodeAndLabel<Node, EdgeCapacity, EdgeFlow>> parse_Empty$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$() throws ParseException {
      {if (true) return new Empty<NodeAndLabel<Node, EdgeCapacity, EdgeFlow>>();}
    throw new Error("Missing return statement in function");
  }

  final public NodeAndLabel<Node,EdgeCapacity,EdgeFlow> parse_NodeAndLabel$Node$EdgeCapacity$EdgeFlow$() throws ParseException {
     Node n;
     EdgeCapacity label1;
     EdgeFlow label2;
    n = parse_Node();
    label1 = parse_EdgeCapacity();
    label2 = parse_EdgeFlow();
      {if (true) return new NodeAndLabel<Node,EdgeCapacity,EdgeFlow>(n,label1,label2);}
    throw new Error("Missing return statement in function");
  }

  final public Cons<NodeAndLabel<Node, EdgeCapacity, EdgeFlow>> parse_Cons$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$() throws ParseException {
     NodeAndLabel<Node,EdgeCapacity,EdgeFlow> first;
     List<NodeAndLabel<Node,EdgeCapacity,EdgeFlow>> rest;
    first = parse_NodeAndLabel$Node$EdgeCapacity$EdgeFlow$();
    rest = parse_List$NodeAndLabel$Node$EdgeCapacity$EdgeFlow$$();
      {if (true) return new Cons<NodeAndLabel<Node, EdgeCapacity, EdgeFlow>>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  final public Cons<Adjacency<Node, EdgeCapacity, EdgeFlow>> parse_Cons$Adjacency$Node$EdgeCapacity$EdgeFlow$$() throws ParseException {
     Adjacency<Node,EdgeCapacity,EdgeFlow> first;
     List<Adjacency<Node,EdgeCapacity,EdgeFlow>> rest;
    first = parse_Adjacency$Node$EdgeCapacity$EdgeFlow$();
    rest = parse_List$Adjacency$Node$EdgeCapacity$EdgeFlow$$();
      {if (true) return new Cons<Adjacency<Node, EdgeCapacity, EdgeFlow>>(first,rest);}
    throw new Error("Missing return statement in function");
  }

  /** Generated Token Manager. */
  public TheParserTokenManager token_source;
  SimpleCharStream jj_input_stream;
  /** Current token. */
  public Token token;
  /** Next token. */
  public Token jj_nt;
  private int jj_ntk;
  private int jj_gen;
  final private int[] jj_la1 = new int[18];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static {
      jj_la1_init_0();
      jj_la1_init_1();
   }
   private static void jj_la1_init_0() {
      jj_la1_0 = new int[] {0x0,0x400,0x3000,0x22,0xc0000,0xe00000,0xc0000,0x0,0x0,0x0,0xc0000,0xe00000,0x0,0x0,0xc0000,0x22,0x0,0x0,};
   }
   private static void jj_la1_init_1() {
      jj_la1_1 = new int[] {0xc000000,0x0,0x0,0x0,0x0,0x0,0x0,0x680,0x1800,0x80000000,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x20000000,0x20000000,};
   }

  /** Constructor with InputStream. */
  public TheParser(java.io.InputStream stream) {
     this(stream, null);
  }
  /** Constructor with InputStream and supplied encoding */
  public TheParser(java.io.InputStream stream, String encoding) {
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source = new TheParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 18; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  public void ReInit(java.io.InputStream stream) {
     ReInit(stream, null);
  }
  /** Reinitialise. */
  public void ReInit(java.io.InputStream stream, String encoding) {
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 18; i++) jj_la1[i] = -1;
  }

  /** Constructor. */
  public TheParser(java.io.Reader stream) {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new TheParserTokenManager(jj_input_stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 18; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  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;
    jj_gen = 0;
    for (int i = 0; i < 18; i++) jj_la1[i] = -1;
  }

  /** Constructor with generated Token Manager. */
  public TheParser(TheParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 18; i++) jj_la1[i] = -1;
  }

  /** Reinitialise. */
  public void ReInit(TheParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 18; i++) jj_la1[i] = -1;
  }

  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();
  }


/** Get the next Token. */
  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;
  }

/** Get the specific 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;
  }

  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.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
  private int[] jj_expentry;
  private int jj_kind = -1;

  /** Generate ParseException. */
  public ParseException generateParseException() {
    jj_expentries.clear();
    boolean[] la1tokens = new boolean[64];
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 18; 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 < 64; i++) {
      if (la1tokens[i]) {
        jj_expentry = new int[1];
        jj_expentry[0] = i;
        jj_expentries.add(jj_expentry);
      }
    }
    int[][] exptokseq = new int[jj_expentries.size()][];
    for (int i = 0; i < jj_expentries.size(); i++) {
      exptokseq[i] = jj_expentries.get(i);
    }
    return new ParseException(token, exptokseq, tokenImage);
  }

  /** Enable tracing. */
  final public void enable_tracing() {
  }

  /** Disable tracing. */
  final public void disable_tracing() {
  }

  }
