question: private void addInteger ( ) { int oldPos = pos - 1 ; String literal = scanInteger ( ) ; final String substring ; final int radix ; if ( literal . startsWith ( "0x" ) || literal . startsWith ( "0X" ) ) { radix = 16 ; substring = literal . substring ( 2 ) ; } else if ( literal . startsWith ( "0" ) && literal . length ( ) > 1 ) { radix = 8 ; substring = literal . substring ( 1 ) ; } else { radix = 10 ; substring = literal ; } int value = 0 ; try { value = Integer . parseInt ( substring , radix ) ; } catch ( NumberFormatException e ) { error ( "invalid base-" + radix + " integer constant: " + literal ) ; } addToken ( TokenKind . INT , oldPos , pos , value ) ; }
target:  Scans an addInteger literal. <p>ON ENTRY: 'pos' is 1 + the index of the first char in the literal. ON EXIT: 'pos' is 1 + the index of the last char in the literal.