Back to index

texmacs  1.0.7.15
Classes | Functions
bridge_default.cpp File Reference
#include "bridge.hpp"

Go to the source code of this file.

Classes

class  bridge_default_rep

Functions

bridge bridge_default (typesetter ttt, tree st, path ip)
tree substitute (tree t, path p, tree u)
tree insert_at (tree t, path p, tree u)
tree remove_at (tree t, path p, int nr)

Function Documentation

bridge bridge_default ( typesetter  ttt,
tree  st,
path  ip 
)

Definition at line 27 of file bridge_default.cpp.

                                                  {
  return tm_new<bridge_default_rep> (ttt, st, ip);
}

Here is the caller graph for this function:

tree insert_at ( tree  t,
path  p,
tree  u 
)

Definition at line 48 of file bridge_default.cpp.

                                   {
  if (is_atom (p)) {
    if (is_atomic (t)) {
      ASSERT (is_atomic (u), "two atoms expected");
      return t->label (0, p->item) *u->label* t->label (p->item, N(t->label));
    }
    else return (t (0, p->item) * u) * t (p->item, N(t));
  }
  else return substitute (t, p->item, insert_at (t[p->item], p->next, u));
}

Here is the call graph for this function:

Here is the caller graph for this function:

tree remove_at ( tree  t,
path  p,
int  nr 
)

Definition at line 60 of file bridge_default.cpp.

                                   {
  if (is_atom (p)) {
    if (is_atomic (t))
      return t->label (0, p->item) * t->label (p->item+nr, N(t->label));
    else return t (0, p->item) * t (p->item+nr, N(t));
  }
  else return substitute (t, p->item, remove_at (t[p->item], p->next, nr));
}

Here is the call graph for this function:

Here is the caller graph for this function:

tree substitute ( tree  t,
path  p,
tree  u 
)

Definition at line 36 of file bridge_default.cpp.

                                    {
  if (is_nil (p)) return u;
  int i, n= N(t);
  tree t2 (t, n);
  for (i=0; i<n; i++) {
    if (i == p->item) t2[i]= substitute (t[i], p->next, u);
    else t2[i]= t[i];
  }
  return t2;
}

Here is the call graph for this function: