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