use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class RelativeObjectIdentifier_Type method checkThisValue.
@Override
public /**
* {@inheritDoc}
*/
boolean checkThisValue(final CompilationTimeStamp timestamp, final IValue value, final Assignment lhs, final ValueCheckingOptions valueCheckingOptions) {
value.setIsErroneous(false);
final boolean selfReference = super.checkThisValue(timestamp, value, lhs, valueCheckingOptions);
IValue last = value.getValueRefdLast(timestamp, valueCheckingOptions.expected_value, null);
if (null == last || last.getIsErroneous(timestamp)) {
return selfReference;
}
// already handled ones
switch(value.getValuetype()) {
case OMIT_VALUE:
case REFERENCED_VALUE:
return selfReference;
case UNDEFINED_LOWERIDENTIFIER_VALUE:
if (Value_type.REFERENCED_VALUE.equals(last.getValuetype())) {
return selfReference;
}
break;
default:
break;
}
switch(last.getValuetype()) {
case RELATIVEOBJECTIDENTIFIER_VALUE:
{
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
((RelativeObjectIdentifier_Value) last).checkROID(timestamp, referenceChain);
referenceChain.release();
break;
}
case UNDEFINED_BLOCK:
{
last = last.setValuetype(timestamp, Value_type.RELATIVEOBJECTIDENTIFIER_VALUE);
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
((RelativeObjectIdentifier_Value) last).checkROID(timestamp, referenceChain);
referenceChain.release();
break;
}
case EXPRESSION_VALUE:
case MACRO_VALUE:
// already checked
break;
default:
value.getLocation().reportSemanticError("RELATIVE-OID value was expected");
value.setIsErroneous(true);
break;
}
if (valueCheckingOptions.sub_check) {
// there is no parent type to check
if (null != subType) {
subType.checkThisValue(timestamp, last);
}
}
value.setLastTimeChecked(timestamp);
return selfReference;
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Selection_Type method checkThisValue.
@Override
public /**
* {@inheritDoc}
*/
boolean checkThisValue(final CompilationTimeStamp timestamp, final IValue value, final Assignment lhs, final ValueCheckingOptions valueCheckingOptions) {
final IReferenceChain refChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IType last = getTypeRefd(timestamp, refChain);
refChain.release();
boolean selfReference = false;
if (null != last && last != this) {
selfReference = last.checkThisValue(timestamp, value, lhs, valueCheckingOptions);
}
value.setLastTimeChecked(timestamp);
return selfReference;
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Selection_Type method checkRecursions.
@Override
public /**
* {@inheritDoc}
*/
void checkRecursions(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
if (referenceChain.add(this)) {
final IReferenceChain tempReferenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final Type type = getTypeRefd(timestamp, tempReferenceChain);
tempReferenceChain.release();
if (null != type && !type.getIsErroneous(timestamp) && !this.equals(type)) {
type.checkRecursions(timestamp, referenceChain);
}
}
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class ISO2022String_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();
switch(last.getValuetype()) {
case ISO2022STRING_VALUE:
return value.equals(((ISO2022String_Value) last).getValueISO2022String());
default:
return false;
}
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class RelativeObjectIdentifier_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();
if (!Value_type.RELATIVEOBJECTIDENTIFIER_VALUE.equals(last.getValuetype())) {
return false;
}
final RelativeObjectIdentifier_Value otherObjid = (RelativeObjectIdentifier_Value) last;
if (objectIdComponents.size() != otherObjid.objectIdComponents.size()) {
return false;
}
for (int i = 0, size = objectIdComponents.size(); i < size; i++) {
if (objectIdComponents.get(i) != otherObjid.objectIdComponents.get(i)) {
return false;
}
}
return true;
}
Aggregations