NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

1.5 Grammar notation

There are two main grammars interspersed throughout this specification: a lexical grammar and a syntactic grammar. The lexical grammar defines how characters can be combined to form tokens; the syntactic grammar defines how the tokens can be combined to form Visual Basic 7.0 programs. There are also several secondary grammars used for preprocessing operations like conditional compilation. It is important to note that the grammars in this specification are not intended to be formal (that is, usable by LEX or YACC), but are designed to be human readable.

All of the grammars use a modified BNF notation, which consists of a set of productions that include non-terminal and terminal names. Each non-terminal is defined by one or more productions. In a production, non-terminal names are shown in italic type, and terminal names are shown in a bold fixed-width font. Text in normal type and surrounded by angle bracket meta-symbols is an informal terminal (for example, "< all Unicode characters >"). Each grammar starts with the non-terminal Start.

The casing of alphabetic characters is unimportant in Visual Basic 7.0 programs. For simplicity, all terminals will be given in a "standard casing," but any casing will match them. Terminals that are printable elements of the ASCII character set are represented by their corresponding ASCII characters.

A set of productions begins with the name of a non-terminal, followed by two colons and an equals sign. The right-hand side contains a terminal or non-terminal production. Line breaks and indentation may be added for readability and are not part of the production. A non-terminal may have multiple productions that are separated by the vertical bar meta-symbol ("|"). Items included in the meta-symbols square brackets ("[]") are optional. A meta-symbol plus ("+") following an item means the item may occur one or more times.