Back to index

texmacs  1.0.7.15
Defines | Functions | Variables
tag_info.cpp File Reference
#include "tag_info.hpp"
#include "hashmap.hpp"

Go to the source code of this file.

Defines

#define get_bits(which, nr)   which=i&((1<<nr)-1);i=i>>nr
#define set_bits(which, nr)   i+=((int)which)<<offset;offset+=nr

Functions

int drd_encode (tree t)
tree drd_decode (int i)
string drd_decode_type (int i)
int drd_encode_type (string s)
tm_ostreamoperator<< (tm_ostream &out, parent_info pi)
tm_ostreamoperator<< (tm_ostream &out, child_info ci)
tm_ostreamoperator<< (tm_ostream &out, tag_info ti)
tag_info copy (tag_info ti)
bool operator== (tag_info ti1, tag_info ti2)
bool operator!= (tag_info ti1, tag_info ti2)

Variables

static hashmap< tree, int > encode_table (-1)
static array< treedecode_table

Define Documentation

#define get_bits (   which,
  nr 
)    which=i&((1<<nr)-1);i=i>>nr

Definition at line 15 of file tag_info.cpp.

#define set_bits (   which,
  nr 
)    i+=((int)which)<<offset;offset+=nr

Definition at line 16 of file tag_info.cpp.


Function Documentation

Definition at line 479 of file tag_info.cpp.

                   {
  return tag_info (ti->pi, copy (ti->ci), copy (ti->extra));
}

Here is the call graph for this function:

tree drd_decode ( int  i)

Definition at line 37 of file tag_info.cpp.

                   {
  ASSERT (i >= 0 && i < N (decode_table), "out of range");
  return decode_table[i];
}

Here is the call graph for this function:

Here is the caller graph for this function:

string drd_decode_type ( int  i)

Definition at line 47 of file tag_info.cpp.

                        {
  switch (i) {
  case TYPE_REGULAR: return "regular";
  case TYPE_ADHOC: return "adhoc";
  case TYPE_VARIABLE: return "variable";
  case TYPE_ARGUMENT: return "argument";
  case TYPE_BOOLEAN: return "boolean";
  case TYPE_INTEGER: return "integer";
  case TYPE_STRING: return "string";
  case TYPE_LENGTH: return "length";
  case TYPE_NUMERIC: return "numeric";
  case TYPE_CODE: return "code";
  case TYPE_IDENTIFIER: return "identifier";
  case TYPE_URL: return "url";
  case TYPE_GRAPHICAL: return "graphical";
  case TYPE_POINT: return "point";
  case TYPE_ANIMATION: return "animation";
  case TYPE_DURATION: return "duration";
  case TYPE_UNKNOWN: return "unknown";
  case TYPE_ERROR: return "error";
  default: return "unknown";
  }
}

Here is the caller graph for this function:

int drd_encode ( tree  t)

Definition at line 26 of file tag_info.cpp.

                    {
  if (encode_table->contains (t))
    return encode_table[t];
  int n= N(decode_table);
  ASSERT (n < (1 << 16), "drd_encode overflow");
  encode_table (t) = n;
  decode_table << t;
  return n;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int drd_encode_type ( string  s)

Definition at line 72 of file tag_info.cpp.

                           {
  if (s == "regular") return TYPE_REGULAR;
  else if (s == "adhoc") return TYPE_ADHOC;
  else if (s == "variable") return TYPE_VARIABLE;
  else if (s == "argument") return TYPE_ARGUMENT;
  else if (s == "boolean") return TYPE_BOOLEAN;
  else if (s == "integer") return TYPE_INTEGER;
  else if (s == "string") return TYPE_STRING;
  else if (s == "length") return TYPE_LENGTH;
  else if (s == "numeric") return TYPE_NUMERIC;
  else if (s == "code") return TYPE_CODE;
  else if (s == "identifier") return TYPE_IDENTIFIER;
  else if (s == "url") return TYPE_URL;
  else if (s == "graphical") return TYPE_GRAPHICAL;
  else if (s == "point") return TYPE_POINT;
  else if (s == "animation") return TYPE_ANIMATION;
  else if (s == "duration") return TYPE_DURATION;
  else if (s == "unknown") return TYPE_UNKNOWN;
  else if (s == "error") return TYPE_ERROR;
  else return -1;
}

Here is the caller graph for this function:

bool operator!= ( tag_info  ti1,
tag_info  ti2 
)

Definition at line 490 of file tag_info.cpp.

                                         {
  return !(ti1 == ti2);
}
tm_ostream& operator<< ( tm_ostream out,
parent_info  pi 
)

Definition at line 171 of file tag_info.cpp.

                                              {
  return out << ((tree) pi);
}
tm_ostream& operator<< ( tm_ostream out,
child_info  ci 
)

Definition at line 243 of file tag_info.cpp.

                                             {
  return out << ((tree) ci);
}
tm_ostream& operator<< ( tm_ostream out,
tag_info  ti 
)

Definition at line 472 of file tag_info.cpp.

                                           {
  out << "[ " << ti->pi << ", " << ti->ci;
  if (ti->extra != "") out << ", " << ti->extra << "\n";
  return out << " ]";
}
bool operator== ( tag_info  ti1,
tag_info  ti2 
)

Definition at line 484 of file tag_info.cpp.

                                         {
  return
    (ti1->pi == ti2->pi) && (ti1->ci == ti2->ci) && (ti1->extra == ti2->extra);
}

Variable Documentation

array<tree> decode_table [static]

Definition at line 23 of file tag_info.cpp.

hashmap<tree,int> encode_table(-1) [static]