private TypeExprBooleanSet<IdentifierType, TType> checkTypeExprBooleanSet(
final TypeExprBooleanSet<IdentifierType, Untyped> e)
throws JPRACompilerCheckerException
{
final SizeExprType<IdentifierType, TType> size_expr =
this.checkSizeExpr(e.getSizeExpression());
final Size<SizeUnitOctetsType> size_octets = this.evaluateSize(size_expr);
if (!JPRAChecker.BOOLEAN_SET_SIZES.includesValue(size_octets.getValue())) {
throw JPRACompilerCheckerException.booleanSetSizeInvalid(
e, JPRAChecker.BOOLEAN_SET_SIZES, size_octets.getValue());
}
final BigInteger required =
BigInteger.valueOf((long) e.getFieldsInDeclarationOrder().size());
final Size<SizeUnitBitsType> bits = Size.toBits(size_octets);
if (bits.getValue().compareTo(required) < 0) {
throw JPRACompilerCheckerException.booleanSetSizeLessThanRequired(
e, required, bits.getValue());
}
final TBooleanSet type = new TBooleanSet(
e.getLexicalInformation(), e.getFieldsInDeclarationOrder(), size_octets);
return new TypeExprBooleanSet<>(
type,
e.getLexicalInformation(),
e.getFieldsInDeclarationOrder(),
size_expr);
}