aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/UnwrappedLineParser.h
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2012-12-07 16:15:44 +0000
committerAlexander Kornienko <alexfh@google.com>2012-12-07 16:15:44 +0000
commit469a21b14c8d00001ad30a925020ee5a81c9b8b5 (patch)
treeab75cb1476f9402295044f815adcbd3b2ff9d9a0 /lib/Format/UnwrappedLineParser.h
parent1dbaef5fe123c588ed6c995dd0a0b79c285433ae (diff)
Clang-format: extracted FormatTokenSource from UnwrappedLineParser.
Summary: FormatTokenLexer is here, FormatTokenBuffer is on the way. This will allow to re-parse unwrapped lines when needed. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D186 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.h')
-rw-r--r--lib/Format/UnwrappedLineParser.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h
index 03dda9957d..92a51abf10 100644
--- a/lib/Format/UnwrappedLineParser.h
+++ b/lib/Format/UnwrappedLineParser.h
@@ -77,10 +77,14 @@ public:
virtual void consumeUnwrappedLine(const UnwrappedLine &Line) = 0;
};
+class FormatTokenSource {
+public:
+ virtual FormatToken getNextToken() = 0;
+};
+
class UnwrappedLineParser {
public:
- UnwrappedLineParser(const FormatStyle &Style, Lexer &Lex,
- SourceManager &SourceMgr,
+ UnwrappedLineParser(const FormatStyle &Style, FormatTokenSource &Tokens,
UnwrappedLineConsumer &Callback);
/// Returns true in case of a structural error.
@@ -105,19 +109,12 @@ private:
void addUnwrappedLine();
bool eof() const;
void nextToken();
- void parseToken();
-
- /// Returns the text of \c FormatTok.
- StringRef tokenText();
UnwrappedLine Line;
FormatToken FormatTok;
- bool GreaterStashed;
const FormatStyle &Style;
- Lexer &Lex;
- SourceManager &SourceMgr;
- IdentifierTable IdentTable;
+ FormatTokenSource &Tokens;
UnwrappedLineConsumer &Callback;
};