예제 #1
0
파일: star.c 프로젝트: jsyk/snet-rts
static bool MatchesExitPattern( snet_record_t *rec,
    snet_variant_list_t *exit_patterns, snet_expr_list_t *guards)
{
  int i;
  snet_variant_t *pattern;

  LIST_ENUMERATE(exit_patterns, i, pattern) {
    if (SNetRecPatternMatches(pattern, rec) &&
        SNetEevaluateBool( SNetExprListGet( guards, i), rec)) {
      return true;
    }
  }

  return false;
}
예제 #2
0
/* Helper function for the feedback-dispatcher
 * - copied from star.c
 */
static bool MatchesBackPattern( snet_record_t *rec,
    snet_variant_list_t *back_patterns, snet_expr_list_t *guards)
{
  snet_expr_t *expr;
  snet_variant_t *pattern;

  LIST_ZIP_EACH(guards, back_patterns, expr, pattern) {
    if (SNetEevaluateBool( expr, rec) &&
        SNetRecPatternMatches(pattern, rec)) {
      return true;
    }
  }

  return false;
}