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();
}
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.
}
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.
}
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.
}
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.
}
Aggregations