Search in sources :

Example 1 with ObjectClass_refd

use of org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Assignment_OS_or_VS method classifyAssignment.

@Override
protected void classifyAssignment(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
    final boolean newChain = null == referenceChain;
    IReferenceChain temporalReferenceChain;
    if (newChain) {
        temporalReferenceChain = ReferenceChain.getInstance(CIRCULARASSIGNMENTCHAIN, true);
    } else {
        temporalReferenceChain = referenceChain;
        temporalReferenceChain.markState();
    }
    realAssignment = null;
    if (temporalReferenceChain.add(this)) {
        if (null != reference) {
            reference.setMyScope(getMyScope());
            if (!reference.refersToSettingType(timestamp, Setting_type.S_ERROR, temporalReferenceChain)) {
                if (identifier.isvalidAsnObjectSetReference() && reference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) {
                    final ObjectClass_refd oc = new ObjectClass_refd(reference);
                    oc.setLocation(reference.getLocation());
                    realAssignment = new ObjectSet_Assignment(identifier, assPard, oc, newObjectSetDefinitionInstance());
                // assPard = null;
                // left = null;
                // right = null;
                // asstype = A_OS;
                } else if (identifier.isvalidAsnValueSetReference() && (reference.refersToSettingType(timestamp, Setting_type.S_T, temporalReferenceChain) || reference.refersToSettingType(timestamp, Setting_type.S_VS, temporalReferenceChain))) {
                    final Referenced_Type type = new Referenced_Type(reference);
                    type.setLocation(reference.getLocation());
                    realAssignment = newValueSetAssignmentInstance(type);
                // left = null;
                // right = null;
                // asstype = A_VS;
                }
            }
        }
    }
    if (null == realAssignment) {
        location.reportSemanticError(UNRECOGNISABLEASSIGNMENT);
        isErroneous = true;
    } else {
        realAssignment.setLocation(location);
        realAssignment.setMyScope(myScope);
        realAssignment.setRightScope(rightScope);
        realAssignment.setFullNameParent(this);
    }
    if (newChain) {
        temporalReferenceChain.release();
    } else {
        temporalReferenceChain.previousState();
    }
}
Also used : IReferenceChain(org.eclipse.titan.designer.AST.IReferenceChain) ObjectClass_refd(org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd) Referenced_Type(org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type)

Example 2 with ObjectClass_refd

use of org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Assignment_T_or_OC method classifyAssignment.

@Override
protected void classifyAssignment(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
    final boolean newChain = null == referenceChain;
    IReferenceChain temporalReferenceChain;
    if (newChain) {
        temporalReferenceChain = ReferenceChain.getInstance(CIRCULARASSIGNMENTCHAIN, true);
    } else {
        temporalReferenceChain = referenceChain;
        temporalReferenceChain.markState();
    }
    realAssignment = null;
    if (temporalReferenceChain.add(this)) {
        reference.setMyScope(rightScope);
        if (identifier.isvalidAsnObjectClassReference() && reference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) {
            final ObjectClass_refd oc = new ObjectClass_refd(reference);
            oc.setLocation(reference.getLocation());
            realAssignment = new ObjectClass_Assignment(identifier, assPard, oc);
        // assPard = null;
        // asstype = Assignment.A_OC;
        } else if (identifier.isvalidAsnTyperef() && (reference.refersToSettingType(timestamp, Setting_type.S_T, temporalReferenceChain) || reference.refersToSettingType(timestamp, Setting_type.S_VS, temporalReferenceChain))) {
            final Referenced_Type type = new Referenced_Type(reference);
            type.setLocation(reference.getLocation());
            realAssignment = new Type_Assignment(identifier, assPard, type);
        // assPard = null;
        // asstype = A_TYPE;
        }
    }
    if (null == realAssignment) {
        location.reportSemanticError(UNRECOGNISABLEASSIGNMENT);
        isErroneous = true;
    } else {
        realAssignment.setLocation(location);
        realAssignment.setMyScope(myScope);
        realAssignment.setRightScope(rightScope);
        realAssignment.setFullNameParent(this);
    }
    if (newChain) {
        temporalReferenceChain.release();
    } else {
        temporalReferenceChain.previousState();
    }
}
Also used : IReferenceChain(org.eclipse.titan.designer.AST.IReferenceChain) ObjectClass_refd(org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd) Referenced_Type(org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type)

Example 3 with ObjectClass_refd

use of org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd in project titan.EclipsePlug-ins by eclipse.

the class Undefined_Assignment_O_or_V method classifyAssignment.

