WIP: factorization of lexer and parser implementation