refactoring statement and expression logics into lexor functions