home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / pascal / part01 / READ.ME < prev   
Encoding:
Text File  |  1991-09-27  |  6.3 KB  |  197 lines

  1. This is the Pascal source of a public domain Pascal compiler and
  2. interpreter. The entire code is documented in the book:
  3.     Pascal Implementation
  4.     by Steven Pemberton and Martin Daniels
  5.     published by Ellis Horwood, Chichester, UK,
  6. (also available in Japanese).
  7. It was distributed by John Wiley in other countries, but now that
  8. Prentice Hall has taken over Ellis Horwood, that may have changed.
  9.  
  10. Steven Pemberton is contactable by email as steven@cwi.nl.
  11.  
  12. The code here is slightly different from that in the book, but the
  13. line numbers have been kept the same.  The changes were to allow
  14. modern Pascal compilers to compile the source (there were some slight
  15. laxities in the original code).
  16.  
  17. The type marktype is added for the parameters of the routines mark and
  18. release:
  19.     76c76
  20.     < 
  21.     ---
  22.     >      marktype= ^integer;
  23.  
  24. The type setty (which represents set types) is added for the new type
  25. compatibility rules of ISO Pascal:
  26.     95c95
  27.     < 
  28.     ---
  29.     >      setty = set of setlow..sethigh;
  30.     100c100
  31.     <                          pset: (pval: set of setlow..sethigh);
  32.     ---
  33.     >                          pset: (pval: setty);
  34.  
  35. Missing variant parts:
  36.     123c123
  37.     <                                   declared: (fconst: ctp));
  38.     ---
  39.     >                                   declared: (fconst: ctp); standard: ());
  40.     145a146
  41.     >                      types: ();
  42.     149,150c150
  43.     <                      proc,
  44.     <                      func:  (case pfdeckind: declkind of
  45.     ---
  46.     >                      proc, func:  (case pfdeckind: declkind of
  47.     154,155c154,155
  48.     <                                            actual: (forwdecl, extern:
  49.     <                                                     boolean)))
  50.     ---
  51.     >                                            actual: (forwdecl, extern: boolean);
  52.     >                                            formal: ()))
  53.  
  54. Pcom has the files prr and prd as standard identifiers. You have to
  55. declare them for other compilers:
  56.     193d192
  57.     < 
  58.     194a194
  59.     >     prr: text; (* comment this out when compiling with pcom *)
  60.     299d298
  61.     < 
  62.  
  63. Other compilers don't have the routines mark and release. Their
  64. effective semantics are null; you just waste heap:
  65.     300a300,301
  66.     >   procedure mark(var p: marktype); begin end;
  67.     >   procedure release(p: marktype); begin end;
  68.     302d302
  69.     < 
  70.  
  71. Output the line number with error messages, so that if the listing
  72. option has been switched off, you still know which line is in error:
  73.     307c307
  74.     <       begin write(output,' ****  ':15);
  75.     ---
  76.     >       begin write(output,linecount:6,' ****  ':9);
  77.  
  78. Accept tabs as white-space as well:
  79.     398c398
  80.     <     repeat while (ch = ' ') and not eol do nextch;
  81.     ---
  82.     >     repeat while ((ch = ' ') or (ch = '    ')) and not eol do nextch;
  83.  
  84. Jumping from the then part of an if into the else part is not allowed;
  85. fix cases like 1..10 in another way:
  86.     429c429
  87.     <           if (ch = '.') or (ch = 'e') then
  88.     ---
  89.     >           if ((ch = '.') and (input^ <> '.')) or (ch = 'e') then
  90.     434c434
  91.     <                       nextch; if ch = '.' then begin ch := ':'; goto 3 end;
  92.     ---
  93.     >                       nextch; (*if ch = '.' then begin ch := ':'; goto 3 end;*)
  94.  
  95. Fix modern type mismatches:
  96.     668c668
  97.     <   procedure align(fsp: stp; var flc: integer);
  98.     ---
  99.     >   procedure align(fsp: stp; var flc: addrrange);
  100.  
  101. An identifier misspelled after the 8th character:
  102.     872c872
  103.     <           if sy = stringconstsy then
  104.     ---
  105.     >           if sy = stringconst then
  106.  
  107. Unused variables, and new type names:
  108.     1529,1531c1529,1531
  109.     <       var oldlev: 0..maxlevel; lsy: symbol; lcp,lcp1: ctp; lsp: stp;
  110.     <           forw: boolean; oldtop: disprange; parcnt: integer;
  111.     <           llc,lcm: addrrange; lbname: integer; markp: ^integer;
  112.     ---
  113.     >       var oldlev: 0..maxlevel; lcp,lcp1: ctp; lsp: stp;
  114.     >           forw: boolean; oldtop: disprange;
  115.     >           llc,lcm: addrrange; lbname: integer; markp: marktype;
  116.     1535c1535
  117.     <           llc: addrrange; count,lsize: integer;
  118.     ---
  119.     >           llc,lsize: addrrange; count: integer;
  120.     1819c1819
  121.     <           i, entname, segsize: integer;
  122.     ---
  123.     >           entname, segsize: integer;
  124.     2087c2087
  125.     <         var lattr: attr; lcp: ctp; lsize,lmin,lmax: integer;
  126.     ---
  127.     >         var lattr: attr; lcp: ctp; lsize: addrrange; lmin,lmax: integer;
  128.     2248c2248
  129.     <             var lcp:ctp; llev:levrange; laddr:addrrange;
  130.     ---
  131.     >             var llev:levrange; laddr:addrrange;
  132.     2306c2306
  133.     <                 lcp:ctp; llev:levrange; laddr,len:addrrange;
  134.     ---
  135.     >                 llev:levrange; laddr,len:addrrange;
  136.     2456,2457c2456,2457
  137.     <             var lsp,lsp1: stp; varts,lmin,lmax: integer;
  138.     <                 lsize,lsz: addrrange; lval: valu;
  139.     ---
  140.     >             var lsp,lsp1: stp; varts: integer;
  141.     >                 lsize: addrrange; lval: valu;
  142.     2750c2750
  143.     <                     cstpart: set of 0..47; lsp: stp;
  144.     ---
  145.     >                     cstpart: setty; lsp: stp;
  146.  
  147. Unix pc can't cope with this line:
  148.     2926c2926
  149.     <             (*/*)     rdiv: begin
  150.     ---
  151.     >             (* / *)   rdiv: begin
  152.  
  153. More unused variables:
  154.     3318c3318
  155.     <           var lattr: attr; lsp: stp;  lsy: symbol;
  156.     ---
  157.     >           var lattr: attr;  lsy: symbol;
  158.     3642c3642
  159.     <     var sp: stp;
  160.     ---
  161.     > 
  162.  
  163. Produce code as default:
  164.     3800c3800
  165.     <     prtables := false; list := true; prcode := false; debug := true;
  166.     ---
  167.     >     prtables := false; list := true; prcode := true; debug := true;
  168.  
  169. Unused variable:
  170.     3868c3868
  171.     <       var i: integer; ch: char;
  172.     ---
  173.     >       var i: integer;
  174.  
  175. Other compilers need to rewrite prr before using it:
  176.     3995,3996c3995,3996
  177.     <   (*compile:*)
  178.     <   (**********)
  179.     ---
  180.     >   (*compile:*) rewrite(prr); (*comment this out when compiling with pcom *)
  181.     >   (**********)
  182.  
  183. Differences in the interpreter are minimal: a set type has been added:
  184.  
  185.     45a46
  186.     >       settype     = set of 0..58;
  187.     63c64
  188.     <                                 sett       :(vs :set of 0..47);
  189.     ---
  190.     >                                 sett       :(vs :settype);
  191.     225c226
  192.     <       var name :alfa;  b :boolean;  r :real;  s :set of 0..58;
  193.     ---
  194.     >       var name :alfa;  b :boolean;  r :real;  s :settype;
  195.  
  196. End of differences
  197.