aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-mc/AsmLexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-mc/AsmLexer.h')
-rw-r--r--tools/llvm-mc/AsmLexer.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/llvm-mc/AsmLexer.h b/tools/llvm-mc/AsmLexer.h
index 08e6f9c6ee..9e694c7a30 100644
--- a/tools/llvm-mc/AsmLexer.h
+++ b/tools/llvm-mc/AsmLexer.h
@@ -29,12 +29,16 @@ namespace asmtok {
Eof, Error,
Identifier,
+ Register,
IntVal,
-
+ EndOfStatement,
Colon,
Plus,
- Minus
+ Minus,
+ Slash, // '/'
+ LParen, RParen,
+ Star, Comma, Dollar
};
}
@@ -66,7 +70,7 @@ public:
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 @@ public:
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