functions lexer and parser