aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/UnwrappedLineParser.h
diff options
context:
space:
mode:
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;
};