27 static char rcsid[]
not_used = {
"$Id: ConstraintEvaluator.cc 25915 2012-10-24 00:14:58Z jimg $" };
44 struct yy_buffer_state;
63 for (
Constants_iter j = constants.begin(); j != constants.end(); j++) {
69 for (
Clause_iter k = expr.begin(); k != expr.end(); k++) {
94 throw InternalErr(__FILE__, __LINE__,
"There are no CE clauses for *this* DDS object.");
96 return (*iter)->value(dds);
115 expr.push_back(clause);
131 expr.push_back(clause);
147 expr.push_back(clause);
159 constants.push_back(btp);
167 func_name_is(
const string &name) :
171 bool operator()(
const ConstraintEvaluator::function f)
173 return f.name == d_name;
200 function func(name, f);
201 functions.push_back(func);
208 function func(name, f);
209 functions.push_back(func);
216 function func(name, f);
217 functions.push_back(func);
223 if (functions.empty())
226 for (
Functions_citer i = functions.begin(); i != functions.end(); i++) {
227 if (name == (*i).name && (*f = (*i).b_func)) {
238 if (functions.empty())
241 for (
Functions_citer i = functions.begin(); i != functions.end(); i++) {
242 if (name == (*i).name && (*f = (*i).bt_func)) {
253 if (functions.empty())
257 if (name == (*i).name && (*f = (*i).p_func)) {
288 if (expr.size() != 1)
289 throw InternalErr(__FILE__, __LINE__,
"The length of the list of CE clauses is not 1.");
293 if (cp->
value(dds, &result))
313 for (
unsigned int i = 0; i < expr.size(); ++i) {
341 throw InternalErr(__FILE__, __LINE__,
"The constraint expression is empty.");
344 for (
unsigned int i = 0; i < expr.size(); ++i) {
347 if (cp->
value(dds, &result)) {
350 DBG(cerr <<
"In CE 1 Grid send_p: " << result->
send_p() << endl);
351 DBG(cerr <<
"In CE 1 Grid Array send_p: " << static_cast<Grid*>(result)->get_array()->send_p() << endl);
356 throw Error(
"A function was called but failed to return a value.");
381 throw InternalErr(__FILE__, __LINE__,
"The constraint expression is empty.");
386 for (
unsigned int i = 0; i < expr.size(); ++i) {
389 if (cp->
value(dds, &result)) {
391 DBG(cerr <<
"In CE 2 Grid send_p: " << result->
send_p() << endl);
392 DBG(cerr <<
"In CE 2 Grid Array send_p: " << static_cast<Grid*>(result)->get_array()->send_p() << endl);
398 throw Error(
"A function was called but failed to return a value.");
412 for (
Clause_iter i = expr.begin(); i != expr.end(); i++) {
413 boolean =
boolean && (*i)->boolean_clause();
429 DBG(cerr <<
"No selection recorded" << endl);
433 DBG(cerr <<
"Eval selection" << endl);
440 for (
Clause_iter i = expr.begin(); i != expr.end() && result; i++) {
442 if (!((*i)->boolean_clause()))
443 throw InternalErr(__FILE__, __LINE__,
"A selection expression must contain only boolean clauses.");
444 result = result && (*i)->value(dds);