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

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

#include <AsmLexer.h>

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

Public Member Functions

 AsmLexer (const MCAsmInfo &MAI)
 
 ~AsmLexer () override
 
void setBuffer (StringRef Buf, const char *ptr=nullptr)
 
void setParsingMSInlineAsm (bool V)
 
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
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)
 

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
 
bool SkipSpace
 
bool AllowAtInIdentifier
 
bool IsAtStartOfStatement
 
AsmCommentConsumerCommentConsumer
 

Detailed Description

AsmLexer - Lexer class for assembly files.

Definition at line 27 of file AsmLexer.h.

Constructor & Destructor Documentation

AsmLexer::AsmLexer ( const MCAsmInfo MAI)
AsmLexer::~AsmLexer ( )
override

Definition at line 40 of file AsmLexer.cpp.

Member Function Documentation

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

Definition at line 55 of file AsmLexer.h.

AsmToken AsmLexer::LexToken ( )
overrideprotectedvirtual

LexToken - Read the next token and return its code.

Implements llvm::MCAsmLexer.

Definition at line 546 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::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, 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().

StringRef AsmLexer::LexUntilEndOfStatement ( )
overridevirtual

Implements llvm::MCAsmLexer.

Definition at line 483 of file AsmLexer.cpp.

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

size_t AsmLexer::peekTokens ( MutableArrayRef< AsmToken Buf,
bool  ShouldSkipSpace = true 
)
overridevirtual
void AsmLexer::setBuffer ( StringRef  Buf,
const char *  ptr = nullptr 
)

Definition at line 43 of file AsmLexer.cpp.

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

void llvm::AsmLexer::setParsingMSInlineAsm ( bool  V)
inline

Definition at line 48 of file AsmLexer.h.


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