/[eliot]/eliot/dic/automaton.c
ViewVC logotype

Diff of /eliot/dic/automaton.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by ipkiss, Fri Nov 4 20:00:06 2005 UTC revision 1.11 by ipkiss, Sat Nov 5 17:56:22 2005 UTC
# Line 33  Line 33 
33  #include "alist.h"  #include "alist.h"
34  #include "automaton.h"  #include "automaton.h"
35    
36  #ifdef DEBUG_AUTOMATON__  #ifdef DEBUG_AUTOMATON
37  #define DMSG(a) a  #define DMSG(a) a
38  #else  #else
39  #define DMSG(a)  #define DMSG(a)
# Line 170  automaton_dump(automaton a, char* filena Line 170  automaton_dump(automaton a, char* filena
170  {  {
171    int i,l;    int i,l;
172    FILE* f;    FILE* f;
173    #ifdef HAVE_SYS_WAIT_H
174    pid_t   pid;    pid_t   pid;
175    #endif
176    
177    if (a == NULL)    if (a == NULL)
178      return ;      return ;
179    f=fopen(filename,"w");    f=fopen(filename,"w");
# Line 411  s_automaton_successor(alist S, int lette Line 414  s_automaton_successor(alist S, int lette
414            alist_insert(Ry,z->id);                          /* Ry = Ry \cup succ(z)    */            alist_insert(Ry,z->id);                          /* Ry = Ry \cup succ(z)    */
415          }          }
416    
417  #if 0        /* \epsilon transition from start node */
418        if ((z = y->next[RE_EPSILON]) != NULL)               /* \delta (y,z) = \epsilon */        if ((z = y->next[RE_EPSILON]) != NULL)               /* \delta (y,z) = \epsilon */
419          {          {
420            r = s_automaton_successor(z->id,letter,nfa, list);            r = s_automaton_successor(z->id,letter,nfa, list);
421            alist_insert(Ry,r);                              /* Ry = Ry \cup succ(z)    */            alist_insert(Ry,r);                              /* Ry = Ry \cup succ(z)    */
422            alist_delete(r);            alist_delete(r);
423          }          }
 #endif  
424    
425        if (letter < RE_FINAL_TOK)        if (letter < RE_FINAL_TOK)
426          {          {
# Line 440  s_automaton_successor(alist S, int lette Line 442  s_automaton_successor(alist S, int lette
442                }                }
443          }          }
444    
445        //      if (alist_is_empty(Ry))                              /* Ry = \empty             */  #if 0
446        //        return Ry;        if (alist_is_empty(Ry))                              /* Ry = \empty             */
447            return Ry;
448    #endif
449    
450        alist_insert(R,Ry);                                  /* R = R \cup Ry           */        alist_insert(R,Ry);                                  /* R = R \cup Ry           */
451        alist_delete(Ry);        alist_delete(Ry);
# Line 651  static void Line 655  static void
655  s_automaton_dump(Automaton a, char* filename)  s_automaton_dump(Automaton a, char* filename)
656  {  {
657    FILE* f;    FILE* f;
658    #ifdef HAVE_SYS_WAIT_H
659    pid_t   pid;    pid_t   pid;
660    #endif
661    if (a == NULL)    if (a == NULL)
662      return;      return;
663    f=fopen(filename,"w");    f=fopen(filename,"w");

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26