class MCAsmLexer
Declaration
class MCAsmLexer { /* full declaration omitted */ };
Description
Generic assembler lexer interface, for use by target specific assembly lexers.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:39
Member Variables
- protected const char* TokStart = nullptr
- protected bool SkipSpace = true
- protected bool AllowAtInIdentifier
- protected bool IsAtStartOfStatement = true
- protected bool LexMasmIntegers = false
- protected llvm::AsmCommentConsumer* CommentConsumer = nullptr
Method Overview
- public const llvm::AsmToken & Lex()
- protected virtual llvm::AsmToken LexToken()
- public virtual llvm::StringRef LexUntilEndOfStatement()
- public MCAsmLexer(const llvm::MCAsmLexer &)
- protected MCAsmLexer()
- protected void SetError(llvm::SMLoc errLoc, const std::string & err)
- public void UnLex(const llvm::AsmToken & Token)
- public bool getAllowAtInIdentifier()
- public const std::string & getErr()
- public llvm::SMLoc getErrLoc()
- public AsmToken::TokenKind getKind() const
- public llvm::SMLoc getLoc() const
- public const llvm::AsmToken & getTok() const
- public bool is(AsmToken::TokenKind K) const
- public bool isAtStartOfStatement()
- public bool isNot(AsmToken::TokenKind K) const
- public const llvm::AsmToken peekTok(bool ShouldSkipSpace = true)
- public virtual size_t peekTokens(MutableArrayRef<llvm::AsmToken> Buf, bool ShouldSkipSpace = true)
- public void setAllowAtInIdentifier(bool v)
- public void setCommentConsumer(llvm::AsmCommentConsumer * CommentConsumer)
- public void setLexMasmIntegers(bool V)
- public void setSkipSpace(bool val)
- public virtual ~MCAsmLexer()
Methods
¶const llvm::AsmToken& Lex()
const llvm::AsmToken& Lex()
Description
Consume the next token from the input stream and return it. The lexer will continuously return the end-of-file token once the end of the main input file has been reached.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:73
¶virtual llvm::AsmToken LexToken()
virtual llvm::AsmToken LexToken()
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:57
¶virtual llvm::StringRef LexUntilEndOfStatement()
virtual llvm::StringRef LexUntilEndOfStatement()
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:94
¶MCAsmLexer(const llvm::MCAsmLexer&)
MCAsmLexer(const llvm::MCAsmLexer&)
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:65
Parameters
- const llvm::MCAsmLexer&
¶MCAsmLexer()
MCAsmLexer()
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:55
¶void SetError(llvm::SMLoc errLoc,
const std::string& err)
void SetError(llvm::SMLoc errLoc,
const std::string& err)
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:59
Parameters
- llvm::SMLoc errLoc
- const std::string& err
¶void UnLex(const llvm::AsmToken& Token)
void UnLex(const llvm::AsmToken& Token)
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:87
Parameters
- const llvm::AsmToken& Token
¶bool getAllowAtInIdentifier()
bool getAllowAtInIdentifier()
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:143
¶const std::string& getErr()
const std::string& getErr()
Description
Get the current error string
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:127
¶llvm::SMLoc getErrLoc()
llvm::SMLoc getErrLoc()
Description
Get the current error location
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:122
¶AsmToken::TokenKind getKind() const
AsmToken::TokenKind getKind() const
Description
Get the kind of current token.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:132
¶llvm::SMLoc getLoc() const
llvm::SMLoc getLoc() const
Description
Get the current source location.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:97
¶const llvm::AsmToken& getTok() const
const llvm::AsmToken& getTok() const
Description
Get the current (last) lexed token.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:100
¶bool is(AsmToken::TokenKind K) const
bool is(AsmToken::TokenKind K) const
Description
Check if the current token has kind \p K.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:135
Parameters
- AsmToken::TokenKind K
¶bool isAtStartOfStatement()
bool isAtStartOfStatement()
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:92
¶bool isNot(AsmToken::TokenKind K) const
bool isNot(AsmToken::TokenKind K) const
Description
Check if the current token has kind \p K.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:138
Parameters
- AsmToken::TokenKind K
¶const llvm::AsmToken peekTok(
bool ShouldSkipSpace = true)
const llvm::AsmToken peekTok(
bool ShouldSkipSpace = true)
Description
Look ahead at the next token to be lexed.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:105
Parameters
- bool ShouldSkipSpace = true
¶virtual size_t peekTokens(
MutableArrayRef<llvm::AsmToken> Buf,
bool ShouldSkipSpace = true)
virtual size_t peekTokens(
MutableArrayRef<llvm::AsmToken> Buf,
bool ShouldSkipSpace = true)
Description
Look ahead an arbitrary number of tokens.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:118
Parameters
- MutableArrayRef<llvm::AsmToken> Buf
- bool ShouldSkipSpace = true
¶void setAllowAtInIdentifier(bool v)
void setAllowAtInIdentifier(bool v)
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:144
Parameters
- bool v
¶void setCommentConsumer(
llvm::AsmCommentConsumer* CommentConsumer)
void setCommentConsumer(
llvm::AsmCommentConsumer* CommentConsumer)
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:146
Parameters
- llvm::AsmCommentConsumer* CommentConsumer
¶void setLexMasmIntegers(bool V)
void setLexMasmIntegers(bool V)
Description
Set whether to lex masm-style binary and hex literals. They look like 0b1101 and 0ABCh respectively.
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:152
Parameters
- bool V
¶void setSkipSpace(bool val)
void setSkipSpace(bool val)
Description
Set whether spaces should be ignored by the lexer
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:141
Parameters
- bool val
¶virtual ~MCAsmLexer()
virtual ~MCAsmLexer()
Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:67