This documentation is archived and is not being maintained.

2. Lexical Grammar

Visual Studio .NET 2003

Compilation of a Visual Basic .NET program first involves translating the raw stream of Unicode characters into an ordered set of lexical tokens. Because the Visual Basic .NET language is not free-format, the set of tokens is then further divided into a series of logical lines. A logical line spans from either the start of the stream or a line terminator through to the next line terminator that is not preceded by a line continuation or through to the end of the stream.

Start ::= [ LogicalLine+ ]
LogicalLine ::= [ LogicalLineElement+ ] [ Comment ] LineTerminator
LogicalLineElement ::= WhiteSpace | LineContinuation | Token
Token ::= Identifier | Keyword | Literal | Separator | Operator

See Also

2.1 Characters and Lines | 2.2 Identifiers | 2.3 Keywords | 2.4 Literals | 2.5 Separators | 2.6 Operator Characters