本文整理汇总了C++中parser::execute方法的典型用法代码示例。如果您正苦于以下问题:C++ parser::execute方法的具体用法?C++ parser::execute怎么用?C++ parser::execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parser
的用法示例。
在下文中一共展示了parser::execute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
stat_t
Inject(Task* t, UInt type, UInt freq)
{
stat_t ret;
instruction_handler* generator;
_scanner.initialize(reinterpret_cast<char*>(t->text.StartAddress()),
reinterpret_cast<char*>(t->text.EndAddress()));
_parser.initialize();
switch (type) {
case FI_NULL:
generator = new fi_null(_scanner);
break;
case FI_ASSIGN:
// 1. Corrupt assignment statements
generator = new fi_assignment(_scanner);
break;
case FI_COND:
// 2. Corrupt conditional constructs
generator = new fi_conditional(_scanner);
break;
case FI_INIT:
// 3. Initialization fault
generator = new fi_initialization(_scanner);
break;
case FI_POINTER:
// 4. Pointer corruption
generator = new fi_pointer(_scanner);
break;
case FI_ALLOC:
// 5. Allocation management
generator = new fi_null(_scanner);
break;
case FI_COPY:
// 6. Copy overrun
generator = new fi_null(_scanner);
break;
case FI_OFFBYONE:
// 7. Off-by-one
generator = new fi_offbyone(_scanner);
break;
case FI_RAND:
// 8. Random deletion
//generator = new fi_random(freq);
generator = new fi_null(_scanner);
break;
/*
case FI_SYNC:
// Synchronization
generator = new fi_null(_scanner);
break;
*/
default:
return ERR_INVALID_ARGUMENTS;
}
if (_parser.execute(_scanner, generator, freq) < 0) {
ret = ERR_UNKNOWN;
}
else {
ret = ERR_NONE;
}
delete generator;
return ret;
}