Version

GlobalAmbiguityDetected Event

Occurs when a global ambiguity is detected while parsing a document.
Syntax
'Declaration
 
Public Event GlobalAmbiguityDetected As EventHandler(Of GlobalAmbiguityDetectedEventArgs)
public event EventHandler<GlobalAmbiguityDetectedEventArgs> GlobalAmbiguityDetected
Event Data

The event handler receives an argument of type GlobalAmbiguityDetectedEventArgs containing data related to this event. The following GlobalAmbiguityDetectedEventArgs properties provide information specific to this event.

PropertyDescription
Context An object containing the relevant information about the global ambiguity.
Remarks

A global ambiguity occurs when the same span of text in a document can be interpreted in two or more different ways based on the grammar rules for the language and the context in which text occurs. The GlobalAmbiguityContext on the event arguments contains two alternate parses for the text (if there are more than two alternate parses, this event will be fired multiple times). An event handler can determine which of the two alternate parse sub-trees should be used in the final tree by setting PreferredSubTreeRoot on the context of the event arguments.

A grammar creator can handle this event to get notified of global ambiguities and know which rules need to be re-written or mark with priority.

Requirements

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

See Also