LLVM  8.0.1
Public Member Functions | Protected Member Functions | List of all members
llvm::AsmLexer Class Reference

AsmLexer - Lexer class for assembly files. More...

#include "llvm/MC/MCParser/AsmLexer.h"

Inheritance diagram for llvm::AsmLexer:
Inheritance graph
[legend]
Collaboration diagram for llvm::AsmLexer:
Collaboration graph
[legend]

Public Member Functions

 AsmLexer (const MCAsmInfo &MAI)
 
 AsmLexer (const AsmLexer &)=delete
 
AsmLexeroperator= (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 MCAsmInfogetMAI () const
 
- Public Member Functions inherited from llvm::MCAsmLexer
 MCAsmLexer (const MCAsmLexer &)=delete
 
MCAsmLexeroperator= (const MCAsmLexer &)=delete
 
virtual ~MCAsmLexer ()
 
const AsmTokenLex ()
 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 AsmTokengetTok () 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 charTokStart = nullptr
 
bool SkipSpace = true
 
bool AllowAtInIdentifier
 
bool IsAtStartOfStatement = true
 
bool LexMasmIntegers = false
 
AsmCommentConsumerCommentConsumer = nullptr
 

Detailed Description

AsmLexer - Lexer class for assembly files.

Definition at line 26 of file AsmLexer.h.

Constructor & Destructor Documentation

◆ AsmLexer() [1/2]

AsmLexer::AsmLexer ( const MCAsmInfo MAI)

◆ AsmLexer() [2/2]

llvm::AsmLexer::AsmLexer ( const AsmLexer )
delete

◆ ~AsmLexer()

AsmLexer::~AsmLexer ( )
overridedefault

Referenced by AsmLexer().

Member Function Documentation

◆ getMAI()

const MCAsmInfo& llvm::AsmLexer::getMAI ( ) const
inline

Definition at line 52 of file AsmLexer.h.

Referenced by parseHexOcta().

◆ LexToken()

AsmToken AsmLexer::LexToken ( )
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().

◆ LexUntilEndOfStatement()

StringRef AsmLexer::LexUntilEndOfStatement ( )
overridevirtual

Implements llvm::MCAsmLexer.

Definition at line 486 of file AsmLexer.cpp.

References llvm::StringRef::end(), and llvm::MCAsmLexer::TokStart.

◆ operator=()

AsmLexer& llvm::AsmLexer::operator= ( const AsmLexer )
delete

◆ peekTokens()

size_t AsmLexer::peekTokens ( MutableArrayRef< AsmToken Buf,
bool  ShouldSkipSpace = true 
)
overridevirtual

◆ setBuffer()

void AsmLexer::setBuffer ( StringRef  Buf,
const char ptr = nullptr 
)

The documentation for this class was generated from the following files: