| 1 |
/* |
| 2 |
* @progname src.ll |
| 3 |
* @version 2.0 |
| 4 |
* @author McBride |
| 5 |
* @category sample |
| 6 |
* @output text |
| 7 |
* @description |
| 8 |
Here is a report program to list SOURces. The REFN and TITL |
| 9 |
values are shown. Other tags can be added by duplicating |
| 10 |
the lines that containing "myrefn" or "REFN" and replacing them |
| 11 |
with the tag you want. |
| 12 |
|
| 13 |
To process tags that have CONTinuation lines, or tags with no |
| 14 |
values you need something more complicated. |
| 15 |
|
| 16 |
"P. McBride" <[email protected]> |
| 17 |
*/ |
| 18 |
|
| 19 |
proc main () |
| 20 |
{ |
| 21 |
forsour(snode, i) { |
| 22 |
set(mytitle, "") |
| 23 |
set(myrefn, "") |
| 24 |
fornodes(root(snode), anode) { |
| 25 |
if(eqstr(tag(anode),"TITL")) { set(mytitle, save(value(anode))) } |
| 26 |
elsif(eqstr(tag(anode),"REFN")) { |
| 27 |
set(myrefn, save(value(anode))) |
| 28 |
} |
| 29 |
} |
| 30 |
myrefn "\t" key(snode) "\t" mytitle nl() |
| 31 |
} |
| 32 |
} |