Input to MAD is free format, and the line length is not limited. During reading, input lines are normally printed on the echo file, but this feature can be turned off for long input files. The input is broken up into tokens (words, numbers, delimiters etc.), which form a sequence of commands, also known as statements. Each statement must be terminated by a semicolon (;), and long statements can be continued on any number of input lines. White space, like blank lines, spaces, tabs, and newlines are ignored between tokens. Comments can be introduced with two slashes (//) and any characters following the slashes on the same line are ignored.
The C convention for comments (/* ... */) is also accepted. The comment delimiters /* and */ can be nested; thus whole section of input can be ``commented out''.
In the following descriptions, words in lower case stand for syntactic units which are to be replaced by actual text. UPPER CASE is used for keywords or names. These must be entered as shown. Ellipses (...) are used to indicate repetition.
The general format for a command is
keyword,attribute,...,attribute; label:keyword,attribute,...,attribute;It has three parts:
attribute-name attribute-name=attribute-value attribute-name:=attribute-valueand serves to define data for the command, where:
When a command has a label, MAD keeps the command in memory. This allows repeated execution of the same command by entering its label only:
label;or to re-execute the command with modified attributes:
label,attribute,...,attribute;If the label of such a command appears together with new attributes, MAD makes a copy of the stored command, replaces the attributes entered, and then executes the copy:
QF:QUADRUPOLE,L=1,K1=0.01; // first definition of QF QF,L=2; // redefinition of QF, new length MATCH; ... LMD:LMDIF,CALLS=10; // first execution of LMD LMD; // re-execute LMD with the same attributes LMD,CALLS=100,TOLERANCE=1E-5; // re-execute LMD with new attributes ENDMATCH;