%%HP: T(3)A(R)F(.);
@ FILE: SGLB
@ SEE FILE "GLB" FOR DOCUMENTATION
\<<
    15 TVARS
    DUP SIZE
    \-> SUBDIRS SUBNUM
    \<<

    @ if DOIT wants PREORDER TRAVERSAL:
    0 \<-DOIT EVAL


    IF SUBDIRS {} \=/
    THEN
        '\<-LVL' INCR DROP      @ update recursion level

        1 SUBNUM
        FOR I                       @ for all subdirs
            SUBDIRS I GET EVAL      @ change to subdir
            SGLB                    @ recursion
            UPDIR                   @ up to our dir
        NEXT

        '\<-LVL' DECR DROP      @ our recursion level

    END


    @ if DOIT wants POSTORDER TRAVERSAL:
    1 \<-DOIT EVAL

    '\<-NUMDIRS' INCR DROP
    \>>
\>>
