Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
join_charmap_rep Struct Reference
Inheritance diagram for join_charmap_rep:
Inheritance graph
[legend]
Collaboration diagram for join_charmap_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 join_charmap_rep (charmap *a, int n)
int arity ()
charmap child (int ch)
void lookup (string s, int &ch, string &r)
void cached_lookup (string s, int &ch, string &r)
void advance (string s, int &pos, string &r, int &ch)

Public Attributes

charmap * ja
int jn
int fast_map [256]
hashmap< string, int > slow_map
hashmap< string, stringslow_subst
string res_name

Detailed Description

Definition at line 152 of file charmap.cpp.


Constructor & Destructor Documentation

join_charmap_rep::join_charmap_rep ( charmap *  a,
int  n 
) [inline]

Definition at line 155 of file charmap.cpp.

                                      :
    charmap_rep (join_name (a, n)), ja (a), jn (n) {}

Member Function Documentation

void charmap_rep::advance ( string  s,
int &  pos,
string r,
int &  ch 
) [inherited]

Definition at line 36 of file charmap.cpp.

                                                            {
  int n= N(s), start= pos;
  if (s[pos] != '<') {
    ch= fast_map [(unsigned char) s[pos++]];
    while (pos<n && s[pos] != '<' &&
          fast_map [(unsigned char) s[pos]] == ch) pos++;
    r= s (start, pos);
    if (pos == n || s[pos] != '<') return;
  }
  else {
    int start= pos;
    tm_char_forwards (s, pos);
    cached_lookup (s (start, pos), ch, r);
  }
  int ch2; string r2;
  while (pos<n) {
    int start= pos;
    tm_char_forwards (s, pos);
    cached_lookup (s (start, pos), ch2, r2);
    if (ch2 != ch) { pos= start; break; }
    else r << r2;
  }
}

Here is the call graph for this function:

int join_charmap_rep::arity ( ) [inline, virtual]

Reimplemented from charmap_rep.

Definition at line 157 of file charmap.cpp.

               {
    int i, sum= 0;
    for (i=0; i<jn; i++)
      sum += ja[i] -> arity ();
    return sum;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void charmap_rep::cached_lookup ( string  s,
int &  ch,
string r 
) [inline, inherited]

Definition at line 35 of file charmap.hpp.

                                                           {
    if (!slow_map->contains (s)) lookup (s, slow_map (s), slow_subst (s));
    ch= slow_map   (s);
    r = slow_subst (s);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

charmap join_charmap_rep::child ( int  ch) [inline, virtual]

Reimplemented from charmap_rep.

Definition at line 163 of file charmap.cpp.

                         {
    int i, sum= 0;
    for (i=0; i<jn; i++) {
      int p= ja[i] -> arity ();
      if (ch >= sum && ch < sum+p) return ja[i] -> child (i-sum);
      sum += p;
    }
    FAILED ("bad child");
    return this;
  }

Here is the call graph for this function:

void join_charmap_rep::lookup ( string  s,
int &  ch,
string r 
) [inline, virtual]

Reimplemented from charmap_rep.

Definition at line 173 of file charmap.cpp.

                                             {
    int i, sum= 0;
    for (i=0; i<jn; i++) {
      ja[i]->lookup (s, ch, r);
      //cout << i << "\t" << s << " -> " << ch << ", " << r << "\n";
      if (ch >= 0) {
       ch += sum;
       return;
      }
      sum += ja[i] -> arity ();
    }
    ch= -1; r= "";
  }  

Here is the call graph for this function:


Member Data Documentation

int charmap_rep::fast_map[256] [inherited]

Definition at line 23 of file charmap.hpp.

Definition at line 153 of file charmap.cpp.

Definition at line 154 of file charmap.cpp.

string rep< charmap >::res_name [inherited]

Definition at line 17 of file resource.hpp.

Definition at line 24 of file charmap.hpp.

Definition at line 25 of file charmap.hpp.


The documentation for this struct was generated from the following file: