diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-27 21:47:03 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-03 14:59:42 +0200 |
commit | d0457b70e33f1a090a91b0037e9254a0e14b8427 (patch) | |
tree | 2984b2db2129ba8cfefeac46d246a4a335b92150 /src/shared/cplusplus/Token.h | |
parent | 88549a4b1dbbb16c7d63f176fd870ec8bdb61477 (diff) | |
download | qt-creator-d0457b70e33f1a090a91b0037e9254a0e14b8427.tar.gz |
Compile the C++ parser library with Sun CC 5.9.
Things you mustn't do:
1) end an enum with a comma
2) #include <cxxxx> and not use std::
3) use anonymous structures
All three things are invalid C++. Anonymous structures inside
anonymous unions are allowed by GCC, but that doesn't mean it's valid.
Diffstat (limited to 'src/shared/cplusplus/Token.h')
-rw-r--r-- | src/shared/cplusplus/Token.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/shared/cplusplus/Token.h b/src/shared/cplusplus/Token.h index 6809468a1a..ab04dfc83c 100644 --- a/src/shared/cplusplus/Token.h +++ b/src/shared/cplusplus/Token.h @@ -276,8 +276,8 @@ public: Token(); ~Token(); - inline bool is(unsigned k) const { return kind == k; } - inline bool isNot(unsigned k) const { return kind != k; } + inline bool is(unsigned k) const { return f.kind == k; } + inline bool isNot(unsigned k) const { return f.kind != k; } const char *spell() const; void reset(); @@ -285,39 +285,39 @@ public: { return offset; } inline unsigned end() const - { return offset + length; } + { return offset + f.length; } inline bool isLiteral() const - { return kind >= T_FIRST_LITERAL && kind <= T_LAST_LITERAL; } + { return f.kind >= T_FIRST_LITERAL && f.kind <= T_LAST_LITERAL; } inline bool isOperator() const - { return kind >= T_FIRST_OPERATOR && kind <= T_LAST_OPERATOR; } + { return f.kind >= T_FIRST_OPERATOR && f.kind <= T_LAST_OPERATOR; } inline bool isKeyword() const - { return kind >= T_FIRST_KEYWORD && kind < T_FIRST_QT_KEYWORD; } + { return f.kind >= T_FIRST_KEYWORD && f.kind < T_FIRST_QT_KEYWORD; } inline bool isComment() const - { return kind == T_COMMENT || kind == T_DOXY_COMMENT; } + { return f.kind == T_COMMENT || f.kind == T_DOXY_COMMENT; } inline bool isObjCAtKeyword() const - { return kind >= T_FIRST_OBJC_AT_KEYWORD && kind <= T_LAST_OBJC_AT_KEYWORD; } + { return f.kind >= T_FIRST_OBJC_AT_KEYWORD && f.kind <= T_LAST_OBJC_AT_KEYWORD; } static const char *name(int kind); public: + struct Flags { + unsigned kind : 8; + unsigned newline : 1; + unsigned whitespace : 1; + unsigned joined : 1; + unsigned expanded : 1; + unsigned generated : 1; + unsigned pad : 3; + unsigned length : 16; + }; union { unsigned flags; - - struct { - unsigned kind : 8; - unsigned newline : 1; - unsigned whitespace : 1; - unsigned joined : 1; - unsigned expanded : 1; - unsigned generated : 1; - unsigned pad : 3; - unsigned length : 16; - }; + Flags f; }; unsigned offset; |