ASN.1 false semantic error on generated information object type "oneErrorObject-Type"
Submitted by Jeno Attila Balasko
Link to original bug (#560000)
Description
Created attachment 281768 Example: X682.asn
This TR is in close connection with titan.core bug 528313 which is corrected in 2017.
In the attached file, the commented line "errorInfo oneErrorObject-Type : foobar" has a semantic marker as follows:
Reference to a non-existent alternative oneErrorObject-Type' in CHOICE value for type
@X682.ErrorReturn.errors.oftype.errorInfo[1]' X682.asn /Regression_Test_java/src/EncodeDecode/BER line 80 on-the-fly semantic markers
The reason is that the semantic analyzer does not take into account that the oneErrorObject name will be changed into oneErrorObject-Type (see also the cpp compiler log).
ASN1.code detail:
ERROR-CLASS ::= CLASS
{
&category PrintableString(SIZE(1)),
&code INTEGER,
&Type DEFAULT INTEGER
}
WITH SYNTAX {&category &code [&Type]}
ErrorSet ERROR-CLASS ::=
{
{"A" 1 [1] INTEGER} |
{"A" 2 [1] VisibleString} |
{"B" 1 [1] PrintableString} |
{"B" 2 [1] BOOLEAN} |
oneErrorObject
}
oneErrorObject ERROR-CLASS ::= { "C" 3 ENUMERATED{foobar} }
ErrorReturn ::= SEQUENCE
{
errorCategory ERROR-CLASS.&category ({ErrorSet}) OPTIONAL,
errors SEQUENCE OF SEQUENCE
{
errorCode ERROR-CLASS.&code({ErrorSet}{@errorCategory}),
errorInfo [99] ERROR-CLASS.&Type({ErrorSet}{@errorCategory,@.errorCode}) -- line 51
} OPTIONAL
}
...
errorReturn2 ErrorReturn ::=
{
errorCategory "3",
errors
{
{
errorCode 3,
errorInfo oneErrorObject-Type : foobar --error marker on this line
}
}
}
Remark:
Perhaps the cpp compilation log helps:
../src/X682.asn: In ASN.1 module `X682':
../src/X682.asn:45: In type assignment `ErrorReturn':
../src/X682.asn:51: In constraint #1 of type `open type':
../src/X682.asn:51: warning: Strange alternative name (`errorSet-1-Type') was added to open type `@X682.ErrorReturn.errors.SEQUENCE.errorInfo.type'
../src/X682.asn:51: warning: Strange alternative name (`errorSet-2-Type') was added to open type `@X682.ErrorReturn.errors.SEQUENCE.errorInfo.type'
../src/X682.asn:51: warning: Strange alternative name (`errorSet-3-Type') was added to open type `@X682.ErrorReturn.errors.SEQUENCE.errorInfo.type'
../src/X682.asn:51: warning: Strange alternative name (`errorSet-4-Type') was added to open type `@X682.ErrorReturn.errors.SEQUENCE.errorInfo.type'
../src/X682.asn:51: warning: Strange alternative name (`oneErrorObject-Type') was added to open type `@X682.ErrorReturn.errors.SEQUENCE.errorInfo.type'
Attachment 281768, "Example: X682.asn":
X682.asn
Version: 6.6.1