'Declaration Public Overloads Function Insert( _ ByVal index As Integer, _ ByVal name As String, _ Optional ByVal value As String, _ Optional ByVal comparison As TerminalSymbolComparison, _ Optional ByVal isExitSymbol As Boolean _ ) As TerminalSymbol
public TerminalSymbol Insert( int index, string name, string value, TerminalSymbolComparison comparison, bool isExitSymbol )
Exception | Description |
---|---|
System.InvalidOperationException | Occurs when the owning LexerState does not belong to a Grammar. |
System.InvalidOperationException | Occurs when the IsMutable value of the owning Grammar is False. |
System.ArgumentNullException | Occurs when name is null or empty. |
System.ArgumentOutOfRangeException | Occurs when index is less than 0 or greater than the Count. |
System.ArgumentException | Occurs when a symbol of the owning Grammar already exists with the specified name. |
System.ArgumentException | Occurs when comparison is not defined in the TerminalSymbolComparison enumeration. |
System.ArgumentException | Occurs when isExitSymbol is True and the owning LexerState is the default lexer state. |
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.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, 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