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

Performs bottom-up analysis to determine which nodes can possibly be part of an evaluated sub-tree. More...

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

Public Member Functions

override Expression Visit (Expression expression)
 

Package Functions

 Nominator (Func< Expression, bool > fnCanBeEvaluated)
 
HashSet< Expression > Nominate (Expression expression)
 

Private Attributes

Func< Expression, bool > fnCanBeEvaluated
 
HashSet< Expression > candidates
 
bool cannotBeEvaluated
 

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

Performs bottom-up analysis to determine which nodes can possibly be part of an evaluated sub-tree.

Definition at line 84 of file Evaluator.cs.

Constructor & Destructor Documentation

Deveel.Data.Linq.Evaluator.Nominator.Nominator ( Func< Expression, bool >  fnCanBeEvaluated)
inlinepackage

Definition at line 89 of file Evaluator.cs.

89  {
91  }
Func< Expression, bool > fnCanBeEvaluated
Definition: Evaluator.cs:85

Member Function Documentation

HashSet<Expression> Deveel.Data.Linq.Evaluator.Nominator.Nominate ( Expression  expression)
inlinepackage

Definition at line 93 of file Evaluator.cs.

93  {
94  this.candidates = new HashSet<Expression>();
95  this.Visit(expression);
96  return this.candidates;
97  }
override Expression Visit(Expression expression)
Definition: Evaluator.cs:99
HashSet< Expression > candidates
Definition: Evaluator.cs:86
override Expression Deveel.Data.Linq.Evaluator.Nominator.Visit ( Expression  expression)
inlinevirtual

Reimplemented from Deveel.Data.Linq.ExpressionVisitor.

Definition at line 99 of file Evaluator.cs.

99  {
100  if (expression != null) {
101  bool saveCannotBeEvaluated = this.cannotBeEvaluated;
102  this.cannotBeEvaluated = false;
103  base.Visit(expression);
104  if (!this.cannotBeEvaluated) {
105  if (this.fnCanBeEvaluated(expression)) {
106  this.candidates.Add(expression);
107  } else {
108  this.cannotBeEvaluated = true;
109  }
110  }
111  this.cannotBeEvaluated |= saveCannotBeEvaluated;
112  }
113  return expression;
114  }
Func< Expression, bool > fnCanBeEvaluated
Definition: Evaluator.cs:85
HashSet< Expression > candidates
Definition: Evaluator.cs:86

Member Data Documentation

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

Definition at line 86 of file Evaluator.cs.

bool Deveel.Data.Linq.Evaluator.Nominator.cannotBeEvaluated
private

Definition at line 87 of file Evaluator.cs.

Func<Expression, bool> Deveel.Data.Linq.Evaluator.Nominator.fnCanBeEvaluated
private

Definition at line 85 of file Evaluator.cs.


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