00001
00002
00003 # include "parm.h"
00004
00005 # include "stree/ststructs.mh"
00006
00007 # include "stree/stplinks.mh"
00008
00009 int next_pre; next_post;
00010
00011
00012
00013 number(p)
00014 NODE * p;
00015 {
00016 register int * q;
00017
00018 register int v;
00019
00020
00021 if ( p == NIL ) return;
00022 p -> pre_num = next_pre++;
00023
00024 if (is_list(p)) {
00025 maplist(e, p, {
00026 number(e);
00027 });
00028 } else {
00029 v = stplinks[p -> kind];
00030 q = (int *) p;
00031 while ( v != 0 ) {
00032 if ( v < 0 ) {
00033 number(*q);
00034 }
00035 q++;
00036 v <<= 1;
00037 }
00038 }
00039 p -> post_num = next_post++;
00040 }
00041