Back to index

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

List of all members.

Public Member Functions

 range_charmap_rep (int start2, int end2)
bool between (int what, int begin, int end)
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

int start
int end
int fast_map [256]
hashmap< string, int > slow_map
hashmap< string, stringslow_subst
string res_name

Detailed Description

Definition at line 86 of file charmap.cpp.


Constructor & Destructor Documentation

range_charmap_rep::range_charmap_rep ( int  start2,
int  end2 
) [inline]

Definition at line 88 of file charmap.cpp.

                                          :
    charmap_rep (as_hexadecimal (start2) * "--" * as_hexadecimal (end2)),
    start (start2), end (end2) {}

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; }
bool range_charmap_rep::between ( int  what,
int  begin,
int  end 
) [inline]

Definition at line 91 of file charmap.cpp.

                                                     {
    return what >= begin && what <= end;
  }

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:

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 range_charmap_rep::lookup ( string  s,
int &  ch,
string r 
) [inline, virtual]

Reimplemented from charmap_rep.

Definition at line 94 of file charmap.cpp.

                                             {
    if (N(s) >= 3 && s[0] == '<' && s[1] == '#' && s[N(s)-1] == '>' &&
       between (from_hexadecimal (s (2, N(s)-1)), start, end)) { ch=0; r=s; }
    else { ch= -1; r= ""; }
  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 87 of file charmap.cpp.

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 87 of file charmap.cpp.


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