@Override
protected void classifyAssignment(final CompilationTimeStamp timestamp, final IReferenceChain referenceChain) {
    final boolean newChain = null == referenceChain;
    IReferenceChain temporalReferenceChain;
    if (newChain) {
        temporalReferenceChain = ReferenceChain.getInstance(CIRCULARASSIGNMENTCHAIN, true);
    } else {
        temporalReferenceChain = referenceChain;
        temporalReferenceChain.markState();
    }
    realAssignment = null;
    if (temporalReferenceChain.add(this)) {
        if (null != reference && !reference.refersToSettingType(timestamp, Setting_type.S_ERROR, temporalReferenceChain)) {
            reference.setMyScope(myScope);
            if (null != objectReference) {
                objectReference.setMyScope(rightScope);
            }
            if (identifier.isvalidAsnObjectReference() && reference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) {
                final ObjectClass_refd oc = new ObjectClass_refd(reference);
                oc.setLocation(reference.getLocation());
                if (null != mBlock) {
                    final Object_Definition obj = new Object_Definition(mBlock);
                    // obj.setLocation(right1);
                    realAssignment = new Object_Assignment(identifier, assPard, oc, obj);
                } else if (null != objectReference) {
                    final ReferencedObject obj = new ReferencedObject(objectReference);
                    obj.setLocation(objectReference.getLocation());
                    realAssignment = new Object_Assignment(identifier, assPard, oc, obj);
                }
            } else if (identifier.isvalidAsnValueReference() && (reference.refersToSettingType(timestamp, Setting_type.S_T, temporalReferenceChain) || reference.refersToSettingType(timestamp, Setting_type.S_VS, temporalReferenceChain))) {
                final Referenced_Type type = new Referenced_Type(reference);
                if (null != mBlock) {
                    final Value value = new Undefined_Block_Value(mBlock);
                    value.setLocation(mBlock.getLocation());
                    realAssignment = new Value_Assignment(identifier, assPard, type, value);
                } else if (null != objectReference) {
                    final Value value = new Undefined_LowerIdentifier_Value(objectReference.getId().newInstance());
                    value.setLocation(objectReference.getLocation());
                    realAssignment = new Value_Assignment(identifier, assPard, type, value);
                }
            }
        }
    }
    if (null == realAssignment) {
        location.reportSemanticError(UNRECOGNISABLEASSIGNMENT);
        isErroneous = true;
    } else {
        realAssignment.setLocation(location);
        realAssignment.setMyScope(myScope);
        realAssignment.setRightScope(rightScope);
        realAssignment.setFullNameParent(this);
    }
    if (newChain) {
        temporalReferenceChain.release();
    } else {
        temporalReferenceChain.previousState();
    }
}
Also used : Object_Definition(org.eclipse.titan.designer.AST.ASN1.Object.Object_Definition) IReferenceChain(org.eclipse.titan.designer.AST.IReferenceChain) ObjectClass_refd(org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd) ReferencedObject(org.eclipse.titan.designer.AST.ASN1.Object.ReferencedObject) Undefined_LowerIdentifier_Value(org.eclipse.titan.designer.AST.TTCN3.values.Undefined_LowerIdentifier_Value) Value(org.eclipse.titan.designer.AST.Value) Undefined_Block_Value(org.eclipse.titan.designer.AST.ASN1.values.Undefined_Block_Value) Undefined_Block_Value(org.eclipse.titan.designer.AST.ASN1.values.Undefined_Block_Value) Referenced_Type(org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type) Undefined_LowerIdentifier_Value(org.eclipse.titan.designer.AST.TTCN3.values.Undefined_LowerIdentifier_Value)

Example 4 with ObjectClass_refd

use of org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd in project titan.EclipsePlug-ins by eclipse.

the class Undefined_FieldSpecification method classifyFieldSpecification.

