InputToken.h revision 533eae20118036f425f27bf0536ef0ccbb090b65
1//===- InputToken.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_INPUTTOKEN_H
10#define MCLD_SCRIPT_INPUTTOKEN_H
11
12#include <mcld/Script/StrToken.h>
13
14namespace mcld
15{
16
17/** \class InputToken
18 *  \brief This class defines the interfaces to a file/namespec token.
19 */
20
21class InputToken : public StrToken
22{
23public:
24  enum Type {
25    Unknown,
26    File,
27    NameSpec
28  };
29
30protected:
31  InputToken();
32  InputToken(Type pType, const std::string& pName, bool pAsNeeded);
33
34public:
35  virtual ~InputToken();
36
37  Type type() const { return m_Type; }
38
39  bool asNeeded() const { return m_bAsNeeded; }
40
41  static bool classof(const StrToken* pToken)
42  {
43    return pToken->kind() == StrToken::Input;
44  }
45
46private:
47  Type m_Type;
48  bool m_bAsNeeded;
49};
50
51} // namepsace of mcld
52
53#endif
54