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/Support/DataTypes.h"
23 /// MCAsmParser - Generic assembler parser interface, for use by target specific
26 MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT
27 void operator=(const MCAsmParser &); // DO NOT IMPLEMENT
28 protected: // Can only create subclasses.
32 virtual ~MCAsmParser();
34 virtual MCAsmLexer &getLexer() = 0;
36 virtual MCContext &getContext() = 0;
38 /// Warning - Emit a warning at the location \arg L, with the message \arg
40 virtual void Warning(SMLoc L, const Twine &Msg) = 0;
42 /// Warning - Emit an error at the location \arg L, with the message \arg
45 /// \return The return value is always true, as an idiomatic convenience to
47 virtual bool Error(SMLoc L, const Twine &Msg) = 0;
49 /// ParseExpression - Parse an arbitrary expression.
51 /// @param Res - The value of the expression. The result is undefined
53 /// @result - False on success.
54 virtual bool ParseExpression(const MCExpr *&Res) = 0;
56 /// ParseParenExpression - Parse an arbitrary expression, assuming that an
57 /// initial '(' has already been consumed.
59 /// @param Res - The value of the expression. The result is undefined
61 /// @result - False on success.
62 virtual bool ParseParenExpression(const MCExpr *&Res) = 0;
64 /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
67 /// @param Res - The value of the absolute expression. The result is undefined
69 /// @result - False on success.
70 virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
73 } // End llvm namespace