for every `while (true)` here and below add `if (isEOF(obj)) break;` statement after `lexer.getObj()`