throw new IllegalActionException("Operation "
+ node.getOperator().image + " not defined on " + result
+ " which does not support bitwise operations.");
}
BitwiseOperationToken bitwiseResult = (BitwiseOperationToken) result;
// Make sure that exactly one of AND, OR, XOR is set.
_assert(node.isBitwiseAnd() ^ node.isBitwiseOr() ^ node.isBitwiseXor(),
node, "Invalid operation");
for (int i = 1; i < numChildren; i++) {
ptolemy.data.Token nextToken = tokens[i];
if (!(nextToken instanceof BitwiseOperationToken)) {
throw new IllegalActionException("Operation "
+ node.getOperator().image + " not defined on "
+ result
+ " which does not support bitwise operations.");
}
if (node.isBitwiseAnd()) {
bitwiseResult = bitwiseResult.bitwiseAnd(nextToken);
} else if (node.isBitwiseOr()) {
bitwiseResult = bitwiseResult.bitwiseOr(nextToken);
} else {
bitwiseResult = bitwiseResult.bitwiseXor(nextToken);
}
}
_evaluatedChildToken = ((ptolemy.data.Token) bitwiseResult);