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