20 #ifndef _SWITCHPARSERS_HXX_
21 #define _SWITCHPARSERS_HXX_
59 virtual void id (
const int&
n);
73 virtual std::pair<int,ENGINE::Node*>
post();
93 virtual void case_ (
const std::pair<int,ENGINE::Node*>&
p);
94 virtual void default_ (
const std::pair<int,ENGINE::Node*>&
p);
95 virtual void name (
const std::string&
name);
97 virtual void select (
const int& s);
111 static std::string
switch_t3[]={
"inline",
"sinline",
"service",
"server",
"remote",
"node",
"forloop",
"foreach",
"optimizer",
"while",
"switch",
"bloc",
""};
118 for (
int i = 0; attr[
i];
i += 2)
120 if(std::string(attr[
i]) ==
"id")
id(atoi(attr[i+1]));
135 std::stringstream temp;
136 if (
_id <0) temp <<
"m" << -
_id <<
"_";
137 else temp <<
"p" << _id <<
"_";
138 std::string fullname=currentProc->
names.back()+temp.str();
139 DEBTRACE(
"case_fullname: " << fullname )
140 currentProc->
names.push_back(fullname);
149 std::string fullname=currentProc->
names.back()+ n->
getName();
156 std::string fullname=currentProc->
names.back()+ n->
getName();
163 std::string fullname=currentProc->
names.back()+ n->
getName();
170 std::string fullname=currentProc->
names.back()+ n->
getName();
177 std::string fullname=currentProc->
names.back()+ n->
getName();
184 std::string fullname=currentProc->
names.back()+ n->
getName();
191 std::string fullname=currentProc->
names.back()+ n->
getName();
197 std::string fullname=currentProc->
names.back()+ n->
getName();
199 fullname +=
".splitter";
205 std::string fullname=currentProc->
names.back()+ n->
getName();
213 std::string fullname=currentProc->
names.back()+ n->
getName();
219 std::string fullname=currentProc->
names.back()+ n->
getName();
225 std::string fullname=currentProc->
names.back()+ n->
getName();
236 currentProc->
names.pop_back();
237 return std::pair<int,ENGINE::Node*>(
_id,
_cnode);
244 for (
int i = 0; attr[
i];
i += 2)
256 std::string fullname=currentProc->
names.back()+
"default_";
257 DEBTRACE(
"case_fullname: " << fullname )
258 currentProc->
names.push_back(fullname);
266 for (
int i = 0; attr[
i];
i += 2)
268 if(std::string(attr[
i]) ==
"name")
name(attr[i+1]);
269 if(std::string(attr[i]) ==
"state")
state(attr[i+1]);
270 if(std::string(attr[i]) ==
"select")
select(atoi(attr[i+1]));
287 std::string fullname=currentProc->
names.back()+
name;
288 DEBTRACE(
"switch_fullname: " << fullname )
291 currentProc->
names.push_back(fullname+
'.');
317 currentProc->
names.pop_back();
323 DEBTRACE(
"switchtypeParser::onStart: " << el )
324 std::string element(el);
325 this->
maxcount(
"default",1,element);
337 DEBTRACE(
"switchtypeParser::onEnd: " << el )
338 std::string element(el);
345 DEBTRACE(
"casetypeParser::onStart: " << el )
346 std::string element(el);
348 this->
maxcount(
"sinline",1,element);
349 this->
maxcount(
"service",1,element);
353 this->
maxcount(
"forloop",1,element);
354 this->
maxcount(
"foreach",1,element);
355 this->
maxcount(
"optimizer",1,element);
382 DEBTRACE(
"casetypeParser::onEnd: " << el )
383 std::string element(el);