コード例 #1
0
double CParseTreeNode::EvaluateSibbling(
  TPParseTreeNode first_second_or_third_sibbling, bool log) {
  // We allow NULL-nodes here, because that can happen 
  // after the end of a sequence of when-conditions
  if (first_second_or_third_sibbling == NULL) {
    return kUndefinedZero;
  }
  double result = first_second_or_third_sibbling->Evaluate(log);
  return result;
}
コード例 #2
0
double CParseTreeOperatorNode::EvaluateSibbling(
  TPParseTreeNode first_second_or_third_sibbling, bool log) {
  // We allow NULL-nodes here, because that can happen 
  // after the end of a sequence of when-conditions
  if (first_second_or_third_sibbling == NULL) {
    // When evaluating an empty tree we evaluate a special symbol
    // kEmptyxpression_False_Zero_WhenOthersFoldForce
    // for better readability of the log-file.
    double null_value = CParseTreeTerminalNodeIdentifier::EvaluateIdentifier(
      kEmptyExpression_False_Zero_WhenOthersFoldForce, log);
		write_log(preferences.debug_formula(), 
      "[CParseTreeOperatorNode] Evaluating empty tree: false / zero / fold\n");
    assert(null_value == kUndefinedZero);
    return null_value;
  }
  double result = first_second_or_third_sibbling->Evaluate(log);
  return result;
}