DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Package Functions | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Linq.Evaluator.SubtreeEvaluator Class Reference

Evaluates & replaces sub-trees when first candidate is reached (top-down) More...

Inheritance diagram for Deveel.Data.Linq.Evaluator.SubtreeEvaluator:
Deveel.Data.Linq.ExpressionVisitor

Public Member Functions

override Expression Visit (Expression exp)
 

Package Functions

 SubtreeEvaluator (HashSet< Expression > candidates)
 
Expression Eval (Expression exp)
 

Private Member Functions

Expression Evaluate (Expression e)
 

Private Attributes

HashSet< Expression > candidates
 

Additional Inherited Members

- Protected Member Functions inherited from Deveel.Data.Linq.ExpressionVisitor
 ExpressionVisitor ()
 
virtual MemberBinding VisitBinding (MemberBinding binding)
 
virtual ElementInit VisitElementInitializer (ElementInit initializer)
 
virtual Expression VisitUnary (UnaryExpression u)
 
virtual Expression VisitBinary (BinaryExpression b)
 
virtual Expression VisitTypeIs (TypeBinaryExpression b)
 
virtual Expression VisitConstant (ConstantExpression c)
 
virtual Expression VisitConditional (ConditionalExpression c)
 
virtual Expression VisitParameter (ParameterExpression p)
 
virtual Expression VisitMemberAccess (MemberExpression m)
 
virtual Expression VisitMethodCall (MethodCallExpression m)
 
virtual ReadOnlyCollection< Expression > VisitExpressionList (ReadOnlyCollection< Expression > original)
 
virtual MemberAssignment VisitMemberAssignment (MemberAssignment assignment)
 
virtual MemberMemberBinding VisitMemberMemberBinding (MemberMemberBinding binding)
 
virtual MemberListBinding VisitMemberListBinding (MemberListBinding binding)
 
virtual IEnumerable< MemberBinding > VisitBindingList (ReadOnlyCollection< MemberBinding > original)
 
virtual IEnumerable< ElementInit > VisitElementInitializerList (ReadOnlyCollection< ElementInit > original)
 
virtual Expression VisitLambda (LambdaExpression lambda)
 
virtual NewExpression VisitNew (NewExpression nex)
 
virtual Expression VisitMemberInit (MemberInitExpression init)
 
virtual Expression VisitListInit (ListInitExpression init)
 
virtual Expression VisitNewArray (NewArrayExpression na)
 
virtual Expression VisitInvocation (InvocationExpression iv)
 

Detailed Description

Evaluates & replaces sub-trees when first candidate is reached (top-down)

Definition at line 49 of file Evaluator.cs.

Constructor & Destructor Documentation

Deveel.Data.Linq.Evaluator.SubtreeEvaluator.SubtreeEvaluator ( HashSet< Expression >  candidates)
inlinepackage

Definition at line 52 of file Evaluator.cs.

52  {
53  this.candidates = candidates;
54  }

Member Function Documentation

Expression Deveel.Data.Linq.Evaluator.SubtreeEvaluator.Eval ( Expression  exp)
inlinepackage

Definition at line 56 of file Evaluator.cs.

56  {
57  return this.Visit(exp);
58  }
override Expression Visit(Expression exp)
Definition: Evaluator.cs:60
Expression Deveel.Data.Linq.Evaluator.SubtreeEvaluator.Evaluate ( Expression  e)
inlineprivate

Definition at line 70 of file Evaluator.cs.

70  {
71  if (e.NodeType == ExpressionType.Constant) {
72  return e;
73  }
74  LambdaExpression lambda = Expression.Lambda(e);
75  Delegate fn = lambda.Compile();
76  return Expression.Constant(fn.DynamicInvoke(null), e.Type);
77  }
override Expression Deveel.Data.Linq.Evaluator.SubtreeEvaluator.Visit ( Expression  exp)
inlinevirtual

Reimplemented from Deveel.Data.Linq.ExpressionVisitor.

Definition at line 60 of file Evaluator.cs.

60  {
61  if (exp == null) {
62  return null;
63  }
64  if (candidates.Contains(exp)) {
65  return Evaluate(exp);
66  }
67  return base.Visit(exp);
68  }
Expression Evaluate(Expression e)
Definition: Evaluator.cs:70

Member Data Documentation

HashSet<Expression> Deveel.Data.Linq.Evaluator.SubtreeEvaluator.candidates
private

Definition at line 50 of file Evaluator.cs.


The documentation for this class was generated from the following file: