From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kommander/widget/parserdata.h | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 kommander/widget/parserdata.h (limited to 'kommander/widget/parserdata.h') diff --git a/kommander/widget/parserdata.h b/kommander/widget/parserdata.h new file mode 100644 index 00000000..4c7f8d50 --- /dev/null +++ b/kommander/widget/parserdata.h @@ -0,0 +1,50 @@ +/*************************************************************************** + parserdata.h - Parser data: keywords, functions etc. + ------------------- + copyright : (C) 2004 Michal Rudolf + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _HAVE_PARSERDATA_H_ +#define _HAVE_PARSERDATA_H_ + +#include "parsenode.h" +#include "function.h" +#include + +class ParserData { +public: + /* initialize keywords */ + ParserData(); + /* Return group of given keyword */ + Parse::KeywordGroup keywordGroup(Parse::Keyword k) const; + /* Convert string to keyword */ + Parse::Keyword stringToKeyword(const QString& s) const; + /* Convert keyword to string */ + QString keywordToString(Parse::Keyword k) const; + /* register a function */ + bool registerFunction(const QString& name, Function f); + /* check if this is a name of standard function */ + bool isFunction(const QString& name) const; + /* Return function with given name. Warning: this function has undefined behavior when there is + no such function. */ + const Function& function(const QString& name) const; +private: + // register standard function + void registerStandardFunctions(); + QMap m_keywords; + QMap m_groups; + QMap m_functions; +}; + + +#endif -- cgit v1.2.1