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

Methods

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()

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:57

virtual llvm::StringRef LexUntilEndOfStatement()

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:94

MCAsmLexer(const llvm::MCAsmLexer&)

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:65

Parameters

const llvm::MCAsmLexer&

MCAsmLexer()

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:55

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)

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:87

Parameters

const llvm::AsmToken& Token

bool getAllowAtInIdentifier()

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:143

const std::string& getErr()

Description

Get the current error string

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:127

llvm::SMLoc getErrLoc()

Description

Get the current error location

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:122

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

Description

Get the current source location.

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:97

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

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()

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:92

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)

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)

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)

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:144

Parameters

bool v

void setCommentConsumer(
    llvm::AsmCommentConsumer* CommentConsumer)

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:146

Parameters

llvm::AsmCommentConsumer* CommentConsumer

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)

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()

Declared at: llvm/include/llvm/MC/MCParser/MCAsmLexer.h:67