Example #1
0
/** \brief Given a parsing table a \c pt and transition \c new_trans, if \c new_trans is a
    transition in \c pt, then return the successor table */
static optional<parse_table> find_match(optional<parse_table> const & pt, transition const & new_trans) {
    if (pt) {
        if (auto ls = pt->find(new_trans.get_token())) {
            for (auto at : ls) {
                if (new_trans.get_action().is_equal(at.first.get_action()))
                    return optional<parse_table>(at.second);
            }
        }
    }
    return optional<parse_table>();
}
Example #2
0
	SleepSet::SleepSet(const SleepSet& previous, const transition& t, const Dependence& D)
	: mSleep(previous.mSleep)
	{
		DEBUGF("\t\t\tSleepSet", "propagate_and_wake_up", to_short_string(t), "");
		DEBUG("mSleep = " << previous << " \\ { ");
		wake_up(
			t.instr(),
			t.post(),
			[] (const auto& pool, const auto& asleep) {
				return pool.next(*asleep)->second.instr; },
			D
		);
		DEBUG("} = " << mSleep << "\n");
	}
Example #3
0
transition replace(transition const & t, std::function<expr(expr const &)> const & f) {
    return transition(t.get_token(), replace(t.get_action(), f));
}