13 #ifndef MLIR_LIB_ASMPARSER_LEXER_H
14 #define MLIR_LIB_ASMPARSER_LEXER_H
50 return Token(kind, StringRef(tokStart, curPtr - tokStart));
53 Token emitError(
const char *loc,
const Twine &message);
56 Token lexAtIdentifier(
const char *tokStart);
57 Token lexBareIdentifierOrKeyword(
const char *tokStart);
58 Token lexEllipsis(
const char *tokStart);
59 Token lexNumber(
const char *tokStart);
60 Token lexPrefixedIdentifier(
const char *tokStart);
61 Token lexString(
const char *tokStart);
66 const llvm::SourceMgr &sourceMgr;
74 const char *codeCompleteLoc;
77 void operator=(
const Lexer &) =
delete;
This class provides an abstract interface into the parser for hooking in code completion events.
This class breaks up the current file into a token stream.
const llvm::SourceMgr & getSourceMgr()
Location getEncodedSourceLocation(SMLoc loc)
Encode the specified source location information into a Location object for attachment to the IR or e...
void resetPointer(const char *newPointer)
Change the position of the lexer cursor.
const char * getBufferBegin()
Returns the start of the buffer.
const char * getCodeCompleteLoc() const
Return the code completion location of the lexer, or nullptr if there is none.
Lexer(const llvm::SourceMgr &sourceMgr, MLIRContext *context, AsmParserCodeCompleteContext *codeCompleteContext)
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
MLIRContext is the top-level object for a collection of MLIR operations.
This represents a token in the MLIR syntax.
Include the generated interface declarations.