final public Unit Method(ClassUnit classUnit) throws ParseException {
  MethodUnit methodUnit = new MethodUnit();
  Modifier modifier = null;
  SimpleNode type = null;
  List<Unit> formalArgs = null;
  String methodName = null;
  SimpleNode block = null;
  String functionName = null;
  boolean isArray = false;
    modifier = Modifier();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case BOOLEAN:
    case CHAR:
    case INT:
    case ID:
      type = Type();
      break;
    case VOID:
      jj_consume_token(VOID);
                               voidType_AST jjtn001 = new voidType_AST(JJTVOIDTYPE_AST);
                               boolean jjtc001 = true;
                               jjtree.openNodeScope(jjtn001);
      try {
                               jjtree.closeNodeScope(jjtn001, true);
                               jjtc001 = false;
                              type = jjtn001;
      } finally {
                               if (jjtc001) {
                                 jjtree.closeNodeScope(jjtn001, true);
                               }
      }
      break;
    default:
      jj_la1[12] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
    }
    label_6:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case LSB:
        ;
        break;
      default:
        jj_la1[13] = jj_gen;
        break label_6;
      }
      jj_consume_token(LSB);
      jj_consume_token(RSB);
    type.typeObj.isArray = true;
    type.typeObj.arraySize+=1;
    }
    functionName = ID();
    if (MODE == 0) {
            methodUnit = (MethodUnit)SYMBOL_TABLE.add(functionName,UnitType.METHOD);
   }
   methodUnit.setModifier(modifier);
   methodUnit.setName(functionName);
   methodUnit.setReturnType(type);
   methodUnit.classUnit = classUnit;
    jj_consume_token(LP);
    SYMBOL_TABLE.enterScopeForUnit(methodUnit, MODE);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case BOOLEAN:
    case CHAR:
    case INT:
    case ID:
      formalArgs = FormalArgs();
    if (MODE == 0){
        methodUnit.setFormalArgs(formalArgs);
    }
      break;
    default:
      jj_la1[14] = jj_gen;
      ;
    }
    jj_consume_token(RP);
    block = Block();
    SYMBOL_TABLE.exitScope(MODE);
    methodUnit.setMethodBlock((block_AST)block);
   {if (true) return methodUnit;}
    throw new Error("Missing return statement in function");
  }