1 #ifndef _EXT_GRS_MATCHPLAN_T_H_
2 #define _EXT_GRS_MATCHPLAN_T_H_
5 * Project: libFIRM/extension module/GRS-matcher
6 * File name: ext/grs/plan_t.h
7 * Purpose: provides an interface for search planers planing
8 * the matching process with respect to information
9 * provided by appropriate analyzers
11 * Created: 7. July 2005
13 * Copyright: (c) 2005 Universität Karlsruhe
14 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
18 #include "analyze_t.h"
19 #include "matchplan.h"
24 ext_grs_k_mop_condition,
26 ext_grs_k_mop_preset_edge
30 /** tells wether this op matches a node or an edge */
31 ext_grs_mop_kind_t kind;
32 /** if this match op matches an edge, then this is the respective pattern edge */
34 /** if this match op matches a node, then this is the respective pattern node,
35 * if this op matches an edge, then this node is the pattern node where the
36 * edge is retrieved from */
38 /** a condition to be checked by this matching op */
39 ext_grs_condition_func_t condition;
40 /** an op condition to be checked by this matching op (for node-ops only) */
41 ext_grs_op_condition_func_t op_condition;
42 /** a mode condition to be checked by this matching op (for node-ops only) */
43 ext_grs_mode_condition_func_t mode_condition;
46 /** a plan the matching process will follow */
47 struct _ext_grs_match_plan_t {
48 /** the action this matching plan belongs to */
49 ext_grs_action_t *action;
50 /** the number of matching ops of this search plan */
54 /** a sequence (array) of match ops (i.e. the matching 'program') */
55 /* Contains pointers to all search plans (positive and negative) */
56 ext_grs_match_op_t **progs;
57 /* Just for "backward compatibility:
58 Contains pointer to the positive search plan */
59 ext_grs_match_op_t *prog;
62 /** a planer fir the creation of matching plans */
63 struct _ext_grs_planer_t {
64 /** a tag identifying a planer */
66 /** this planers analyzer */
67 ext_grs_analyzer_t *analyzer;
69 /** initialize this planer */
70 void (*init) (struct _ext_grs_planer_t *, ext_grs_analyzer_t *);
71 /** compute a match plan according to analysis data of a given ir graph */
72 ext_grs_match_plan_t * (*compute_plan)
73 (struct _ext_grs_planer_t *, ir_graph *, ext_grs_action_t *);
74 /** compute a match plan according to analysis data of all ir graphs */
75 ext_grs_match_plan_t * (*ext_grs_compute_plan_global)
76 (struct _ext_grs_planer_t *, ext_grs_action_t *);
78 /** this planers private data area */
84 #endif /*_EXT_GRS_MATCHPLAN_T_H_*/