LLVM API Documentation
AsmLexer - Lexer class for assembly files. More...
#include <AsmLexer.h>
Public Member Functions | |
AsmLexer (const MCAsmInfo &MAI) | |
~AsmLexer () | |
void | setBuffer (StringRef Buf, const char *ptr=nullptr) |
StringRef | LexUntilEndOfStatement () override |
StringRef | LexUntilEndOfLine () |
const AsmToken | peekTok (bool ShouldSkipSpace=true) override |
peekTok - Look ahead at the next token to be lexed. | |
bool | isAtStartOfComment (const char *Ptr) |
bool | isAtStatementSeparator (const char *Ptr) |
const MCAsmInfo & | getMAI () const |
Protected Member Functions | |
AsmToken | LexToken () override |
LexToken - Read the next token and return its code. |
AsmLexer - Lexer class for assembly files.
Definition at line 27 of file AsmLexer.h.
Definition at line 24 of file AsmLexer.cpp.
References llvm::MCAsmLexer::AllowAtInIdentifier, and llvm::MCAsmInfo::getCommentString().
Definition at line 30 of file AsmLexer.cpp.
const MCAsmInfo& llvm::AsmLexer::getMAI | ( | ) | const [inline] |
Definition at line 55 of file AsmLexer.h.
bool AsmLexer::isAtStartOfComment | ( | const char * | Ptr | ) |
Definition at line 461 of file AsmLexer.cpp.
References llvm::MCAsmInfo::getCommentString(), llvm::LibFunc::strlen, and llvm::LibFunc::strncmp.
Referenced by LexToken(), and LexUntilEndOfStatement().
bool AsmLexer::isAtStatementSeparator | ( | const char * | Ptr | ) |
Definition at line 474 of file AsmLexer.cpp.
References llvm::MCAsmInfo::getSeparatorString(), llvm::LibFunc::strlen, and llvm::LibFunc::strncmp.
Referenced by LexToken(), and LexUntilEndOfStatement().
AsmToken AsmLexer::LexToken | ( | ) | [override, protected, virtual] |
LexToken - Read the next token and return its code.
Implements llvm::MCAsmLexer.
Definition at line 479 of file AsmLexer.cpp.
References llvm::AsmToken::Amp, llvm::AsmToken::AmpAmp, llvm::AsmToken::At, llvm::AsmToken::BackSlash, llvm::AsmToken::Caret, llvm::AsmToken::Colon, llvm::AsmToken::Comma, llvm::AsmToken::Dollar, llvm::AsmToken::EndOfStatement, llvm::AsmToken::Eof, llvm::AsmToken::Equal, llvm::AsmToken::EqualEqual, llvm::AsmToken::Exclaim, llvm::AsmToken::ExclaimEqual, llvm::MCAsmInfo::getSeparatorString(), llvm::AsmToken::Greater, llvm::AsmToken::GreaterEqual, llvm::AsmToken::GreaterGreater, llvm::AsmToken::Hash, isAtStartOfComment(), isAtStatementSeparator(), llvm::AsmToken::LBrac, llvm::AsmToken::LCurly, llvm::AsmToken::Less, llvm::AsmToken::LessEqual, llvm::AsmToken::LessGreater, llvm::AsmToken::LessLess, llvm::AsmToken::LParen, llvm::AsmToken::Minus, llvm::AsmToken::Percent, llvm::AsmToken::Pipe, llvm::AsmToken::PipePipe, llvm::AsmToken::Plus, llvm::AsmToken::RBrac, llvm::AsmToken::RCurly, llvm::AsmToken::RParen, llvm::MCAsmLexer::SkipSpace, llvm::AsmToken::Space, llvm::AsmToken::Star, llvm::LibFunc::strlen, llvm::AsmToken::Tilde, and llvm::MCAsmLexer::TokStart.
Referenced by peekTok().
Definition at line 429 of file AsmLexer.cpp.
References llvm::StringRef::end(), and llvm::MCAsmLexer::TokStart.
StringRef AsmLexer::LexUntilEndOfStatement | ( | ) | [override, virtual] |
Implements llvm::MCAsmLexer.
Definition at line 417 of file AsmLexer.cpp.
References llvm::StringRef::end(), isAtStartOfComment(), isAtStatementSeparator(), and llvm::MCAsmLexer::TokStart.
const AsmToken AsmLexer::peekTok | ( | bool | ShouldSkipSpace = true | ) | [override, virtual] |
peekTok - Look ahead at the next token to be lexed.
Implements llvm::MCAsmLexer.
Definition at line 439 of file AsmLexer.cpp.
References llvm::MCAsmLexer::getErr(), llvm::MCAsmLexer::getErrLoc(), LexToken(), llvm::MCAsmLexer::SetError(), llvm::MCAsmLexer::SkipSpace, and llvm::MCAsmLexer::TokStart.
void AsmLexer::setBuffer | ( | StringRef | Buf, |
const char * | ptr = nullptr |
||
) |
Definition at line 33 of file AsmLexer.cpp.
References llvm::StringRef::begin(), and llvm::MCAsmLexer::TokStart.