removed unused function
follow file mode implementation for lexer