remove DebugLoc from MCInst and eliminate "Comment printing" from
[oota-llvm.git] / include / llvm / MC / MCAsmParser.h
1 //===-- llvm/MC/MCAsmParser.h - Abstract Asm Parser Interface ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_MC_MCASMPARSER_H
11 #define LLVM_MC_MCASMPARSER_H
12
13 #include "llvm/Support/DataTypes.h"
14
15 namespace llvm {
16 class MCAsmLexer;
17 class MCContext;
18 class MCExpr;
19 class MCValue;
20 class SMLoc;
21 class Twine;
22
23 /// MCAsmParser - Generic assembler parser interface, for use by target specific
24 /// assembly parsers.
25 class MCAsmParser {
26   MCAsmParser(const MCAsmParser &);   // DO NOT IMPLEMENT
27   void operator=(const MCAsmParser &);  // DO NOT IMPLEMENT
28 protected: // Can only create subclasses.
29   MCAsmParser();
30  
31 public:
32   virtual ~MCAsmParser();
33
34   virtual MCAsmLexer &getLexer() = 0;
35
36   virtual MCContext &getContext() = 0;
37
38   /// Warning - Emit a warning at the location \arg L, with the message \arg
39   /// Msg.
40   virtual void Warning(SMLoc L, const Twine &Msg) = 0;
41
42   /// Warning - Emit an error at the location \arg L, with the message \arg
43   /// Msg.
44   ///
45   /// \return The return value is always true, as an idiomatic convenience to
46   /// clients.
47   virtual bool Error(SMLoc L, const Twine &Msg) = 0;
48
49   /// ParseExpression - Parse an arbitrary expression.
50   ///
51   /// @param Res - The value of the expression. The result is undefined
52   /// on error.
53   /// @result - False on success.
54   virtual bool ParseExpression(const MCExpr *&Res) = 0;
55
56   /// ParseParenExpression - Parse an arbitrary expression, assuming that an
57   /// initial '(' has already been consumed.
58   ///
59   /// @param Res - The value of the expression. The result is undefined
60   /// on error.
61   /// @result - False on success.
62   virtual bool ParseParenExpression(const MCExpr *&Res) = 0;
63
64   /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
65   /// absolute value.
66   ///
67   /// @param Res - The value of the absolute expression. The result is undefined
68   /// on error.
69   /// @result - False on success.
70   virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
71 };
72
73 } // End llvm namespace
74
75 #endif