1 #ifndef MATCHOPERATION_H
2 #define MATCHOPERATION_H
16 typedef std::map<std::string,SgNode*> SingleMatchVarBindings;
18 typedef std::list<SingleMatchMarkedLocation> SingleMatchMarkedLocations;
19 typedef std::list<SingleMatchVarBindings> MatchResult;
24 SingleMatchVarBindings singleMatchVarBindings;
25 SingleMatchMarkedLocations singleMatchMarkedLocations;
34 resetAllMatchVarBindings();
35 resetAllMarkedLocations();
38 delete _allMatchVarBindings;
40 enum PatternMatchMode {MATCHMODE_SHALLOW, MATCHMODE_DEEP, MATCHMODE_SINGLE};
41 enum CheckNodeMode {NODECHECKMODE_TYPEID,NODECHECKMODE_VARIANT};
43 void resetAllMatchVarBindings();
44 void resetAllMarkedLocations();
49 std::list<SingleMatchVarBindings>* _allMatchVarBindings;
50 SingleMatchMarkedLocations _allMatchMarkedLocations;
53 void addVarBinding(std::string varname,
SgNode* node);
59 void commitSingleMatchResult();
62 #if 0 // [Robb Matzke 2021-03-17]: unused
63 bool _keepMarkedLocations;
69 virtual std::string toString()=0;
76 std::string toString();
83 std::string toString();
93 std::string toString();
102 std::string toString();
105 std::string _nodename;
111 std::string toString();
114 std::string _nodenameset;
121 std::string toString();
141 std::string toString();
148 std::string toString();
156 std::string toString();
164 std::string toString();
172 std::string toString();
177 typedef std::list<MatchOperationList*> MatchOperationListList;
185 #if 0 // [Robb Matzke 2021-03-17]: unused
189 std::string toString() {
return "binop()";}
193 case C_NEQ:
return _left->performOperation(status,i,vb) != _right->performOperation(status,i,vb);
194 case C_EQ:
return _left->performOperation(status,i,vb) == _right->performOperation(status,i,vb);
196 default:
throw "Error: unknown operation in where-expression.";
201 #if 0 // [Robb Matzke 2021-03-17]: unused
210 std::string toString() {
return "not-implemented-yet";}
215 std::string toString() {
return "not-implemented-yet";}
222 std::string toString() {
return "not-implemented-yet";}
227 std::string toString() {
return "not-implemented-yet";}
232 std::string toString() {
return "not-implemented-yet";}