@x @d banner=='This is WEAVE, Version 2.7' @y @d banner=='This is Weave 2.7 for Cedar 6.0' @z @x @d end_of_WEAVE = 9999 {go here to wrap it up} @y @d end_of_WEAVE = 9999 {go here to wrap it up} @d read_ln == readln @d write_ln == writeln @z @x var @@/ @@/ @y var @@/ @@/ @@/ @z @x @!buf_size=100; {maximum length of input line} @!longest_name=400; {module names shouldn't be longer than this} @!long_buf_size=500; {|buf_size+longest_name|} @y @!buf_size=5000; {maximum length of input line} @!longest_name=400; {module names shouldn't be longer than this} @!long_buf_size=5400; {|buf_size+longest_name|} @z @x @!max_refs=20000; {number of cross references; must be less than 65536} @y @!max_refs=25000; {number of cross references; must be less than 65536} @z @x @d last_text_char=127 {ordinal number of the largest element of |text_char|} @y @d last_text_char=255 {ordinal number of the largest element of |text_char|} @z @x for i:=1 to @'37 do xchr[i]:=' '; @y for i:=1 to @'37 do xchr[i]:=chr(i); @z @x rewrite(term_out,'TTY:'); {send |term_out| output to the terminal} @y tty_rewrite(term_out); {send |term_out| output to the terminal} @z @x begin reset(web_file); reset(change_file); @y begin file_reset(web_file, 'web '); file_reset(change_file, 'changes '); @z @x rewrite(tex_file); @y file_rewrite(tex_file, 'tex '); @z @x begin if changing then print('. (change file ')@+else print('. ('); print_ln('l.', line:1, ')'); if loc>=limit then l:=limit else l:=loc; @y begin if loc>=limit then l:=limit else l:=loc; if changing then print_ln('. (change file pos:', file_get_pos(change_file)-(limit-l)-2:1, ')') else print_ln('. (pos:', file_get_pos(web_file)-(limit-l)-2:1, ')'); @z @x @ @= @!xmem:array[xref_number] of packed record@t@>@/ @!num_field: sixteen_bits; {module number plus zero or |def_flag|} @!xlink_field: sixteen_bits; {pointer to the previous cross reference} end; @y @ @= @!xmem_record=packed record@t@>@/ @!num_field: sixteen_bits; {module number plus zero or |def_flag|} @!xlink_field: sixteen_bits; {pointer to the previous cross reference} end; @ @= @!xmem:array[xref_number] of xmem_record; @z @x @!c,@!d:ASCII_code; {characters from the buffer} @y @!d:ASCII_code; {character from the buffer} @z @x @!j:0..max_scraps; {runs through final scraps} @!k:0..long_buf_size; {index into |buffer|} @y @!j:0..max_scraps; {runs through final scraps} @z @x if num(cur_xref)<>module_count+def_flag then @y mod_count_plus_def_flag := module_count+def_flag; if num(cur_xref)<>mod_count_plus_def_flag then @z @x procedure Phase_II; begin @; end; @y procedure Phase_II; var mod_count_plus_def_flag: sixteen_bits; begin @; end; @# procedure Phase_III; begin @; end; @z @x Phase_I; Phase_II;@/ @; @y Phase_I; Phase_II; Phase_III;@/ @z @x @t\4\4@>{here files should be closed if the operating system requires it} @y file_close(web_file); file_close(change_file); file_close(tex_file); @z @x @; @y @; new_line; @z @x @* System-dependent changes. This module should be replaced, if necessary, by changes to the program that are necessary to make \.{WEAVE} work at a particular installation. It is usually best to design your change file so that all changes to previous modules preserve the module numbering; then everybody's version will be consistent with the printed program. More extensive changes, which introduce new modules, can be inserted here; then only the index itself will get a new module number. @^system dependencies@> @y @* System-dependent changes. Here at PARC, any Pascal output by Tangle must be transliterated into Cedar by McCreight's PasMesa compiler before it can be executed. Rather than incorporate the funny features of Pascal-H into PasMesa, we instead here declare some procedures |external| that we never intend to implement in Pascal at all. Instead, these procedures are written by hand in Cedar, and are linked in with the translated Pascal program by the Cedar binding process. @^changed modules@> @^system dependencies@> @= procedure tty_rewrite(var f: text_file); external; {set up for output to terminal} procedure file_reset(var f: text_file; ext: alfa); external; {set up for input from file} procedure file_rewrite(var f: text_file; ext: alfa); external; {set up for output to file} procedure file_close(var f: text_file); external; {close a file} function file_get_pos(var f: text_file):integer; external; {return character count} @z "File: Weave.changes Last Changed by Pavel on September 15, 1985 4:10:19 pm PDT 003033: Change the banner line. 003464: Define read_ln and write_ln as macros, expanding to themselves without the underscores so that PasMesa doesn't throw up on them. 003716: Allow for external procedure and function declarations for things implemented directly in Cedar, rather than in Pascal. 008116: Up the buf_size to something reasonable. 008378: TeX needs more cross-references. 013661: Allow for eight-bit characters in the input files. 019341: Pretend that we have the MIT character set. 020988: Hook up tty open call to Cedar. 022012: Hook up file open calls to Cedar. 022302: Hook up more file open calls to Cedar. 026191: Report error locations using character counts instead of line numbers. 035848: Change declaration of xmem from array of explicit record type into array of named record type, so that the Cedar compiler won't find a type mismatch. 084826: Remove declaration of the unreferenced variable, c 131827: Remove declaration of the unreferenced variable, k 167121: Compute a sixteen_bits intermediate result so that the Cedar compiler won't get a signed/unsigned ambiguity. This piece of code is in the procedure Phase_II, which is conveniently already in a change, below. We declare the new variable as a local variable in that procedure. 181950: Encapsulate Phase III in a procedure so we can make the main program smaller. As is, it doesn't fit in a single Mesa module (sigh). ALSO, declare the new variable for change 167121. 182130: The rest of the job of encapsulating Phase III. 182283: Close files. 182357: Add a final carriage return after the job history 183401: Add Cedar forward declarations. These are here, rather than in the .mod file, because their types refer to a macro, namely `text_file'. Κ­˜J™J™:J™unitšœ™šœ˜Jšœ'˜'—šœ˜Jšœ,˜,—Jšœ˜—šœˆ™ˆšœ˜Jšœ.˜.—šœ˜Jšœ.˜.J˜J˜—Jšœ˜—™˜J˜$J˜—˜J˜$J˜NJ˜—J˜—šœ0™0šœ˜Jšœ.˜.Jšœ@˜@Jšœ.˜.—šœ˜Jšœ/˜/Jšœ@˜@Jšœ/˜/—Jšœ˜—šœ(™(šœ˜J˜G—šœ˜J˜G—Jšœ˜—šœ:™:šœ˜JšœL˜L—šœ˜JšœL˜L—Jšœ˜—šœ3™3šœ˜Jšœ!˜!—šœ˜Jšœ$˜$—Jšœ˜—™'˜J˜B—˜J˜?—J˜—™)˜J˜*—˜J˜P—J˜—™.˜J˜—˜J˜%—J˜—šœN™Nšœ˜JšœC˜CJšœ˜Jšœ(˜(—šœ˜Jšœ.˜.˜J˜M—J˜D—Jšœ˜—šœ™šœ˜Jšœ˜Jšœ0˜0JšœD˜DJšœH˜HJšœ˜—šœ˜J˜Jšœ!˜!JšœD˜DJšœH˜HJšœ˜J˜Jšœ˜Jšœ)˜)—Jšœ˜—šœ:™:šœ˜Jšœ0˜0—šœ˜Jšœ+˜+—Jšœ˜—šœ:™:šœ˜J˜.Jšœ+˜+—šœ˜J˜.—Jšœ˜—šœœ™œšœ˜Jšœ,˜,—šœ˜Jšœ1˜1Jšœ.˜.—Jšœ˜—šœΏ™Ώ˜J˜J˜J˜—˜J˜Jšœ*˜*J˜J˜J˜J˜J˜J˜—J˜—™7˜J˜J˜—˜J˜—J˜—™˜J˜I—˜J˜.J˜—J˜—šœ9™9šœ˜Jšœ˜—šœ˜Jšœ˜J˜ —Jšœ˜—šœ™˜J˜„—˜J˜ψ—J˜——…—β±