OpendTect-6_4  6.4
interpretexpr.h
Go to the documentation of this file.
1 #ifndef interpretexpr_h
2 #define interpretexpr_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Jaap Glas
9  Date: March 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uicmddrivermod.h"
16 #include "bufstring.h"
17 
18 
19 namespace CmdDrive
20 {
21 
22 class CmdDriver;
23 
25 {
26 public:
27  ExprInterpreter(const CmdDriver&);
28 
29  const char* process(const char* exprstr,BufferString& val,
30  bool isargument=false);
31 
32  bool isResultTrivial() const { return trivialresult_; }
33  const char* parsedExpr() const { return parsedexpr_.buf(); }
34  const char* breakPrefix() const { return breakprefix_.buf(); }
35  bool isParseError() const;
36  const char* errMsg() const;
37 
38 protected:
39  const char* interpretSingleExpr(const char* parstr,
40  BufferString& val);
41  const char* interpretCompositeExpr(const char* parstr,
42  BufferString& val);
43  void setBreakPrefix(const char* endptr,
44  BufferString& breakprefix) const;
45 
46  const char* exprstr_;
50 
52  // Start with '~'-symbol to denote parsing error
53 
54  const CmdDriver& drv_;
55 };
56 
57 
58 }; // namespace CmdDrive
59 
60 
61 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Command Drive
Definition: canvascommands.h:22
BufferString errmsg_
Definition: interpretexpr.h:51
Definition: interpretexpr.h:24
const char * breakPrefix() const
Definition: interpretexpr.h:34
const char * parsedExpr() const
Definition: interpretexpr.h:33
const CmdDriver & drv_
Definition: interpretexpr.h:54
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool trivialresult_
Definition: interpretexpr.h:47
BufferString breakprefix_
Definition: interpretexpr.h:49
const char * errMsg() const
Definition: horizontracker.h:61
bool isResultTrivial() const
Definition: interpretexpr.h:32
Definition: cmddriver.h:103
BufferString parsedexpr_
Definition: interpretexpr.h:48
const char * exprstr_
Definition: interpretexpr.h:46

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019