49 (
"LHS",
"left-hand side");
51 (
"RHS",
"right-hand side");
53 (
"WGT",
"the weight(s) for this constraint");
81 std::cerr <<
"\n 1 constraint has been added.\n" <<
std::endl;
90 itsAttr[LHS].parse(stat,
false);
100 "Expected relational operator: "
101 "\"==\", \">\", or \"<\".");
104 itsAttr[RHS].parse(stat,
false);
112 itsAttr[WGT].parse(stat,
true);
115 "The delimiter \":=\" is not allowed here.");
118 "The attribute \"WGT\" has no default.");
122 "Object \"CONSTRAINT\" has no attribute \"" +
131 if(parent != 0 && ! parent->
getOpalName().empty()) {
137 << ((
relation == 0) ?
"==" : ((relation > 0) ?
">" :
"<"))
145 os <<
"\nThe \"CONSTRAINT\" sub-command defines a constraint.\n"
146 <<
"Its format is:\n"
147 <<
"\tCONSTRAINT,<lhs><relop><rhs>,W=<wgt>"
148 <<
"where <lhs>, <rhs>, and <wgt> are array expressions,"
149 <<
"and <relop> is one of \"<\", \"==\", or \">\"." <<
std::endl;
virtual void print(std::ostream &) const
Print the command.
The base class for all OPAL actions.
virtual ConstraintCmd * clone(const std::string &name)
Make clone.
Object * getParent() const
Return parent pointer.
static Match * block
The block of match data.
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
A single matching constraints or an array of matching constraints.
void parseDelimiter(Statement &stat, char delim)
Test for one-character delimiter.
const std::string & getOpalName() const
Return object name.
virtual void parse(Statement &)
Parse the command.
Interface for statements.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
void addFunction(AbstractFun *)
Add a set of matching function(s).
ConstraintCmd()
Exemplar constructor.
virtual void printHelp(std::ostream &) const
Print help for the command.
The base class for all OPAL objects.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
virtual void execute()
Execute the command.
std::string parseString(Statement &, const char msg[])
Parse string value.
bool delimiter(char c)
Test for delimiter.
Inform & endl(Inform &inf)