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