diff options
| author | Roberto Raggi <[email protected]> | 2009-09-18 11:14:54 +0200 |
|---|---|---|
| committer | Roberto Raggi <[email protected]> | 2009-09-18 12:28:15 +0200 |
| commit | 81cac3cc49c5ea7817cc04479d706d426f528bc0 (patch) | |
| tree | 4bb191fb0b62670cd7fadba8fd2a4af8c7c01e9c /src/libs/cplusplus/BackwardsScanner.h | |
| parent | 8ce39a8a3b988c8de77c7f6c74864e282b3936a9 (diff) | |
Introduced BackwardsScanner::LA(n). LA(n) returns the n-th lookhead token.
Diffstat (limited to 'src/libs/cplusplus/BackwardsScanner.h')
| -rw-r--r-- | src/libs/cplusplus/BackwardsScanner.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/cplusplus/BackwardsScanner.h b/src/libs/cplusplus/BackwardsScanner.h index 7b8e3b6e717..68d1f047878 100644 --- a/src/libs/cplusplus/BackwardsScanner.h +++ b/src/libs/cplusplus/BackwardsScanner.h @@ -54,7 +54,11 @@ public: QString text(int begin, int end) const; QStringRef textRef(int begin, int end) const; - const SimpleToken &operator[](int i) const; + // 1-based + const SimpleToken &LA(int index) const; + + // n-la token is [startToken - n] + const SimpleToken &operator[](int index) const; // ### deprecate int startOfMatchingBrace(int index) const; int previousBlockState(const QTextBlock &block) const; @@ -71,6 +75,7 @@ private: QString _text; SimpleLexer _tokenize; int _maxBlockCount; + int _startToken; }; } // end of namespace CPlusPlus |
