The very first thing to say about layuot is that ASN.1 does not give any rules for module layout. It is realy up to you, what are your modules like.
So, on this page you will get an overview of what is syntacticaly allowed, and also some tips for using this open space.
Any syntactic items can be separated by any arbitrary amount of whitespace characters (spaces, tabs, newlines), but not interrupted.
Comments are alowed anywhere in code, except interrupting syntactinc items. A comment starts with double hyphens and ends with matching pair of hyphens or end of line. This is the only place, where the end of line is significant. It is usual to use some smaller typeface and/or italic to emphasize (?) comments for reader.
Ya, that's all, folks! But... If you have already wrote some pieces of code for standard C, Pascal or even Occam, keep on with structural programming, or how do you call that nice identations. Just for comparation, these two examples are the same as far as ASN.1 syntax, but guess which one is readable. Winner gets another bier.
Example #1:
WeatherReport ::= SEQUENCE {
stationNumber INTEGER (1 .. 99999),
timeOfReport UTCTime,
pressure INTEGER (850 .. 1100),
temperature INTEGER (-100 .. 60),
humidity INTEGER (0 .. 100),
windVelocity INTEGER (0 .. 500),
windDirrection INTEGER (0 .. 359)
}
Example #2:
WeatherReport ::= SEQUENCE {stationNumber INTEGER (1..99999), timeOfReport UTCTime, pressure INTEGER (850..1100), temperature INTEGER (-100..60), humidity INTEGER (0..100), windVelocity INTEGER (0..500), windDirrection INTEGER (0..359)}