28 {
"$Id: ConstraintEvaluator.cc 24370 2011-03-28 16:21:32Z jimg $"
38 struct yy_buffer_state;
57 for (
Constants_iter j = constants.begin(); j != constants.end(); j++) {
62 for (
Clause_iter k = expr.begin(); k != expr.end(); k++) {
90 "There are no CE clauses for *this* DDS object.");
92 return (*iter)->value(dds);
112 expr.push_back(clause);
129 expr.push_back(clause);
146 expr.push_back(clause);
159 constants.push_back(btp);
168 func_name_is(
const string &name): d_name(name)
170 bool operator()(
const ConstraintEvaluator::function f)
172 return f.name == d_name;
200 function func(name, f);
201 functions.push_back(func);
209 function func(name, f);
210 functions.push_back(func);
218 function func(name, f);
219 functions.push_back(func);
226 if (functions.empty())
229 for (
Functions_citer i = functions.begin(); i != functions.end(); i++) {
230 if (name == (*i).name && (*f = (*i).b_func)) {
242 if (functions.empty())
245 for (
Functions_citer i = functions.begin(); i != functions.end(); i++) {
246 if (name == (*i).name && (*f = (*i).bt_func)) {
258 if (functions.empty())
262 if (name == (*i).name && (*f = (*i).p_func)) {
290 if (expr.size() != 1)
292 "The length of the list of CE clauses is not 1.");
296 if (cp->
value(dds, &result))
316 for (
unsigned int i = 0; i < expr.size(); ++i) {
344 throw InternalErr(__FILE__, __LINE__,
"The constraint expression is empty.");
347 for (
unsigned int i = 0; i < expr.size(); ++i) {
350 if (cp->
value(dds, &result)) {
356 throw Error(
"A function was called but failed to return a value.");
372 throw InternalErr(__FILE__, __LINE__,
"The constraint expression is empty.");
378 for (
unsigned int i = 0; i < expr.size(); ++i) {
381 if (cp->
value(dds, &result)) {
387 throw Error(
"A function was called but failed to return a value.");
402 for (
Clause_iter i = expr.begin(); i != expr.end(); i++) {
403 boolean =
boolean && (*i)->boolean_clause();
421 DBG(cerr <<
"No selection recorded" << endl);
425 DBG(cerr <<
"Eval selection" << endl);
432 for (
Clause_iter i = expr.begin(); i != expr.end() && result; i++) {
434 if (!((*i)->boolean_clause()))
436 "A selection expression must contain only boolean clauses.");
437 result = result && (*i)->value(dds);