Implemented several functions in lexer.c