0022627: Change OCCT memory management defaults
[occt.git] / src / ExprIntrp / ExprIntrp_GenRel.cxx
1 // Copyright:   Matra-Datavision 1992
2 // File:        ExprIntrp_GenRel.cxx
3 // Created:     Tue Aug 18 11:33:52 1992
4 // Author:      Arnaud BOUZY
5 //              <adn>
6
7 #include <ExprIntrp_GenRel.ixx>
8 #include <ExprIntrp.hxx>
9 #include <ExprIntrp_yaccanal.hxx>
10 #include <Standard_NoSuchObject.hxx>
11
12 ExprIntrp_GenRel::ExprIntrp_GenRel ()
13 {
14   done = Standard_False;
15 }
16
17 Handle( ExprIntrp_GenRel ) ExprIntrp_GenRel::Create()
18 {
19   return new ExprIntrp_GenRel();
20 }
21
22 void ExprIntrp_GenRel::Process (const TCollection_AsciiString& str)
23 {
24   Handle(ExprIntrp_GenRel) me = this;
25   done = Standard_False;
26   if (ExprIntrp::Parse(me,str)) {
27     if (!ExprIntrp_Recept.IsRelStackEmpty()) {
28       myRelation = ExprIntrp_Recept.PopRelation();
29       done = Standard_True;
30     }
31     else {
32       myRelation.Nullify();
33     }
34   }
35   else {
36     myRelation.Nullify();
37   }
38 }
39  
40 Standard_Boolean ExprIntrp_GenRel::IsDone() const
41 {
42   return done;
43 }
44
45 Handle(Expr_GeneralRelation) ExprIntrp_GenRel::Relation () const
46 {
47   if (!done) {
48     Standard_NoSuchObject::Raise();
49   }
50   return myRelation;
51 }
52