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