MLIR  20.0.0git
Public Member Functions | List of all members
mlir::Lexer Class Reference

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...
 

Detailed Description

This class breaks up the current file into a token stream.

Definition at line 23 of file Lexer.h.

Constructor & Destructor Documentation

◆ Lexer()

Lexer::Lexer ( const llvm::SourceMgr &  sourceMgr,
MLIRContext context,
AsmParserCodeCompleteContext codeCompleteContext 
)
explicit

Member Function Documentation

◆ getBufferBegin()

const char* mlir::Lexer::getBufferBegin ( )
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().

◆ getCodeCompleteLoc()

const char* mlir::Lexer::getCodeCompleteLoc ( ) const
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().

◆ getEncodedSourceLocation()

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::FileLineColLoc::get(), and getSourceMgr().

Referenced by mlir::detail::Parser::getEncodedSourceLocation().

◆ getSourceMgr()

const llvm::SourceMgr& mlir::Lexer::getSourceMgr ( )
inline

Definition at line 28 of file Lexer.h.

Referenced by getEncodedSourceLocation(), and mlir::detail::Parser::getSourceMgr().

◆ lexToken()

Token Lexer::lexToken ( )

◆ resetPointer()

void mlir::Lexer::resetPointer ( const char *  newPointer)
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().


The documentation for this class was generated from the following files: