MLIR
18.0.0git
|
#include "Tools/PDLL/Parser/Lexer.h"
Public Member Functions | |
Lexer (llvm::SourceMgr &mgr, ast::DiagnosticEngine &diagEngine, CodeCompleteContext *codeCompleteContext) | |
~Lexer () | |
llvm::SourceMgr & | getSourceMgr () |
Return a reference to the source manager used by the lexer. More... | |
ast::DiagnosticEngine & | getDiagEngine () |
Return a reference to the diagnostic engine used by the lexer. More... | |
LogicalResult | pushInclude (StringRef filename, SMRange includeLoc) |
Push an include of the given file. More... | |
Token | lexToken () |
Lex the next token and return it. More... | |
void | resetPointer (const char *newPointer) |
Change the position of the lexer cursor. More... | |
Token | emitError (SMRange loc, const Twine &msg) |
Emit an error to the lexer with the given location and message. More... | |
Token | emitError (const char *loc, const Twine &msg) |
Token | emitErrorAndNote (SMRange loc, const Twine &msg, SMRange noteLoc, const Twine ¬e) |
Lexer::Lexer | ( | llvm::SourceMgr & | mgr, |
ast::DiagnosticEngine & | diagEngine, | ||
CodeCompleteContext * | codeCompleteContext | ||
) |
Definition at line 75 of file Lexer.cpp.
References diag(), mlir::pdll::CodeCompleteContext::getCodeCompleteLoc(), mlir::pdll::ast::DiagnosticEngine::getHandlerFn(), and mlir::pdll::ast::DiagnosticEngine::setHandlerFn().
Lexer::~Lexer | ( | ) |
Definition at line 103 of file Lexer.cpp.
References mlir::pdll::ast::DiagnosticEngine::setHandlerFn().
Token mlir::pdll::Lexer::emitError | ( | const char * | loc, |
const Twine & | msg | ||
) |
Token Lexer::emitError | ( | SMRange | loc, |
const Twine & | msg | ||
) |
Emit an error to the lexer with the given location and message.
Definition at line 121 of file Lexer.cpp.
References mlir::pdll::ast::DiagnosticEngine::emitError(), and mlir::pdll::Token::error.
Token Lexer::emitErrorAndNote | ( | SMRange | loc, |
const Twine & | msg, | ||
SMRange | noteLoc, | ||
const Twine & | note | ||
) |
Definition at line 125 of file Lexer.cpp.
References mlir::pdll::ast::Diagnostic::attachNote(), mlir::pdll::ast::DiagnosticEngine::emitError(), and mlir::pdll::Token::error.
|
inline |
|
inline |
Token mlir::pdll::Lexer::lexToken | ( | ) |
Lex the next token and return it.
LogicalResult Lexer::pushInclude | ( | StringRef | filename, |
SMRange | includeLoc | ||
) |
Push an include of the given file.
This will cause the lexer to start processing the provided file. Returns failure if the file could not be opened, success otherwise.
Definition at line 108 of file Lexer.cpp.
References mlir::failure(), and mlir::success().
|
inline |