parser and lexer modified to support function parsing