Attached is an asn1 file that references a non-existent set in a table constraint.
I happened upon this when widdling down a more complex asn1 file into a smaller one.
This is a minor but annoying issue.
In the fix, I convert the table constraint to a type (the constrained set of types). I am going to generate some runtime code using AtNotation to further decode an ANY type created due to a class. So, in order to check the validity of the component reference I am going to use the type that was converted from a ATV_REFERENCED to compare against the component's constraint.
E.g., the following should fail to compile:
MySeq ::= SEQUENCE {
id MYCLASS.&id({SomeSet})
value MYCLASS.&value({SomeOtherSet}{@.id})
}
This should fail because the table constraints are different: SomeSet v SomeOtherSet.
So, by converting the ATV_REFERENCED for SomeSet and SomeOtherSet to actual types it is simpler to check that the component relation is valid.
The diff is against the svn revision 1396.
File Added: table_constraint_check.diff
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
asn1 file with a non-existent table constraint.
Logged In: YES
user_id=1932039
Originator: YES
I have attached a fix.
In the fix, I convert the table constraint to a type (the constrained set of types). I am going to generate some runtime code using AtNotation to further decode an ANY type created due to a class. So, in order to check the validity of the component reference I am going to use the type that was converted from a ATV_REFERENCED to compare against the component's constraint.
E.g., the following should fail to compile:
MySeq ::= SEQUENCE {
id MYCLASS.&id({SomeSet})
value MYCLASS.&value({SomeOtherSet}{@.id})
}
This should fail because the table constraints are different: SomeSet v SomeOtherSet.
So, by converting the ATV_REFERENCED for SomeSet and SomeOtherSet to actual types it is simpler to check that the component relation is valid.
The diff is against the svn revision 1396.
File Added: table_constraint_check.diff
Adds table constraint check