Show / Hide Table of Contents

Class RuleCollection<TSource, TTarget>

Represents a collection of rewrite rules.

Inheritance
System.Object
RuleCollection<TSource, TTarget>
Implements
System.Collections.Generic.IEnumerable<Rule<TSource, TTarget>>
System.Collections.IEnumerable
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public sealed class RuleCollection<TSource, TTarget> : Object, IEnumerable<Rule<TSource, TTarget>>, IEnumerable
Type Parameters
Name Description
TSource

Type of the source tree nodes.

TTarget

Type of the target tree nodes.

Properties

Count

Gets the number of rewrite rules in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Methods

Add(Expression<Func<TSource, TSource, TSource, TSource>>, Expression<Func<TTarget, TTarget, TTarget, TTarget>>, Int32)

Adds a new rewrite rule.

Declaration
public void Add(Expression<Func<TSource, TSource, TSource, TSource>> pattern, Expression<Func<TTarget, TTarget, TTarget, TTarget>> goal, int cost)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TSource, TSource, TSource, TSource>> pattern

Lambda expression representing the pattern matched by the rule.

System.Linq.Expressions.Expression<System.Func<TTarget, TTarget, TTarget, TTarget>> goal

Lambda expression representing the rewrite goal applied by the rule.

System.Int32 cost

Cost to apply the rule.

Add(Expression<Func<TSource, TSource, TSource>>, Expression<Func<TTarget, TTarget, TTarget>>, Int32)

Adds a new rewrite rule.

Declaration
public void Add(Expression<Func<TSource, TSource, TSource>> pattern, Expression<Func<TTarget, TTarget, TTarget>> goal, int cost)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TSource, TSource, TSource>> pattern

Lambda expression representing the pattern matched by the rule.

System.Linq.Expressions.Expression<System.Func<TTarget, TTarget, TTarget>> goal

Lambda expression representing the rewrite goal applied by the rule.

System.Int32 cost

Cost to apply the rule.

Add(Expression<Func<TSource, TSource>>, Expression<Func<TTarget, TTarget>>, Int32)

Adds a new rewrite rule.

Declaration
public void Add(Expression<Func<TSource, TSource>> pattern, Expression<Func<TTarget, TTarget>> goal, int cost)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TSource, TSource>> pattern

Lambda expression representing the pattern matched by the rule.

System.Linq.Expressions.Expression<System.Func<TTarget, TTarget>> goal

Lambda expression representing the rewrite goal applied by the rule.

System.Int32 cost

Cost to apply the rule.

Add(Expression<Func<TSource>>, Expression<Func<TTarget>>, Int32)

Adds a new rewrite rule.

Declaration
public void Add(Expression<Func<TSource>> pattern, Expression<Func<TTarget>> goal, int cost)
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TSource>> pattern

Lambda expression representing the pattern matched by the rule.

System.Linq.Expressions.Expression<System.Func<TTarget>> goal

Lambda expression representing the rewrite goal applied by the rule.

System.Int32 cost

Cost to apply the rule.

GetEnumerator()

Gets an enumerator to iterate over the rewrite rules in the collection.

Declaration
public IEnumerator<Rule<TSource, TTarget>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<Rule<TSource, TTarget>>

Enumerator to iterate over the rewrite rules in the collection.

Implements

System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable
In This Article
Back to top Generated by DocFX