private IntegerLiteral doRead(Source source, int index) { IntegerLiteral integerLiteral = null; main: switch (source.getCurrentCharacter()) { case '0': switch (source.getCharacterAt(1)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': integerLiteral = decimalIntegerLiteralOrOctalIntegerLiteralReader.read(source, index); break main; case '8': case '9': integerLiteral = decimalIntegerLiteralReader.read(source, index); break main; case 'X': case 'x': integerLiteral = hexIntegerLiteralReader.read(source, index); break main; case 'B': case 'b': integerLiteral = binaryIntegerLiteralReader.read(source, index); break main; case '_': integerLiteral = octalIntegerLiteralReader.read(source, index); break main; default: integerLiteral = decimalIntegerLiteralReader.read(source, index); break main; } case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': integerLiteral = decimalIntegerLiteralReader.read(source, index); break main; default: source.rewind(index); break main; } return integerLiteral; }
@Override public IntegerLiteral read(Source source) { return doRead(source, source.getIndex()); }