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