Version

SyntaxTreePruningMode Enumeration

Constants which describe whether a non-terminal SyntaxNode should appear in the SyntaxTree produced when a document is parsed.
Syntax
'Declaration
 
Public Enum SyntaxTreePruningMode 
   Inherits System.Enum
public enum SyntaxTreePruningMode : System.Enum 
Members
MemberDescription
BasedOnChildrenNon-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.
BasedOnChildrenAndNameCombines the BasedOnChildren and BasedOnName values. This is the default value for Grammar.SyntaxTreePruningMode.
BasedOnNameNon-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.
NoneAll non-terminal nodes appear in the tree.
Remarks

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/>?"

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