User Tools

Site Tools


Action unknown: copypageplugin__copy
cdc:nos2.source:opl.opl871:deck:tduex

Deck TDUEX

Library Member Format: MODIFY

Source

Seq #  *Modification Id* Act 
----------------------------+
00001  M00S00001.tduex   +++|*NOSEQ
00002  M00S00002.tduex   +++|*WIDTH 95
00003  M00S00003.tduex   +++|MODULE tduex;
00004  M00S00004.tduex   +++|
00005  M00S00005.tduex   +++|?? SET ( CHKALL := ON ), RIGHT := 110 ??
00006  M00S00006.tduex   +++|
00007  M00S00007.tduex   +++|{  Program:  TDUEX  }
Line S00001 Modification History
M01 (Added by) 281l803
Seq #  *Modification Id* Act 
----------------------------+
00008  M01S00001.281l803 +++|{            Copyright Control Data Systems Inc.  1992.  }
00009  M00S00008.tduex   +++|{  Written:  1/84 by R. Lindsey  }
00010  M00S00009.tduex   +++|{  Version:  Cyber 170, version 1 }
00011  M00S00010.tduex   +++|{  Purpose:  Compile terminal definitions for the use of the terminal- }
00012  M00S00011.tduex   +++|{            independent handler VIRTERM.  This handler is used by FSE, }
00013  M00S00012.tduex   +++|{            SCREEN, and possibly other programs.  }
00014  M00S00013.tduex   +++|{            TDU takes its input ("source") in the form of SCL-like statements}
00015  M00S00014.tduex   +++|{            which define the characteristics of the particular terminal.  }
00016  M00S00015.tduex   +++|{            As output ("object") it produces a Virtual Terminal Table (VTT) }
00017  M00S00016.tduex   +++|{            which is in the form of COMPASS source code.  This source is }
00018  M00S00017.tduex   +++|{            in turn fed through COMPASS which produces a relocatable version,}
00019  M00S00018.tduex   +++|{            which is then linked to produce the absolute version that can be }
00020  M00S00019.tduex   +++|{            directly loaded by VIRTERM.  }
00021  M00S00020.tduex   +++|{  Modules:  The TDU program is composed of four separately compiled modules: }
00022  M00S00021.tduex   +++|{            o  TDUEX (this module) is the main program.  It calls procedures }
00023  M00S00022.tduex   +++|{               from the other modules.  This module also supplies file- and }
00024  M00S00023.tduex   +++|{               error-handling procedures used by all the other modules. }
00025  M00S00024.tduex   +++|{            o  TDUIN performs the input handling functions.  It reads the }
00026  M00S00025.tduex   +++|{               TDL source file, translates it into intermediate form, and }
00027  M00S00026.tduex   +++|{               writes that intermediate output to internal tables managed }
00028  M00S00027.tduex   +++|{               by TDUTAB. }
00029  M00S00028.tduex   +++|{            o  TDUTAB manages the intermediate data produced by TDUIN and }
00030  M00S00029.tduex   +++|{               consumed by TDUOUT.  It hides, as much as possible, all the }
00031  M00S00030.tduex   +++|{               details of the tables which contain this data.  This serves }
00032  M00S00031.tduex   +++|{               to isolate TDUIN and TDUOUT from changes made in each other. }
00033  M00S00032.tduex   +++|{            o  TDUOUT produces the output table from the intermediate data. }
00034  M00S00033.tduex   +++|{               It hides all details of target machine word and byte sizes, }
00035  M00S00034.tduex   +++|{               alignment, and object code format (e.g., the CYBER 170 }
00036  M00S00035.tduex   +++|{               version produces COMPASS source code). }
00037  M00S00036.tduex   +++|
00038  M00S00037.tduex   +++|{ ?? PUSH ( LIST := OFF ) ??          { un-comment this list for no comm list }
00039  M00S00038.tduex   +++|  ?? PUSH ( LIST := ON ) ??           { un-comment this line for commdeck list}
00040  M00S00039.tduex   +++|
00041  M00S00040.tduex   +++|?? NEWTITLE := 'File I/O' ??
00042  M00S00041.tduex   +++|
00043  M00S00042.tduex   +++|{ ***************************************** }
00044  M00S00043.tduex   +++|{ common deck pxiotyp, for file i/o follows }
00045  M00S00044.tduex   +++|*CALL PXIOTYP
00046  M00S00045.tduex   +++|
00047  M00S00046.tduex   +++|{ ********************************************* }
00048  M00S00047.tduex   +++|{ common deck lgz, for legible file i/o follows }
00049  M00S00048.tduex   +++|*CALLALL LGZ
00050  M00S00049.tduex   +++|
00051  M00S00050.tduex   +++|{ ************************************ }
00052  M00S00051.tduex   +++|{ common deck fz, for file i/o follows }
00053  M00S00052.tduex   +++|*CALLALL FZ
00054  M00S00053.tduex   +++|
00055  M00S00054.tduex   +++|?? OLDTITLE ??
00056  M00S00055.tduex   +++|?? POP ??
00057  M00S00056.tduex   +++|?? NEWTITLE := 'Error handling, initialization, and messages' ??
00058  M00S00057.tduex   +++|?? EJECT ??
00059  M00S00058.tduex   +++|
00060  M00S00059.tduex   +++|{ ************************************************************** }
00061  M00S00060.tduex   +++|{ constants and types for procedures which are XDCL'ed in TDUEX: }
00062  M00S00061.tduex   +++|*CALL ZTDCERR
00063  M00S00062.tduex   +++|*CALL ZTDTFIL
00064  M00S00063.tduex   +++|
00065  M00S00064.tduex   +++|{ ************************ }
00066  M00S00065.tduex   +++|{ parser error conditions: }
00067  M00S00066.tduex   +++|*CALL ZTDAMT0
00068  M00S00067.tduex   +++|*CALL ZTDCCON
00069  M00S00068.tduex   +++|*CALL ZTDCCLC
00070  M00S00069.tduex   +++|
00071  M00S00070.tduex   +++|{ **************************** }
00072  M00S00071.tduex   +++|{ initialization & termination }
00073  M00S00072.tduex   +++|*CALL ZUTPCSA
00074  M00S00073.tduex   +++|*CALL ZOSPINI
00075  M00S00074.tduex   +++|*CALL ZOSPEND
00076  M00S00075.tduex   +++|
00077  M00S00076.tduex   +++|{ ************************* }
00078  M00S00077.tduex   +++|{ status message formatting }
00079  M00S00078.tduex   +++|*CALL ZOSPFMG
00080  M00S00079.tduex   +++|
00081  M00S00080.tduex   +++|?? OLDTITLE ??
00082  M00S00081.tduex   +++|
00083  M00S00082.tduex   +++|  PROCEDURE [XREF] read_tdl_statements;
00084  M00S00083.tduex   +++|
00085  M00S00084.tduex   +++|  PROCEDURE [XREF] initialize_tables;
00086  M00S00085.tduex   +++|
00087  M00S00086.tduex   +++|  PROCEDURE [XREF] write_tables;
00088  M00S00087.tduex   +++|
00089  M00S00088.tduex   +++|  PROCEDURE [XREF] optimize_tables;
00090  M00S00089.tduex   +++|
00091  M00S00090.tduex   +++|  ?? EJECT ??
00092  M00S00091.tduex   +++|{ ?? POP ??
00093  M00S00092.tduex   +++|
00094  M00S00093.tduex   +++|  VAR
00095  M00S00094.tduex   +++|     tdu_version_num: [XDCL] INTEGER := 1; { version 1 }
00096  M00S00095.tduex   +++|
00097  M00S00096.tduex   +++|  VAR
00098  M00S00097.tduex   +++|     error_flag: BOOLEAN := FALSE,    { an error has occurred }
00099  M00S00098.tduex   +++|
00100  M00S00099.tduex   +++|     input_file,
00101  M00S00100.tduex   +++|     output_file,
00102  M00S00101.tduex   +++|     error_file: file,
00103  M00S00102.tduex   +++|     input_file_name,                 { from control statement }
00104  M00S00103.tduex   +++|     output_file_name,
00105  M00S00104.tduex   +++|     error_file_name: ost$name_descriptor,
00106  M00S00105.tduex   +++|
00107  M00S00106.tduex   +++|     status: ost$status,
00108  M00S00107.tduex   +++|
00109  M00S00108.tduex   +++|     command_name: ost$name_descriptor,
00110  M00S00109.tduex   +++|     control_statement_arguments: ARRAY [ 1 .. 3 ] OF STRING(7)
00111  M00S00110.tduex   +++|        := [ 'TDUIN', 'TDUOUT', 'OUTPUT' ];
00112  M00S00111.tduex   +++|
00113  M00S00112.tduex   +++|  ?? NEWTITLE := 'open_file' ??
00114  M00S00113.tduex   +++|  ?? EJECT ??
00115  M00S00114.tduex   +++|
00116  M00S00115.tduex   +++|  PROCEDURE [XDCL] open_file (file_id: file_selector;
00117  M00S00116.tduex   +++|        input_output: input_output_selector;
00118  M00S00117.tduex   +++|        code_set: code_set_selector);
00119  M00S00118.tduex   +++|     VAR
00120  M00S00119.tduex   +++|        f: file,
00121  M00S00120.tduex   +++|        f_name: ost$name_descriptor;
00122  M00S00121.tduex   +++|
00123  M00S00122.tduex   +++|     CASE file_id OF
00124  M00S00123.tduex   +++|        = input_file_sel =
00125  M00S00124.tduex   +++|           f := input_file;
00126  M00S00125.tduex   +++|           f_name := input_file_name;
00127  M00S00126.tduex   +++|        = output_file_sel =
00128  M00S00127.tduex   +++|           f := output_file;
00129  M00S00128.tduex   +++|           f_name := output_file_name;
00130  M00S00129.tduex   +++|        = error_file_sel =
00131  M00S00130.tduex   +++|           f := error_file;
00132  M00S00131.tduex   +++|           f_name := error_file_name;
00133  M00S00132.tduex   +++|     CASEND;
00134  M00S00133.tduex   +++|     CASE input_output OF
00135  M00S00134.tduex   +++|        = input_sel =
00136  M00S00135.tduex   +++|           lg#open(f, f_name.str(1,f_name.length), old#, input#, first#);
00137  M00S00136.tduex   +++|        = output_sel =
00138  M00S00137.tduex   +++|           lg#open(f, f_name.str(1,f_name.length), new#, output#, first#);
00139  M00S00138.tduex   +++|     CASEND;
00140  M00S00139.tduex   +++|     CASE code_set OF
00141  M00S00140.tduex   +++|        = ascii_sel =
00142  M00S00141.tduex   +++|           ;
00143  M00S00142.tduex   +++|        = ascii64_sel =
00144  M00S00143.tduex   +++|           lg#codeset(f, ascii64#);   { use 6-bit display code }
00145  M00S00144.tduex   +++|     CASEND;
00146  M00S00145.tduex   +++|     CASE file_id OF
00147  M00S00146.tduex   +++|        = input_file_sel =
00148  M00S00147.tduex   +++|           input_file := f;
00149  M00S00148.tduex   +++|        = output_file_sel =
00150  M00S00149.tduex   +++|           output_file := f;
00151  M00S00150.tduex   +++|        = error_file_sel =
00152  M00S00151.tduex   +++|           error_file := f;
00153  M00S00152.tduex   +++|     CASEND;
00154  M00S00153.tduex   +++|  PROCEND open_file;
00155  M00S00154.tduex   +++|  ?? OLDTITLE ??
00156  M00S00155.tduex   +++|
00157  M00S00156.tduex   +++|  ?? NEWTITLE := 'close_file' ??
00158  M00S00157.tduex   +++|  ?? SKIP := 4 ??
00159  M00S00158.tduex   +++|
00160  M00S00159.tduex   +++|  PROCEDURE [XDCL] close_file (file_id: file_selector);
00161  M00S00160.tduex   +++|     CASE file_id OF
00162  M00S00161.tduex   +++|        = input_file_sel =
00163  M00S00162.tduex   +++|           lg#close(input_file, first#);
00164  M00S00163.tduex   +++|        = output_file_sel =
00165  M00S00164.tduex   +++|           lg#close(output_file, first#);
00166  M00S00165.tduex   +++|        = error_file_sel =
00167  M00S00166.tduex   +++|           lg#close(error_file, first#);
00168  M00S00167.tduex   +++|     CASEND;
00169  M00S00168.tduex   +++|  PROCEND close_file;
00170  M00S00169.tduex   +++|  ?? OLDTITLE ??
00171  M00S00170.tduex   +++|
00172  M00S00171.tduex   +++|  ?? NEWTITLE := 'get_file' ??
00173  M00S00172.tduex   +++|  ?? EJECT ??
00174  M00S00173.tduex   +++|
00175  M00S00174.tduex   +++|  PROCEDURE [XDCL] get_file (file_id: file_selector;
00176  M00S00175.tduex   +++|        VAR text: STRING(*);
00177  M00S00176.tduex   +++|        VAR text_len: INTEGER;
00178  M00S00177.tduex   +++|        VAR eof_flag: BOOLEAN);
00179  M00S00178.tduex   +++|     VAR
00180  M00S00179.tduex   +++|        structure_mark: file_mark;
00181  M00S00180.tduex   +++|
00182  M00S00181.tduex   +++|     text := '';
00183  M00S00182.tduex   +++|     CASE file_id OF
00184  M00S00183.tduex   +++|        = input_file_sel =
00185  M00S00184.tduex   +++|           lg#get(input_file, text_len, text);
00186  M00S00185.tduex   +++|           f#mark(input_file, structure_mark);
00187  M00S00186.tduex   +++|        = output_file_sel =
00188  M00S00187.tduex   +++|           lg#get(output_file, text_len, text);
00189  M00S00188.tduex   +++|           f#mark(output_file, structure_mark);
00190  M00S00189.tduex   +++|        = error_file_sel =
00191  M00S00190.tduex   +++|           lg#get(error_file, text_len, text);
00192  M00S00191.tduex   +++|           f#mark(error_file, structure_mark);
00193  M00S00192.tduex   +++|     CASEND;
00194  M00S00193.tduex   +++|     IF ( structure_mark = eof# ) OR
00195  M00S00194.tduex   +++|        ( structure_mark = eoi# ) THEN
00196  M00S00195.tduex   +++|        eof_flag := TRUE
00197  M00S00196.tduex   +++|     ELSE
00198  M00S00197.tduex   +++|        eof_flag := FALSE
00199  M00S00198.tduex   +++|     IFEND
00200  M00S00199.tduex   +++|  PROCEND get_file;
00201  M00S00200.tduex   +++|  ?? OLDTITLE ??
00202  M00S00201.tduex   +++|
00203  M00S00202.tduex   +++|  ?? NEWTITLE := 'put_file' ??
00204  M00S00203.tduex   +++|  ?? SKIP := 4 ??
00205  M00S00204.tduex   +++|
00206  M00S00205.tduex   +++|  PROCEDURE [XDCL] put_file (file_id: file_selector;
00207  M00S00206.tduex   +++|        text: STRING(*));
00208  M00S00207.tduex   +++|     CASE file_id OF
00209  M00S00208.tduex   +++|        = input_file_sel =
00210  M00S00209.tduex   +++|           lg#put(input_file, text);
00211  M00S00210.tduex   +++|        = output_file_sel =
00212  M00S00211.tduex   +++|           lg#put(output_file, text);
00213  M00S00212.tduex   +++|        = error_file_sel =
00214  M00S00213.tduex   +++|           lg#put(error_file, text);
00215  M00S00214.tduex   +++|     CASEND
00216  M00S00215.tduex   +++|  PROCEND put_file;
00217  M00S00216.tduex   +++|  ?? OLDTITLE ??
00218  M00S00217.tduex   +++|
00219  M00S00218.tduex   +++|  ?? NEWTITLE := 'report_error' ??
00220  M00S00219.tduex   +++|  ?? EJECT ??
00221  M00S00220.tduex   +++|
00222  M00S00221.tduex   +++|  PROCEDURE [XDCL] report_error (text: STRING(*));
00223  M00S00222.tduex   +++|     VAR
00224  M00S00223.tduex   +++|        str_ndx,
00225  M00S00224.tduex   +++|        str_length: INTEGER;
00226  M00S00225.tduex   +++|
00227  M00S00226.tduex   +++|     IF NOT error_flag THEN
00228  M00S00227.tduex   +++|        open_file(error_file_sel, output_sel, ascii_sel);
00229  M00S00228.tduex   +++|        error_flag := TRUE
00230  M00S00229.tduex   +++|     IFEND;
00231  M00S00230.tduex   +++|     str_ndx := 1;
00232  M00S00231.tduex   +++|     WHILE str_ndx <= STRLENGTH(text) DO
00233  M00S00232.tduex   +++|        str_length := ( STRLENGTH(text) - str_ndx ) + 1;
00234  M00S00233.tduex   +++|        IF str_length > 80 THEN
00235  M00S00234.tduex   +++|           str_length := 80
00236  M00S00235.tduex   +++|        IFEND;
00237  M00S00236.tduex   +++|        put_file(error_file_sel, text(str_ndx, str_length));
00238  M00S00237.tduex   +++|        str_ndx := str_ndx + str_length
00239  M00S00238.tduex   +++|     WHILEND
00240  M00S00239.tduex   +++|  PROCEND report_error;
00241  M00S00240.tduex   +++|  ?? OLDTITLE ??
00242  M00S00241.tduex   +++|
00243  M00S00242.tduex   +++|  ?? NEWTITLE := 'error_status' ??
00244  M00S00243.tduex   +++|  ?? EJECT ??
00245  M00S00244.tduex   +++|
00246  M00S00245.tduex   +++|  PROCEDURE [XDCL] error_status (status: ost$status);
00247  M00S00246.tduex   +++|     VAR
00248  M00S00247.tduex   +++|        reentry,
00249  M00S00248.tduex   +++|        message_complete: BOOLEAN,
00250  M00S00249.tduex   +++|        length: 0 .. osc$max_string_length,
00251  M00S00250.tduex   +++|        msg: STRING(79);
00252  M00S00251.tduex   +++|
00253  M00S00252.tduex   +++|     report_error(' ');
00254  M00S00253.tduex   +++|     reentry := FALSE;
00255  M00S00254.tduex   +++|     REPEAT
00256  M00S00255.tduex   +++|        osp$format_message(reentry, message_complete, length,
00257  M00S00256.tduex   +++|           msg, status);
00258  M00S00257.tduex   +++|        report_error(msg(1,length));
00259  M00S00258.tduex   +++|        reentry := TRUE;
00260  M00S00259.tduex   +++|     UNTIL message_complete;
00261  M00S00260.tduex   +++|  PROCEND error_status;
00262  M00S00261.tduex   +++|  ?? OLDTITLE ??
00263  M00S00262.tduex   +++|
00264  M00S00263.tduex   +++|  ?? NEWTITLE := 'interpret_control_statement' ??
00265  M00S00264.tduex   +++|  ?? EJECT ??
00266  M00S00265.tduex   +++|
00267  M00S00266.tduex   +++|  PROCEDURE interpret_control_statement;
00268  M00S00267.tduex   +++|     VAR
00269  M00S00268.tduex   +++|        command_line_pointer: ^STRING(*),
00270  M00S00269.tduex   +++|        command_line_index: clt$string_index;
00271  M00S00270.tduex   +++|
00272  M00S00271.tduex   +++|     osp$initiate(command_name, command_line_pointer,
00273  M00S00272.tduex   +++|        command_line_index, status);
00274  M00S00273.tduex   +++|     utp$get_control_statement_args(control_statement_arguments);
00275  M00S00274.tduex   +++|     input_file_name.typ := clc$nos170_name;
00276  M00S00275.tduex   +++|     input_file_name.length := 7;
00277  M00S00276.tduex   +++|     input_file_name.str := control_statement_arguments[1];
00278  M00S00277.tduex   +++|     output_file_name.typ := clc$nos170_name;
00279  M00S00278.tduex   +++|     output_file_name.length := 7;
00280  M00S00279.tduex   +++|     output_file_name.str := control_statement_arguments[2];
00281  M00S00280.tduex   +++|     error_file_name.typ := clc$nos170_name;
00282  M00S00281.tduex   +++|     error_file_name.length := 7;
00283  M00S00282.tduex   +++|     error_file_name.str := control_statement_arguments[3]
00284  M00S00283.tduex   +++|  PROCEND interpret_control_statement;
00285  M00S00284.tduex   +++|  ?? OLDTITLE ??
00286  M00S00285.tduex   +++|  ?? EJECT ??
00287  M00S00286.tduex   +++|
00288  M00S00287.tduex   +++|  PROGRAM tduex;
Line S00288 Modification History
M01 (Removed by) tduex1
Seq #  *Modification Id* Act 
----------------------------+
00289  M01S00288.tduex1  ---|     utp$start_metrics_time;
00290  M00S00289.tduex   ---|     interpret_control_statement;
00291  M00S00290.tduex   ---|     initialize_tables;
00292  M00S00291.tduex   ---|     IF NOT error_flag THEN
00293  M00S00292.tduex   ---|        read_tdl_statements;
00294  M00S00293.tduex   ---|        IF NOT error_flag THEN
00295  M00S00294.tduex   ---|           optimize_tables;
00296  M00S00295.tduex   ---|           IF NOT error_flag THEN
00297  M00S00296.tduex   ---|              write_tables
00298  M00S00297.tduex   ---|           IFEND
00299  M00S00298.tduex   ---|        IFEND
00300  M00S00299.tduex   ---|     IFEND;
00301  M00S00300.tduex   ---|     IF error_flag THEN
00302  M00S00301.tduex   ---|        close_file(error_file_sel);
00303  M00S00302.tduex   ---|        { osp$set_status_abnormal(tdc_prod_code, tde_error_termination,
00304  M00S00303.tduex   ---|        {    '', status)
00305  M00S00304.tduex   ---|     IFEND;
00306  M01S00305.tduex1  ---|     utp$report_metrics_time('TDUEX');
00307  M00S00306.tduex   ---|     osp$terminate(command_name, status)
00308  M00S00307.tduex   ---|  PROCEND tduex;
00309  M00S00308.tduex   ---|
00310  M00S00309.tduex   ---|MODEND tduex;
cdc/nos2.source/opl.opl871/deck/tduex.txt ยท Last modified: (external edit)