Move DataTypes.h to include/llvm/System, update all users. This breaks the last
[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/System/DataTypes.h"
14
15 namespace llvm {
16 class MCAsmLexer;
17 class MCContext;
18 class MCExpr;
19 class MCStreamer;
20 class MCValue;
21 class SMLoc;
22 class Twine;
23
24 /// MCAsmParser - Generic assembler parser interface, for use by target specific
25 /// assembly parsers.
26 class MCAsmParser {
27   MCAsmParser(const MCAsmParser &);   // DO NOT IMPLEMENT
28   void operator=(const MCAsmParser &);  // DO NOT IMPLEMENT
29 protected: // Can only create subclasses.
30   MCAsmParser();
31  
32 public:
33   virtual ~MCAsmParser();
34
35   virtual MCAsmLexer &getLexer() = 0;
36
37   virtual MCContext &getContext() = 0;
38
39   /// getSteamer - Return the output streamer for the assembler.
40   virtual MCStreamer &getStreamer() = 0;
41
42   /// Warning - Emit a warning at the location \arg L, with the message \arg
43   /// Msg.
44   virtual void Warning(SMLoc L, const Twine &Msg) = 0;
45
46   /// Warning - Emit an error at the location \arg L, with the message \arg
47   /// Msg.
48   ///
49   /// \return The return value is always true, as an idiomatic convenience to
50   /// clients.
51   virtual bool Error(SMLoc L, const Twine &Msg) = 0;
52
53   /// ParseExpression - Parse an arbitrary expression.
54   ///
55   /// @param Res - The value of the expression. The result is undefined
56   /// on error.
57   /// @result - False on success.
58   virtual bool ParseExpression(const MCExpr *&Res) = 0;
59
60   /// ParseParenExpression - Parse an arbitrary expression, assuming that an
61   /// initial '(' has already been consumed.
62   ///
63   /// @param Res - The value of the expression. The result is undefined
64   /// on error.
65   /// @result - False on success.
66   virtual bool ParseParenExpression(const MCExpr *&Res) = 0;
67
68   /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
69   /// absolute value.
70   ///
71   /// @param Res - The value of the absolute expression. The result is undefined
72   /// on error.
73   /// @result - False on success.
74   virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
75 };
76
77 } // End llvm namespace
78
79 #endif