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