-///////////////////////////////////////////
-// find_close(bp *b,int s)
-// returns the matching close parenthesis of s
-///////////////////////////////////////////
-int find_close(bp *b,int s)
-{
- return fwd_excess(b,s,-1);
-}
-
-///////////////////////////////////////////
-// find_open(bp *b,int s)
-// returns the matching open parenthesis of s
-///////////////////////////////////////////
-int find_open(bp *b,int s)
-{
- int r;
- r = bwd_excess(b,s,0);
- if (r >= -1) return r+1;
- return -1;
-}
-
-///////////////////////////////////////////
-// parent(bp *b,int s)
-// returns the parent of s
-// -1 if s is the root
-///////////////////////////////////////////
-int parent(bp *b,int s)
-{
- int r;
- r = bwd_excess(b,s,-2);
- if (r >= -1) return r+1;
- return -1;
-}
-
-int enclose(bp *b,int s)
-{
- return parent(b,s);
-}
-
-///////////////////////////////////////////
-// level_ancestor(bp *b,int s,int d)
-// returns the ancestor of s with relative depth d (d < 0)
-// -1 if no such node
-///////////////////////////////////////////
-int level_ancestor(bp *b,int s,int d)
-{
- int r;
- r = bwd_excess(b,s,d-1);
- if (r >= -1) return r+1;
- return -1;
-}