Lexer that tokenizes assembly source for the MC assembler parser.

Synopsis

Declared in <llvm/MC/MCParser/AsmLexer.h>

class AsmLexer;

Member Functions

Name

Description

AsmLexer [constructor]

Constructors

operator= [deleted]

Copy assignment is deleted; AsmLexer is not copyable.

Lex

Consume the next token from the input stream and return it.

LexUntilEndOfStatement

Lex raw text until a comment, statement separator, or newline.

UnLex

Push Token onto the front of the token queue.

getAllowAtInIdentifier

Return whether '@' is allowed in identifiers.

getErr

Get the current error string.

getErrLoc

Get the current error location.

getKind

Get the kind of current token.

getLoc

Get the current source location.

getMAI

Return the MCAsmInfo used by this lexer.

getMasmDefaultRadix

Return the default radix used for MASM integer literals.

getTok

Get the current (last) lexed token.

is

Check if the current token has kind K.

isNot

Check if the current token does not have kind K.

justConsumedEOL

Return true if the last consumed token was an end‐of‐statement.

peekTok

Look ahead at the next token to be lexed.

peekTokens

Look ahead an arbitrary number of tokens.

setAllowAtInIdentifier

Set whether '@' is allowed in identifiers.

setAllowHashInIdentifier

Set whether '#' is allowed in identifiers.

setBuffer

Set the source buffer that this lexer will tokenize.

setCommentConsumer

Set the callback invoked when a comment is lexed.

setLexHLASMIntegers

Set whether to lex HLASM‐flavour integers. For now this is only [0‐9]*

setLexHLASMStrings

Set whether to "lex" HLASM‐flavour character and string literals. For now, setting this option to true, will disable lexing for character and string literals.

setLexMasmHexFloats

Set whether to lex masm‐style hex float literals, such as 3f800000r.

setLexMasmIntegers

Set whether to lex masm‐style binary (e.g., 0b1101) and radix‐specified literals (e.g., 0ABCh [hex], 576t [decimal], 77o [octal], 1101y [binary]).

setLexMasmStrings

Set whether to lex masm‐style string literals, such as 'Can''t find file' and "This ""value"" not found".

setLexMotorolaIntegers

Set whether to lex Motorola‐style integer literals, such as $deadbeef or %01010110.

setMasmDefaultRadix

Set the default radix used for MASM integer literals.

setSkipSpace

Set whether spaces should be ignored by the lexer.

useMasmDefaultRadix

Set whether to use masm‐style default‐radix integer literals. If disabled, assume decimal unless prefixed (e.g., 0x2c [hex], 077 [octal]).

Created with MrDocs