use of org.eclipse.titan.designer.AST.TTCN3.values.Bitstring_Value in project titan.EclipsePlug-ins by eclipse.
the class Oct2BitExpression 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 OCTETSTRING_VALUE:
final String octetString = ((Octetstring_Value) last).getValue();
lastValue = new Bitstring_Value(Hex2BitExpression.hex2bit(octetString));
lastValue.copyGeneralProperties(this);
break;
default:
setIsErroneous(true);
break;
}
return lastValue;
}
use of org.eclipse.titan.designer.AST.TTCN3.values.Bitstring_Value in project titan.EclipsePlug-ins by eclipse.
the class Or4bExpression 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)) {
return lastValue;
}
if (isUnfoldable(timestamp, referenceChain)) {
return lastValue;
}
final IValue last1 = value1.getValueRefdLast(timestamp, referenceChain);
final IValue last2 = value2.getValueRefdLast(timestamp, referenceChain);
String str1;
String str2;
switch(last1.getValuetype()) {
case BITSTRING_VALUE:
str1 = ((Bitstring_Value) last1).getValue();
str2 = ((Bitstring_Value) last2).getValue();
lastValue = new Bitstring_Value(or4b(str1, str2));
lastValue.copyGeneralProperties(this);
break;
case HEXSTRING_VALUE:
str1 = ((Hexstring_Value) last1).getValue();
str2 = ((Hexstring_Value) last2).getValue();
lastValue = new Hexstring_Value(or4b(str1, str2));
lastValue.copyGeneralProperties(this);
break;
case OCTETSTRING_VALUE:
str1 = ((Octetstring_Value) last1).getValue();
str2 = ((Octetstring_Value) last2).getValue();
lastValue = new Octetstring_Value(or4b(str1, str2));
lastValue.copyGeneralProperties(this);
break;
default:
setIsErroneous(true);
break;
}
return lastValue;
}
use of org.eclipse.titan.designer.AST.TTCN3.values.Bitstring_Value in project titan.EclipsePlug-ins by eclipse.
the class And4bExpression 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)) {
setIsErroneous(true);
return lastValue;
}
final IValue last1 = value1.getValueRefdLast(timestamp, referenceChain);
final IValue last2 = value2.getValueRefdLast(timestamp, referenceChain);
String str1;
String str2;
switch(last1.getValuetype()) {
case BITSTRING_VALUE:
str1 = ((Bitstring_Value) last1).getValue();
str2 = ((Bitstring_Value) last2).getValue();
lastValue = new Bitstring_Value(and4b(str1, str2));
lastValue.copyGeneralProperties(this);
break;
case HEXSTRING_VALUE:
str1 = ((Hexstring_Value) last1).getValue();
str2 = ((Hexstring_Value) last2).getValue();
lastValue = new Hexstring_Value(and4b(str1, str2));
lastValue.copyGeneralProperties(this);
break;
case OCTETSTRING_VALUE:
str1 = ((Octetstring_Value) last1).getValue();
str2 = ((Octetstring_Value) last2).getValue();
lastValue = new Octetstring_Value(and4b(str1, str2));
lastValue.copyGeneralProperties(this);
break;
default:
setIsErroneous(true);
break;
}
return lastValue;
}
use of org.eclipse.titan.designer.AST.TTCN3.values.Bitstring_Value in project titan.EclipsePlug-ins by eclipse.
the class Bit2HexExpression 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 BITSTRING_VALUE:
final String tempBitstring = ((Bitstring_Value) last).getValue();
lastValue = new Hexstring_Value(bit2hex(tempBitstring));
lastValue.copyGeneralProperties(this);
break;
default:
setIsErroneous(true);
break;
}
return lastValue;
}
use of org.eclipse.titan.designer.AST.TTCN3.values.Bitstring_Value in project titan.EclipsePlug-ins by eclipse.
the class Bit2IntExpression 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)) {
return lastValue;
}
switch(last.getValuetype()) {
case BITSTRING_VALUE:
final String tempBitstring = ((Bitstring_Value) last).getValue();
lastValue = bit2int(tempBitstring);
break;
default:
return this;
}
lastValue.copyGeneralProperties(this);
return lastValue;
}
Aggregations