private void classifyFieldSpecification(final CompilationTimeStamp timestamp) {
    final IReferenceChain temporalReferenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
    if (isOptional && (null != defaultSetting1 || null != mDefaultSetting)) {
        location.reportSemanticError("OPTIONAL and DEFAULT are mutually exclusive");
        isOptional = false;
    }
    if (temporalReferenceChain.add(this) && null != governorReference) {
        governorReference.setMyScope(myObjectClass.getMyScope());
        if (null != defaultSetting1) {
            defaultSetting1.setMyScope(myObjectClass.getMyScope());
        }
        if (identifier.isvalidAsnObjectSetFieldReference() && governorReference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) {
            ObjectSet defaultObjectset = null;
            if (null != mDefaultSetting) {
                defaultObjectset = new ObjectSet_definition(mDefaultSetting);
            }
            final ObjectClass_refd oc = new ObjectClass_refd(governorReference);
            oc.setLocation(governorReference.getLocation());
            fieldSpecification = new ObjectSet_FieldSpecification(identifier, oc, isOptional, defaultObjectset);
        } else if (identifier.isvalidAsnObjectFieldReference() && governorReference.refersToSettingType(timestamp, Setting_type.S_OC, temporalReferenceChain)) {
            ASN1Object defaultObject = null;
            if (null != defaultSetting1) {
                defaultObject = new ReferencedObject(defaultSetting1);
            } else if (null != mDefaultSetting) {
                defaultObject = new Object_Definition(mDefaultSetting);
            }
            fieldSpecification = new Object_FieldSpecification(identifier, new ObjectClass_refd(governorReference), isOptional, defaultObject);
        } else if (identifier.isvalidAsnValueFieldReference() && (governorReference.refersToSettingType(timestamp, Setting_type.S_T, temporalReferenceChain) || governorReference.refersToSettingType(timestamp, Setting_type.S_VS, temporalReferenceChain))) {
            IValue defaultValue = null;
            if (null != defaultSetting1) {
                if (defaultSetting1 instanceof Defined_Reference && null == defaultSetting1.getModuleIdentifier()) {
                    defaultValue = new Undefined_LowerIdentifier_Value(defaultSetting1.getId().newInstance());
                } else {
                    defaultValue = new Referenced_Value(defaultSetting1);
                }
            } else if (null != mDefaultSetting) {
                defaultValue = new Undefined_Block_Value(mDefaultSetting);
            }
            fieldSpecification = new FixedTypeValue_FieldSpecification(identifier, new Referenced_Type(governorReference), false, isOptional, null != defaultSetting1 && null != mDefaultSetting, defaultValue);
        }
    }
    if (null == fieldSpecification) {
        location.reportSemanticError(CANNOTRECOGNISE);
        fieldSpecification = new Erroneous_FieldSpecification(identifier, isOptional, null != defaultSetting1 || null != mDefaultSetting);
    } else {
        if (null != myObjectClass) {
            fieldSpecification.setMyObjectClass(myObjectClass);
        }
    }
    fieldSpecification.setFullNameParent(getNameParent());
    fieldSpecification.setLocation(location);
    temporalReferenceChain.release();
}
Also used : Defined_Reference(org.eclipse.titan.designer.AST.ASN1.Defined_Reference) Referenced_Value(org.eclipse.titan.designer.AST.TTCN3.values.Referenced_Value) ObjectSet(org.eclipse.titan.designer.AST.ASN1.ObjectSet) IValue(org.eclipse.titan.designer.AST.IValue) IReferenceChain(org.eclipse.titan.designer.AST.IReferenceChain) Undefined_Block_Value(org.eclipse.titan.designer.AST.ASN1.values.Undefined_Block_Value) ASN1Object(org.eclipse.titan.designer.AST.ASN1.ASN1Object) Referenced_Type(org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type) Undefined_LowerIdentifier_Value(org.eclipse.titan.designer.AST.TTCN3.values.Undefined_LowerIdentifier_Value)

Aggregations

IReferenceChain (org.eclipse.titan.designer.AST.IReferenceChain)4 Referenced_Type (org.eclipse.titan.designer.AST.TTCN3.types.Referenced_Type)4 ObjectClass_refd (org.eclipse.titan.designer.AST.ASN1.Object.ObjectClass_refd)3 Undefined_Block_Value (org.eclipse.titan.designer.AST.ASN1.values.Undefined_Block_Value)2 Undefined_LowerIdentifier_Value (org.eclipse.titan.designer.AST.TTCN3.values.Undefined_LowerIdentifier_Value)2 ASN1Object (org.eclipse.titan.designer.AST.ASN1.ASN1Object)1 Defined_Reference (org.eclipse.titan.designer.AST.ASN1.Defined_Reference)1 Object_Definition (org.eclipse.titan.designer.AST.ASN1.Object.Object_Definition)1 ReferencedObject (org.eclipse.titan.designer.AST.ASN1.Object.ReferencedObject)1 ObjectSet (org.eclipse.titan.designer.AST.ASN1.ObjectSet)1 IValue (org.eclipse.titan.designer.AST.IValue)1 Referenced_Value (org.eclipse.titan.designer.AST.TTCN3.values.Referenced_Value)1 Value (org.eclipse.titan.designer.AST.Value)1