Sebesta Scanner Implementation in Java