Exemplo n.º 1
0
 /// <summary>
 /// Accepts a visitor evaluating the numeric expression.
 /// </summary>
 /// <param name="visitor">Evaluation visitor.</param>
 /// <returns>Result value of the numeric expression.</returns>
 public double Accept(INumericExpressionEvaluationVisitor visitor)
 {
     return(LeftChild.Accept(visitor) - RightChild.Accept(visitor));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Accepts a generic numeric expression visitor.
 /// </summary>
 /// <param name="visitor">Visitor.</param>
 public void Accept(INumericExpressionVisitor visitor)
 {
     LeftChild.Accept(visitor);
     RightChild.Accept(visitor);
     visitor.PostVisit(this);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Accepts a visitor evaluating the logical expression.
 /// </summary>
 /// <param name="visitor">Evaluation visitor.</param>
 /// <returns>True if the expression is logically true. False otherwise.</returns>
 public bool Accept(IExpressionEvalVisitor visitor)
 {
     // (a imply b) ~ (not(a) or b)
     return(!LeftChild.Accept(visitor) || RightChild.Accept(visitor));
 }