2
$Id: nstate.pas,v 1.3 2002/09/07 15:25:05 peter Exp $
3
Copyright (c) 1998-2002 by Daniel Mantione
5
This unit contains support routines for the state tracker
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
****************************************************************************
32
type Tstate_entry=class(Tlinkedlistitem)
35
constructor create(w,v:Tnode);
41
procedure store_fact(w,v:Tnode);
42
function find_fact(what:Tnode):Tnode;
43
procedure delete_fact(what:Tnode);
46
var aktstate:Tstate_storage;
50
constructor Tstate_entry.create(w,v:Tnode);
58
constructor Tstate_storage.create;
61
storage:=Tlinkedlist.create;
64
procedure Tstate_storage.store_fact(w,v:Tnode);
73
se:=Tstate_entry(storage.first);
76
if se.what.isequal(w) then
82
se:=Tstate_entry(se.next);
84
se:=Tstate_entry.create(w,v);
88
function Tstate_storage.find_fact(what:Tnode):Tnode;
94
se:=storage.first as Tstate_entry;
97
if se.what.isequal(what) then
102
se:=se.next as Tstate_entry;
106
procedure Tstate_storage.delete_fact(what:Tnode);
111
se:=storage.first as Tstate_entry;
112
while assigned(se) do
114
if se.what.isequal(what) then
120
se:=se.next as Tstate_entry;
128
Revision 1.3 2002/09/07 15:25:05 peter
129
* old logs removed and tabs fixed
131
Revision 1.2 2002/07/15 18:03:15 florian
132
* readded removed changes
134
Revision 1.1 2002/07/14 18:00:44 daniel
135
+ Added the beginning of a state tracker. This will track the values of
136
variables through procedures and optimize things away.