LLVM API Documentation
00001 //===-- llvm/MC/MCAsmParser.h - Abstract Asm Parser Interface ---*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_MC_MCASMPARSER_H 00011 #define LLVM_MC_MCASMPARSER_H 00012 00013 #include "llvm/Support/DataTypes.h" 00014 00015 namespace llvm { 00016 class MCAsmLexer; 00017 class MCValue; 00018 class SMLoc; 00019 class Twine; 00020 00021 /// MCAsmParser - Generic assembler parser interface, for use by target specific 00022 /// assembly parsers. 00023 class MCAsmParser { 00024 MCAsmParser(const MCAsmParser &); // DO NOT IMPLEMENT 00025 void operator=(const MCAsmParser &); // DO NOT IMPLEMENT 00026 protected: // Can only create subclasses. 00027 MCAsmParser(); 00028 00029 public: 00030 virtual ~MCAsmParser(); 00031 00032 virtual MCAsmLexer &getLexer() = 0; 00033 00034 /// Warning - Emit a warning at the location \arg L, with the message \arg 00035 /// Msg. 00036 virtual void Warning(SMLoc L, const Twine &Msg) = 0; 00037 00038 /// Warning - Emit an error at the location \arg L, with the message \arg 00039 /// Msg. 00040 /// 00041 /// \return The return value is always true, as an idiomatic convenience to 00042 /// clients. 00043 virtual bool Error(SMLoc L, const Twine &Msg) = 0; 00044 00045 /// ParseAbsoluteExpression - Parse an expression which must evaluate to an 00046 /// absolute value. 00047 /// 00048 /// @param Res - The value of the absolute expression. The result is undefined 00049 /// on error. 00050 /// @result - False on success. 00051 virtual bool ParseAbsoluteExpression(int64_t &Res) = 0; 00052 00053 /// ParseRelocatableExpression - Parse an expression which must be 00054 /// relocatable. 00055 /// 00056 /// @param Res - The relocatable expression value. The result is undefined on 00057 /// error. 00058 /// @result - False on success. 00059 virtual bool ParseRelocatableExpression(MCValue &Res) = 0; 00060 00061 /// ParseParenRelocatableExpression - Parse an expression which must be 00062 /// relocatable, assuming that an initial '(' has already been consumed. 00063 /// 00064 /// @param Res - The relocatable expression value. The result is undefined on 00065 /// error. 00066 /// @result - False on success. 00067 /// 00068 /// @see ParseRelocatableExpression, ParseParenExpr. 00069 virtual bool ParseParenRelocatableExpression(MCValue &Res) = 0; 00070 }; 00071 00072 } // End llvm namespace 00073 00074 #endif