The ways you can write MAXScript tokens and clauses are given using a set of shorthand rules as shown in the following example:
[-]{<digit>}[.{<digit>}[(e | E)[+ | -]{<digit>}+]
These rules, or syntax definitions, follow the standard EBNF notation (Extended Backus-Naur Form).
The example above shows the syntax for a decimal number in MAXScript. The rules typically contain a number of characters which have 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 part of other rules. The special characters in the rules have the following meaning:
[...] -- items inside the brackets are optional
(...|...|...) -- choose one of the items separated by the bars
{...} -- you can repeat the braced item ZERO or more times
{...}+ -- you can repeat the braced item ONE or more times
<rule> -- you can insert what is defined by the named rule
bold_characters -- characters or token as written
The above number syntax example can be interpreted as follows:
an optional minus sign, followed by
-- the sign
0 or more digits, followed by
-- the integer part
an optional sequence comprized of:
-- the fraction part
a period character, followed by
0 or more digits, followed by
either an āeā or āEā, followed by
-- the exponent part
an optional plus or minus sign, followed by
one or more digits.
Examples of valid numbers are:
123
1.456
-0.89e-7
1.536E23
The following numbers are not valid:
12x34
-0.45x10^3
0e