当前位置: 首页>>代码示例>>C++>>正文


C++ StatementList::end方法代码示例

本文整理汇总了C++中StatementList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ StatementList::end方法的具体用法?C++ StatementList::end怎么用?C++ StatementList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StatementList的用法示例。


在下文中一共展示了StatementList::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: makeIsect

void StatementList::makeIsect(StatementList &a, LocationSet &b)
{
    if (this == &a) { // *this = *this isect b
        for (auto it = a.begin(); it != a.end();) {
            assert((*it)->isAssignment());
            Assignment *as = static_cast<Assignment *>(*it);

            if (!b.contains(as->getLeft())) {
                it = m_list.erase(it);
            }
            else {
                it++;
            }
        }
    }
    else { // normal assignment
        clear();
        for (Statement *stmt : a) {
            assert(stmt->isAssignment());
            Assignment *as = static_cast<Assignment *>(stmt);

            if (b.contains(as->getLeft())) {
                append(as);
            }
        }
    }
}
开发者ID:nemerle,项目名称:boomerang,代码行数:27,代码来源:StatementList.cpp

示例2: removeRedundantBlocks

 void removeRedundantBlocks(BlockPtr b) {
     StatementList& children = b->getChildren();
     for (size_t i = 0; i < children.size(); ++i) {
         if (REN_DYNAMIC_CAST_PTR(ib, Block, children[i])) {
             removeRedundantBlocks(ib);
             StatementList sl = ib->getChildren();
             children.erase(children.begin() + i);
             children.insert(children.begin() + i, sl.begin(), sl.end());
             --i;
         }
     }
 }
开发者ID:chadaustin,项目名称:renaissance,代码行数:12,代码来源:GLSLShader.cpp

示例3: append

void StatementList::append(const StatementList &sl)
{
    if (&sl == this) {
        const size_t oldSize = m_list.size();
        auto it              = m_list.begin();
        for (size_t i = 0; i < oldSize; i++) {
            m_list.push_back(*it++);
        }
    }
    else {
        m_list.insert(end(), sl.begin(), sl.end());
    }
}
开发者ID:nemerle,项目名称:boomerang,代码行数:13,代码来源:StatementList.cpp

示例4: miniDebugger

void MiniDebugger::miniDebugger(UserProc *proc, const char *description)
{
    OStream q_cout(stdout);
    QTextStream q_cin(stdin);

    q_cout << "decompiling " << proc->getName() << ": " << description << "\n";
    QString stopAt;

    if (stopAt.isEmpty() || !proc->getName().compare(stopAt)) {
        // This is a mini command line debugger.  Feel free to expand it.
        for (const Statement *stmt : watches) {
            stmt->print(q_cout);
            q_cout << "\n";
        }

        q_cout << " <press enter to continue> \n";
        QString line;

        while (true) {
            line.clear();
            q_cin >> line;

            if (line.startsWith("print")) {
                proc->print(q_cout);
            }
            else if (line.startsWith("fprint")) {
                QFile tgt("out.proc");

                if (tgt.open(QFile::WriteOnly)) {
                    OStream of(&tgt);
                    proc->print(of);
                }
            }
            else if (line.startsWith("run ")) {
                QStringList parts = line.trimmed().split(" ", QString::SkipEmptyParts);

                if (parts.size() > 1) {
                    stopAt = parts[1];
                }

                break;
            }
            else if (line.startsWith("watch ")) {
                QStringList parts = line.trimmed().split(" ", QString::SkipEmptyParts);

                if (parts.size() > 1) {
                    int n = parts[1].toInt();
                    StatementList stmts;
                    proc->getStatements(stmts);
                    StatementList::iterator it;

                    for (it = stmts.begin(); it != stmts.end(); ++it) {
                        if ((*it)->getNumber() == n) {
                            watches.insert(*it);
                            q_cout << "watching " << *it << "\n";
                        }
                    }
                }
            }
            else {
                break;
            }
        }
    }
}
开发者ID:nemerle,项目名称:boomerang,代码行数:65,代码来源:MiniDebugger.cpp


注:本文中的StatementList::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。