use of org.eclipse.titan.designer.AST.IValue in project titan.EclipsePlug-ins by eclipse.
the class EqualsExpression method evaluateValue.
@Override
public /**
* {@inheritDoc}
*/
IValue evaluateValue(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return lastValue;
}
isErroneous = false;
lastTimeChecked = timestamp;
lastValue = this;
if (value1 == null || value2 == null) {
return lastValue;
}
checkExpressionOperands(timestamp, expectedValue, referenceChain);
if (getIsErroneous(timestamp) || isUnfoldable(timestamp, referenceChain)) {
return lastValue;
}
final IValue last1 = value1.getValueRefdLast(timestamp, referenceChain);
final IValue last2 = value2.getValueRefdLast(timestamp, referenceChain);
if (last1 == null || last2 == null) {
setIsErroneous(true);
return lastValue;
}
lastValue = new Boolean_Value(last1.checkEquality(timestamp, last2));
lastValue.copyGeneralProperties(this);
return lastValue;
}
use of org.eclipse.titan.designer.AST.IValue in project titan.EclipsePlug-ins by eclipse.
the class Float2IntExpression method evaluateValue.
@Override
public /**
* {@inheritDoc}
*/
IValue evaluateValue(final CompilationTimeStamp timestamp, final Expected_Value_type expectedValue, final IReferenceChain referenceChain) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return lastValue;
}
isErroneous = false;
lastTimeChecked = timestamp;
lastValue = this;
if (value == null) {
return lastValue;
}
checkExpressionOperands(timestamp, expectedValue, referenceChain);
if (getIsErroneous(timestamp)) {
return lastValue;
}
if (isUnfoldable(timestamp, referenceChain)) {
return lastValue;
}
final IValue last = value.getValueRefdLast(timestamp, referenceChain);
if (last.getIsErroneous(timestamp)) {
setIsErroneous(true);
return lastValue;
}
switch(last.getValuetype()) {
case REAL_VALUE:
lastValue = new Integer_Value((long) ((Real_Value) last).getValue());
lastValue.copyGeneralProperties(this);
break;
default:
setIsErroneous(true);
break;
}
return lastValue;
}
use of org.eclipse.titan.designer.AST.IValue in project titan.EclipsePlug-ins by eclipse.
the class Set_Value method checkRecursions.
@Override
public /**
* {@inheritDoc}
*/
void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
if (referenceChain.add(this)) {
for (int i = 0, size = values.getSize(); i < size; i++) {
final IValue temp = values.getNamedValueByIndex(i).getValue();
if (temp != null) {
referenceChain.markState();
temp.checkRecursions(timestamp, referenceChain);
referenceChain.previousState();
}
}
}
}
use of org.eclipse.titan.designer.AST.IValue in project titan.EclipsePlug-ins by eclipse.
the class TTCN3_Null_Value method checkEquality.
@Override
public /**
* {@inheritDoc}
*/
boolean checkEquality(final CompilationTimeStamp timestamp, final IValue other) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = other.getValueRefdLast(timestamp, referenceChain);
referenceChain.release();
return getValuetype().equals(last.getValuetype());
}
use of org.eclipse.titan.designer.AST.IValue in project titan.EclipsePlug-ins by eclipse.
the class Testcase_Reference_Value method checkEquality.
@Override
public /**
* {@inheritDoc}
*/
boolean checkEquality(final CompilationTimeStamp timestamp, final IValue other) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = other.getValueRefdLast(timestamp, referenceChain);
referenceChain.release();
return Value_type.TESTCASE_REFERENCE_VALUE.equals(last.getValuetype()) && referredTestcase == ((Testcase_Reference_Value) last).getReferredTestcase();
}
Aggregations