Debian Codegraph @

src/opentryparser.h

raw symbols SCIP
1 /*
2 Copyright (C) 2008, 2009 Andres Cabrera
3 [email protected]
4
5 This file is part of CsoundQt.
6
7 CsoundQt is free software; you can redistribute it
8 and/or modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 CsoundQt is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with Csound; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA
21 */
22
23 #ifndef OPENTRYPARSER_H
24 #define OPENTRYPARSER_H
25
26 #include <QString>
27 #include <QStringList>
28 #include <QtXml>
29 #include "node.h"
30 #include "types.h" // For Opcode class
31
32 class OpEntryParser
33 {
34 public:
35 OpEntryParser(QString opcodeFile);
36
37 ~OpEntryParser();
38
39 void parseOpcodesXml(QString opcodeFile);
40 void sortOpcodes();
41 void addExtraOpcodes();
42 QStringList opcodeNameList(bool includeDisabled=false);
43 QString getSyntax(QString opcodeName);
44 QVector<Opcode> getMatchingOpcodes(QString word, int maxsize = 0);
45 QList< QPair<QString, QList<Opcode> > > getOpcodesByCategory();
46 int getCategoryCount();
47 QString getCategory(int index);
48 QStringList getCategoryList();
49 QList<Opcode> getOpcodeList(int index);
50 bool isOpcode(QString opcodeName);
51 bool getOpcodeArgNames(Node &node);
52 void setUdos(QHash<QString, Opcode>*udosMap) { m_udosMap = udosMap; }
53 Opcode findOpcode(QString opcodeName);
54 bool isKnownOpcode(QString name);
55 QList<Opcode> opcodeList;
56
57 private:
58 QString m_opcodeFile;
59 QHash<QString, Opcode> opcodeMap;
60 QList< QPair<QString, QList<Opcode> > > opcodeCategoryList;
61 QVector<QList<Opcode> > opcodeListCategory;
62 QStringList categoryList;
63 QStringList excludedOpcodes;
64 QStringList m_opcodeNameListCache;
65
66 void addOpcode(Opcode opcode);
67 void addFlag(QString flag, QString description);
68
69 QHash<QString, Opcode>*m_udosMap;
70
71 };
72
73 #endif