hand coded lexer using Java