1 //===- ScriptCommand.h ----------------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #ifndef MCLD_SCRIPT_SCRIPTCOMMAND_H_ 10 #define MCLD_SCRIPT_SCRIPTCOMMAND_H_ 11 12 namespace mcld { 13 14 class Module; 15 16 /** \class ScriptCommand 17 * \brief This class defines the interfaces to a script command. 18 */ 19 class ScriptCommand { 20 public: 21 enum Kind { 22 ASSERT, 23 ASSIGNMENT, 24 ENTRY, 25 GROUP, 26 INPUT, 27 INPUT_SECT_DESC, 28 OUTPUT, 29 OUTPUT_ARCH, 30 OUTPUT_FORMAT, 31 SEARCH_DIR, 32 OUTPUT_SECT_DESC, 33 SECTIONS 34 }; 35 36 protected: 37 explicit ScriptCommand(Kind pKind) : m_Kind(pKind) {} 38 39 public: 40 virtual ~ScriptCommand() = 0; 41 42 virtual void dump() const = 0; 43 44 virtual void activate(Module&) = 0; 45 46 Kind getKind() const { return m_Kind; } 47 48 private: 49 Kind m_Kind; 50 }; 51 52 } // namespace mcld 53 54 #endif // MCLD_SCRIPT_SCRIPTCOMMAND_H_ 55