ObjectGeode's model mapper logic is stored inside file og_A_mapper.py
.
Since ObjectGeode is an SDL tool, it includes native support for ASN.1;
that is, ASN.1 grammars can be used in their original form inside the .pr files
that define an SDL subsystem.
Unfortunately, this isn't entirely accurate... The SDL parser used by ObjectGeode
imposes some minor restrictions in the way ASN.1 content appears, and this mapper
(og_A_mapper.py
) takes extra care to handle this.
- When used inside an ObjectGeode SDL file (a .pr file), ASN.1 definitions are
not allowed to use hyphens, since hyphens are considered by ObjectGeode's parser
to denote subtraction (or negation). The mapper therefore "patches" the original
ASN.1 definitions into a form more suitable for consumption from ObjectGeode
(i.e. replacing '
-
' with '_
')
- For the same reason, comments - which start with '
--
' - have to be eliminated
- As per ESA's request, the definitions of ASN.1 types must reside in a
section named 'Datamodel' ; the mapper replaces the original name with this.
- Obviously, hyphens are not changed when found inside range constraints
The mapper uses regular expressions to locate the appropriate places and apply these
rules in the text of the original ASN.1 grammars. To be able to cope with all
possible ASN.1 grammars, a full fledged ASN.1 parser would be required;
however, this regular-expression based implementation covers almost all cases
without requiring the effort necessary for a full-blown ASN.1 parser.