diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-06-29 17:57:15 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-07-02 11:18:51 +0200 |
commit | 8e4fb678fd68cbb01d5548ba07dfcb2927868df4 (patch) | |
tree | 8d2a8d2dd7c31a3bfa0d98b28f2cb7589e18ecc5 /src/libs/cplusplus/SimpleLexer.h | |
parent | e3e8b1a5c01ddc230772ee0553ca325704295312 (diff) | |
download | qt-creator-8e4fb678fd68cbb01d5548ba07dfcb2927868df4.tar.gz |
Removing SimpleToken
Diffstat (limited to 'src/libs/cplusplus/SimpleLexer.h')
-rw-r--r-- | src/libs/cplusplus/SimpleLexer.h | 78 |
1 files changed, 7 insertions, 71 deletions
diff --git a/src/libs/cplusplus/SimpleLexer.h b/src/libs/cplusplus/SimpleLexer.h index cf451cacc6..b745b1b809 100644 --- a/src/libs/cplusplus/SimpleLexer.h +++ b/src/libs/cplusplus/SimpleLexer.h @@ -39,73 +39,6 @@ namespace CPlusPlus { class SimpleLexer; class Token; -class CPLUSPLUS_EXPORT SimpleToken -{ -public: - SimpleToken(const Token &token); - - SimpleToken() - : _kind(0) - , _flags(0) - , _position(0) - , _length(0) - { } - - inline int kind() const - { return _kind; } - - inline int position() const - { return _position; } - - inline int length() const - { return _length; } - - inline int begin() const - { return _position; } - - inline int end() const - { return _position + _length; } - - inline bool followsNewline() const - { return f._newline; } - - inline bool followsWhitespace() const - { return f._whitespace; } - - inline bool is(int k) const { return _kind == k; } - inline bool isNot(int k) const { return _kind != k; } - - bool isLiteral() const; - bool isOperator() const; - bool isKeyword() const; - bool isComment() const; - bool isObjCAtKeyword() const; - bool isObjCTypeQualifier() const { return f._objcTypeQualifier; } - - const char *name() const; - - // internal - inline void setPosition(int position) - { _position = position; } - -public: - short _kind; - union { - short _flags; - - struct { - unsigned _newline: 1; - unsigned _whitespace: 1; - unsigned _objcTypeQualifier: 1; - } f; - }; - - int _position; - int _length; - - friend class SimpleLexer; -}; - class CPLUSPLUS_EXPORT SimpleLexer { public: @@ -121,15 +54,18 @@ public: bool objCEnabled() const; void setObjCEnabled(bool onoff); - QList<SimpleToken> operator()(const QString &text, int state = 0); + QList<Token> operator()(const QString &text, int state = 0); int state() const { return _lastState; } - static int tokenAt(const QList<SimpleToken> &tokens, int offset); - static SimpleToken tokenAt(const QString &text, int offset, int state, bool qtMocRunEnabled = false); + static int tokenAt(const QList<Token> &tokens, unsigned offset); + static Token tokenAt(const QString &text, + unsigned offset, + int state, + bool qtMocRunEnabled = false); - static int tokenBefore(const QList<SimpleToken> &tokens, int offset); + static int tokenBefore(const QList<Token> &tokens, unsigned offset); private: int _lastState; |