1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // ClosureCache.cc
4 // ---------------
5 // Dragon closure cache implementation
6 //
7 // Design and Implementation by Bjoern Lemke
8 //
9 // (C)opyright 2000-2007 Bjoern Lemke
10 //
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; see the file COPYING.  If not, write to
23 // the Free Software Foundation, 59 Temple Place - Suite 330,
24 // Boston, MA 02111-1307, USA.
25 //
26 // IMPLEMENTATION MODULE
27 //
28 // Class: ClosureCache
29 //
30 // Description:
31 //
32 ///////////////////////////////////////////////////////////////////////////////
33 
34 #include "ClosureCache.h"
35 
36 
37 ////////////////////////////
38 // ClosureCache sub class //
39 ////////////////////////////
40 
ClosureCache()41 ClosureCache::ClosureCache()
42 {
43 }
44 
ClosureCache(const LR1Element & e)45 ClosureCache::ClosureCache(const LR1Element& e)
46 {
47     _e = e;
48 }
49 
ClosureCache(const SetT<LR1Element> & closureSet,const LR1Element & e)50 ClosureCache::ClosureCache(const SetT<LR1Element>& closureSet,
51 				   const LR1Element& e)
52 {
53     _closureSet = closureSet;
54     _e = e;
55 }
56 
~ClosureCache()57 ClosureCache::~ClosureCache()
58 {
59 }
60 
getClosure() const61 SetT<LR1Element>& ClosureCache::getClosure() const
62 {
63     return ((ClosureCache*)this)->_closureSet;
64 }
65 
operator =(const ClosureCache & cc)66 ClosureCache& ClosureCache::operator = (const ClosureCache& cc)
67 {
68     _closureSet = cc._closureSet;
69     _e = cc._e;
70     return (*this);
71 }
72 
operator ==(const ClosureCache & cc) const73 bool ClosureCache::operator == (const ClosureCache& cc) const
74 {
75     if ( _e == cc._e)
76 	return true;
77     return false;
78 }
79 
80 
81 
82 
83 
84 
85 
86 
87