Model Builder's Guide Chapter 3

=General syntax rules=

General Syntax Common to All Model Files

 * Each command and expression must be on a separate line (i.e. separated by a carriage return). Some expressions may span multiple lines (e.g. “IF” expressions).
 * The last command or expression of a file must end with a carriage return (i.e. the last line of the file should be empty). When the LSEditor cannot locate a syntax error, this should be one of the first items to check.
 * Commands and expressions in model files consist of keywords and expressions.
 * Commands, except the model type declaration at the top of the file, are generally optional. The default value for commands is given with the syntax description.
 * A command followed by a superscripted asterisk (*) indicates that the command may be repeated zero or more times. A command followed by a superscripted plus sign (+) indicates that the command may be repeated one or more times (i.e. at least once).
 * Two commands separated by a vertical bar (|) indicate alternate forms.
 * Punctuation, where shown, must be provided as is.


 * Comments can be placed anywhere in a model file. Comments are surrounded by “/*” and “*/” (e.g.  /* This is a comment, and will be ignored by the parser */ ). If the parser encounters “//”, the remainder of the line is treated as a comment. Well-documented models have at least as many comments as commands and expressions.
 * White space (extra spaces, tabs, or carriage returns) is ignored and can be used to help format models. Use of consistent indentation (e.g. three spaces for each nested level of sub-expressions) is critical to model readability. Spaces are better to use than tabs since different programs may interpret tab depth differently.


 * Labels shown in upper case denote keywords. The parser is not case sensitive, but otherwise keywords must be spelled exactly as shown. Portions of keywords shown in italics are optional (e.g., the syntax description “MINIMUM” indicates that either “MIN” or “MINIMUM” is valid). In versions prior to 3.3, keywords in landscape event and agent files must be in upper case. SELESv3.3 is no longer case sensitive.
 * Labels that are not all upper case (or enclosed in “{}” braces) indicate structures defined elsewhere in the section.
 * Labels enclosed in “< >” indicate text (e.g. variable names) or numbers for which the modeller must substitute an appropriate value.


 * Labels preceded by a “#” indicate numbers. If not obvious, command and expression descriptions indicate if these are restricted to integers. In most cases, expressions composed of numbers, constants and arithmetic can be used. For example, the following are valid number expressions: 2, 3.5 1/365.25, (5*-3)^4/6, MaxAge+1 (where MaxAge is a defined constant name), and 1/NUMCELLS (where NUMCELLS is a built-in constant name).
 * NumberPairs and NumberLists may be enclosed in optional brackets “”, and each number in the list must be separated by a comma (e.g., “(1,2,5,6)” or “1,2,5,6”)
 * Labels preceded by a “%” indicate logical value (true or false). Logical values may be any of: ‘0’, ‘OFF’, or ‘FALSE’ to indicate false; ‘1’, ‘ON’, or ‘TRUE’ to indicate true.


 * Text enclosed in double quotes indicates a literal text value (e.g. “This is a literal text string”).
 * Filenames must be specified as literal text if they contain any spaces (as a general rule, spaces in filenames should be avoided).

Go to... Prev Chapter Next Chapter  Guide Index