case '[':
bracketCount++;
break;
case ']':
if (bracketCount == 0)
throw new ICVerificationException("Too many closing braces " + "on line " + li[i]
.line + " at column " + li[i].col);
bracketCount--;
break;
case '+':
case '-':
case 'A':
case 'B':
case 'C':
case 'd':
case 'p':
case 'x':
case '!':
case '|':
case '=':
case '&':
case '^':
case 's':
case 'r':
break;
case '<':
case '>':
case 'e':
case 'S':
case 'L':
switch (chars[++i]) {
case 'p':
case 'r':
case 'l':
case 'P':
case 'R':
case 'L':
break;
default:
throw new ICVerificationException("Unknown modifier " + chars[i] + " to opcode "
+ c + " " + "on line "
+ li[i].line + " at column " + li[i].col);
}
if (c == 'S' || c == 'L') {
char p = chars[++i];
if (!(p >= '0' || p <= '9') && !(p >= 'a' || p <= 'v'))
throw new ICVerificationException("Bad table index " + chars[i] + " for opcode "
+ c + " " + "on line "
+ li[i].line + " at column " + li[i].col);
}
break;
case 'v': {
char n = chars[++i];
if (!(n >= '0' || n <= '9'))
throw new ICVerificationException("Bad peek depth " + chars[i] + " " + "on line " +
li[i].line + " at column "
+ li[i].col);
}
break;
case '.':
for (int j = 0; j < 4; j++) {
switch (chars[++i]) {
case '+':
case '-':
case '1':
case '0':
break;
default:
throw new ICVerificationException("Bad logic table value " + chars[i] + " " +
"on line " + li[i].line
+ " at column " + li[i].col);
}
}
break;
case 'c':
case 't':
for (int j = 0; j < 2; j++) {
char n = chars[++i];
if (!(n >= '0' || n <= '9'))
throw new ICVerificationException("Invalid character " + chars[i] + " in function" +
" number " + "on line "
+ li[i].line + " at column " + li[i].col);
}
{
char n = chars[++i];
if (!(n >= '0' || n <= '9'))
throw new ICVerificationException("Invalid character " + chars[i] + " in argument " +
"count " + "on line "
+ li[i].line + " at column " + li[i].col);
}
break;
default:
throw new ICVerificationException("Unknown opcode " + c + " " + "on line " + li[i].line +
" at column " + li[i].col);
}
} catch (ArrayIndexOutOfBoundsException e) {
BukkitUtil.printStacktrace(e);
i = li.length - 1;
throw new ICVerificationException("Unexpected function end " + "around line " + li[i].line);
}
}
if (bracketCount != 0)
throw new ICVerificationException("Missing closing braces in function #" + l + " " + " " +
" starting on line "
+ li[0].line + " and ending on line " + li[li.length - 1].line);
}
return functions;
}