Back to index

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

List of all members.

Public Member Functions

 explicit_charmap_rep (string name)
void lookup (string s, int &ch, string &r)
virtual int arity ()
virtual charmap child (int i)
void cached_lookup (string s, int &ch, string &r)
void advance (string s, int &pos, string &r, int &ch)

Public Attributes

translator trl
int fast_map [256]
hashmap< string, int > slow_map
hashmap< string, stringslow_subst
string res_name

Detailed Description

Definition at line 123 of file charmap.cpp.


Constructor & Destructor Documentation

Definition at line 125 of file charmap.cpp.

                                    :
    charmap_rep (name), trl (load_translator (name)) {}

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:

virtual int charmap_rep::arity ( ) [inline, virtual, inherited]

Reimplemented in join_charmap_rep.

Definition at line 30 of file charmap.hpp.

{ return 1; }
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:

virtual charmap charmap_rep::child ( int  i) [inline, virtual, inherited]

Reimplemented in join_charmap_rep.

Definition at line 31 of file charmap.hpp.

                                       {
    ASSERT (i == 0, "bad child");
    return this; }
void explicit_charmap_rep::lookup ( string  s,
int &  ch,
string r 
) [inline, virtual]

Reimplemented from charmap_rep.

Definition at line 127 of file charmap.cpp.

                                             {
    if (trl->dict->contains (s)) { ch= 0; r= string ((char) trl->dict[s]); }
    else { ch= -1; r= ""; }
  }

Member Data Documentation

int charmap_rep::fast_map[256] [inherited]

Definition at line 23 of file charmap.hpp.

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.

Definition at line 124 of file charmap.cpp.


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