1 //===-- llvm/MC/MCAsmParser.h - Abstract Asm Parser Interface ---*- 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_MC_MCASMPARSER_H
11 #define LLVM_MC_MCASMPARSER_H
13 #include "llvm/System/DataTypes.h"
24 /// MCAsmParser - Generic assembler parser interface, for use by target specific
27 MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT
28 void operator=(const MCAsmParser &); // DO NOT IMPLEMENT
29 protected: // Can only create subclasses.
33 virtual ~MCAsmParser();
35 virtual MCAsmLexer &getLexer() = 0;
37 virtual MCContext &getContext() = 0;
39 /// getSteamer - Return the output streamer for the assembler.
40 virtual MCStreamer &getStreamer() = 0;
42 /// Warning - Emit a warning at the location \arg L, with the message \arg
44 virtual void Warning(SMLoc L, const Twine &Msg) = 0;
46 /// Warning - Emit an error at the location \arg L, with the message \arg
49 /// \return The return value is always true, as an idiomatic convenience to
51 virtual bool Error(SMLoc L, const Twine &Msg) = 0;
53 /// ParseExpression - Parse an arbitrary expression.
55 /// @param Res - The value of the expression. The result is undefined
57 /// @result - False on success.
58 virtual bool ParseExpression(const MCExpr *&Res) = 0;
60 /// ParseParenExpression - Parse an arbitrary expression, assuming that an
61 /// initial '(' has already been consumed.
63 /// @param Res - The value of the expression. The result is undefined
65 /// @result - False on success.
66 virtual bool ParseParenExpression(const MCExpr *&Res) = 0;
68 /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
71 /// @param Res - The value of the absolute expression. The result is undefined
73 /// @result - False on success.
74 virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
77 } // End llvm namespace