summaryrefslogtreecommitdiff
path: root/include/mcld/Script/ScriptCommand.h
blob: d670b011235f78285e9819c54fe24c4ac8e621cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//===- ScriptCommand.h ----------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_SCRIPT_COMMAND_H
#define MCLD_SCRIPT_COMMAND_H

namespace mcld {

class Module;

/** \class ScriptCommand
 *  \brief This class defines the interfaces to a script command.
 */
class ScriptCommand
{
public:
  enum Kind {
    ENTRY,
    OUTPUT_FORMAT,
    GROUP,
    OUTPUT,
    SEARCH_DIR,
    OUTPUT_ARCH,
    ASSERT,
    ASSIGNMENT,
    SECTIONS,
    OUTPUT_SECT_DESC,
    INPUT_SECT_DESC
  };

protected:
  ScriptCommand(Kind pKind)
    : m_Kind(pKind)
  {}

public:
  virtual ~ScriptCommand() = 0;

  virtual void dump() const = 0;

  virtual void activate(Module&) = 0;

  Kind getKind() const { return m_Kind; }

private:
  Kind m_Kind;
};

} // namespace of mcld

#endif