LLVM
8.0.1
|
AsmLexer - Lexer class for assembly files. More...
#include "llvm/MC/MCParser/AsmLexer.h"
Public Member Functions | |
AsmLexer (const MCAsmInfo &MAI) | |
AsmLexer (const AsmLexer &)=delete | |
AsmLexer & | operator= (const AsmLexer &)=delete |
~AsmLexer () override | |
void | setBuffer (StringRef Buf, const char *ptr=nullptr) |
StringRef | LexUntilEndOfStatement () override |
size_t | peekTokens (MutableArrayRef< AsmToken > Buf, bool ShouldSkipSpace=true) override |
Look ahead an arbitrary number of tokens. More... | |
const MCAsmInfo & | getMAI () const |
Public Member Functions inherited from llvm::MCAsmLexer | |
MCAsmLexer (const MCAsmLexer &)=delete | |
MCAsmLexer & | operator= (const MCAsmLexer &)=delete |
virtual | ~MCAsmLexer () |
const AsmToken & | Lex () |
Consume the next token from the input stream and return it. More... | |
void | UnLex (AsmToken const &Token) |
bool | isAtStartOfStatement () |
SMLoc | getLoc () const |
Get the current source location. More... | |
const AsmToken & | getTok () const |
Get the current (last) lexed token. More... | |
const AsmToken | peekTok (bool ShouldSkipSpace=true) |
Look ahead at the next token to be lexed. More... | |
SMLoc | getErrLoc () |
Get the current error location. More... | |
const std::string & | getErr () |
Get the current error string. More... | |
AsmToken::TokenKind | getKind () const |
Get the kind of current token. More... | |
bool | is (AsmToken::TokenKind K) const |
Check if the current token has kind K . More... | |
bool | isNot (AsmToken::TokenKind K) const |
Check if the current token has kind K . More... | |
void | setSkipSpace (bool val) |
Set whether spaces should be ignored by the lexer. More... | |
bool | getAllowAtInIdentifier () |
void | setAllowAtInIdentifier (bool v) |
void | setCommentConsumer (AsmCommentConsumer *CommentConsumer) |
void | setLexMasmIntegers (bool V) |
Set whether to lex masm-style binary and hex literals. More... | |
Protected Member Functions | |
AsmToken | LexToken () override |
LexToken - Read the next token and return its code. More... | |
Protected Member Functions inherited from llvm::MCAsmLexer | |
MCAsmLexer () | |
void | SetError (SMLoc errLoc, const std::string &err) |
Additional Inherited Members | |
Protected Attributes inherited from llvm::MCAsmLexer | |
const char * | TokStart = nullptr |
bool | SkipSpace = true |
bool | AllowAtInIdentifier |
bool | IsAtStartOfStatement = true |
bool | LexMasmIntegers = false |
AsmCommentConsumer * | CommentConsumer = nullptr |
AsmLexer - Lexer class for assembly files.
Definition at line 26 of file AsmLexer.h.
Definition at line 34 of file AsmLexer.cpp.
References llvm::MCAsmLexer::AllowAtInIdentifier, llvm::MCAsmInfo::getCommentString(), startswith(), and ~AsmLexer().
|
overridedefault |
Referenced by AsmLexer().
Definition at line 52 of file AsmLexer.h.
Referenced by parseHexOcta().
|
overrideprotectedvirtual |
LexToken - Read the next token and return its code.
Implements llvm::MCAsmLexer.
Definition at line 549 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::Default, llvm::AsmToken::Dollar, llvm::StringRef::end(), 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, llvm::AsmToken::HashDirective, llvm::MCAsmInfo::hasMipsExpressions(), llvm::AsmToken::Integer, llvm::MCAsmLexer::is(), 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::MinusGreater, peekTokens(), llvm::AsmToken::Percent, llvm::AsmToken::PercentCall16, llvm::AsmToken::PercentCall_Hi, llvm::AsmToken::PercentCall_Lo, llvm::AsmToken::PercentDtprel_Hi, llvm::AsmToken::PercentDtprel_Lo, llvm::AsmToken::PercentGot, llvm::AsmToken::PercentGot_Disp, llvm::AsmToken::PercentGot_Hi, llvm::AsmToken::PercentGot_Lo, llvm::AsmToken::PercentGot_Ofst, llvm::AsmToken::PercentGot_Page, llvm::AsmToken::PercentGottprel, llvm::AsmToken::PercentGp_Rel, llvm::AsmToken::PercentHi, llvm::AsmToken::PercentHigher, llvm::AsmToken::PercentHighest, llvm::AsmToken::PercentLo, llvm::AsmToken::PercentNeg, llvm::AsmToken::PercentPcrel_Hi, llvm::AsmToken::PercentPcrel_Lo, llvm::AsmToken::PercentTlsgd, llvm::AsmToken::PercentTlsldm, llvm::AsmToken::PercentTprel_Hi, llvm::AsmToken::PercentTprel_Lo, 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::AsmToken::String, llvm::AsmToken::Tilde, llvm::MCAsmLexer::TokStart, and llvm::MCAsmLexer::UnLex().
Referenced by peekTokens().
|
overridevirtual |
Implements llvm::MCAsmLexer.
Definition at line 486 of file AsmLexer.cpp.
References llvm::StringRef::end(), and llvm::MCAsmLexer::TokStart.
|
overridevirtual |
Look ahead an arbitrary number of tokens.
Implements llvm::MCAsmLexer.
Definition at line 506 of file AsmLexer.cpp.
References llvm::StringRef::data(), llvm::AsmToken::Eof, llvm::MCAsmInfo::getCommentString(), llvm::MCAsmLexer::getErr(), llvm::MCAsmLexer::getErrLoc(), llvm::MCAsmInfo::getSeparatorString(), llvm::AsmToken::is(), LexToken(), llvm::MCAsmLexer::SetError(), llvm::StringRef::size(), llvm::ArrayRef< T >::size(), llvm::MCAsmLexer::SkipSpace, and llvm::MCAsmLexer::TokStart.
Referenced by isOperator(), and LexToken().
Definition at line 40 of file AsmLexer.cpp.
References assert(), llvm::StringRef::begin(), llvm::StringRef::end(), llvm::AsmToken::Error, llvm::SMLoc::getFromPointer(), llvm::isDigit(), llvm::isHexDigit(), llvm::AsmToken::Real, llvm::MCAsmLexer::SetError(), and llvm::MCAsmLexer::TokStart.
Referenced by isOperator().