Home | History | Annotate | Download | only in Script
      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_COMMAND_H
     10 #define MCLD_SCRIPT_COMMAND_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 {
     21 public:
     22   enum Kind {
     23     ENTRY,
     24     OUTPUT_FORMAT,
     25     GROUP,
     26     OUTPUT,
     27     SEARCH_DIR,
     28     OUTPUT_ARCH,
     29     ASSERT,
     30     ASSIGNMENT,
     31     SECTIONS,
     32     OUTPUT_SECT_DESC,
     33     INPUT_SECT_DESC
     34   };
     35 
     36 protected:
     37   ScriptCommand(Kind pKind)
     38     : m_Kind(pKind)
     39   {}
     40 
     41 public:
     42   virtual ~ScriptCommand() = 0;
     43 
     44   virtual void dump() const = 0;
     45 
     46   virtual void activate(Module&) = 0;
     47 
     48   Kind getKind() const { return m_Kind; }
     49 
     50 private:
     51   Kind m_Kind;
     52 };
     53 
     54 } // namespace of mcld
     55 
     56 #endif
     57 
     58