1 //===-- MCAsmParser.cpp - Abstract Asm Parser Interface -------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCParser/MCAsmParser.h"
11 #include "llvm/ADT/Twine.h"
12 #include "llvm/MC/MCParser/MCAsmLexer.h"
13 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
14 #include "llvm/Support/SourceMgr.h"
15 #include "llvm/Target/TargetAsmParser.h"
18 MCAsmParser::MCAsmParser() : TargetParser(0), ShowParsedOperands(0) {
21 MCAsmParser::~MCAsmParser() {
24 void MCAsmParser::setTargetParser(TargetAsmParser
&P
) {
25 assert(!TargetParser
&& "Target parser is already initialized!");
27 TargetParser
->Initialize(*this);
30 const AsmToken
&MCAsmParser::getTok() {
31 return getLexer().getTok();
34 bool MCAsmParser::TokError(const Twine
&Msg
) {
35 Error(getLexer().getLoc(), Msg
);
39 bool MCAsmParser::ParseExpression(const MCExpr
*&Res
) {
41 return ParseExpression(Res
, L
);