aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-mc/AsmLexer.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-21 19:21:25 +0000
committerChris Lattner <sabre@nondot.org>2009-06-21 19:21:25 +0000
commit4651bca31bdad27184fa0d36640bf5ef1d83cf5c (patch)
treeb97455dfc60462b5a65c04d5b95393f838627af2 /tools/llvm-mc/AsmLexer.h
parent1c3329f7072356c8da84534ed0a7033b10f73062 (diff)
downloadexternal_llvm-4651bca31bdad27184fa0d36640bf5ef1d83cf5c.zip
external_llvm-4651bca31bdad27184fa0d36640bf5ef1d83cf5c.tar.gz
external_llvm-4651bca31bdad27184fa0d36640bf5ef1d83cf5c.tar.bz2
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
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 08e6f9c..9e694c7 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