Note
The Insidion Engine is meant for simple, small-scale engines that parse relatively simpler grammars. This is not to say that the Insidion Engine cannot handle complex grammars, but rather, that you are better off with a different architecture if you’re going for production-grade engines.
Essentially, the lexer produces a rudimentary abstract syntax tree, showing the rough outline of the program. If a math operation is in play, it ensure there are expressions on the left- and right-hand side. The parser is the one validating these expressions. Hence, the lexer can catch most syntax errors while the parser catches runtime errors.