latex: lexer moved to a separate class, syntax error checks to be done in parser