Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Private Attributes | Friends
tag_info_rep Class Reference

#include <tag_info.hpp>

Inheritance diagram for tag_info_rep:
Inheritance graph
[legend]
Collaboration diagram for tag_info_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 tag_info_rep (parent_info pi, array< child_info > ci, tree extra)
 tag_info_rep (int arity, int extra, int amode, int cmode, bool frozen)
 ~tag_info_rep ()
tag_info inner_border ()
tag_info outer_border ()
tag_info with_like ()
tag_info type (int tp)
tag_info type (int i, int tp)
tag_info accessible (int i)
tag_info hidden (int i)
tag_info disable_writable (int i)
tag_info enable_writable (int i)
tag_info locals (int i, string var, string val)
tag_info name (string s)
tag_info long_name (string s)
tag_info name (int i, string s)
tag_info long_name (int i, string s)
int get_index (int child, int n)
void set_attribute (string which, tree val)
tree get_attribute (string which)

Public Attributes

parent_info pi
array< child_infoci
tree extra

Private Attributes

int ref_count

Friends

class tag_info

Detailed Description

Definition at line 183 of file tag_info.hpp.


Constructor & Destructor Documentation

Definition at line 251 of file tag_info.cpp.

                                                                         :
  pi (pi2), ci (ci2), extra (x) {}
tag_info_rep::tag_info_rep ( int  arity,
int  extra,
int  amode,
int  cmode,
bool  frozen 
)

Definition at line 254 of file tag_info.cpp.

                                                                    :
  pi (a, x, am, cm, frozen),
  ci ((a+x)==0? 0: (cm==CHILD_UNIFORM? 1: (cm==CHILD_BIFORM? 2: (a+x))))
{
  if (frozen) {
    int i, n= N(ci);
    for (i=0; i<n; i++)
      ci[i]= child_info (true);
  }
}

Here is the call graph for this function:

Definition at line 191 of file tag_info.hpp.

{}

Member Function Documentation

Definition at line 328 of file tag_info.cpp.

                               {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  ci[i].type= TYPE_REGULAR;
  ci[i].accessible= ACCESSIBLE_ALWAYS;
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 346 of file tag_info.cpp.

                                     {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  ci[i].writability= WRITABILITY_DISABLE;
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 354 of file tag_info.cpp.

                                    {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  ci[i].writability= WRITABILITY_ENABLE;
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 381 of file tag_info.cpp.

                                         {
  if (!is_func (extra, ATTR)) return "";
  int i, n= N(extra);
  for (i=0; i+1<n; i+=2)
    if (extra[i] == which)
      return extra[i+1];
  return "";
}

Here is the call graph for this function:

int tag_info_rep::get_index ( int  child,
int  n 
)

Definition at line 419 of file tag_info.cpp.

                                         {
  int r= 0;
  switch (pi.child_mode) {
  case CHILD_UNIFORM:
    r= 0;
    break;
  case CHILD_BIFORM:
    if (pi.arity_mode != ARITY_VAR_REPEAT) {
      if (child < ((int) pi.arity_base)) r= 0;
      else r= 1;
    }
    else {
      if (child < (n-((int) pi.arity_base))) r= 0;
      else r= 1;
    }
    break;
  case CHILD_DETAILED:
    if (((int) pi.arity_mode) <= ARITY_OPTIONS)
      r= child;
    else if (pi.arity_mode == ARITY_REPEAT) {
      if (child < ((int) pi.arity_base)) r= child;
      else r= (child - pi.arity_base) % pi.arity_extra + pi.arity_base;
    }
    else {
      if (child < (n-((int) pi.arity_base))) r= child % pi.arity_extra;
      else r= pi.arity_base + pi.arity_extra + child - n;
    }
    break;
  }
  return r;
}

Here is the call graph for this function:

Definition at line 337 of file tag_info.cpp.

                           {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  ci[i].type= TYPE_REGULAR;
  ci[i].accessible= ACCESSIBLE_HIDDEN;
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 296 of file tag_info.cpp.

tag_info tag_info_rep::locals ( int  i,
string  var,
string  val 
)

Definition at line 362 of file tag_info.cpp.

                                                   {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  ci[i].env= drd_encode (tree (ATTR, var, val));
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 397 of file tag_info.cpp.

                                 {
  set_attribute ("long-name", s);
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 411 of file tag_info.cpp.

                                        {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  set_attribute ("long-name-" * as_string (i), s);
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 391 of file tag_info.cpp.

                            {
  set_attribute ("name", s);
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

tag_info tag_info_rep::name ( int  i,
string  s 
)

Definition at line 403 of file tag_info.cpp.

                                   {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  set_attribute ("name-" * as_string (i), s);
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 302 of file tag_info.cpp.

void tag_info_rep::set_attribute ( string  which,
tree  val 
)

Definition at line 370 of file tag_info.cpp.

                                                   {
  if (extra == "") extra= tree (ATTR);
  for (int i=0; i+1<N(extra); i+=2)
    if (extra[i] == tree (which)) {
      extra[i+1]= val;
      return;
    }
  extra << tree (which) << val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 314 of file tag_info.cpp.

                          {
  pi.type= tp;
  return tag_info (pi, ci, extra);
}
tag_info tag_info_rep::type ( int  i,
int  tp 
)

Definition at line 320 of file tag_info.cpp.

                                 {
  if (i < 0 || i >= N(ci)) cout << i << " out of " << N(ci) << "\n";
  ASSERT (i >= 0 && i<N(ci), "index out of range");
  ci[i].type= tp;
  return tag_info (pi, ci, extra);
}

Here is the call graph for this function:

Definition at line 308 of file tag_info.cpp.

                         {
  pi.with_like= true;
  return tag_info (pi, ci, extra);
}

Friends And Related Function Documentation

friend class tag_info [friend]

Definition at line 211 of file tag_info.hpp.


Member Data Documentation

Definition at line 186 of file tag_info.hpp.

Definition at line 187 of file tag_info.hpp.

Definition at line 185 of file tag_info.hpp.

int concrete_struct::ref_count [inherited]

Definition at line 135 of file basic.hpp.


The documentation for this class was generated from the following files: