本文整理汇总了C++中FunctionDefinition::addAction方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionDefinition::addAction方法的具体用法?C++ FunctionDefinition::addAction怎么用?C++ FunctionDefinition::addAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionDefinition
的用法示例。
在下文中一共展示了FunctionDefinition::addAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: configureRuleForFunction
FunctionDefinition* configureRuleForFunction(Parser* pParser, Repository* pRepo)
{
FunctionDefinition* pFunctionDefinition = new FunctionDefinition();
PushFunction* pPushFunction = new PushFunction(pRepo);
AddFunctionNode* pAddFunctionNode = new AddFunctionNode(pRepo);
pFunctionDefinition->addAction(pPushFunction);
pFunctionDefinition->addAction(pAddFunctionNode);
pParser->addRule(pFunctionDefinition);
return pFunctionDefinition;
}
示例2: main
int main(int argc, char* argv[])
{
std::cout << "\n Testing ActionsAndRules class\n "
<< std::string(30,'=') << std::endl;
try
{
//std::queue<std::string> resultsQ;
PrintPreproc pp;
PreprocStatement pps;
pps.addAction(&pp);
FunctionDefinition fnd;
PrintFunction prt;
fnd.addAction(&prt);
Toker toker("../ActionsAndRules.h");
SemiExp se(&toker);
Parser parser(&se);
parser.addRule(&pps);
parser.addRule(&fnd);
while(se.get())
parser.parse();
std::cout << "\n\n";
}
catch(std::exception& ex)
{
std::cout << "\n\n " << ex.what() << "\n\n";
}
}
示例3: main
int main(int argc, char* argv[])
{
std::cout << "\n Testing ActionsAndRules class\n "
<< std::string(30,'=') << std::endl;
RelationshipAnal* p = new RelationshipAnal;
TypeAnal* q = new TypeAnal;
try
{
PrintPreproc pp;
PreprocStatement pps;
pps.addAction(&pp);
FunctionDefinition fnd;
PrintFunction prt;
fnd.addAction(&prt);
ClassStructEnumDefinition cls1;
std::vector<std::string> classResult;
PrintClass cls2(&classResult);
cls1.addAction(&cls2);
InheritanceDetection* cls3 = new InheritanceDetection;
InheritanceAction* cls4 = new InheritanceAction(q, p);
cls3->addAction(cls4);
Toker toker("../ActionsAndRules.h");
SemiExp se(&toker);
Parser parser(&se);
parser.addRule(&pps);
parser.addRule(&fnd);
parser.addRule(&cls1);
parser.addRule(cls3);
while(se.get())
parser.parse();
std::cout << "\n\n";
}
catch(std::exception& ex)
{
std::cout << "\n\n " << ex.what() << "\n\n";
}
}
示例4: main
int main(int argc, char* argv[])
{
std::cout << "\n Testing ActionsAndRules class\n "
<< std::string(30,'=') << std::endl;
try
{
std::queue<std::string> resultsQ;
PreprocToQ ppq(resultsQ);
//Modified Pallavi
PrintPreproc ppq;
PreprocStatement pps;
pps.addAction(&ppq);
FunctionDefinition fnd;
PrettyPrintToQ pprtQ(resultsQ);
//Modified Pallavi
PrettyPrintFunction pprtQ;
fnd.addAction(&pprtQ);
Toker toker("../ActionsAndRules.h");
SemiExp se(&toker);
Parser parser(&se);
parser.addRule(&pps);
parser.addRule(&fnd);
while(se.get())
parser.parse();
size_t len = resultsQ.size();
for(size_t i=0; i<len; ++i)
{
std::cout << "\n " << resultsQ.front().c_str();
resultsQ.pop();
}
std::cout << "\n\n";
}
catch(std::exception& ex)
{
std::cout << "\n\n " << ex.what() << "\n\n";
}
}
开发者ID:pallaviiyengar,项目名称:RemotePerformanceAssistant,代码行数:44,代码来源:127.0.0.1_8588_ActionsAndRules.cpp