MLIR
20.0.0git
|
This class breaks up the current file into a token stream. More...
#include "AsmParser/Lexer.h"
Public Member Functions | |
Lexer (const llvm::SourceMgr &sourceMgr, MLIRContext *context, AsmParserCodeCompleteContext *codeCompleteContext) | |
const llvm::SourceMgr & | getSourceMgr () |
Token | lexToken () |
Location | getEncodedSourceLocation (SMLoc loc) |
Encode the specified source location information into a Location object for attachment to the IR or error reporting. More... | |
void | resetPointer (const char *newPointer) |
Change the position of the lexer cursor. More... | |
const char * | getBufferBegin () |
Returns the start of the buffer. More... | |
const char * | getCodeCompleteLoc () const |
Return the code completion location of the lexer, or nullptr if there is none. More... | |
|
explicit |
Definition at line 36 of file Lexer.cpp.
References mlir::AsmParserCodeCompleteContext::getCodeCompleteLoc().
|
inline |
Returns the start of the buffer.
Definition at line 41 of file Lexer.h.
Referenced by mlir::detail::Parser::codeCompleteDialectOrElidedOpName(), and mlir::detail::Parser::emitWrongTokenError().
|
inline |
Return the code completion location of the lexer, or nullptr if there is none.
Definition at line 45 of file Lexer.h.
Referenced by mlir::detail::Parser::parseDialectSymbolBody().
Location Lexer::getEncodedSourceLocation | ( | SMLoc | loc | ) |
Encode the specified source location information into a Location object for attachment to the IR or error reporting.
Encode the specified source location information into an attribute for attachment to the IR.
Definition at line 50 of file Lexer.cpp.
References mlir::get(), and getSourceMgr().
Referenced by mlir::detail::Parser::getEncodedSourceLocation().
|
inline |
Definition at line 28 of file Lexer.h.
Referenced by getEncodedSourceLocation(), and mlir::detail::Parser::getSourceMgr().
Token Lexer::lexToken | ( | ) |
Definition at line 73 of file Lexer.cpp.
Referenced by mlir::detail::Parser::consumeToken(), and mlir::detail::Parser::resetToken().
|
inline |
Change the position of the lexer cursor.
The next token we lex will start at the designated point in the input.
Definition at line 38 of file Lexer.h.
Referenced by mlir::detail::Parser::parseAttribute(), mlir::detail::Parser::parseIntegerInDimensionList(), mlir::detail::Parser::parseOptionalDecimalInteger(), mlir::detail::Parser::parseXInDimensionList(), and mlir::detail::Parser::resetToken().