Parses mathematics content
LaTeXML::MathParser parses the mathematical content of a document. It uses Parse::RecDescent and a grammar MathGrammar.
Needs description.
Needs description.
The following functions are exported for convenience in writing the grammar productions.
Creates a new XMTok node with given $name (a string or undef), and $content (a string or undef) (but at least one of name or content should be provided), and attributes.
Returns the $n-th argument of an XMApp node; 0 is the operator node.
Add attributes to $node.
Create a new XMApp node representing the application of the node $op to the nodes @args.
Create a new XMApp node representing the application of the node $op to the arguments found in @stuff. @stuff are delimited arguments in the sense that the leading and trailing nodes should represent open and close delimiters and the arguments are separated by punctuation nodes.
Similar to ApplyDelimited, this interprets sequence of delimited, punctuated items as being the application of $op to those items.
Given a sequence of operators and an argument, forms the nested application op(op(...(arg)))>.
Creates an invisible times operator.
Checks whether $open and $close form a ‘normal’ pair of delimiters, or if either is ”.”.
Given a delimited sequence of nodes, starting and ending with open/close delimiters, and with intermediate nodes separated by punctuation or such, attempt to guess what type of thing is represented such as a set, absolute value, interval, and so on.
This would be a good candidate for customization!
Given a set of formulas, construct a Formulae application, if there are more than one, else just return the first.
Given a set of expressions, construct a list application, if there are more than one, else just return the first.
Given an expr followed by repeated (op expr), compose the left recursive tree. For example a + b + c - d would give (- (+ a b c) d)>
Note the possible use of $token as a function, which may cause incorrect parsing. This is used to generate warning messages.