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"
22 /// MCAsmParser - Generic assembler parser interface, for use by target specific
25 MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT
26 void operator=(const MCAsmParser &); // DO NOT IMPLEMENT
27 protected: // Can only create subclasses.
31 virtual ~MCAsmParser();
33 virtual MCAsmLexer &getLexer() = 0;
35 virtual MCContext &getContext() = 0;
37 /// Warning - Emit a warning at the location \arg L, with the message \arg
39 virtual void Warning(SMLoc L, const Twine &Msg) = 0;
41 /// Warning - Emit an error at the location \arg L, with the message \arg
44 /// \return The return value is always true, as an idiomatic convenience to
46 virtual bool Error(SMLoc L, const Twine &Msg) = 0;
48 /// ParseAbsoluteExpression - Parse an expression which must evaluate to an
51 /// @param Res - The value of the absolute expression. The result is undefined
53 /// @result - False on success.
54 virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
56 /// ParseRelocatableExpression - Parse an expression which must be
59 /// @param Res - The relocatable expression value. The result is undefined on
61 /// @result - False on success.
62 virtual bool ParseRelocatableExpression(MCValue &Res) = 0;
64 /// ParseParenRelocatableExpression - Parse an expression which must be
65 /// relocatable, assuming that an initial '(' has already been consumed.
67 /// @param Res - The relocatable expression value. The result is undefined on
69 /// @result - False on success.
71 /// @see ParseRelocatableExpression, ParseParenExpr.
72 virtual bool ParseParenRelocatableExpression(MCValue &Res) = 0;
75 } // End llvm namespace