File indexing completed on 2024-04-14 04:00:07

0001 //
0002 // C++ Interface: cexpresolver
0003 //
0004 // Description: Variable/function resolver for the expression parser.
0005 //
0006 /*
0007 Copyright 2006-2011 Tomas Mecir <kmuddy@kmuddy.com>
0008 
0009 This program is free software; you can redistribute it and/or
0010 modify it under the terms of the GNU General Public License as
0011 published by the Free Software Foundation; either version 2 of 
0012 the License, or (at your option) any later version.
0013 
0014 This program is distributed in the hope that it will be useful,
0015 but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 GNU General Public License for more details.
0018 
0019 You should have received a copy of the GNU General Public License
0020 along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 */
0022 
0023 #ifndef CEXPRESOLVER_H
0024 #define CEXPRESOLVER_H
0025 
0026 #include <arith-exp.h>
0027 #include <cvalue.h>
0028 #include <kmuddy_export.h>
0029 
0030 class cCmdQueue;
0031 
0032 /**
0033 Resolver for variables and functions, used by the expression processor.
0034 
0035 @author Tomas Mecir
0036 */
0037 
0038 class KMUDDY_EXPORT cExpResolver : public arith_exp_server {
0039   public:
0040     cExpResolver (int _sess);
0041     cValue get (QString varName) override;
0042     cValue function_call (const QString &functionName, list<cValue> &arguments) override;
0043     void setQueue (cCmdQueue *q) { queue = q; };
0044   protected:
0045     int sess;
0046     cCmdQueue *queue;
0047 };
0048 
0049 
0050 #endif