00001 #ifndef _RTREENAMEDCONTEXTRULE_H_ 00002 #define _RTREENAMEDCONTEXTRULE_H_ 00003 00004 #include "rtreecontextrule.h" 00005 #include "streevariable.h" 00006 00008 class NamedContextRule : public Rule{ 00009 00010 private: 00012 const string name; 00014 RunRuleList &runRuleList; 00015 00017 List* phpInPattern; 00019 List* phpOutPattern; 00021 Variable* namePattern; 00023 Variable* argumentsPattern; 00025 Variable* contextPattern; 00026 00027 public: 00029 NamedContextRule(Constant* iname, RunRuleList &irunRuleList, List* iphpInPattern, List* iphpOutPattern, 00030 Variable* inamePattern, Variable* iargumentsPattern, Variable* icontextPattern); 00031 00032 virtual ~NamedContextRule(); 00033 00034 virtual bool execute(RuleContext* context, List* phpIn, List* phpOut, List* tplOut, Node::Assignment& assign) const; 00035 00037 void runRules(NameSpace &subNameSpace, Node* phpContextMatched, StatementList* phpContextOut, 00038 StatementList* tplContextOut, Node::Assignment& assign) const; 00039 00040 virtual Rule* copy(); 00041 00042 virtual Rule* substitute(const Node::Assignment &assign); 00043 00044 virtual ostream& print(ostream& os) const; 00045 }; 00046 00047 00048 #endif