Esempio n. 1
0
void Constants::import_constants(const Constants& c, OperationTree& otree, Tintintmap& tmap)
{
	for (Tconstantmap::const_iterator it = c.cmap.begin();
		 it != c.cmap.end(); ++it) {
		int told = (*it).first;
		int tnew = otree.add_nulary();
		tmap.insert(Tintintmap::value_type(told, tnew));
		add_constant(tnew, (*it).second);
	}
}
Esempio n. 2
0
void StaticAtoms::import_atoms(const DynamicAtoms& da, OperationTree& otree, Tintintmap& tmap)
{
	Constants::import_constants(da, otree, tmap);

	for (int i = 0; i < da.get_name_storage().num(); i++) {
		const char* name = da.get_name_storage().get_name(i);
		register_name(name);
		int tnew = otree.add_nulary();
		assign(name, tnew);
		try {
			const DynamicAtoms::Tlagmap& lmap = da.lagmap(name);
			for (DynamicAtoms::Tlagmap::const_iterator it = lmap.begin();
				 it != lmap.end(); ++it) {
				int told = (*it).second;
				tmap.insert(Tintintmap::value_type(told, tnew));
			}
		} catch (const ogu::Exception& e) {
		}
	}
}