Version

SyntaxTreePruningMode Property

Gets or sets the value indicating how the syntax tree should be pruned.
Syntax
'Declaration
 
Public Property SyntaxTreePruningMode As SyntaxTreePruningMode
public SyntaxTreePruningMode SyntaxTreePruningMode {get; set;}
Exceptions
ExceptionDescription
System.InvalidOperationExceptionOccurs when the value is set and IsMutable is False.
System.ArgumentExceptionOccurs when the specified value is not defined in the SyntaxTreePruningMode.
Remarks

A grammar writer could define certain non-terminal symbols to group certain constructs together for reuse purposes. If these kinds of symbols should not appear in the final parse tree, naming these helper symbols with an underscore ('_') prefix and using the BasedOnName pruning mode will removed them from the final parse tree. In addition, certain operator precedence rules require long chains of lower precedence rules containing higher precedence rules. When only the higher precedence structure is used, the owning lower precedence symbol should not appear in the tree. In these cases, using the BasedOnChildren pruning mode will remove non-terminals which only have a single non-terminal child. Or BasedOnChildrenAndName (the default value for this property) could be used to perform both types of pruning modes.

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