LLVM API Documentation
AsmLexer - Lexer class for assembly files. More...
#include <AsmLexer.h>
Public Member Functions | |
AsmLexer (const MCAsmInfo &MAI) | |
~AsmLexer () | |
void | setBuffer (const MemoryBuffer *buf, const char *ptr=NULL) |
virtual StringRef | LexUntilEndOfStatement () |
StringRef | LexUntilEndOfLine () |
bool | isAtStartOfComment (char Char) |
bool | isAtStatementSeparator (const char *Ptr) |
const MCAsmInfo & | getMAI () const |
![]() | |
virtual | ~MCAsmLexer () |
const AsmToken & | Lex () |
SMLoc | getLoc () const |
getLoc - Get the current source location. More... | |
const AsmToken & | getTok () |
getTok - Get the current (last) lexed token. More... | |
const SMLoc & | getErrLoc () |
getErrLoc - Get the current error location More... | |
const std::string & | getErr () |
getErr - Get the current error string More... | |
AsmToken::TokenKind | getKind () const |
getKind - Get the kind of current token. More... | |
bool | is (AsmToken::TokenKind K) const |
is - Check if the current token has kind K . More... | |
bool | isNot (AsmToken::TokenKind K) const |
isNot - Check if the current token has kind K . More... | |
void | setSkipSpace (bool val) |
setSkipSpace - Set whether spaces should be ignored by the lexer More... | |
Protected Member Functions | |
virtual AsmToken | LexToken () |
LexToken - Read the next token and return its code. More... | |
![]() | |
MCAsmLexer () | |
void | SetError (const SMLoc &errLoc, const std::string &err) |
Additional Inherited Members | |
![]() | |
const char * | TokStart |
bool | SkipSpace |
AsmLexer - Lexer class for assembly files.
Definition at line 27 of file AsmLexer.h.
AsmLexer::AsmLexer | ( | const MCAsmInfo & | MAI | ) |
Definition at line 24 of file AsmLexer.cpp.
AsmLexer::~AsmLexer | ( | ) |
Definition at line 30 of file AsmLexer.cpp.
|
inline |
Definition at line 53 of file AsmLexer.h.
bool AsmLexer::isAtStartOfComment | ( | char | Char | ) |
Definition at line 439 of file AsmLexer.cpp.
References llvm::MCAsmInfo::getCommentString().
Referenced by LexToken(), and LexUntilEndOfStatement().
bool AsmLexer::isAtStatementSeparator | ( | const char * | Ptr | ) |
Definition at line 444 of file AsmLexer.cpp.
References llvm::MCAsmInfo::getSeparatorString(), llvm::LibFunc::strlen, and llvm::LibFunc::strncmp.
Referenced by LexToken(), and LexUntilEndOfStatement().
|
protectedvirtual |
LexToken - Read the next token and return its code.
Implements llvm::MCAsmLexer.
Definition at line 449 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.
StringRef AsmLexer::LexUntilEndOfLine | ( | ) |
Definition at line 428 of file AsmLexer.cpp.
References llvm::MemoryBuffer::getBufferEnd(), and llvm::MCAsmLexer::TokStart.
|
virtual |
Implements llvm::MCAsmLexer.
Definition at line 415 of file AsmLexer.cpp.
References llvm::MemoryBuffer::getBufferEnd(), isAtStartOfComment(), isAtStatementSeparator(), and llvm::MCAsmLexer::TokStart.
void AsmLexer::setBuffer | ( | const MemoryBuffer * | buf, |
const char * | ptr = NULL |
||
) |
Definition at line 33 of file AsmLexer.cpp.
References llvm::MemoryBuffer::getBufferStart(), and llvm::MCAsmLexer::TokStart.