- asmtok::TokKind Lex() {
- return CurKind = LexToken();
- }
-
- asmtok::TokKind getKind() const { return CurKind; }
- bool is(asmtok::TokKind K) const { return CurKind == K; }
- bool isNot(asmtok::TokKind K) const { return CurKind != K; }
-
- /// getCurStrVal - Get the string for the current token, this includes all
- /// characters (for example, the quotes on strings) in the token.
- ///
- /// The returned StringRef points into the source manager's memory buffer, and
- /// is safe to store across calls to Lex().
- StringRef getCurStrVal() const {
- assert((CurKind == asmtok::Identifier || CurKind == asmtok::Register ||
- CurKind == asmtok::String) &&
- "This token doesn't have a string value");
- return CurStrVal;
- }
- int64_t getCurIntVal() const {
- assert(CurKind == asmtok::IntVal && "This token isn't an integer");
- return CurIntVal;
- }
-