Debian Codegraph @

plugins/symbolbrowser/symbols/parsers/parser.h

raw symbols SCIP
1 /***************************************************************************
2 A SymbolBrowser plugin for JuffEd editor.
3
4 Copyright: 2010 Aleksander Sokoloff <[email protected]>
5
6 Some of the code based on a ctags project http://ctags.sourceforge.net/
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License.
10 version 2 as published by the Free Software Foundation.
11
12 This program 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 General Public License for more details.
16
17 You should have rceived a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 ***************************************************************************/
21
22 #ifndef PARSER_H
23 #define PARSER_H
24
25 #include <QObject>
26 #include <QTextStream>
27 #include <QByteArray>
28 #include "../common.h"
29
30 class QString;
31 class Symbol;
32
33 class Parser: public QObject {
34 Q_OBJECT
35 public:
36 Parser();
37 virtual ~Parser();
38
39 void run(char *textBuf, int textBufLen, Symbol *symbols);
40 void stop();
41
42 Language language() const { return mLanguage; };
43 void setLanguage(Language value) { mLanguage = value; };
44
45 protected:
46 int fileGetc();
47 void fileUngetc(int c);
48 const char *fileReadLine();
49 void resetText();
50
51 unsigned long getSourceLineNumber();
52 unsigned long getInputLineNumber() ;
53
54 virtual void parse()=0;
55
56 Symbol *mSymbols;
57
58 private:
59 Language mLanguage;
60 int mUngetChar;
61 char *mTextBuf;
62 char *mTextBufEnd;
63
64 char *mCurPos;
65 char *mRChar;
66 char *mNChar;
67 bool mStopped;
68 unsigned long mLineNum;
69 };
70
71
72 typedef struct sKindOption {
73 bool enabled; /* are tags for kind enabled? */
74 int letter; /* kind letter */
75 const char* name; /* kind name */
76 const char* description; /* displayed in --help output */
77 } kindOption;
78
79 #endif // PARSER_H