mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
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
This commit is contained in:
@ -72,17 +72,29 @@ static int AssembleInput(const char *ProgName) {
|
||||
asmtok::TokKind Tok = Lexer.Lex();
|
||||
while (Tok != asmtok::Eof) {
|
||||
switch (Tok) {
|
||||
default: outs() << "<<unknown token>>\n"; break;
|
||||
case asmtok::Error: outs() << "<<error>>\n"; break;
|
||||
default: Lexer.PrintError(Lexer.getLoc(), "driver: unknown token"); break;
|
||||
case asmtok::Error:
|
||||
Lexer.PrintError(Lexer.getLoc(), "error, bad token");
|
||||
break;
|
||||
case asmtok::Identifier:
|
||||
outs() << "identifier: " << Lexer.getCurStrVal() << '\n';
|
||||
break;
|
||||
case asmtok::Register:
|
||||
outs() << "register: " << Lexer.getCurStrVal() << '\n';
|
||||
break;
|
||||
case asmtok::IntVal:
|
||||
outs() << "int: " << Lexer.getCurIntVal() << '\n';
|
||||
break;
|
||||
case asmtok::EndOfStatement: outs() << "EndOfStatement\n"; break;
|
||||
case asmtok::Colon: outs() << "Colon\n"; break;
|
||||
case asmtok::Plus: outs() << "Plus\n"; break;
|
||||
case asmtok::Minus: outs() << "Minus\n"; break;
|
||||
case asmtok::Slash: outs() << "Slash\n"; break;
|
||||
case asmtok::LParen: outs() << "LParen\n"; break;
|
||||
case asmtok::RParen: outs() << "RParen\n"; break;
|
||||
case asmtok::Star: outs() << "Star\n"; break;
|
||||
case asmtok::Comma: outs() << "Comma\n"; break;
|
||||
case asmtok::Dollar: outs() << "Dollar\n"; break;
|
||||
}
|
||||
|
||||
Tok = Lexer.Lex();
|
||||
|
Reference in New Issue
Block a user