NameSpec.h revision f33f6de54db174aa679a4b6d1e040d37e95541c0
1//===- NameSpec.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_NAMESPEC_H
10#define MCLD_SCRIPT_NAMESPEC_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14
15#include <mcld/Script/InputToken.h>
16#include <mcld/Support/Allocators.h>
17#include <mcld/Config/Config.h>
18
19namespace mcld
20{
21
22/** \class NameSpec
23 *  \brief This class defines the interfaces to a namespec in INPUT/GROUP
24 *         command.
25 */
26
27class NameSpec : public InputToken
28{
29private:
30  friend class Chunk<NameSpec, MCLD_SYMBOLS_PER_INPUT>;
31  NameSpec();
32  NameSpec(const std::string& pName, bool pAsNeeded);
33
34public:
35  ~NameSpec();
36
37  static bool classof(const InputToken* pToken)
38  {
39    return pToken->type() == InputToken::NameSpec;
40  }
41
42  /* factory method */
43  static NameSpec* create(const std::string& pName, bool pAsNeeded);
44  static void destroy(NameSpec*& pToken);
45  static void clear();
46};
47
48} // namepsace of mcld
49
50#endif
51