equal
deleted
inserted
replaced
44 */ |
44 */ |
45 |
45 |
46 #ifndef TOKENIZER_H |
46 #ifndef TOKENIZER_H |
47 #define TOKENIZER_H |
47 #define TOKENIZER_H |
48 |
48 |
|
49 #include <qfile.h> |
49 #include <qstack.h> |
50 #include <qstack.h> |
50 #include <qstring.h> |
51 #include <qstring.h> |
51 |
|
52 #include <stdio.h> |
|
53 |
52 |
54 #include "location.h" |
53 #include "location.h" |
55 |
54 |
56 QT_BEGIN_NAMESPACE |
55 QT_BEGIN_NAMESPACE |
57 |
56 |
97 |
96 |
98 class Tokenizer |
97 class Tokenizer |
99 { |
98 { |
100 public: |
99 public: |
101 Tokenizer(const Location& loc, const QByteArray &in); |
100 Tokenizer(const Location& loc, const QByteArray &in); |
102 Tokenizer(const Location& loc, FILE *in); |
101 Tokenizer(const Location& loc, QFile &file); |
103 |
102 |
104 ~Tokenizer(); |
103 ~Tokenizer(); |
105 |
104 |
106 int getToken(); |
105 int getToken(); |
107 void setParsingFnOrMacro(bool macro) { parsingMacro = macro; } |
106 void setParsingFnOrMacro(bool macro) { parsingMacro = macro; } |
108 bool parsingFnOrMacro() const { return parsingMacro; } |
107 bool parsingFnOrMacro() const { return parsingMacro; } |
109 |
108 |
110 const Location &location() const { return yyTokLoc; } |
109 const Location &location() const { return yyTokLoc; } |
111 QString previousLexeme() const { return QString(yyPrevLex); } |
110 QString previousLexeme() const; |
112 QString lexeme() const { return QString(yyLex); } |
111 QString lexeme() const; |
113 QString version() const { return yyVersion; } |
112 QString version() const { return yyVersion; } |
114 int braceDepth() const { return yyBraceDepth; } |
113 int braceDepth() const { return yyBraceDepth; } |
115 int parenDepth() const { return yyParenDepth; } |
114 int parenDepth() const { return yyParenDepth; } |
116 int bracketDepth() const { return yyBracketDepth; } |
115 int bracketDepth() const { return yyBracketDepth; } |
117 |
116 |