implement enough of a lexer to get through Olden/health/Output/health.llc.s
without errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73855 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-mc/AsmLexer.h b/tools/llvm-mc/AsmLexer.h
index 08e6f9c..9e694c7 100644
--- a/tools/llvm-mc/AsmLexer.h
+++ b/tools/llvm-mc/AsmLexer.h
@@ -29,12 +29,16 @@
Eof, Error,
Identifier,
+ Register,
IntVal,
-
+ EndOfStatement,
Colon,
Plus,
- Minus
+ Minus,
+ Slash, // '/'
+ LParen, RParen,
+ Star, Comma, Dollar
};
}
@@ -66,7 +70,7 @@
asmtok::TokKind getKind() const { return CurKind; }
const std::string &getCurStrVal() const {
- assert(CurKind == asmtok::Identifier &&
+ assert((CurKind == asmtok::Identifier || CurKind == asmtok::Register) &&
"This token doesn't have a string value");
return CurStrVal;
}
@@ -82,9 +86,15 @@
private:
int getNextChar();
+ asmtok::TokKind ReturnError(const char *Loc, const std::string &Msg);
/// LexToken - Read the next token and return its code.
asmtok::TokKind LexToken();
+ asmtok::TokKind LexIdentifier();
+ asmtok::TokKind LexPercent();
+ asmtok::TokKind LexSlash();
+ asmtok::TokKind LexHash();
+ asmtok::TokKind LexDigit();
};
} // end namespace llvm