1 // Created on: 1992-06-22
2 // Created by: Gilles DEBARBOUILLE
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Units_Sentence_HeaderFile
18 #define _Units_Sentence_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Units_TokensSequence.hxx>
25 #include <Standard_CString.hxx>
26 #include <Standard_Boolean.hxx>
31 //! This class describes all the methods to create and
32 //! compute an expression contained in a string.
40 //! Creates and returns a Sentence, by analyzing the
41 //! string <astring> with the lexicon <alexicon>.
42 Standard_EXPORT Units_Sentence(const Handle(Units_Lexicon)& alexicon, const Standard_CString astring);
44 //! For each constant encountered, sets the value.
45 Standard_EXPORT void SetConstants();
47 //! Returns <thesequenceoftokens>.
48 Handle(Units_TokensSequence) Sequence() const;
50 //! Sets the field <thesequenceoftokens> to <asequenceoftokens>.
51 void Sequence (const Handle(Units_TokensSequence)& asequenceoftokens);
53 //! Computes and returns in a token the result of the
55 Standard_EXPORT Handle(Units_Token) Evaluate();
57 //! Return True if number of created tokens > 0
58 //! (i.e creation of sentence is succesfull)
59 Standard_Boolean IsDone() const;
61 //! Useful for debugging.
77 Handle(Units_TokensSequence) thesequenceoftokens;
83 #include <Units_Sentence.lxx>
89 #endif // _Units_Sentence_HeaderFile