From 456d418b2431007c0b850ea7ceb4b3deac1efcde Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Fri, 5 Jun 2009 12:08:36 +0200 Subject: [PATCH] Introduced iterators for the c++ literals. --- src/shared/cplusplus/Control.cpp | 18 ++++++++++++++++++ src/shared/cplusplus/Control.h | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/shared/cplusplus/Control.cpp b/src/shared/cplusplus/Control.cpp index 79b53d00e0e..509e79b0a62 100644 --- a/src/shared/cplusplus/Control.cpp +++ b/src/shared/cplusplus/Control.cpp @@ -522,6 +522,24 @@ Control::IdentifierIterator Control::firstIdentifier() const Control::IdentifierIterator Control::lastIdentifier() const { return d->identifiers.end(); } +Control::StringLiteralIterator Control::firstStringLiteral() const +{ return d->stringLiterals.begin(); } + +Control::StringLiteralIterator Control::lastStringLiteral() const +{ return d->stringLiterals.end(); } + +Control::NumericLiteralIterator Control::firstNumericLiteral() const +{ return d->numericLiterals.begin(); } + +Control::NumericLiteralIterator Control::lastNumericLiteral() const +{ return d->numericLiterals.end(); } + +Control::FileNameIterator Control::firstFileName() const +{ return d->fileNames.begin(); } + +Control::FileNameIterator Control::lastFileName() const +{ return d->fileNames.end(); } + StringLiteral *Control::findOrInsertStringLiteral(const char *chars, unsigned size) { return d->stringLiterals.findOrInsertLiteral(chars, size); } diff --git a/src/shared/cplusplus/Control.h b/src/shared/cplusplus/Control.h index b00b7b080b8..b98da650cc5 100644 --- a/src/shared/cplusplus/Control.h +++ b/src/shared/cplusplus/Control.h @@ -150,11 +150,30 @@ public: Identifier *findOrInsertIdentifier(const char *chars, unsigned size); Identifier *findOrInsertIdentifier(const char *chars); + /* + LiteralTable<Identifier> identifiers; + LiteralTable<StringLiteral> stringLiterals; + LiteralTable<NumericLiteral> numericLiterals; + LiteralTable<StringLiteral> fileNames; + */ + typedef const Identifier *const *IdentifierIterator; + typedef const StringLiteral *const *StringLiteralIterator; + typedef const NumericLiteral *const *NumericLiteralIterator; + typedef const StringLiteral *const *FileNameIterator; IdentifierIterator firstIdentifier() const; IdentifierIterator lastIdentifier() const; + StringLiteralIterator firstStringLiteral() const; + StringLiteralIterator lastStringLiteral() const; + + NumericLiteralIterator firstNumericLiteral() const; + NumericLiteralIterator lastNumericLiteral() const; + + FileNameIterator firstFileName() const; + FileNameIterator lastFileName() const; + StringLiteral *findOrInsertStringLiteral(const char *chars, unsigned size); StringLiteral *findOrInsertStringLiteral(const char *chars); -- GitLab