Added AsmToken enum constants to MCAsmLexer.h for '[', ']', '{', and '}' in

preparation of supporting other targets. Then changed the lexer to parse these
as tokens.

llvm-svn: 81050
This commit is contained in:
Kevin Enderby 2009-09-04 22:40:31 +00:00
parent f92f9909c4
commit 9c0f7fc746
2 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,7 @@ struct AsmToken {
Colon, Colon,
Plus, Minus, Tilde, Plus, Minus, Tilde,
Slash, // '/' Slash, // '/'
LParen, RParen, LParen, RParen, LBrac, RBrac, LCurly, RCurly,
Star, Comma, Dollar, Equal, EqualEqual, Star, Comma, Dollar, Equal, EqualEqual,
Pipe, PipePipe, Caret, Pipe, PipePipe, Caret,

View File

@ -277,6 +277,10 @@ AsmToken AsmLexer::LexToken() {
case '~': return AsmToken(AsmToken::Tilde, StringRef(TokStart, 1)); case '~': return AsmToken(AsmToken::Tilde, StringRef(TokStart, 1));
case '(': return AsmToken(AsmToken::LParen, StringRef(TokStart, 1)); case '(': return AsmToken(AsmToken::LParen, StringRef(TokStart, 1));
case ')': return AsmToken(AsmToken::RParen, StringRef(TokStart, 1)); case ')': return AsmToken(AsmToken::RParen, StringRef(TokStart, 1));
case '[': return AsmToken(AsmToken::LBrac, StringRef(TokStart, 1));
case ']': return AsmToken(AsmToken::RBrac, StringRef(TokStart, 1));
case '{': return AsmToken(AsmToken::LCurly, StringRef(TokStart, 1));
case '}': return AsmToken(AsmToken::RCurly, StringRef(TokStart, 1));
case '*': return AsmToken(AsmToken::Star, StringRef(TokStart, 1)); case '*': return AsmToken(AsmToken::Star, StringRef(TokStart, 1));
case ',': return AsmToken(AsmToken::Comma, StringRef(TokStart, 1)); case ',': return AsmToken(AsmToken::Comma, StringRef(TokStart, 1));
case '$': return AsmToken(AsmToken::Dollar, StringRef(TokStart, 1)); case '$': return AsmToken(AsmToken::Dollar, StringRef(TokStart, 1));