§ 3.1. Digestion
Digestion is carried out primarily in a pull mode: The LaTeXML::Stomach pulls expanded LaTeXML::Tokens from the LaTeXML::Gullet, which itself pulls tokens from the LaTeXML::Mouth. The LaTeXML::Mouth converts characters from the plain text input into tokens according to the current category codes assigned to them (in the LaTeXML::State). The LaTeXML::Gullet is responsible for expanding any macro or expandible tokens (when the current binding of the token in the LaTeXML::State is an LaTeXML::Expandable definition), and for parsing sequences of tokens into common core datatypes (numbers, dimensions, etc.). The LaTeXML::Stomach digests these tokens by executing LaTeXML::Primitive control sequences (generally for side effect), converting control sequences bound to LaTeXML::Constructors into LaTeXML::Whatsits, and converting the remaining tokens into a recursive structure consisting of LaTeXML::Boxes and LaTeXML::Lists and of LaTeXML::Boxes.