Back to index

texmacs  1.0.7.15
Classes | Defines | Functions | Variables
memorizer.hpp File Reference
#include "tree.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  memorizer_rep
class  memorizer
class  compound_memorizer_rep

Defines

#define MEMORIZE_EVALUATE   0
#define MEMORIZE_REWRITE   1
#define MEMORIZE_INACTIVE   2
#define MEMORIZE_ASSIGN   10
#define MEMORIZE_BEGIN_WITH   11
#define MEMORIZE_END_WITH   12
#define MEMORIZE_MACRO_DOWN   13
#define MEMORIZE_MACRO_REDOWN   14
#define MEMORIZE_MACRO_UP   15

Functions

void print_tree (memorizer mem)
void memorize_initialize ()
memorizer memorize_finalize ()
void memorize_start ()
void memorize_end ()

Variables

int memorizer_count

Define Documentation

#define MEMORIZE_ASSIGN   10

Definition at line 22 of file memorizer.hpp.

#define MEMORIZE_BEGIN_WITH   11

Definition at line 23 of file memorizer.hpp.

#define MEMORIZE_END_WITH   12

Definition at line 24 of file memorizer.hpp.

#define MEMORIZE_EVALUATE   0

Definition at line 18 of file memorizer.hpp.

#define MEMORIZE_INACTIVE   2

Definition at line 20 of file memorizer.hpp.

#define MEMORIZE_MACRO_DOWN   13

Definition at line 25 of file memorizer.hpp.

#define MEMORIZE_MACRO_REDOWN   14

Definition at line 26 of file memorizer.hpp.

#define MEMORIZE_MACRO_UP   15

Definition at line 27 of file memorizer.hpp.

#define MEMORIZE_REWRITE   1

Definition at line 19 of file memorizer.hpp.


Function Documentation

void memorize_end ( )

Definition at line 155 of file memorizer.cpp.

                {
  mem_cur--;
  int start= mem_pos[mem_cur], end= mem_pos[mem_cur+1];
  //cout << UNINDENT << "Memorize end [" << start << ", " << end << "]" << LF;
  mem_stack[start-1]->set_children (mem_stack + start, end - start);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file memorizer.cpp.

                     {
  cout << UNINDENT << "Memorize finalize" << LF;
  memorizer mem= mem_stack[0];
  tm_delete_array (mem_pos);
  tm_delete_array (mem_stack);
  mem_max_pos  = 0;
  mem_pos      = NULL;
  mem_max_stack= 0;
  mem_stack    = NULL;
  return mem;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 122 of file memorizer.cpp.

                       {
  cout << "Memorize initialize" << INDENT << LF;
  mem_max_pos  = 16;
  mem_pos      = tm_new_array<int> (mem_max_pos);
  mem_max_stack= 16;
  mem_stack    = tm_new_array<memorizer> (mem_max_stack);
  mem_cur      = 0;
  mem_pos[0]   = 0;
}

Here is the caller graph for this function:

void memorize_start ( )

Definition at line 146 of file memorizer.cpp.

                  {
  //cout << "Memorize start" << INDENT << LF;
  mem_cur++;
  if (mem_cur == mem_max_pos)
    double_size (mem_pos, mem_max_pos);
  mem_pos[mem_cur]= mem_pos[mem_cur-1];
}

Here is the call graph for this function:

Here is the caller graph for this function:

void print_tree ( memorizer  mem)

Definition at line 87 of file memorizer.cpp.

                           {
  mem->print (cout);
  cout << LF;
  memorizer* a;
  int n;
  mem->get_children (a, n);
  if (n != 0) {
    cout << INDENT;
    for (int i=0; i<n; i++)
      print_tree (a[i]);
    cout << UNINDENT;
  }
}

Here is the call graph for this function:


Variable Documentation

Definition at line 19 of file memorizer.cpp.