'Declaration Public Enum SyntaxTreePruningMode Inherits System.Enum
public enum SyntaxTreePruningMode : System.Enum
Member | Description |
---|---|
BasedOnChildren | Non-terminal syntax nodes which have zero children or only one child, where that child is itself a non-terminal syntax node, are not included in the syntax tree. |
BasedOnChildrenAndName | Combines the BasedOnChildren and BasedOnName values. This is the default value for Grammar.SyntaxTreePruningMode. |
BasedOnName | Non-terminal syntax nodes which are associated with a NonTerminalSymbol whose name begins with an underscore ('_') are considered to be used internally for the purpose of grouping certain constructs, and do not appear in the syntax tree. |
None | All non-terminal nodes appear in the tree. |
The term "pruning" refers to the process of removing non-terminal syntax nodes which, for whatever reason, are not considered important to the consumer of the syntax tree.
Terminal nodes are never removed from a syntax tree, since they always represent significant content.
Child nodes of non-terminal nodes which are pruned from the tree become immediate children of the first ancestor node that is not pruned.
By default, non-terminal nodes which have only one child, where that child is itself a non-terminal node, do not appear in the syntax tree. Non-terminal nodes whose name is prefixed with an underscore ('_') also do not appear. This is the equivalent of the BasedOnChildrenAndName value.
Pruning can be overridden on individual non-terminal symbols by setting their NonTerminalSymbol.PreventPruning value to True, or in EBNF by marking a non-terminal definition with a special sequence like this: "?<PreventPruning/>?"
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