In This Article

ITypedTreeConstructionNode<TAstNode> Interface

Provides the base requirements for tree construction node, used to output a specific type of IAstNode for an EbnfProduction.

public interface ITypedTreeConstructionNode<TAstNode> : ITreeConstructionNode where TAstNode : class, IAstNode
Type Parameters:
TAstNode -

The type of IAstNode.

Methods

AddToCollectionProperty<TItem>(Expression<Func<TAstNode, ICollection<TItem>>>, params ITreeConstructionNode[])

Creates an ITreePropertyConstructionNode<T> that adds values from one or more specified ITreeConstructionNode constructed nodes to a collection property.

ITypedTreeConstructionNode<TAstNode> AddToCollectionProperty<TItem>(Expression<Func<TAstNode, ICollection<TItem>>> expression, params ITreeConstructionNode[] children)
Type Parameters:
TItem -

The type of collection item.

Parameter Type Description
expression Expression<Func<TAstNode, ICollection<TItem>>>

The lambda expression indicating the collection property to update.

children ITreeConstructionNode[]

The optional child ITreeConstructionNode objects.

Returns

ITypedTreeConstructionNode<TAstNode>:

The ITypedTreeConstructionNode<TAstNode> upon which the property was created.

Remarks

String, integer, boolean, and AST node (any IAstNode-based class) property types are supported.

Multiple ITreeConstructionNode constructed nodes can be passed to this method. In the case of a string collection property type, the string values of the constructed nodes are added as items to the collection property. In the case of an integer collection property type, the numeric values of the constructed nodes are added as items to the collection property. In the case of a boolean collection property type, the boolean values of the constructed nodes are added as items to the collection property. In the case of an AST node collection type, the nodes are added as items to the collection property.

AppendToProperty<TProperty>(Expression<Func<TAstNode, TProperty>>, params ITreeConstructionNode[])

Creates an ITreePropertyConstructionNode<T> that appends a value to a property using the specified ITreeConstructionNode constructed nodes.

ITypedTreeConstructionNode<TAstNode> AppendToProperty<TProperty>(Expression<Func<TAstNode, TProperty>> expression, params ITreeConstructionNode[] children)
Type Parameters:
TProperty -

The property type.

Parameter Type Description
expression Expression<Func<TAstNode, TProperty>>

The lambda expression indicating the property to update.

children ITreeConstructionNode[]

The optional child ITreeConstructionNode objects.

Returns

ITypedTreeConstructionNode<TAstNode>:

The ITypedTreeConstructionNode<TAstNode> upon which the property was created.

Remarks

String, integer, boolean, and flags enumeration property types are supported.

Multiple ITreeConstructionNode constructed nodes can be passed to this method. In the case of a string property type, the string values of the constructed nodes are concatenated to form the value appended to the property. In the case of an integer property type, the numeric values of the constructed nodes are added together to form the value appended to the property. In the case of a boolean property type, the boolean values of the constructed nodes are or'ed together to form the value appended to the property. In the case of a flags enumeration property type, the constructed node values are matched against enumeration value names, or'ed together, and the result is used as the value appended to the property.

SetCollectionItemProperties<TItem, TProperty>(Expression<Func<TAstNode, ICollection<TItem>>>, Expression<Func<TItem, TProperty>>, params ITreeConstructionNode[])

Creates an ITreePropertyConstructionNode<T> that sets a value to a property on each item in a collection property using the specified ITreeConstructionNode constructed nodes.

ITypedTreeConstructionNode<TAstNode> SetCollectionItemProperties<TItem, TProperty>(Expression<Func<TAstNode, ICollection<TItem>>> expression1, Expression<Func<TItem, TProperty>> expression2, params ITreeConstructionNode[] children) where TItem : IAstNode, new()
Type Parameters:
TItem -

The type of collection item type.

TProperty -

The property type.

Parameter Type Description
expression1 Expression<Func<TAstNode, ICollection<TItem>>>

The lambda expression indicating the collection property to update.

expression2 Expression<Func<TItem, TProperty>>

The lambda expression indicating the item property to update.

children ITreeConstructionNode[]

The optional child ITreeConstructionNode objects.

Returns

