From: kaashoek Date: Thu, 7 Jan 1988 15:25:34 +0000 (+0000) Subject: Comments added X-Git-Tag: release-5-5~3671 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=dcf14f338be5b414cbd6146a298ac83c6a43b166;p=ack.git Comments added --- diff --git a/util/ceg/EM_parser/obj_EM_pars/dist.c b/util/ceg/EM_parser/obj_EM_pars/dist.c index 0acf8eb20..5fedc1945 100644 --- a/util/ceg/EM_parser/obj_EM_pars/dist.c +++ b/util/ceg/EM_parser/obj_EM_pars/dist.c @@ -5,10 +5,14 @@ arith cur_pos = 0; dist( lab) char *lab; + +/* Just output a reference which must be filled in on a second pass */ + { out( "$%s$ - %ld", lab, cur_pos); } + #define MAX_LABEL 10 #define TRUE 1 #define FALSE 0 @@ -24,6 +28,9 @@ int n_labs = 0; handle_label( lab) char *lab; + +/* Record position of this label */ + { char *Salloc(); @@ -39,6 +46,9 @@ char *lab; relocate( f) FILE *f; + +/* Output position-count of the label in file 'f', remove also trailing $ */ + { char buf[256]; int i; @@ -58,6 +68,9 @@ File *oldout; extern File *outfile; back_patch() +/* Echo the text on file '.tmp', but replace every occurence of label- + *reference's by its position-count. Reference of label 'foo' is '$foo$'. + */ { FILE *save; char c, c1; @@ -98,5 +111,5 @@ save_output() if ( ! sys_open( ".tmp", OP_WRITE, &outfile)) fprint( STDERR, "can't open .tmp\n"); cur_pos = 0; - n_labs = 0; /* geheugen-ruimte teruggeven? */ + n_labs = 0; }