85 int n_pos(
void)
const;
87 template<
class Char,
class Traits>
88 std::basic_ostream<Char,Traits>&
89 print(std::basic_ostream<Char,Traits>& os)
const;
91 static void*
operator new(size_t);
92 static void operator delete(
void*);
105 REG::Exp::operator
new(
size_t s) {
109 REG::Exp::operator
delete(
void*) {
114 REG::Exp::dispose(
void) {
117 while (!todo.empty()) {
140 if ((
this != NULL) && (--use_cnt == 0))
147 return (
this != NULL) ? _n_pos : 0;
192 for (
int i=n;
i--; ) {
200 for (
int m=n;
m>1; ) {
213 for (
int i=0;
i<
m;
i++) {
259 if (e == NULL)
return r2;
260 if (r2.e == NULL)
return *
this;
305 if ((n>m) || (m == 0))
318 unsigned int i = m-n;
355 namespace MiniModel {
398 for (
const PosSet* ps =
this; ps != NULL; ps = ps->
next)
401 }
else if (ps->pos < p) {
409 while ((ps1 != NULL) && (ps2 != NULL)) {
427 while ((ps1 != NULL) && (ps2 != NULL)) {
432 *p = n; p = &n->
next;
433 if (ps1->
pos == ps2->
pos) {
436 }
else if (ps1->
pos > ps2->
pos) {
442 *p = (ps1 != NULL) ? ps1 : ps2;
476 : nullable(n), firstpos(fp), lastpos(lp) {}
480 : exp(e), open(true) {}
500 if (todo.
top().exp == NULL) {
504 switch (todo.
top().exp->type) {
507 pi[p].
symbol = todo.
pop().exp->data.symbol;
513 if (todo.
top().open) {
515 todo.
top().open =
false;
516 todo.
push(todo.
top().exp->data.kids[0]);
527 if (todo.
top().open) {
529 todo.
top().open =
false;
548 if (todo.
top().open) {
550 todo.
top().open =
false;
566 }
while (!todo.
empty());
567 return done.
top().firstpos;
571 namespace MiniModel {
605 bool empty(
void)
const;
652 n->
state = n_states++;
672 Support::quicksort<int,SymbolsInc>(s,n,o);
687 void add(
int,
int,
int);
697 t[n].i_state = i_state;
698 t[n].symbol = symbol;
699 t[n].o_state = o_state;
767 int n_pos = r.e->
n_pos();
770 for (
int i=n_pos;
i--; )
771 pi[
i].followpos = NULL;
777 for (
int i=n_pos;
i--; )
778 symbols[
i] = pi[
i].symbol;
782 for (
int i = 1;
i<n_pos-1;
i++)
783 if (symbols[
i-1] != symbols[
i])
784 symbols[n_symbols++] = symbols[
i];
789 while (!sp.
empty()) {
791 for (
int i = n_symbols; i--; ) {
794 if (pi[ps->pos].
symbol == symbols[i])
805 if (n->pos->in(n_pos-1))