add some functions to lex.c