From 7c44c466aeba17b04ad493c21ef388b844a84355 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 28 Nov 2000 15:30:12 +0000 Subject: *** empty log message *** --- dnn/Automaton.cc | 99 -------------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100755 dnn/Automaton.cc (limited to 'dnn/Automaton.cc') diff --git a/dnn/Automaton.cc b/dnn/Automaton.cc deleted file mode 100755 index 558a0ba..0000000 --- a/dnn/Automaton.cc +++ /dev/null @@ -1,99 +0,0 @@ -/* - * DNN - Data News Network - * - * by Stephane Chatty - * - * Copyright 1993-1995 - * Centre d'Etudes de la Navigation Aerienne (CENA) - * - * Automata. - * - * $Id$ - * $CurLog$ - */ - -#include "Automaton.h" - -DnnState :: DnnState (const char* name, int sz, DnnStateFun* in, DnnStateFun* out) -: Name (name), - InFun (in), - OutFun (out), - Links (sz) -{ -} - -DnnState :: ~DnnState () -{ - CcuHashIterOf l = Links; - while (++l) - delete *l; -} - -void -DnnState :: CreateLink (DnnState* to, void* k, DnnLinkFun fn) -{ - CcuHashCellOf * c = Links.Add (k); - c->SetInfo (new DnnLink (to, fn)); -} - -DnnState* -DnnState :: Next (void* k, bool peek) -{ - CcuHashCellOf * c = Links.Get (k); - if (!c) - return 0; - DnnLink* l = c->GetInfo (); - DnnState* to = l->To; - if (!peek) { - if (OutFun) - (*OutFun) (this); - if (l->Fun) - l->Fun (this, to, k); - if (to->InFun) - (*to->InFun) (to); - } - return to; -} - -DnnAutomaton :: DnnAutomaton (int sz) -: Initial (0), - Size (sz) -{ -} - -DnnAutomaton :: ~DnnAutomaton () -{ - CcuListIterOf s = AllStates; - while (++s) - delete *s; -} - -DnnState* -DnnAutomaton :: CreateState (const char* n, DnnStateFun in, DnnStateFun out) -{ - DnnState* s = new DnnState (n, Size, in, out); - AllStates.Append (s); - return s; -} - -DnnAutomIter :: DnnAutomIter (DnnAutomaton& a) -: TheAutomaton (&a), - CurState (a.GetInitial ()) -{ -} - -DnnAutomIter :: ~DnnAutomIter () -{ -} - -bool -DnnAutomIter :: Step (void* k) -{ - if (!CurState && !(CurState = TheAutomaton->GetInitial ())) - return false; - DnnState* n = CurState->Next (k); - if (!n) - return false; - CurState = n; - return true; -} -- cgit v1.1