| Home News Product Order Forum Feedback Partner Profile | © Neatware 2000 |
| Neatware | Snaml |
|
Syntax |
|
|
Last Update: Wed Apr 12 20:06:27 2000 |
|
Snaml Basic
Introduction Syntax Control Types Modules Status Snaml HTML HTML Structure Link Objects Text Font Snaml CSS CSS Script Snaml CGI CGI Variables Output Form Application Snaml XML XML Document EBNF |
The command-line syntax of Snaml has the form:
where command is a buildin or a defined procedure in the Snaml. Spaces separate a command name and its arguments in a line. Newline and semicolons are line or command terminators. To continue arguments on the next line, a command must have a backslash in the end of a line. Each command has a return value. To evaluate a command, interpreter substitutes command-line arguments from left to right. It makes a single passing substitution. Snaml commands are cataloged as regular, block, empty, and inline.
Regular Command has a typical command-line syntax. Its number of argument is unlimited. There is no direct relation for two commands. A new command can be defined by proc command. For example, set command assigns a value to a variable.
Block Command may specify a scope of a set of commands. start command is the beginning of a block command. Snaml specifies the satrt command name with the underscore prefix such as '_command'. A start command may have zero to two arguments called attributes. end command is the end of a block command. The command name has the underscore postfix such as 'command_'. An end command has no argument. The commands between the start and end commands are called content.
Attribute is a list of key/value pairs separated by whitespace. A pair has the format key='value' where key must be a character string (include letters, digits, hypen, period, and underscore). The value may be any of strings or variables. The single quote ' ' groups the value. A key that is not defined as an attribute of a start command will be ignored. A non-declared key will be assigned to its default value when a start command is invocated.
Block commands may be nested. A difference between the block command and regular command is that the attributes of block commands may be inherited. The inner commands in the content of a block command may inherite the attributes of the outer block command. A command in the content is called a child of the outer block command. In contrast, the outer block command is a parent of the inner commands. Finally, the block commmands should be properly paired.
Empty command is a special case of the block command where the content is empty. It has a special syntax with double underscore prefix such as '__command'. It is convenient for a parser to check a program for empty command since there is no end command is expected. Empty command is consistent to the XML syntax. In HTML some start command and empty command may be the same
Inline command is a shorthand of block command. But it is limited to be a command in the square brackets and acts as an element of an argument. An inline command is represented as '_command_' where two underscores are prefix and postfix of a block command name. Usually it has two arguments: the first one is the attribute of the block command; the second one is the content of the block command. The content of an inline command must be a group of string, a regular or inline command. Inline command must return a value. If inline command has only one argument, this argument is considered as content rather than an attribute. To make one argument consider as attribute you must use the inline empty command. It has the double underscore prefix and one underscore postfix as '__command_'. Typically, an inline command is used inside a short text description.
Dollar sign $ enables variable substitution. It replaces the variable with its value. variable will be useful to mix with other special characters.
Square brackets enable command substitution. A command must be inside the brackets. After evaluation of the command, the return value will replace the square bracket string. The brackets maybe nested.
Backslash \ enables next character substitution. The next character or group after the backslash will be replaced by a new representation of the character. Usually backslash \ is widely used to quote a specific character
Double quote " " enable inside string substitution. The " character inside the double quote must be disabled with the backslash \" quoting. The grouping value of double quotes is the string inside after substitution.
Curly braces { } disable substitution inside. All the characters include whitespace, double quotes, even nested curly braces (exclude outmost curly braces) are value of the group. When curly braces are inside the double quote, they will not work as grouping.
|
|
|
|
Last Update: Wed Apr 12 20:06:27 2000 |
|
Syntax |
| Neatware | Snaml |
| Home News Product Order Forum Feedback Partner Profile | © Neatware 2000 |