MLIR 22.0.0git
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.
void resetPointer (const char *newPointer)
 Change the position of the lexer cursor.
const char * getBufferBegin ()
 Returns the start of the buffer.
const char * getBufferEnd ()
 Returns the end of the buffer.
const char * getCodeCompleteLoc () const
 Return the code completion location of the lexer, or nullptr if there is none.

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

Definition at line 36 of file Lexer.cpp.

References nullptr.

Member Function Documentation

◆ getBufferBegin()

const char * mlir::Lexer::getBufferBegin ( )
inline

Returns the start of the buffer.

Definition at line 41 of file Lexer.h.

◆ getBufferEnd()

const char * mlir::Lexer::getBufferEnd ( )
inline

Returns the end of the buffer.

Definition at line 44 of file Lexer.h.

◆ 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 48 of file Lexer.h.

◆ 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 62 of file Lexer.cpp.

References mlir::FileLineColLoc::get(), and getSourceMgr().

◆ getSourceMgr()

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

Definition at line 28 of file Lexer.h.

Referenced by getEncodedSourceLocation().

◆ lexToken()

Token Lexer::lexToken ( )

Definition at line 85 of file Lexer.cpp.

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


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