home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / language / oberon / potsrc / src / mod / cocs < prev    next >
Encoding:
Text File  |  1995-05-07  |  20.7 KB  |  565 lines

  1. MODULE COCS;  (*NW 7.6.87 / 20.12.90*) (* DVD 05 08 1993 01:05 *)
  2.   
  3.     IMPORT Files, Reals, Texts, Throwback;
  4.   
  5.     (*symbols:
  6.         |  0          1          2           3            4
  7.      ---|--------------------------------------------------------
  8.       0 |  null       *          /           DIV          MOD
  9.       5 |  &          +          -           OR           =
  10.      10 |  #          <          <=          >            >=
  11.      15 |  IN         IS         ^           .            ,
  12.      20 |  :          ..         )           ]            }
  13.      25 |  OF         THEN       DO          TO           (
  14.      30 |  [          {          ~           :=           number
  15.      35 |  NIL        string     ident       ;            |
  16.      40 |  END        ELSE       ELSIF       UNTIL        IF
  17.      45 |  CASE       WHILE      REPEAT      LOOP         WITH      
  18.      50 |  EXIT       RETURN     ARRAY       RECORD       POINTER
  19.      55 |  BEGIN      CONST      TYPE        VAR          PROCEDURE
  20.      60 |  IMPORT     MODULE     eof *)
  21.   
  22.     CONST KW = 43;  (*size of hash table*)
  23.           maxDig = 32;
  24.           maxInt = 7FFFH;
  25.           maxShInt = 7FH;
  26.           maxExp = 38; maxLExp = 308;
  27.           maxStrLen = 127;
  28.       
  29.     (*name, numtyp, intval, realval, lrlval are implicit results of Get*)
  30.   
  31.     TYPE
  32.       errormsg = ARRAY 132 OF CHAR;
  33.  
  34.     VAR
  35.       linecol*: BOOLEAN;
  36.  
  37.       numtyp* : INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal*)
  38.       intval* : LONGINT;
  39.       realval*: REAL;
  40.       lrlval* : LONGREAL;
  41.       scanerr*: BOOLEAN;
  42.       name*   : ARRAY maxStrLen + 1 OF CHAR;
  43.  
  44.       txtpos*: RECORD
  45.         name*: ARRAY Files.MaxPathLength + 1 OF CHAR;
  46.         line*: LONGINT;
  47.         col*: INTEGER
  48.       END;
  49.   
  50.       ifile: Files.File;
  51.       Input: Files.Rider;
  52.       Diag: Texts.Writer;
  53.   
  54.       ch: CHAR;     (*current character*)
  55.       lastpos: LONGINT; (*error position in source file*)
  56.  
  57.       i: INTEGER;
  58.       keyTab  : ARRAY KW OF RECORD 
  59.         symb, alt: INTEGER; 
  60.         id: ARRAY 12 OF CHAR 
  61.       END;
  62.  
  63.       errormsgs: ARRAY 250 OF errormsg;
  64.  
  65.     PROCEDURE Mark*(n: INTEGER);
  66.       VAR pos:  LONGINT;
  67.     BEGIN 
  68.       pos := Files.Pos(Input);
  69.       IF lastpos + 8 < pos THEN
  70.         Texts.WriteLn(Diag); 
  71.         IF linecol THEN
  72.           Texts.WriteString(Diag, txtpos.name); 
  73.           Texts.WriteString(Diag, "("); Texts.WriteInt(Diag, txtpos.line, 1);
  74.           Texts.WriteString(Diag, ", "); Texts.WriteInt(Diag, txtpos.col, 1);
  75.           Texts.WriteString(Diag, "): ")
  76.         ELSE
  77.           Texts.WriteString(Diag, "  pos"); Texts.WriteInt(Diag, pos, 8)
  78.         END;
  79.         IF n < 0 THEN Texts.WriteString(Diag, "  warning");
  80.           IF linecol THEN
  81.             Throwback.SendError(txtpos.name, txtpos.line, Throwback.Warning, errormsgs[-n]);
  82.           END;
  83.         ELSE Texts.WriteString(Diag, "  err"); scanerr := TRUE;
  84.           IF linecol THEN
  85.             Throwback.SendError(txtpos.name, txtpos.line, Throwback.Error, errormsgs[n]);
  86.           END;
  87.         END ;
  88.         Texts.WriteInt(Diag, ABS(n), 4); 
  89.         Texts.WriteString(Diag, " ");
  90.         Texts.WriteString(Diag, errormsgs[ABS(n)]);
  91.         Texts.WriteString(Diag, " ");
  92.         Texts.Append(Files.StdErr, Diag.buf);
  93.         lastpos := pos
  94.       END
  95.     END Mark;
  96.  
  97.     PROCEDURE Read(VAR ch: CHAR);
  98.     BEGIN Files.Read(Input, ch);
  99.       IF ch = 0AX THEN 
  100.         INC(txtpos.line); txtpos.col := 0 
  101.       ELSE 
  102.         INC(txtpos.col) 
  103.       END
  104.     END Read;
  105.   
  106.     PROCEDURE String(VAR sym: INTEGER);
  107.       VAR i: INTEGER;
  108.     BEGIN i := 0;
  109.       LOOP Read(ch);
  110.         IF ch = 22X THEN EXIT END ;
  111.         IF ch < " " THEN Mark(3); EXIT END ;
  112.         IF i < maxStrLen THEN name[i] := ch; INC(i) ELSE Mark(212); i := 0 END
  113.       END ;
  114.       Read(ch);
  115.       IF i = 1 THEN sym := 34; numtyp := 1; intval := ORD(name[0]) (*character*)
  116.       ELSE sym := 36; intval := i; name[i] := 0X (*string,intval holds length*)
  117.       END
  118.     END String;
  119.   
  120.     PROCEDURE Identifier(VAR sym: INTEGER);
  121.       VAR i, k: INTEGER;
  122.     BEGIN i := 0; k := 0;
  123.       REPEAT
  124.         IF i < 31 THEN name[i] := ch; INC(i); INC(k, ORD(ch)) END ;
  125.         Read(ch)
  126.       UNTIL (ch < "0") OR ("9" < ch) & (CAP(ch) < "A") OR ("Z" < CAP(ch));
  127.       name[i] := 0X;
  128.       k := (k+i) MOD KW;  (*hash function*)
  129.       IF (keyTab[k].symb # 0) & (keyTab[k].id = name) THEN sym := keyTab[k].symb
  130.       ELSE k := keyTab[k].alt;
  131.         IF (keyTab[k].symb # 0) & (keyTab[k].id = name) THEN sym := keyTab[k].symb
  132.         ELSE sym := 37 (*ident*)
  133.         END
  134.       END
  135.     END Identifier;
  136.   
  137.     PROCEDURE Hval(ch: CHAR): INTEGER;
  138.       VAR d: INTEGER;
  139.     BEGIN d := ORD(ch) - 30H; (*d >= 0*)
  140.       IF d >= 10 THEN
  141.         IF (d >= 17) & (d < 23) THEN DEC(d, 7) ELSE d := 0; Mark(2) END
  142.       END ;
  143.       RETURN d
  144.     END Hval;
  145.   
  146.     PROCEDURE Number;
  147.       VAR i, j, h, d, e, n: INTEGER;
  148.       x, f:   REAL;
  149.       y, g: LONGREAL;
  150.       lastCh: CHAR; neg: BOOLEAN;
  151.       dig:    ARRAY maxDig OF CHAR;
  152.   
  153.       PROCEDURE ReadScaleFactor;
  154.       BEGIN Read(ch);
  155.         IF ch = "-" THEN neg := TRUE; Read(ch)
  156.         ELSE neg := FALSE;
  157.           IF ch = "+" THEN Read(ch) END
  158.         END ;
  159.         IF ("0" <= ch) & (ch <= "9") THEN
  160.           REPEAT e := e*10 + ORD(ch)-30H; Read(ch)
  161.           UNTIL (ch < "0") OR (ch >"9")
  162.         ELSE Mark(2)
  163.         END
  164.       END ReadScaleFactor;
  165.   
  166.     BEGIN i := 0;
  167.       REPEAT dig[i] := ch; INC(i); Read(ch)
  168.       UNTIL (ch < "0") OR ("9" < ch) & (CAP(ch) < "A") OR ("Z" < CAP(ch));
  169.       lastCh := ch; j := 0;
  170.       WHILE (j < i-1) & (dig[j] = "0") DO INC(j) END;
  171.       IF (dig[j] = "H") OR (dig[j] = "X") THEN DEC(j) END;
  172.       IF ch = "." THEN Read(ch);
  173.         IF ch = "." THEN lastCh := 0X; ch := 7FX END
  174.       END ;
  175.       IF lastCh = "." THEN (*decimal point*)
  176.         h := i;
  177.         WHILE ("0" <= ch) & (ch <= "9") DO (*read fraction*)
  178.           IF i < maxDig THEN dig[i] := ch; INC(i) END ;
  179.           Read(ch)
  180.         END ;
  181.         IF ch = "D" THEN
  182.           y := 0; g := 1; e := 0;
  183.           WHILE j < h DO y := y*10 + (ORD(dig[j])-30H); INC(j) END ;
  184.           WHILE j < i DO g := g/10; y := (ORD(dig[j])-30H)*g + y; INC(j) END ;
  185.           ReadScaleFactor;
  186.           IF neg THEN
  187.             IF e <= maxLExp THEN y := y / Reals.TenL(e) ELSE y := 0 END
  188.           ELSIF e > 0 THEN
  189.             IF e <= maxLExp THEN y := Reals.TenL(e) * y ELSE y := 0; Mark(203) END
  190.           END ;
  191.           numtyp := 4; lrlval := y
  192.         ELSE x := 0; f := 1; e := 0;
  193.           WHILE j < h DO x := x*10 + (ORD(dig[j])-30H); INC(j) END ;
  194.           WHILE j < i DO f := f/10; x := (ORD(dig[j])-30H)*f + x; INC(j) END ;
  195.           IF ch = "E" THEN ReadScaleFactor END ;
  196.           IF neg THEN
  197.             IF e <= maxExp THEN x := x / Reals.Ten(e) ELSE x := 0 END
  198.           ELSIF e > 0 THEN
  199.             IF e <= maxExp THEN x := Reals.Ten(e) * x ELSE x := 0; Mark(203) END
  200.           END ;
  201.           numtyp := 3; realval := x
  202.         END
  203.       ELSE (*integer*)
  204.         lastCh := dig[i-1]; intval := 0;
  205.         IF lastCh = "H" THEN
  206.           IF j < i THEN
  207.             DEC(i); intval := Hval(dig[j]); INC(j);
  208.             IF i-j <= 7 THEN
  209.               IF (i-j = 7) & (intval >= 8) THEN DEC(intval, 16) END ;
  210.               WHILE j < i DO intval := Hval(dig[j]) + intval * 10H; INC(j) END
  211.             ELSE Mark(203)
  212.             END
  213.           END
  214.         ELSIF lastCh = "X" THEN
  215.           DEC(i);
  216.           WHILE j < i DO
  217.             intval := Hval(dig[j]) + intval*10H; INC(j);
  218.             IF intval > 0FFH THEN Mark(203); intval := 0 END
  219.           END
  220.         ELSE (*decimal*)
  221.           WHILE j < i DO
  222.             d := ORD(dig[j]) - 30H;
  223.             IF d < 10 THEN
  224.               IF intval <= (MAX(LONGINT) - d) DIV 10 THEN intval := intval*10 + d
  225.               ELSE Mark(203); intval := 0
  226.               END
  227.             ELSE Mark(2); intval := 0
  228.             END ;
  229.             INC(j)
  230.           END
  231.         END ;
  232.         IF lastCh = "X" THEN numtyp := 1 ELSE numtyp := 2 END
  233.       END
  234.     END Number;
  235.   
  236.     PROCEDURE Get*(VAR sym: INTEGER);
  237.       VAR s: INTEGER; xch: CHAR;
  238.   
  239.       PROCEDURE Comment;  (* do not read after end of file *)
  240.       BEGIN Read(ch);
  241.         LOOP
  242.           LOOP
  243.             WHILE ch = "(" DO Read(ch);
  244.               IF ch = "*" THEN Comment END
  245.             END ;
  246.             IF ch = "*" THEN Read(ch); EXIT END ;
  247.             IF ch = 0X THEN EXIT END ;
  248.             Read(ch)
  249.           END ;
  250.           IF ch = ")" THEN Read(ch); EXIT END ;
  251.           IF ch = 0X THEN Mark(5); EXIT END
  252.         END
  253.       END Comment;
  254.   
  255.     BEGIN
  256.       LOOP (*ignore control characters*)
  257.         IF ch <= " " THEN
  258.           IF ch = 0X THEN ch := " "; EXIT
  259.           ELSE Read(ch)
  260.           END
  261.         ELSIF ch > 7FX THEN Read(ch)
  262.         ELSE EXIT
  263.         END
  264.       END ;
  265.       CASE ch OF   (* " " <= ch <= 7FX *)
  266.           " "  : s := 62; ch := 0X (*eof*)
  267.         | "!", "$", "%", "'", "?", "@", "\", "_", "`": s :=  0; Read(ch)
  268.         | 22X  : String(s)
  269.         | "#"  : s := 10; Read(ch)
  270.         | "&"  : s :=  5; Read(ch)
  271.         | "("  : Read(ch);
  272.                  IF ch = "*" THEN Comment; Get(s)
  273.                    ELSE s := 29
  274.                  END
  275.         | ")"  : s := 22; Read(ch)
  276.         | "*"  : s :=  1; Read(ch)
  277.         | "+"  : s :=  6; Read(ch)
  278.         | ","  : s := 19; Read(ch)
  279.         | "-"  : s :=  7; Read(ch)
  280.         | "."  : Read(ch);
  281.                  IF ch = "." THEN Read(ch); s := 21 ELSE s := 18 END
  282.         | "/"  : s := 2;  Read(ch)
  283.         | "0".."9": Number; s := 34
  284.         | ":"  : Read(ch);
  285.                  IF ch = "=" THEN Read(ch); s := 33 ELSE s := 20 END
  286.         | ";"  : s := 38; Read(ch)
  287.         | "<"  : Read(ch);
  288.                  IF ch = "=" THEN Read(ch); s := 12 ELSE s := 11 END
  289.         | "="  : s :=  9; Read(ch)
  290.         | ">"  : Read(ch);
  291.                  IF ch = "=" THEN Read(ch); s := 14 ELSE s := 13 END
  292.         | "A".."Z": Identifier(s)
  293.         | "["  : s := 30; Read(ch)
  294.         | "]"  : s := 23; Read(ch)
  295.         | "^"  : s := 17; Read(ch)
  296.         | "a".."z": Identifier(s)
  297.         | "{"  : s := 31; Read(ch)
  298.         | "|"  : s := 39; Read(ch)
  299.         | "}"  : s := 24; Read(ch)
  300.         | "~"  : s := 32; Read(ch)
  301.         | 7FX  : s := 21; Read(ch)
  302.       END ;
  303.       sym := s
  304.     END Get;
  305.   
  306.     PROCEDURE Open*(name: ARRAY OF CHAR);
  307.     BEGIN
  308.       COPY(name, txtpos.name);
  309.       ch := " "; scanerr := FALSE; 
  310.       lastpos := -8; 
  311.       txtpos.line := 1; txtpos.col := 0;
  312.       ifile := Files.Old(name);
  313.       Files.Set(Input, ifile, 0)
  314.     END Open;
  315.  
  316.     PROCEDURE Close*;
  317.     BEGIN Files.Close(ifile);
  318.       IF scanerr THEN Texts.WriteLn(Diag) END;
  319.       Texts.Append(Files.StdErr, Diag.buf)
  320.     END Close;
  321.   
  322.     PROCEDURE EnterKW(sym: INTEGER; name: ARRAY OF CHAR);
  323.       VAR j, k: INTEGER;
  324.     BEGIN j := 0; k := 0;
  325.       REPEAT INC(k, ORD(name[j])); INC(j)
  326.       UNTIL name[j] = 0X;
  327.       k := (k+j) MOD KW;  (*hash function*)
  328.       IF keyTab[k].symb # 0 THEN
  329.         j := k;
  330.         REPEAT INC(k) UNTIL keyTab[k].symb = 0;
  331.         keyTab[j].alt := k
  332.       END ;
  333.       keyTab[k].symb := sym; COPY(name, keyTab[k].id)
  334.     END EnterKW;
  335.   
  336.   BEGIN linecol := FALSE;
  337.     i := KW;
  338.     WHILE i > 0 DO
  339.       DEC(i); keyTab[i].symb := 0; keyTab[i].alt := 0
  340.     END ;
  341.     keyTab[0].id := "";
  342.     EnterKW(27, "DO");
  343.     EnterKW(44, "IF");
  344.     EnterKW(15, "IN");
  345.     EnterKW(16, "IS");
  346.     EnterKW(25, "OF");
  347.     EnterKW( 8, "OR");
  348.     EnterKW(40, "END");
  349.     EnterKW( 4, "MOD");
  350.     EnterKW(35, "NIL");
  351.     EnterKW(58, "VAR");
  352.     EnterKW(45, "CASE");
  353.     EnterKW(41, "ELSE");
  354.     EnterKW(50, "EXIT");
  355.     EnterKW(26, "THEN");
  356.     EnterKW(49, "WITH");
  357.     EnterKW(52, "ARRAY");
  358.     EnterKW(55, "BEGIN");
  359.     EnterKW(56, "CONST");
  360.     EnterKW(42, "ELSIF");
  361.     EnterKW(43, "UNTIL");
  362.     EnterKW(46, "WHILE");
  363.     EnterKW(53, "RECORD");
  364.     EnterKW(47, "REPEAT");
  365.     EnterKW(51, "RETURN");
  366.     EnterKW(59, "PROCEDURE");
  367.     EnterKW(28, "TO");
  368.     EnterKW( 3, "DIV");
  369.     EnterKW(48, "LOOP");
  370.     EnterKW(57, "TYPE");
  371.     EnterKW(60, "IMPORT");
  372.     EnterKW(61, "MODULE");
  373.     EnterKW(54, "POINTER");
  374.  
  375.  
  376.  (* List of Oberon Error Numbers                      *)
  377.  (* N. Wirth / 20.6.87 / David Tolpin Wed Jan 26 1994 *)
  378.  (* 1. Incorrect use of language Oberon               *)
  379.  
  380.     errormsgs[ 0] := "undeclared identifier";
  381.     errormsgs[ 1] := "multiply defined identifier";
  382.     errormsgs[ 2] := "illegal character in number";
  383.     errormsgs[ 3] := "illegal character in string";
  384.     errormsgs[ 4] := "identifier does not match procedure name";
  385.     errormsgs[ 5] := "comment not closed";
  386.     errormsgs[ 6] := "";
  387.     errormsgs[ 7] := "";
  388.     errormsgs[ 8] := "";
  389.     errormsgs[ 9] := "'=' expected";
  390.     errormsgs[10] := "identifier expected";
  391.     errormsgs[11] := "";
  392.     errormsgs[12] := "type definition starts with incorrect symbol";
  393.     errormsgs[13] := "factor starts with incorrect symbol";
  394.     errormsgs[14] := "statement starts with incorrect symbol";
  395.     errormsgs[15] := "declaration followed by incorrect symbol";
  396.     errormsgs[16] := "MODULE expected";
  397.     errormsgs[17] := "number expected";
  398.     errormsgs[18] := "'.' missing";
  399.     errormsgs[19] := "',' missing";
  400.     errormsgs[20] := "':' missing";
  401.     errormsgs[21] := "";
  402.     errormsgs[22] := "')' missing";
  403.     errormsgs[23] := "']' missing";
  404.     errormsgs[24] := "'}' missing";
  405.     errormsgs[25] := "OF missing";
  406.     errormsgs[26] := "THEN missing";
  407.     errormsgs[27] := "DO missing";
  408.     errormsgs[28] := "TO missing";
  409.     errormsgs[29] := "'(' missing";
  410.     errormsgs[30] := "";
  411.     errormsgs[31] := "";
  412.     errormsgs[32] := "";
  413.     errormsgs[33] := "':=' missing";
  414.     errormsgs[34] := "',' or OF expected";
  415.     errormsgs[35] := "";
  416.     errormsgs[36] := "";
  417.     errormsgs[37] := "identifier expected";
  418.     errormsgs[38] := "';' missing";
  419.     errormsgs[39] := "";
  420.     errormsgs[40] := "END missing";
  421.     errormsgs[41] := "";
  422.     errormsgs[42] := "";
  423.     errormsgs[43] := "UNTIL missing";
  424.     errormsgs[44] := "";
  425.     errormsgs[45] := "EXIT not within loop statement";
  426.     errormsgs[46] := "";
  427.     errormsgs[47] := "illegally marked identifier";
  428.     errormsgs[48] := "unsatisfied forward reference";
  429.     errormsgs[49] := "recursive import not allowed";
  430.     errormsgs[50] := "expression should be constant";
  431.     errormsgs[51] := "constant not an integer";
  432.     errormsgs[52] := "identifier does not denote a type";
  433.     errormsgs[53] := "identifier does not denote a record type";
  434.     errormsgs[54] := "result type of procedure is not a basic type";
  435.     errormsgs[55] := "procedure call of a function";
  436.     errormsgs[56] := "assignment to non-variable";
  437.     errormsgs[57] := "pointer not bound to record or array type";
  438.     errormsgs[58] := "recursive type definition";
  439.     errormsgs[59] := "illegal open array parameter";
  440.     errormsgs[60] := "wrong type of case label";
  441.     errormsgs[61] := "inadmissible type of case label";
  442.     errormsgs[62] := "case label defined more than once";
  443.     errormsgs[63] := "index out of bounds";
  444.     errormsgs[64] := "more actual than formal parameters";
  445.     errormsgs[65] := "fewer actual than formal parameters";
  446.     errormsgs[66] := "element types of actual array and formal open array differ";
  447.     errormsgs[67] := "actual parameter corresponding to open array is not an array";
  448.     errormsgs[68] := "";
  449.     errormsgs[69] := "parameter must be an integer constant";
  450.     errormsgs[70] := "";
  451.     errormsgs[71] := "";
  452.     errormsgs[72] := "";
  453.     errormsgs[73] := "procedure must have level 0";
  454.     errormsgs[74] := "";
  455.     errormsgs[75] := "";
  456.     errormsgs[76] := "";
  457.     errormsgs[77] := "object is not a record";
  458.     errormsgs[78] := "dereferenced object is not a variable";
  459.     errormsgs[79] := "indexed object is not a variable";
  460.     errormsgs[80] := "index expression is not an integer";
  461.     errormsgs[81] := "index out of specified bounds";
  462.     errormsgs[82] := "indexed variable is not an array";
  463.     errormsgs[83] := "undefined record field";
  464.     errormsgs[84] := "dereferenced variable is not a pointer";
  465.     errormsgs[85] := "guard or test type is not an extension of variable type";
  466.     errormsgs[86] := "guard or testtype is not a pointer";
  467.     errormsgs[87] := "guarded or tested variable is neither a pointer nor a VAR-parameter record";
  468.     errormsgs[88] := "";
  469.     errormsgs[89] := "";
  470.     errormsgs[90] := "";
  471.     errormsgs[91] := "";
  472.     errormsgs[92] := "operand of IN not an integer, or not a set";
  473.     errormsgs[93] := "set element type is not an integer";
  474.     errormsgs[94] := "operand of & is not of type BOOLEAN";
  475.     errormsgs[95] := "operand of OR is not of type BOOLEAN";
  476.     errormsgs[96] := "operand not applicable to (unary) +";
  477.     errormsgs[97] := "operand not applicable to (unary) -";
  478.     errormsgs[98] := "operand of ~ is not of type BOOLEAN";
  479.     errormsgs[99] := "";
  480.     errormsgs[100] := "incompatible operands of dyadic operator";
  481.     errormsgs[101] := "operand type inapplicable to *";
  482.     errormsgs[102] := "operand type inapplicable to /";
  483.     errormsgs[103] := "operand type inapplicable to DIV";
  484.     errormsgs[104] := "operand type inapplicable to MOD";
  485.     errormsgs[105] := "operand type inapplicable to +";
  486.     errormsgs[106] := "operand type inapplicable to -";
  487.     errormsgs[107] := "operand type inapplicable to = or #";
  488.     errormsgs[108] := "operand type inapplicable to relation";
  489.     errormsgs[109] := "";
  490.     errormsgs[110] := "operand is not a type";
  491.     errormsgs[111] := "operand inapplicable to (this) function";
  492.     errormsgs[112] := "operand is not a variable";
  493.     errormsgs[113] := "incompatible assignment";
  494.     errormsgs[114] := "string too long";
  495.     errormsgs[115] := "parameter discrepancy between type (or name) of variable (or forward procedure) and this procedure";
  496.     errormsgs[116] := "type of variable (or forward procedure) has more parameters than this procedure";
  497.     errormsgs[117] := "type of variable (or forward procedure) has fewer parameters than this procedure";
  498.     errormsgs[118] := "procedure result type of variable (or of forward declaration) differs from result type of this procedure";
  499.     errormsgs[119] := "assigned procedure is not global";
  500.     errormsgs[120] := "type of expression following IF, WHILE, or UNTIL is not BOOLEAN";
  501.     errormsgs[121] := "called object is not a procedure (or is an interrupt procedure)";
  502.     errormsgs[122] := "actual VAR-parameter is not a variable";
  503.     errormsgs[123] := "type of actual parameter is not identical with that of formal VAR-parameter";
  504.     errormsgs[124] := "type of result expression differs from that of procedure";
  505.     errormsgs[125] := "type of case expression is neither INTEGER nor CHAR";
  506.     errormsgs[126] := "this expression cannot be a type or a procedure";
  507.     errormsgs[127] := "illegal use of object";
  508.     errormsgs[128] := "";
  509.     errormsgs[129] := "unsatisfied forward procedure";
  510.     errormsgs[130] := "WITH clause does not specify a variable";
  511.     errormsgs[131] := "LEN not applied to array";
  512.     errormsgs[132] := "dimension in LEN too large or negative";
  513.     errormsgs[133] := "procedure declaration don't match forward declaration";
  514.     errormsgs[150] := "key inconsistency of imported module";
  515.     errormsgs[151] := "incorrect symbol file";
  516.     errormsgs[152] := "symbol file of imported module not found";
  517.     errormsgs[153] := "object or symbol file not opened (disk full?)";
  518.     errormsgs[154] := "";
  519.     errormsgs[155] := "generation of new symbol file not allowed";
  520.     errormsgs[156] := "generation of new h-file is not allowed";
  521.  
  522.  (* 2. Limitations of implementation  *)
  523.  
  524.     errormsgs[200] := "not yet implemented";
  525.     errormsgs[201] := "lower bound of set range greater than higher bound";
  526.     errormsgs[202] := "set element greater  than MAX(SET) or less than 0";
  527.     errormsgs[203] := "number too large";
  528.     errormsgs[204] := "product too large";
  529.     errormsgs[205] := "division by zero";
  530.     errormsgs[206] := "sum too large";
  531.     errormsgs[207] := "difference too large";
  532.     errormsgs[208] := "overflow in arithmetic shift";
  533.     errormsgs[209] := "";
  534.     errormsgs[210] := "";
  535.     errormsgs[211] := "";
  536.     errormsgs[212] := "";
  537.     errormsgs[213] := "";
  538.     errormsgs[214] := "";
  539.     errormsgs[215] := "not enough registers: simplify expression";
  540.     errormsgs[216] := "";
  541.     errormsgs[217] := "parameter must be an integer constant";
  542.     errormsgs[218] := "illegal value of parameter  (32 <= p < 256)";
  543.     errormsgs[219] := "illegal value of parameter  (0 <= p < 16)";
  544.     errormsgs[220] := "illegal value of parameter";
  545.     errormsgs[221] := "imported string is not a constant";
  546.     errormsgs[222] := "";
  547.     errormsgs[223] := "too many record types";
  548.     errormsgs[224] := "too many pointer types";
  549.     errormsgs[225] := "";
  550.     errormsgs[226] := "";
  551.     errormsgs[227] := "too many imported modules";
  552.     errormsgs[228] := "too many exported structures";
  553.     errormsgs[229] := "too many nested records for import";
  554.     errormsgs[230] := "too many constants (strings) in module";
  555.     errormsgs[231] := "";
  556.     errormsgs[232] := "";
  557.     errormsgs[233] := "record extension hierarchy too high";
  558.     errormsgs[234] := "";
  559.     errormsgs[240] := "identifier too long";
  560.     errormsgs[241] := "string too long";
  561.     errormsgs[244] := "character array too long";
  562.  
  563.     Texts.OpenWriter(Diag);
  564. END COCS.
  565.