3 * Project: libFIRM/extension module/GRS-matcher
4 * File name: ext/grs/plan.h
5 * Purpose: provides an interface for search planers planing
6 * the matching process with respect to information
7 * provided by appropriate analyzers
9 * Modified by: Andreas Schoesser
10 * Created: 16. August 2005
12 * Copyright: (c) 2005 Universität Karlsruhe
13 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
18 #include "matchplan_t.h"
21 /**dump a search plans to stdout */
22 void ext_grs_dump_match_plan(ext_grs_match_plan_t *plan) {
25 printf("\nA plan for action %s: \n", plan->action->name);
27 for(j = 0; j < plan->num_progs; j++)
30 printf("Positive plan:\n");
32 printf("NAC plan %d:\n", j - 1);
34 for (i = 0; i < plan->length[j]; i++) {
35 ext_grs_match_op_t *mop;
36 mop = & plan->progs[j][i];
39 case ext_grs_k_mop_node:
40 printf(" node(%s)\n", mop->node->name);
42 case ext_grs_k_mop_edge:
43 printf(" edge(%s, %s)\n", mop->node->name, mop->edge->name);
45 case ext_grs_k_mop_condition:
46 printf(" condition\n");
48 case ext_grs_k_mop_preset:
49 printf(" preset_node(%s)\n", mop->node->name);
51 case ext_grs_k_mop_preset_edge:
52 printf(" preset_edge(%s, %s)\n", mop->node->name, mop->edge->name);
55 printf(" invalid matcher op\n");
62 /** initialize a planer */
63 void ext_grs_init_planer(ext_grs_planer_t *planer, ext_grs_analyzer_t *alz) {
64 planer->init(planer, alz);
67 /** compute a match plan */
68 ext_grs_match_plan_t *ext_grs_compute_plan(
69 ext_grs_planer_t *planer, ir_graph *irg, ext_grs_action_t *act)
71 return planer->compute_plan(planer, irg, act);