use of org.eclipse.titan.designer.AST.TTCN3.values.Omit_Value in project titan.EclipsePlug-ins by eclipse.
the class Integer_Type method checkThisValueLimit.
/**
* Checks if a given value is a valid integer limit.
* <p>
* The special float values infinity and -infinity are valid integer range limits too.
*
* @param timestamp the time stamp of the actual semantic check cycle.
* @param value the value to be checked
* @param expectedValue the kind of the value to be expected
* @param incompleteAllowed true if an incomplete value can be accepted at the given location, false otherwise
* @param omitAllowed true if the omit value can be accepted at the given location, false otherwise
* @param subCheck true if the subtypes should also be checked.
* @param implicitOmit true if the implicit omit optional attribute was set for the value, false otherwise
*/
public void checkThisValueLimit(final CompilationTimeStamp timestamp, final IValue value, final Expected_Value_type expectedValue, final boolean incompleteAllowed, final boolean omitAllowed, final boolean subCheck, final boolean implicitOmit) {
super.checkThisValue(timestamp, value, null, new ValueCheckingOptions(expectedValue, incompleteAllowed, omitAllowed, subCheck, implicitOmit, false));
final IValue last = value.getValueRefdLast(timestamp, expectedValue, null);
if (last == null || last.getIsErroneous(timestamp)) {
return;
}
// already handled ones
switch(value.getValuetype()) {
case OMIT_VALUE:
case REFERENCED_VALUE:
return;
case UNDEFINED_LOWERIDENTIFIER_VALUE:
if (Value_type.REFERENCED_VALUE.equals(last.getValuetype())) {
return;
}
break;
default:
break;
}
switch(last.getValuetype()) {
case INTEGER_VALUE:
break;
case REAL_VALUE:
{
final Real_Value real = (Real_Value) last;
if (!real.isNegativeInfinity() && !real.isPositiveInfinity()) {
value.getLocation().reportSemanticError(INTEGERVALUEEXPECTED);
value.setIsErroneous(true);
}
break;
}
case EXPRESSION_VALUE:
case MACRO_VALUE:
// already checked
break;
default:
value.getLocation().reportSemanticError(INTEGERVALUEEXPECTED);
value.setIsErroneous(true);
}
if (subCheck) {
// there is no parent type to check
if (subType != null) {
subType.checkThisValue(timestamp, last);
}
}
}
Aggregations