Skip to content

Visualizer treeview

Zev Spitz edited this page Jun 26, 2019 · 9 revisions

The treeview shows the various objects that make up the expression tree:

Expression tree with a loop, a label, and a condition

The emphasis is on displaying the structure of the expression tree:

  • Not every property becomes a child node; only properties which return specific types which are part of the expression tree's structure, such as Expression and CaseBlock

  • There are no child nodes for properties which return collections -- LambdaExpression.Parameters, Block.RuntimeVariables; instead, each element gets its own child node. For example, LambdaExpression has a Parameters property, which returns a ReadOnlyCollection<ParameterExpression>; but the tree doesn't have a child node for Parameters, only for the individual elements -- Parameter[0], Parameter[1] etc.:

    Elements of collection properties as child nodes

Node properties

Given the following node:

Node details

The following properties are shown for each node:

Description In highlighted example Applies to
Path from parent node Left - Every node
Node type MemberAccess ConstantExpression
DefaultExpression
closed-over variables
System.Type of expression (int) Expression and subtypes
CallSiteBinder and subtypes
Name firstVariable ParameterExpression if it has one
MemberExpression
MethodCallExpression
LambdaExpression if it has one
MemberBinding -- bound member's name
Value of the expression, as a literal = 5 ConstantExpression
DefaultExpression
closed-over variables
Clone this wiki locally