The ways you can write MAXScript tokens and clauses are given using a set of shorthand rules as shown in the following example:
These rules, or syntax definitions, follow the standard EBNF notation (Extended Backus-Naur Form).
The previous example shows the syntax for a decimal number in MAXScript. The rules typically contain a number of characters with special meanings. For example, brackets enclose optional items, such as the minus sign in front of the number. Braces enclose items you can use repeatedly, and bars separate multiple items from which you can choose one. Sometimes, rules are given names so they can be referred to in the documentation or as parts of other rules. The special characters in the rules have the following meaning:
The previous number syntax example is interpreted as follows:
Examples of valid numbers are:
The syntax definitions in MAXScript Grammar are in the form of named rule definitions.
FOR EXAMPLE |
allowing the rule to be referred to by name in other rules in the grammar. |
AN EXAMPLE OF SUCH RULE IS: |
modulo arithmetic, the remainder when <number1> is divided by <number2> |
Some definitions throughout this document also use the convention of showing alternative definitions for a rule on consecutive lines instead of separating them with the ' | ' symbol.