| 1 |
/* |
| 2 |
* @progname upl2.li |
| 3 |
* @version 1999-04-02 |
| 4 |
* @author McBride, Prinke |
| 5 |
* @category |
| 6 |
* @output procedure effects |
| 7 |
* @description |
| 8 |
* |
| 9 |
* Do upl functions |
| 10 |
*/ |
| 11 |
/* upl.ll - Paul B. McBride 01-apr-99 */ |
| 12 |
/* upl2.ll - modified Rafal T. Prinke 02-apr-99 */ |
| 13 |
|
| 14 |
proc upl_build() |
| 15 |
{ |
| 16 |
call upl_init() |
| 17 |
call upl_add("NAME", "", "", 1, 1) |
| 18 |
call upl_add("BIRT", ", *", "", 1, 2) /* event */ |
| 19 |
call upl_add("RESI", ", ", "", 1, 1) /* event */ |
| 20 |
call upl_add("DEAT", ", +", "", 1, 2) /* event */ |
| 21 |
call upl_add("BURI", ", bur. ", "", 1, 2) /* event */ |
| 22 |
call upl_add("OCCU", ", ", "", 1, 0) /* value */ |
| 23 |
call upl_add("NOTE", "; ", "", 1, 0) |
| 24 |
call upl_add("CONT", " ", "", 2, 0) |
| 25 |
/* add more tags here */ |
| 26 |
} |
| 27 |
|
| 28 |
proc upl_report(ind) |
| 29 |
{ |
| 30 |
traverse(root(ind), node, lev) { |
| 31 |
forlist(upl_tag_list, atag, n) { |
| 32 |
if(and(eq(getel(upl_level_list, n), lev), |
| 33 |
eqstr(tag(node), atag))) { |
| 34 |
set(before, getel(upl_before_list, n)) |
| 35 |
if(before) { call upl_out(before) } |
| 36 |
call upl_process(ind, node, getel(upl_process_list, n)) |
| 37 |
set(after, getel(upl_after_list, n)) |
| 38 |
if(after) { call upl_out(after) } |
| 39 |
} |
| 40 |
} |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
proc upl_process(ind, node, process) |
| 45 |
{ |
| 46 |
if(eq(process, 0)) { |
| 47 |
set(v, value(node)) |
| 48 |
if(v) { call upl_out(v) } |
| 49 |
} |
| 50 |
elsif(eq(process, 1)) { |
| 51 |
call upl_out(name(ind,0)) |
| 52 |
} |
| 53 |
elsif(eq(process, 2)) { |
| 54 |
list(datum) |
| 55 |
extracttokens(date(node),datum,n," ") |
| 56 |
set(v, "") |
| 57 |
forlist(datum,q,n) { |
| 58 |
if (lookup(mens,upper(q))) { |
| 59 |
set(v, concat(v,lookup(mens,q))) } |
| 60 |
else { set(v, concat(v,q)) } |
| 61 |
} |
| 62 |
if(place(node)) { |
| 63 |
set(v, concat(v," (", place(node), ")")) |
| 64 |
} |
| 65 |
if(gt(strlen(v),1)) { call upl_out(v) } |
| 66 |
} |
| 67 |
|
| 68 |
/* add more processing types here */ |
| 69 |
} |
| 70 |
|
| 71 |
proc upl_init() |
| 72 |
{ |
| 73 |
list(upl_tag_list) |
| 74 |
list(upl_before_list) |
| 75 |
list(upl_after_list) |
| 76 |
list(upl_level_list) |
| 77 |
list(upl_process_list) |
| 78 |
} |
| 79 |
|
| 80 |
proc upl_add(tag, before, after, level, process) |
| 81 |
{ |
| 82 |
set(len, add(length(upl_tag_list), 1)) |
| 83 |
setel(upl_tag_list, len, tag) |
| 84 |
setel(upl_before_list, len, before) |
| 85 |
setel(upl_after_list, len, after) |
| 86 |
setel(upl_level_list, len, level) |
| 87 |
setel(upl_process_list, len, process) |
| 88 |
} |
| 89 |
|
| 90 |
proc upl_dump() |
| 91 |
{ |
| 92 |
set(len, length(upl_tag_list)) |
| 93 |
set(i, 1) |
| 94 |
while(le(i, len)) { |
| 95 |
print(getel(upl_tag_list, i), "\n") |
| 96 |
set(i, add(i, 1)) |
| 97 |
} |
| 98 |
} |
| 99 |
|
| 100 |
proc upl_out(str) |
| 101 |
{ |
| 102 |
if(or(eq(upl_out_type, 0), eq(upl_out_type, 1))) { print(str) } |
| 103 |
if(or(eq(upl_out_type, 0), eq(upl_out_type, 2))) { str } |
| 104 |
} |