Fixed/added namespace ending comments using clang-tidy. NFC
[oota-llvm.git] / include / llvm / MC / MCParser / AsmLexer.h
index 21878899cac1ebdaea44a5409754cffc1ca14829..62d39b26c860055cbb3e99e436e7c4f0ba5407cc 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef ASMLEXER_H
-#define ASMLEXER_H
+#ifndef LLVM_MC_MCPARSER_ASMLEXER_H
+#define LLVM_MC_MCPARSER_ASMLEXER_H
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCParser/MCAsmLexer.h"
-#include "llvm/MC/MCAsmInfo.h"
-#include "llvm/System/DataTypes.h"
+#include "llvm/Support/DataTypes.h"
 #include <string>
-#include <cassert>
 
 namespace llvm {
 class MemoryBuffer;
-class SMLoc;
 class MCAsmInfo;
 
 /// AsmLexer - Lexer class for assembly files.
 class AsmLexer : public MCAsmLexer {
   const MCAsmInfo &MAI;
-  
+
   const char *CurPtr;
-  const MemoryBuffer *CurBuf;
-  
-  void operator=(const AsmLexer&); // DO NOT IMPLEMENT
-  AsmLexer(const AsmLexer&);       // DO NOT IMPLEMENT
+  StringRef CurBuf;
+  bool isAtStartOfLine;
+
+  void operator=(const AsmLexer&) = delete;
+  AsmLexer(const AsmLexer&) = delete;
 
 protected:
   /// LexToken - Read the next token and return its code.
-  virtual AsmToken LexToken();
+  AsmToken LexToken() override;
 
 public:
   AsmLexer(const MCAsmInfo &MAI);
-  ~AsmLexer();
-  
-  void setBuffer(const MemoryBuffer *buf, const char *ptr = NULL);
-  
-  virtual StringRef LexUntilEndOfStatement();
-
-  bool isAtStartOfComment(char Char);
-  
+  ~AsmLexer() override;
+
+  void setBuffer(StringRef Buf, const char *ptr = nullptr);
+
+  StringRef LexUntilEndOfStatement() override;
+  StringRef LexUntilEndOfLine();
+
+  const AsmToken peekTok(bool ShouldSkipSpace = true) override;
+
+  bool isAtStartOfComment(const char *Ptr);
+  bool isAtStatementSeparator(const char *Ptr);
+
   const MCAsmInfo &getMAI() const { return MAI; }
 
 private:
@@ -60,9 +62,12 @@ private:
   AsmToken LexSlash();
   AsmToken LexLineComment();
   AsmToken LexDigit();
+  AsmToken LexSingleQuote();
   AsmToken LexQuote();
+  AsmToken LexFloatLiteral();
+  AsmToken LexHexFloatLiteral(bool NoIntDigits);
 };
-  
+
 } // end namespace llvm
 
 #endif