1 //===-- llvm/Target/TargetAsmParser.h - Target Assembly Parser --*- C++ -*-===//
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 #ifndef LLVM_TARGET_TARGETPARSER_H
11 #define LLVM_TARGET_TARGETPARSER_H
19 /// TargetAsmParser - Generic interface to target specific assembly parsers.
20 class TargetAsmParser {
21 TargetAsmParser(const TargetAsmParser &); // DO NOT IMPLEMENT
22 void operator=(const TargetAsmParser &); // DO NOT IMPLEMENT
23 protected: // Can only create subclasses.
24 TargetAsmParser(const Target &);
26 /// TheTarget - The Target that this machine was created for.
27 const Target &TheTarget;
30 virtual ~TargetAsmParser();
32 const Target &getTarget() const { return TheTarget; }
34 /// ParseInstruction - Parse one assembly instruction.
36 /// The parser is positioned following the instruction name. The target
37 /// specific instruction parser should parse the entire instruction and
38 /// construct the appropriate MCInst, or emit an error. On success, the entire
39 /// line should be parsed up to and including the end-of-statement token. On
40 /// failure, the parser is not required to read to the end of the line.
42 /// \param AP - The current parser object.
43 /// \param Name - The instruction name.
44 /// \param Inst [out] - On success, the parsed instruction.
45 /// \return True on failure.
46 virtual bool ParseInstruction(const StringRef &Name, MCInst &Inst) = 0;
49 } // End llvm namespace