-
MathType
-
Wiris Quizzes
-
Learning Lemur
-
CalcMe
-
MathPlayer
-
Store FAQ
-
VPAT for the electronic documentation
-
MathFlow
-
BF FAQ
File Syntax
Reading time: 1minHere is some information about the syntax of rules. You do not need to know this -- it is only for informational purposes for the curious who have some programming background. The pattern matcher works on a tree and finds the first match it can in a file. The pattern matcher tries to match a node in the input tree and if it finds a rule that matches, produces an output node. Nodes have a name, can have attributes (name/value pairs), and can have children. In general, a rule looks like
nodeName ? boolean tests => newNodeName(children) {attribute values}
An example from
UIWord ? (ruleRef=="RR_simpleSuperScript" ) => UIInput(string{text=(::verbosity < ::v_full) ? "to the" : "raised to the";}) { ruleRef="RR_simpleSuperScript"; };
In this example, the nodeName is "UIWord" and we are testing its "ruleRef" attribute is the string "RR_simpleSuperScript". If it is, then we generate a new tree node named "UIInput" with the child named "string". String has a text attribute whose value depends upon the value of the global variable "verbosity". "UIInput" has the attribute named "ruleRef".
A lot of the syntax is based on C/C++ and is similar to Java and Javascript. One piece of syntax that is used a lot in the rules is the conditional operator
condition ? value-if-true : value-if-false
The example above uses it to return different strings to speak depending on the values of the global variable "verbosity".
Note that all global variables are accessed using the "::" syntax as in "::verbosity".