use of org.eclipse.titan.designer.AST.IType.Type_type in project titan.EclipsePlug-ins by eclipse.
the class RotateRightExpression method isUnfoldable.
@Override
public /**
* {@inheritDoc}
*/
boolean isUnfoldable(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) {
if (value1 == null || value2 == null || getIsErroneous(timestamp)) {
return true;
}
if (value1.isUnfoldable(timestamp, expectedValue, referenceChain) || value2.isUnfoldable(timestamp, expectedValue, referenceChain)) {
return true;
}
value1.setLoweridToReference(timestamp);
final Type_type tempType = value1.getExpressionReturntype(timestamp, expectedValue);
switch(tempType) {
case TYPE_BITSTRING:
case TYPE_HEXSTRING:
case TYPE_OCTETSTRING:
case TYPE_CHARSTRING:
case TYPE_UCHARSTRING:
return false;
default:
return true;
}
}
use of org.eclipse.titan.designer.AST.IType.Type_type in project titan.EclipsePlug-ins by eclipse.
the class LessThanExpression method checkExpressionOperands.
/**
* Checks the parameters of the expression and if they are valid in
* their position in the expression or not.
*
* @param timestamp
* the timestamp of the actual semantic check cycle.
* @param expectedValue
* the kind of value expected.
* @param referenceChain
* a reference chain to detect cyclic references.
*/
private void checkExpressionOperands(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) {
if (value1 == null || value2 == null) {
return;
}
ExpressionUtilities.checkExpressionOperatorCompatibility(timestamp, this, referenceChain, expectedValue, value1, value2);
final IValue tempValue1 = value1.setLoweridToReference(timestamp);
final Type_type tempType1 = tempValue1.getExpressionReturntype(timestamp, expectedValue);
switch(tempType1) {
case TYPE_INTEGER:
case TYPE_REAL:
case TYPE_TTCN3_ENUMERATED:
tempValue1.getValueRefdLast(timestamp, expectedValue, referenceChain);
break;
case TYPE_UNDEFINED:
setIsErroneous(true);
break;
default:
tempValue1.getLocation().reportSemanticError(FIRSTOPERANDERROR);
setIsErroneous(true);
break;
}
final IValue tempValue2 = value2.setLoweridToReference(timestamp);
final Type_type tempType2 = tempValue2.getExpressionReturntype(timestamp, expectedValue);
switch(tempType2) {
case TYPE_INTEGER:
case TYPE_REAL:
case TYPE_TTCN3_ENUMERATED:
tempValue2.getValueRefdLast(timestamp, expectedValue, referenceChain);
break;
case TYPE_UNDEFINED:
setIsErroneous(true);
break;
default:
tempValue2.getLocation().reportSemanticError(SECONDOPERANDERROR);
setIsErroneous(true);
break;
}
}
use of org.eclipse.titan.designer.AST.IType.Type_type in project titan.EclipsePlug-ins by eclipse.
the class MultiplyExpression method getExpressionReturntype.
@Override
public /**
* {@inheritDoc}
*/
Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) {
if (value1 == null) {
return Type_type.TYPE_UNDEFINED;
}
value1.setLoweridToReference(timestamp);
final Type_type tempType = value1.getExpressionReturntype(timestamp, expectedValue);
switch(tempType) {
case TYPE_INTEGER:
case TYPE_REAL:
return tempType;
case TYPE_UNDEFINED:
return tempType;
default:
getValueRefdLast(timestamp, expectedValue, null);
setIsErroneous(true);
return Type_type.TYPE_UNDEFINED;
}
}
use of org.eclipse.titan.designer.AST.IType.Type_type in project titan.EclipsePlug-ins by eclipse.
the class Not4bExpression method checkExpressionOperands.
/**
* Checks the parameters of the expression and if they are valid in
* their position in the expression or not.
*
* @param timestamp
* the timestamp of the actual semantic check cycle.
* @param expectedValue
* the kind of value expected.
* @param referenceChain
* a reference chain to detect cyclic references.
*/
private void checkExpressionOperands(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) {
if (value == null) {
return;
}
value.setLoweridToReference(timestamp);
final Type_type temp = value.getExpressionReturntype(timestamp, expectedValue);
switch(temp) {
case TYPE_BITSTRING:
case TYPE_HEXSTRING:
case TYPE_OCTETSTRING:
value.getValueRefdLast(timestamp, expectedValue, referenceChain);
break;
case TYPE_UNDEFINED:
setIsErroneous(true);
break;
default:
location.reportSemanticError(OPERANDERROR);
setIsErroneous(true);
break;
}
}
use of org.eclipse.titan.designer.AST.IType.Type_type in project titan.EclipsePlug-ins by eclipse.
the class SubstractExpression method getExpressionReturntype.
@Override
public /**
* {@inheritDoc}
*/
Type_type getExpressionReturntype(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue) {
if (value1 == null) {
return Type_type.TYPE_UNDEFINED;
}
value1.setLoweridToReference(timestamp);
final Type_type tempType = value1.getExpressionReturntype(timestamp, expectedValue);
switch(tempType) {
case TYPE_INTEGER:
case TYPE_REAL:
return tempType;
case TYPE_UNDEFINED:
return tempType;
default:
getValueRefdLast(timestamp, expectedValue, null);
setIsErroneous(true);
return Type_type.TYPE_UNDEFINED;
}
}
Aggregations