Version

Add(TerminalSymbol,Boolean) Method

Adds the specified symbol to the collection.
Syntax
'Declaration
 
Public Overloads Sub Add( _
   ByVal symbol As TerminalSymbol, _
   Optional ByVal isExitSymbol As Boolean _
) 
public void Add( 
   TerminalSymbol symbol,
   bool isExitSymbol
)

Parameters

symbol
The symbol to add to the collection.
isExitSymbol
Indicates whether the symbol should be an exit symbol for the lexer state.
Exceptions
ExceptionDescription
System.InvalidOperationExceptionOccurs when the IsMutable value of the owning Grammar is False.
System.ArgumentNullExceptionOccurs when symbol is null.
System.ArgumentExceptionOccurs when symbol does not belong to the same Grammar as the owning LexerState.
System.ArgumentExceptionOccurs when symbol is the EndOfStreamSymbol.
System.ArgumentExceptionOccurs when isExitSymbol is True and the owning LexerState is the default lexer state.
Remarks

If the LexerState owning the collection is not the default lexer state, the symbol can optionally be added as an exit symbol. If it is an exit symbol, the lexer state will be exited when tokens associated with the symbol are created by the lexer. When a lexer state is exited, the lexer will go back to the state it was in before the state was entered. A LexerState will be entered when a token is created which is associated with a TerminalSymbol that has a TerminalSymbol.LexerStateToEnter set. If a TerminalSymbol is both an exit symbol and it has a LexerStateToEnter set, the LexerStateToEnter will be ignored. The lexer cannot enter and exit a state at the same time and exiting a lexer state takes precedence.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also