Search in sources :

Example 1 with RawAST

use of org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST in project titan.EclipsePlug-ins by eclipse.

the class AbstractOfType method checkCodingAttributes.

@Override
public /**
 * {@inheritDoc}
 */
void checkCodingAttributes(final CompilationTimeStamp timestamp, final IReferenceChain refChain) {
    // check raw attributes
    if (subType != null) {
        final int restrictionLength = subType.get_length_restriction();
        if (restrictionLength != -1) {
            if (rawAttribute == null) {
                rawAttribute = new RawAST(getDefaultRawFieldLength());
            }
            rawAttribute.length_restriction = restrictionLength;
            ofType.forceRaw(timestamp);
            if (rawAttribute.fieldlength == 0 && rawAttribute.length_restriction != -1) {
                rawAttribute.fieldlength = rawAttribute.length_restriction;
                rawAttribute.length_restriction = -1;
            }
            if (rawAttribute.length_restriction != -1 && rawAttribute.length_restriction != rawAttribute.fieldlength) {
                getLocation().reportSemanticError(MessageFormat.format("Invalid length specified in parameter FIELDLENGTH for type `{0}''. The FIELDLENGTH must be equal to specified length restriction", getFullName()));
            }
        }
    }
    if (refChain.contains(this)) {
        return;
    }
    refChain.add(this);
    refChain.markState();
    ofType.checkCodingAttributes(timestamp, refChain);
    refChain.previousState();
}
Also used : RawAST(org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST)

Example 2 with RawAST

use of org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST in project titan.EclipsePlug-ins by eclipse.

the class BitString_Type method checkCodingAttributes.

@Override
public /**
 * {@inheritDoc}
 */
void checkCodingAttributes(final CompilationTimeStamp timestamp, final IReferenceChain refChain) {
    // check raw attributes
    if (subType != null) {
        final int restrictionLength = subType.get_length_restriction();
        if (restrictionLength != -1) {
            if (rawAttribute == null) {
                rawAttribute = new RawAST(getDefaultRawFieldLength());
            }
            if (rawAttribute.fieldlength == 0) {
                rawAttribute.fieldlength = restrictionLength;
                rawAttribute.length_restriction = -1;
            } else {
                rawAttribute.length_restriction = restrictionLength;
            }
        }
    }
// TODO add checks for other encodings.
}
Also used : RawAST(org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST)

Example 3 with RawAST

use of org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST in project titan.EclipsePlug-ins by eclipse.

the class CharString_Type method checkCodingAttributes.

@Override
public /**
 * {@inheritDoc}
 */
void checkCodingAttributes(final CompilationTimeStamp timestamp, final IReferenceChain refChain) {
    // check raw attributes
    if (subType != null) {
        final int restrictionLength = subType.get_length_restriction();
        if (restrictionLength != -1) {
            if (rawAttribute == null) {
                rawAttribute = new RawAST(getDefaultRawFieldLength());
            }
            if (rawAttribute.fieldlength == 0) {
                rawAttribute.fieldlength = restrictionLength * 8;
                rawAttribute.length_restriction = -1;
            } else {
                rawAttribute.length_restriction = restrictionLength;
            }
        }
    }
// TODO add checks for other encodings.
}
Also used : RawAST(org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST)

Example 4 with RawAST

use of org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST in project titan.EclipsePlug-ins by eclipse.

the class HexString_Type method checkCodingAttributes.

@Override
public /**
 * {@inheritDoc}
 */
void checkCodingAttributes(final CompilationTimeStamp timestamp, final IReferenceChain refChain) {
    // check raw attributes
    if (subType != null) {
        final int restrictionLength = subType.get_length_restriction();
        if (restrictionLength != -1) {
            if (rawAttribute == null) {
                rawAttribute = new RawAST(getDefaultRawFieldLength());
            }
            if (rawAttribute.fieldlength == 0) {
                rawAttribute.fieldlength = restrictionLength * 4;
                rawAttribute.length_restriction = -1;
            } else {
                rawAttribute.length_restriction = restrictionLength;
            }
        }
    }
// TODO add checks for other encodings.
}
Also used : RawAST(org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST)

Example 5 with RawAST

use of org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST in project titan.EclipsePlug-ins by eclipse.

the class Integer_Type method checkCodingAttributes.

@Override
public /**
 * {@inheritDoc}
 */
void checkCodingAttributes(final CompilationTimeStamp timestamp, final IReferenceChain refChain) {
    // check raw attributes
    if (subType != null) {
        final int restrictionLength = subType.get_length_restriction();
        if (restrictionLength != -1) {
            if (rawAttribute == null) {
                rawAttribute = new RawAST(getDefaultRawFieldLength());
            }
            rawAttribute.length_restriction = restrictionLength;
        }
    }
    if (rawAttribute != null) {
        if (rawAttribute.intX) {
            rawAttribute.bitorderinfield = RawAST.XDEFMSB;
            rawAttribute.bitorderinoctet = RawAST.XDEFMSB;
            rawAttribute.byteorder = RawAST.XDEFMSB;
        }
    }
// TODO add checks for other encodings.
}
Also used : RawAST(org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST)

Aggregations

RawAST (org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST)13 ASN1_Choice_Type (org.eclipse.titan.designer.AST.ASN1.types.ASN1_Choice_Type)3 ASN1_Set_Seq_Choice_BaseType (org.eclipse.titan.designer.AST.ASN1.types.ASN1_Set_Seq_Choice_BaseType)3 IType (org.eclipse.titan.designer.AST.IType)3 Identifier (org.eclipse.titan.designer.AST.Identifier)3 RawAST.rawAST_single_tag (org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST.rawAST_single_tag)3 RawAST.rawAST_tag_field_value (org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST.rawAST_tag_field_value)3 Type (org.eclipse.titan.designer.AST.Type)3 ArrayList (java.util.ArrayList)2 RawAST.rawAST_ext_bit_group (org.eclipse.titan.designer.AST.TTCN3.attributes.RawAST.rawAST_ext_bit_group)2 RawASTStruct (org.eclipse.titan.designer.AST.TTCN3.attributes.RawASTStruct)2 RawASTStruct.rawAST_coding_fields (org.eclipse.titan.designer.AST.TTCN3.attributes.RawASTStruct.rawAST_coding_fields)2 RawASTStruct.rawAST_coding_taglist (org.eclipse.titan.designer.AST.TTCN3.attributes.RawASTStruct.rawAST_coding_taglist)2 ExpressionStruct (org.eclipse.titan.designer.AST.TTCN3.values.expressions.ExpressionStruct)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Open_Type (org.eclipse.titan.designer.AST.ASN1.types.Open_Type)1 ArraySubReference (org.eclipse.titan.designer.AST.ArraySubReference)1 FieldSubReference (org.eclipse.titan.designer.AST.FieldSubReference)1 IReferenceChain (org.eclipse.titan.designer.AST.IReferenceChain)1 ISubReference (org.eclipse.titan.designer.AST.ISubReference)1