ITypedTreeConstructionNode<TAstNode>:

The ITypedTreeConstructionNode<TAstNode> upon which the property was created.

Remarks

String, integer, boolean, enumeration, and AST node (any IAstNode-based class) property types are supported.

Multiple ITreeConstructionNode constructed nodes can be passed to this method. In the case of a string property type, the string values of the constructed nodes are concatenated to form the value set to the property. In the case of an integer property type, the numeric values of the constructed nodes are added together to form the value set to the property. In the case of a boolean property type, the boolean values of the constructed nodes are or'ed together to form the value set to the property. In the case of an enumeration property type, the first constructed node value is matched against an enumeration value name and is used as the value set to the property. In the case of a flags enumeration property type, the constructed node values are matched against enumeration value names, or'ed together, and the result is used as the value set to the property. In the case of an AST node type, the first constructed node is the value set to the property.

SetCollectionItemProperties<TItem, TProperty>(Expression<Func<TAstNode, ICollection<TItem>>>, Expression<Func<TItem, TProperty>>, object)

Creates an ITreePropertyConstructionNode<T> that sets a single explicit value to a property on each item in a collection property.

ITypedTreeConstructionNode<TAstNode> SetCollectionItemProperties<TItem, TProperty>(Expression<Func<TAstNode, ICollection<TItem>>> expression1, Expression<Func<TItem, TProperty>> expression2, object explicitValue) where TItem : IAstNode, new()
Type Parameters:
TItem -

The type of collection item type.

TProperty -

The property type.

Parameter Type Description
expression1 Expression<Func<TAstNode, ICollection<TItem>>>

The lambda expression indicating the collection property to update.

expression2 Expression<Func<TItem, TProperty>>

The lambda expression indicating the item property to update.

explicitValue object

The explicit value to set.

Returns

ITypedTreeConstructionNode<TAstNode>:

The ITypedTreeConstructionNode<TAstNode> upon which the property was created.

SetProperty<TProperty>(Expression<Func<TAstNode, TProperty>>, params ITreeConstructionNode[])

Creates an ITreePropertyConstructionNode<T> that sets a value to a property using the specified ITreeConstructionNode constructed nodes.

ITypedTreeConstructionNode<TAstNode> SetProperty<TProperty>(Expression<Func<TAstNode, TProperty>> expression, params ITreeConstructionNode[] children)
Type Parameters:
TProperty -

The property type.

Parameter Type Description
expression Expression<Func<TAstNode, TProperty>>

The lambda expression indicating the property to update.

children ITreeConstructionNode[]

The optional child ITreeConstructionNode objects.

Returns

ITypedTreeConstructionNode<TAstNode>:

The ITypedTreeConstructionNode<TAstNode> upon which the property was created.

Remarks

String, integer, boolean, enumeration, and AST node (any IAstNode-based class) property types are supported.

Multiple ITreeConstructionNode constructed nodes can be passed to this method. In the case of a string property type, the string values of the constructed nodes are concatenated to form the value set to the property. In the case of an integer property type, the numeric values of the constructed nodes are added together to form the value set to the property. In the case of a boolean property type, the boolean values of the constructed nodes are or'ed together to form the value set to the property. In the case of an enumeration property type, the first constructed node value is matched against an enumeration value name and is used as the value set to the property. In the case of a flags enumeration property type, the constructed node values are matched against enumeration value names, or'ed together, and the result is used as the value set to the property. In the case of an AST node type, the first constructed node is the value set to the property.

SetProperty<TProperty>(Expression<Func<TAstNode, TProperty>>, object)

Creates an ITreePropertyConstructionNode<T> that sets a single explicit value to a property.

ITypedTreeConstructionNode<TAstNode> SetProperty<TProperty>(Expression<Func<TAstNode, TProperty>> expression, object explicitValue)
Type Parameters:
TProperty -

The property type.

Parameter Type Description
expression Expression<Func<TAstNode, TProperty>>

The lambda expression indicating the property to update.

explicitValue object

The explicit value to set.

Returns

ITypedTreeConstructionNode<TAstNode>:

The ITypedTreeConstructionNode<TAstNode> upon which the property was created.

Inherited Members