Version

IsStartOfErrorRecoveryPair Property

Gets or sets a value indicating whether the presence of the Symbol followed by a specific TerminalSymbol signals the middle or end of a structure being parsed.
Syntax
'Declaration
 
Public Property IsStartOfErrorRecoveryPair As Boolean
public bool IsStartOfErrorRecoveryPair {get; set;}
Exceptions
ExceptionDescription
System.InvalidOperationExceptionOccurs when the IsMutable value of the owning Grammar is False.
Remarks

The use of this setting helps the error handling logic report more meaningful errors. This should be used on symbols which, when followed by a specific TerminalSymbol, unambiguously indicate that the middle or end of a structure has been reached. For example, in VB.NET, the "End" keyword followed by the "Class" keyword unambiguously signals the end of a Class declaration. Similarly, the "End" keyword followed by a "Sub" keyword unambiguously signals the end of a Sub (method) declaration. If the parser is currently within a Sub declaration that is within a Class declaration and the "End" keyword is found followed by the "Class" keyword, the use of IsStartOfErrorRecoveryPair will let the error handling logic know that "End Class" cannot end the Sub declaration and therefore, the "End Sub" is missing. That missing pair will then be inserted in the parse tree so that "End Class" can correctly be used to close the owning class. Therefore, setting the value to True on the TerminalSymbol representing the "End" keyword would help the parser provide more meaningful error messages when parsing documents in the VB.NET language.

Note: This value is intended to be used on relatively small constructs. If the number of terminal symbols parsed to create a symbol is more than 10, the IsStartOfErrorRecoveryPair value will be ignored for that symbol.

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