1 //===- AsmLexer.h - Lexer for Assembly Files --------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This class declares the lexer for assembly files.
12 //===----------------------------------------------------------------------===//
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/MC/MCAsmLexer.h"
19 #include "llvm/Support/DataTypes.h"
28 /// AsmLexer - Lexer class for assembly files.
29 class AsmLexer : public MCAsmLexer {
33 const MemoryBuffer *CurBuf;
37 /// This is the current buffer index we're lexing from as managed by the
41 void operator=(const AsmLexer&); // DO NOT IMPLEMENT
42 AsmLexer(const AsmLexer&); // DO NOT IMPLEMENT
45 /// LexToken - Read the next token and return its code.
46 virtual AsmToken LexToken();
49 AsmLexer(SourceMgr &SrcMgr);
54 /// EnterIncludeFile - Enter the specified file. This returns true on failure.
55 bool EnterIncludeFile(const std::string &Filename);
57 void PrintMessage(SMLoc Loc, const std::string &Msg, const char *Type) const;
61 AsmToken ReturnError(const char *Loc, const std::string &Msg);
63 AsmToken LexIdentifier();
64 AsmToken LexPercent();
66 AsmToken LexLineComment();
71 } // end namespace llvm