Extend MCAsmLexer so that it can peek forward several tokens
[oota-llvm.git] / include / llvm / MC / MCParser / MCAsmLexer.h
index 71f15b37c331e70458e497fa1e896bfef15eba5d..644dbd90997a5dbf8c62cd6e2374c6fae8601700 100644 (file)
@@ -162,7 +162,21 @@ public:
   }
 
   /// Look ahead at the next token to be lexed.
-  virtual const AsmToken peekTok(bool ShouldSkipSpace = true) = 0;
+  const AsmToken peekTok(bool ShouldSkipSpace = true) {
+    AsmToken Tok;
+
+    MutableArrayRef<AsmToken> Buf(Tok);
+    size_t ReadCount = peekTokens(Buf, ShouldSkipSpace);
+
+    assert(ReadCount == 1);
+    (void)ReadCount;
+
+    return Tok;
+  }
+
+  /// Look ahead an arbitrary number of tokens.
+  virtual size_t peekTokens(MutableArrayRef<AsmToken> Buf,
+                            bool ShouldSkipSpace = true) = 0;
 
   /// Get the current error location
   const SMLoc &getErrLoc() {