Extracted lexerLex() function from main().

Added better error handling when opening the input file.