deviations.doc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. .sp 2
  2. .NH
  3. Deviations from the standard
  4. .nh
  5. .PP
  6. The compiler deviates from the ISO 7185 standard with respect to the
  7. following clauses:
  8. .IP "\fBISO 6.1.3:\fR" 14
  9. \h'-5u'Identifiers may be of any length and all characters of an identifier
  10. shall be significant in distinguishing between them.
  11. .sp
  12. .in +3m
  13. The constant IDFSIZE, defined in the file \fIidfsize.h\fR, determines
  14. the (maximum) significant length of an identifier. It can be set at run
  15. time with the \-M option (see also section on compiler options).
  16. .in -3m
  17. .sp
  18. .IP "\fBISO 6.1.8:\fR"
  19. \h'-5u'There shall be at least one separator between any pair of consecutive tokens
  20. made up of identifiers, word-symbols, labels or unsigned-numbers.
  21. .sp
  22. .in +3m
  23. A token separator is not needed when a number is followed by an identifier
  24. or a word-symbol. For example the input sequence, 2\fBthen\fR, is recognized
  25. as the integer 2 followed by the keyword \fBthen\fR.
  26. .in -3m
  27. .sp
  28. .IP "\fBISO 6.2.1:\fR"
  29. \h'-29u'The label-declaration-part shall specify all labels that prefix a statement
  30. in the corresponding statement-part.
  31. .sp
  32. .ti +3m
  33. The compiler generates a warning if a label is declared but never defined.
  34. .bp
  35. .IP "\fBISO 6.2.2:\fR"
  36. \h'-9u'The scope of identifiers and labels should start at the beginning of the
  37. block in which these identifiers or labels are declared.
  38. .sp
  39. .in +3m
  40. The compiler, as most other one pass compilers deviates in this respect,
  41. because the scope of variables and labels start at their defining-point.
  42. .nf
  43. .in +4m
  44. \fBprogram\fR deviates\fB;
  45. const\fR
  46. x \fB=\fR 3\fB;
  47. procedure\fR p\fB;
  48. const\fR
  49. y \fB=\fR x\fB;\fR
  50. x \fB=\fR true\fB;
  51. begin end;
  52. begin
  53. end.\fR
  54. .in -4m
  55. .fi
  56. In procedure p, the constant y has the integer value 3. This program does not
  57. conform to the standard. In [SAL] a simple algorithm is described for
  58. enforcing the scope rules, it involves numbering all scopes encoutered in the
  59. program in order of their opening, and recording in each identifier table
  60. entry the number of the latest scope in which it is used.
  61. Note: The compiler does not deviate from the standard in the following program:
  62. .nf
  63. .in +4m
  64. \fBprogram\fR conforms\fB;
  65. type\fR
  66. x \fB=\fR real\fB;
  67. procedure\fR p\fB;
  68. type\fR
  69. y \fB= ^\fRx\fB;\fR
  70. x \fB=\fR boolean\fB;
  71. var\fR
  72. p \fB:\fR y\fB;
  73. begin end;
  74. begin
  75. end.\fR
  76. .in -4m
  77. .fi
  78. In procedure p, the variable p is a pointer to boolean.
  79. .fi
  80. .in -3m
  81. .sp
  82. .IP "\fBISO 6.4.3.2:\fR"
  83. The standard specifies that any ordinal type is allowed as index-type.
  84. .sp
  85. .in +3m
  86. The required type \fIinteger\fR is not allowed as index-type, i.e.
  87. .ti +2m
  88. \fBARRAY [ \fIinteger\fB ] OF\fR <component-type>
  89. is not permitted.
  90. .br
  91. This could be implemented, but this might cause problems on machines with
  92. a small memory.
  93. .in -3m
  94. .sp
  95. .IP "\fBISO 6.4.3.3:\fR"
  96. \h'-1u'The type possessed by the variant-selector, called the tag-type, must
  97. be an ordinal type, so the integer type is permitted. The values denoted by
  98. all case-constants shall be distinct and the set thereof shall be equal
  99. to the set of values specified by the tag-type.
  100. .sp
  101. .in +3m
  102. Because it is impracticable to enumerate all integers as case-constants,
  103. the integer type is not permitted as tag-type. It would not make a great
  104. difference to allow it as tagtype.
  105. .in -3m
  106. .sp
  107. .IP "\fBISO 6.8.3.9:\fR"
  108. The standard specifies that the control-variable of a for-statement is not
  109. allowed to be modified while executing the loop.
  110. .sp
  111. .in +3m
  112. Violation of this rule is not detected. An algorithm to implement this rule
  113. can be found in [PCV].