Math expressions parsing, lexical analysis and comparing