Exception | Description |
---|---|
System.InvalidOperationException | Occurs when the IsMutable value of the owning Grammar is False. |
When a global ambiguity is detected, it means two or more SyntaxNode sub-trees are capable of representing the same portion of textual content in the document based on the grammar definition. If nodes in one or more of those trees are associated with priority NonTerminalSymbol instances, the tree with the priority node closest to the root level will be chosen as the preferred sub-tree. If multiple trees have priority nodes at the same level, the tree with more priority nodes at that level will be chosen. Otherwise, if multiple trees have the same number of priority nodes at the same level or if all trees don't have any priority nodes, the global ambiguity cannot be resolved automatically and the LanguageBase.OnGlobalAmbiguityDetected method will be called to allow the developer to resolve it with custom logic. If a CustomLanguage instance is the language used to parse the document, it will fire its CustomLanguage.GlobalAmbiguityDetected event which also allows the developer to resolve the ambiguity. If it is not resolved, one of the ambiguous trees will be arbitrarily chosen by the parser to represent the content.
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