Implement parser and lexer support for most of the type grammar.
Semi-affine maps and address spaces are not yet supported (someone want to take
this on?). We also don't generate IR objects for types yet, which I plan to
tackle next.
PiperOrigin-RevId: 201754283
diff --git a/lib/Parser/Lexer.h b/lib/Parser/Lexer.h
index 5886c5c..4f364bc 100644
--- a/lib/Parser/Lexer.h
+++ b/lib/Parser/Lexer.h
@@ -46,6 +46,11 @@
Token lexToken();
+ /// Change the position of the lexer cursor. The next token we lex will start
+ /// at the designated point in the input.
+ void resetPointer(const char *newPointer) {
+ curPtr = newPointer;
+ }
private:
// Helpers.
Token formToken(Token::TokenKind kind, const char *tokStart) {
@@ -58,6 +63,7 @@
Token lexComment();
Token lexBareIdentifierOrKeyword(const char *tokStart);
Token lexAtIdentifier(const char *tokStart);
+ Token lexNumber(const char *tokStart);
};
} // end namespace mlir